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

ParametersTypeRequiredDetails
limitintegernoA limit on the number of items to be returned. Limits can range between 1 and 250, and the default is 15.
pageintegernoThe 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

ParametersTypeRequiredLimitationsDetails
coupon_idintegeryesId of the coupon that promotion code will be attached.
codestringnoIdentifier of the promotion code in the API. We recommend leaving this blank so we can generate an unique code.
first_time_orderboolnoIf enabled, coupon will be valid only for first time order i.e. for customers who have never made a purchase.
limit_to_specific_partnerboolnoIf enabled, you'll have to set the specific partners that is eligible for discounts.
coupon_specific_partnersarrayyes if limit_to_specific_partnerRelevant 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_customerboolnoIf enabled, you'll have to set the specific customers that is eligible for discounts.
coupon_specific_customersarrayyes if coupon_specific_customersRelevant 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_statusstringnoString value on/off. If enabled you'll have to define minimum order value.
minimum_order_valueintegeryes if minimum_order_valueA minimum amount that is eligible for using a promotion code.
expiration_date_statusstringnoString value on/off. If enabled you'll have to define the date when promotion code can be redeemed.
expiration_date_valuedateyes if expiration_date_valueLimit the date when customers can redeem the promotion code.
redemption_times_statusstringnoString value on/off. If enabled you'll have to define the total number of how many times promotion code can be redeemed.
redemption_times_valueintegeryes if redemption_times_statusLimit 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

ParametersTypeRequiredLimitationsDetails
idintegeryesId of promotion code that's being updated.
codestringno
first_time_orderboolno
limit_to_specific_partnerboolno
coupon_specific_partnersarrayno
limit_to_specific_customerboolno
coupon_specific_customersarrayno
minimum_order_statusstringno
minimum_order_valueintegerno
expiration_date_statusstringno
expiration_date_valuedateno
redemption_times_statusstringno
redemption_times_valueintegerno

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
}