2. Define Discount

You can define discounts for your products not only at the time of payment but also afterward.

Define Product Discount

POST {{Base Adres}}/api/paywall/product/discount

Important: To use the Discount Definition service, you must include the apikeyprivate and apiclientprivate parameters in the Header section. PaymentAPI Address

Parameter
Type
Compolsory
Description

apikeyprivate

string

Yes

Private Key obtained from the merchant panel.

apiclientprivate

string

Yes

Private Client obtained from the merchant panel.

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

Parameter
Type
Compolsory
Description

ProductId

int

Yes

Product ID information

DiscountOwnerType

int

Yes

Type of the discount owner See: DiscountOwnerType

DiscountType

int

Yes

Type of discount

See: DiscountType

DiscountValue

decimal

Yes

Discount amount

The example JSON and sample codes to be sent to the service are as follows:

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

Response returned from the service:

Parameter
Type
Description

ErrorCode

int

Error code. Returns '0' if the operation is successful.

Result

bool

Returns a true or false value. Returns 'true' if the operation is successful.

Message

string

If the operation fails, this is the message describing the error, and it supports localization based on the locale parameter.

Body

object

Detailed information about the transaction

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

Last updated