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": "sample string 1",
"percentageValue": 2,
"couponCodes": [
"sample string 1",
"sample string 2"
],
"validFrom": "2022-12-28T11:19:34.6559308-05:00",
"validTill": "2022-12-28T11:19:34.6559308-05:00",
"productIds": [
1,
2
],
"vendorAccountId": 123456,
"apiSecretKey": "your_api_secret_key"
}
Response Sample
{
"response": {
"couponId": 1
},
"request": {
"couponName": "sample string 1",
"percentageValue": 2,
"couponCodes": [
"sample string 1",
"sample string 2"
],
"validFrom": "2022-12-28T11:19:34.6559308-05:00",
"validTill": "2022-12-28T11:19:34.6559308-05:00",
"productIds": [
1,
2
],
"vendorAccountId": 123456,
"apiSecretKey": "your_api_secret_key"
},
"errors": [
{
"propertyWithError": "orderId",
"propertyErrorMessages": [
"Error message 1",
"Error message 2"
]
},
{
"propertyWithError": "orderId",
"propertyErrorMessages": [
"Error message 1",
"Error message 2"
]
}
],
"isSuccess": false
}