> For the complete documentation index, see [llms.txt](https://developer.paywall.one/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.paywall.one/payment-orchestration-integration-document/payment-service/16.-payment-product-management/3.-discount/2.-define-discount.md).

# 2. Define Discount

## **Define Product Discount**

<mark style="color:green;">`POST`</mark> `{{Base Adres}}/api/paywall/product/discount`

{% hint style="info" %}
**Important:** To use the Discount Definition service, you must include the **apikeyprivate** and **apiclientprivate** parameters in the **Header** section.\
\
[<mark style="color:green;">**PaymentAPI Address**</mark>](/payment-orchestration-integration-document/environment.md)
{% endhint %}

<table><thead><tr><th width="188">Parameter</th><th width="79">Type</th><th width="136.31640625">Compolsory</th><th width="403">Description</th></tr></thead><tbody><tr><td>apikeyprivate</td><td>string</td><td>Yes</td><td>Private Key obtained from the merchant panel.</td></tr><tr><td>apiclientprivate</td><td>string</td><td>Yes</td><td>Private Client obtained from the merchant panel.</td></tr></tbody></table>

**The parameters to be sent to the service are as follows:**

<table><thead><tr><th width="236">Parameter</th><th width="157">Type</th><th width="131">Compolsory</th><th width="336">Description</th></tr></thead><tbody><tr><td>ProductId</td><td>int</td><td>Yes</td><td>Product ID information</td></tr><tr><td>DiscountOwnerType</td><td>int</td><td>Yes</td><td>Type of the discount owner<br><br>See: <a href="/pages/bqxaM0EMgXUQF65H83Sn">DiscountOwnerType</a></td></tr><tr><td>DiscountType</td><td>int</td><td>Yes</td><td><p><strong>Type of discount</strong></p><p><br>See: <a href="/pages/K1uoFiSqWEjPawMoe4Ke">DiscountType</a></p></td></tr><tr><td>DiscountValue</td><td>decimal</td><td>Yes</td><td>Discount amount</td></tr></tbody></table>

**The example&#x20;**<mark style="color:green;">**JSON**</mark>**&#x20;and&#x20;**<mark style="color:green;">**sample codes**</mark>**&#x20;to be sent to the service are as follows:**

{% tabs %}
{% tab title="JSON" %}
{% code lineNumbers="true" %}

```json5
{
    "ProductId": 2113995,
    "DiscountOwnerType": 1,
    "DiscountType": 1,
    "DiscountValue": 100
}
```

{% endcode %}
{% endtab %}

{% tab title="C#" %}

```csharp
// Soon
```

{% endtab %}

{% tab title="GO" %}

```go
// Soon
```

{% endtab %}

{% tab title="Java" %}

```java
// Soon
```

{% endtab %}

{% tab title="PHP" %}

```php
// Soon
```

{% endtab %}

{% tab title="Python" %}

```python
// Soon
```

{% endtab %}

{% tab title="Ruby" %}

```ruby
// Soon
```

{% endtab %}

{% tab title="TypeScript" %}

```typescript
// Soon
```

{% endtab %}

{% tab title="Curl" %}

```sh
// Soon
```

{% endtab %}
{% endtabs %}

**Response returned from the service:**

<table><thead><tr><th width="189">Parameter</th><th width="100.33333333333331">Type</th><th>Description</th></tr></thead><tbody><tr><td>ErrorCode</td><td>int</td><td>Error code. Returns '0' if the operation is successful.</td></tr><tr><td>Result</td><td>bool</td><td>Returns a true or false value. Returns 'true' if the operation is successful.</td></tr><tr><td>Message</td><td>string</td><td>If the operation fails, this is the message describing the error, and it supports localization based on the locale parameter.</td></tr><tr><td>Body</td><td>object</td><td>Detailed information about the transaction</td></tr></tbody></table>

{% tabs %}
{% tab title="JSON" %}
{% code lineNumbers="true" %}

```json
{
    "ErrorCode": 0,
    "Result": true,
    "Message": "",
    "Body": null
}
```

{% endcode %}
{% endtab %}
{% endtabs %}
