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_uuid": "8BNZGIR7",
"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,
"metadata": {}
}
Request parameters
Parameters | Type | Required | Limitations | Details |
---|---|---|---|---|
coupon_uuid | string | yes | Uuid 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 partner that is eligible for discounts. | |
coupon_specific_partners | array | yes if limit_to_specific_partner | Relevant partner that you would like to limit promotion code to. Partner 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 customer that is eligible for discounts. | |
coupon_specific_customers | array | yes if coupon_specific_customers | Relevant customer that you would like to limit promotion code to. Customer 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. | |
metadata | object | no | Object of Key value pairs. |
Response
Returns the created promotion code object.
Response example:
{
"data": {
"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,
"metadata": {}
},
"status": 1,
"message": "Promotion code created in the app successfully.",
"synchronization_enabled": false,
"synchronization_successful": false,
"synchronization_message": ""
}
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": {
"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,
"metadata": {}
},
"status": 1
}
Update a promotion code
Update an existing promotion code.
PUT https://api.partnero.com/v1/promotion-codes
Request example
{
"code": "SCQJMCY0",
"limit_to_specific_partner": false,
"coupon_specific_partners": {},
"metadata": {}
}
Request parameters
Parameters | Type | Required | Limitations | Details |
---|---|---|---|---|
code | string | no | Code of promotion code that's being updated. | |
limit_to_specific_partner | bool | no | If enabled, you'll have to set the specific partner that is eligible for discounts. | |
coupon_specific_partners | array | yes if limit_to_specific_partner | Relevant partner that you would like to limit promotion code to. Partner should be defined as objects like {"id": x, "full_name": "Partner Name"} | |
metadata | object | no | Object of Key value pairs. |
Response
Updated promotion code if request succeed.
Response example:
{
"data": {
"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,
"metadata": {}
},
"status": 1,
"message": "Promotion code updated in the app successfully.",
"synchronization_enabled": false,
"synchronization_successful": false,
"synchronization_message": ""
}
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" or "Coupon and promotion code are synced with provider. Please delete promotion code from provider if possible.".
Response example:
{
"data": {
"status": 1,
"message": "Promotion code deleted in the app successfully"
}
}