2. Create Discoun

You can define discounts both during the payment process and afterward for your relevant products.

Define Product Discount

POST {{PaymentBaseAddress}}/api/paywall/product/discount

Important: To use the Discount Definition service, you need to send the 'apikeyprivate' and 'apiclientprivate' parameters in the 'Header' section.

PaymentAPI Address

ParameterTypeMandatoryDescription

apikeyprivate

string

Yes

The Private Key obtained from the merchant panel.

apiclientprivate

string

Yes

The Private Client obtained from the merchant panel.

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

ParameterTypeMandatoryDescription

ProductId

int

Yes

Product's Id (identity) information

DiscountOwnerType

int

Yes

Discount holder's type

See: DiscountOwnerType

DiscountType

int

Yes

Discount type

See: DiscountType

DiscountValue

decimal

Yes

Discount value

Example to be sent to the service JSON and example code as follows

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

The response returned from the service.

ParameterTypeDescription

ErrorCode

int

The error code. Returns '0' if the operation is successful.

Result

bool

It returns true or false. Returns 'true' if the operation is successful.

Message

string

If the operation is unsuccessful, this is the error message provided, offering language support based on the locale parameter.

Body

nesne

Operation details.

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

Last updated