Skip to main content

Create Percentage Discount Coupon

Create a percentage discount coupon.

Request Parametersapplication/json
CreatePercentageDiscountCouponRequestModel
object
couponName
string
The name of the coupon you want to create.
percentageValue
integer
The value of the percentage discount.
It must be greater than 0 and less than or equal to 100.
couponCodes
array[string]
The coupon codes you want to create.
validFrom
string<date-time>
If defined, the date when the coupon will be activated.
validTill
string<date-time>
If defined, the date when the coupon will be expired.
productIds
array[integer]
The product IDs to which you want to assign the coupon.
vendorAccountId
integer
required
The vendor account ID identifies your PayPro Global account.
It can be found in Account settings > Business info.
apiSecretKey
string
required
The vendor account API secret key is a unique key
that was generated specifically for authenticating API requests.
It can be found in Store settings > General settings > Integration tab.
Response Parametersapplication/json
CreatePercentageDiscountCouponResponseModel
object
response
object
couponId
integer
The ID of the created coupon.
request
object
couponName
string
The name of the coupon you want to create.
percentageValue
integer
The value of the percentage discount.
It must be greater than 0 and less than or equal to 100.
couponCodes
array[string]
The coupon codes you want to create.
validFrom
string<date-time>
If defined, the date when the coupon will be activated.
validTill
string<date-time>
If defined, the date when the coupon will be expired.
productIds
array[integer]
The product IDs to which you want to assign the coupon.
vendorAccountId
integer
The vendor account ID identifies your PayPro Global account.
It can be found in Account settings > Business info.
apiSecretKey
string
The vendor account API secret key is a unique key
that was generated specifically for authenticating API requests.
It can be found in Store settings > General settings > Integration tab.
errors
array[object]
propertyWithError
string
propertyErrorMessages
array[string]
isSuccess
boolean
Request Sample
{
"couponName": "your_coupon_name",
"percentageValue": 20,
"couponCodes": [
"coupon_code_1",
"coupon_code_2"
],
"validFrom": "2023-12-28T11:19:34.6559308-05:00",
"validTill": "2024-12-28T11:19:34.6559308-05:00",
"productIds": [
12345,
12345
],
"vendorAccountId": 123456,
"apiSecretKey": "your_api_secret_key"
}
Response Sample
{
"response": {
"couponId": 22222
},
"request": {
"couponName": "your_coupon_name",
"percentageValue": 20,
"couponCodes": [
"coupon_code_1",
"coupon_code_2"
],
"validFrom": "2023-12-28T11:19:34.6559308-05:00",
"validTill": "2024-12-28T11:19:34.6559308-05:00",
"productIds": [
12345,
12345
],
"vendorAccountId": 123456,
"apiSecretKey": "your_api_secret_key"
},
"errors": [],
"isSuccess": true
}