Promotion codes
A Promotion Code is a code that customers can redeem for a coupon. Creation of multiple codes for a single coupon is available. You have the option to limit the code to a particular partner or customer, set a redemption limit, an expiration date and more.
Get a list of promotion codes
Returns a list of your promotion-codes.
GET https://api.partnero.com/v1/promotion-codes
Request parameters
Parameters | Type | Required | Details |
---|---|---|---|
limit | integer | no | A limit on the number of items to be returned. Limits can range between 1 and 250, and the default is 15. |
page | integer | no | The default is 1. |
Response
A list with a data property that contains an array of up to limit promotion codes. Each entry in the array is a separate promotion code object. If no promotion codes available, the resulting array will be empty. This request should never return an error.
Create a promotion code
A promotion code points to a coupon (is attached to a coupon). You can optionally set a different types of restrictions for the promotion code listed in the table below.
You may create a promotion code via the API using the following example.
POST https://api.partnero.com/v1/promotion-code
Request example
{
"coupon_id": 4,
"code": "",
"first_time_order": true,
"limit_to_specific_partner": false,
"coupon_specific_partners": [],
"limit_to_specific_customer": false,
"coupon_specific_customers": [],
"minimum_order_status": true,
"minimum_order_value": 22,
"expiration_date_status": false,
"expiration_date_value": null,
"redemption_times_status": false,
"redemption_times_value": null
}
Request parameters
Parameters | Type | Required | Limitations | Details |
---|---|---|---|---|
coupon_id | integer | yes | Id of the coupon that promotion code will be attached. | |
code | string | no | Identifier of the promotion code in the API. We recommend leaving this blank so we can generate an unique code. | |
first_time_order | bool | no | If enabled, coupon will be valid only for first time order i.e. for customers who have never made a purchase. | |
limit_to_specific_partner | bool | no | If enabled, you'll have to set the specific partners that is eligible for discounts. | |
coupon_specific_partners | array | yes if limit_to_specific_partner | Relevant partners that you would like to limit coupons to. Partners should be defined as objects like {"id": x, "full_name": "Partner Name"} | |
limit_to_specific_customer | bool | no | If enabled, you'll have to set the specific customers that is eligible for discounts. | |
coupon_specific_customers | array | yes if coupon_specific_customers | Relevant customers that you would like to limit coupons to. Customers should be defined as objects like {"id": x, "customer_full_name": "Partner Name"} | |
minimum_order_status | string | no | String value on/off. If enabled you'll have to define minimum order value. | |
minimum_order_value | integer | yes if minimum_order_value | A minimum amount that is eligible for using a promotion code. | |
expiration_date_status | string | no | String value on/off. If enabled you'll have to define the date when promotion code can be redeemed. | |
expiration_date_value | date | yes if expiration_date_value | Limit the date when customers can redeem the promotion code. | |
redemption_times_status | string | no | String value on/off. If enabled you'll have to define the total number of how many times promotion code can be redeemed. | |
redemption_times_value | integer | yes if redemption_times_status | Limit the total number of times the promotion code can be redeemed. |
Response
Returns the created promotion code object. Response example:
{
"data": {
"id": 12,
"coupon_id": 4,
"code": "SCQJMCY0",
"first_time_order": true,
"limit_to_specific_partner": false,
"coupon_specific_partners": [],
"limit_to_specific_customer": false,
"coupon_specific_customers": [],
"minimum_order_status": true,
"minimum_order_value": 22,
"expiration_date_status": false,
"expiration_date_value": null,
"redemption_times_status": false,
"redemption_times_value": null
},
"status": 1
}
Fetch a promotion code
Get the details about specific promotion code. You need to provide a promotion code code
property.
GET https://api.partnero.com/v1/promotion-codes/{code}
Request example
GET https://api.partnero.com/v1/promotion-codes/SCQJMCY0
Response
Returns a coupon if a valid uuid_code was provided. Otherwise, returns an error. Response example:
{
"data": {
"id": 12,
"coupon_id": 4,
"code": "SCQJMCY0",
"first_time_order": true,
"limit_to_specific_partner": false,
"coupon_specific_partners": [],
"limit_to_specific_customer": false,
"coupon_specific_customers": [],
"minimum_order_status": true,
"minimum_order_value": 22,
"expiration_date_status": false,
"expiration_date_value": null,
"redemption_times_status": false,
"redemption_times_value": null
},
"status": 1
}
Update a promotion code
Update an existing promotion code.
PUT https://api.partnero.com/v1/promotion-codes
Request example
{
"id": 12,
"first_time_order": true,
"limit_to_specific_partner": false,
"coupon_specific_partners": [],
"limit_to_specific_customer": false,
"coupon_specific_customers": [],
"minimum_order_status": true,
"minimum_order_value": 22,
"expiration_date_status": false,
"expiration_date_value": null,
"redemption_times_status": false,
"redemption_times_value": null
}
Request parameters
Parameters | Type | Required | Limitations | Details |
---|---|---|---|---|
id | integer | yes | Id of promotion code that's being updated. | |
code | string | no | ||
first_time_order | bool | no | ||
limit_to_specific_partner | bool | no | ||
coupon_specific_partners | array | no | ||
limit_to_specific_customer | bool | no | ||
coupon_specific_customers | array | no | ||
minimum_order_status | string | no | ||
minimum_order_value | integer | no | ||
expiration_date_status | string | no | ||
expiration_date_value | date | no | ||
redemption_times_status | string | no | ||
redemption_times_value | integer | no |
Response
Updated promotion code if request succeed. Response example:
{
"data": {
"id": 12,
"coupon_id": 4,
"code": "SCQJMCY0",
"first_time_order": true,
"limit_to_specific_partner": false,
"coupon_specific_partners": [],
"limit_to_specific_customer": false,
"coupon_specific_customers": [],
"minimum_order_status": true,
"minimum_order_value": 22,
"expiration_date_status": false,
"expiration_date_value": null,
"redemption_times_status": false,
"redemption_times_value": null
},
"status": 1
}
Delete a promotion code
Delete an existing promotion code.
DELETE https://api.partnero.com/v1/promotion-codes
Request example
{
"code": "8BNZGIR7",
"coupon": {
"uuid_code": "QUGMOC0C"
}
}
Response
Status 1 upon success. Otherwise, this call returns a status 0 with "Promotion code not found". Response example:
{
"status": 1
}