Documentación Mercado Libre
Descubre toda la información que debes conocer sobre las APIs de Mercado Libre.Documentación
Promotion management
Promotions
Glossary of fields and parameters
Fields | Field description | Possible values for the field and its description |
---|---|---|
name | Promotion name. | String |
code | Discount code. | String |
description | Short description of the discount campaign. | String |
discount_type | Discount type. | The values are percent and fixed. For the massive ones you can count with the value by_item Also with discount_by_quantity, percentage_by_volume and percentage_by_unit, for volume discounts. |
value | Discount value applied. | Double |
start_date | Promotion star date. | String, p,e: 2021-11-01T00:00:00.000+0000. |
end_date | Promotion end date (must be a date higher to start_date). | String, p,e: 2021-12-01T00:00:00.000+0000. |
min_payment_amount | Minimum payment amount to apply discount. | Double |
campaign_item_type | This field applies to traditional. | The values are massive or traditional. |
one_coupon_per_user | Check if the coupon type campaign allows the use of the coupon more than once. | Boolean |
status | Promotion status. | The values are active and inactive. |
id | Promotion ID. | String |
item_id | Publication ID. | It can be displayed in individual promotions. |
type | Type of campaign that the user wants to create. | The values are boleto, coupon, traditional, individual, volume, individual_volume. |
target | Coverage of products, identifies whether the campaign applies to all products, selected products or a list of products. | The values are ALL_PRODUCTS, SELECTED_PRODUCTS, LISTED_PRODUCTS. |
shop_id | store/user id. | Integer |
value_discount | It is the value of the discount for the item (this field only applies to the creation of massive campaigns). | Double |
discount_type | It is the type of discount that is applied to the item (this field only applies to the creation of massive campaigns). | The possible values are fixed_price and percent, discount_by_quantity, percentage_by_unit and percentage_by_volume. |
buy_quantity | The number of products that are part of the promotion. | Integer |
pay_quantity | It is the amount of products that are paid for from the promotion. | Integer |
Consult promotions
Request:
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN'
https://api.mercadolibre.com/seller-promotions/promotions/$PROMOTION_ID?promotion_type=$TIPODEPROMOTION&channel=$CHANNEL
Example:
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/seller-promotions/promotions/TR-496907760-202112031641564156?promotion_type=BOLETO&channel=mshops
Traditional offer response:
'{
"id": "TR-496907760-202112031641564156",
"name": "Traditional Modificada 3",
"status": "ACTIVE",
"type": "TRADITIONAL",
"start_date": "2120-03-14T00:00:00.000+00:00",
"end_date": "2120-02-13T00:00:00.000+00:00",
"target": "SELECTED_PRODUCTS",
"discount_type": "PERCENT",
"value": 10,
"shop_id": 496907780,
"campaign_item_type": "traditional"
}'
Coupon response:
{
"id": "10097749",
"name": "Cupon OPEN PLATFORM",
"status": "ACTIVE",
"type": "coupon",
"start_date": "2022-10-30T00:00:00.000+00:00",
"end_date": "2022-10-31T00:00:00.000+00:00",
"target": "ALL_PRODUCTS",
"discount_type": "percent",
"value": 10,
"shop_id": 654461415,
"description": "Esta es la descripción del cupon",
"code": "TESTCODE",
"use_limit": 1
}
Massive traditional offer response:
{
"id": "TRM-654461415-202202011726162616",
"name": "Traditional Kike masiva prueba 3",
"status": "ACTIVE",
"type": "traditional",
"start_date": "2120-03-14T00:00:00.000+00:00",
"end_date": "2120-02-13T00:00:00.000+00:00",
"target": "LISTED_PRODUCTS",
"discount_type": "by_item",
"shop_id": 654461415,
"campaign_item_type": "massive"
}
Response of quantity offers:
{
"results": [
{
"id": "DXV-553421365-20230131110752752",
"name": " DXV PRUEBA 1",
"status": "ACTIVE",
"type": "volume",
"start_date": "2023-02-02T00:00:00.000+00:00",
"end_date": "2023-03-31T00:00:00.000+00:00",
"target": "SELECTED_PRODUCTS",
"discount_type": "percentage_by_unit",
"value": 20,
"shop_id": 553421365,
"buy_quantity": 6
},
}
Response by campaign not found:
'{
"message": "GET to /shops/635345120/discounts/00006720 returned 404 and {\"status_code\":404,\"code\":\"discount_not_found_exception\",\"message\":\"discount with campaign id 00006720 not found for shop 635345120\",\"stacktrace\":null,\"request_id\":\"2edcb000-aacf-41d4-834e-916e1bd922ac\"}",
"error": "internal_server_error",
"status": 500,
"cause": []
}'
Response for promotions that do not belong to Mercado Shops:
'{
"message": "Invalid promotion type",
"error": "bad_request",
"status": 400,
"cause": []
}'
Parameters
promotion_type: type of promotion to be queried.
promotion_id: identifier of the campaign/promotion to be
queried.
channel: channel in which we want to consult. By default, a
marketplace will be available.
Manage publications with promotions
Consult promotions of a publication
This functionality allows you to recognize all the promotions that are active in a publication.
Request:
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN'
https://api.mercadolibre.com/seller-promotions/items/$ITEM_ID?channel=$CHANNEL
Example:
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/seller-promotions/items/MLA932421975?channel=mshops
Response traditional discount:
{
"id": "TR-496907760-202112031641564156",
"name": "Traditional Modificada 3",
"status": "programmed",
"type": "traditional",
"start_date": "2120-03-13",
"finish_date": "2120-02-12",
"target": "SELECTED_PRODUCTS"
"campaign_item_type": "traditional_campaign"
}
Quantity offer response:
{
"id": "DXV-553421365-20230131110752752",
"name": " DXV PRUEBA 1",
"status": "programmed",
"type": "volume",
"start_date": "2023-02-01",
"finish_date": "2023-03-30",
"target": "SELECTED_PRODUCTS",
"buy_quantity": 6
}
Response if the item does not exist:
{
"message": "Item with id MLA082324822 not found",
"error": "not_found",
"status": 404,
"cause": []
}
Response if they do not have access:
{
"message": "Caller don't have permissions to access this item",
"error": "forbidden",
"status": 403,
"cause": []
}
Parameters
promotion_type: type of promotion to be queried.
promotion_id: identifier of the campaign/promotion to be
queried.
channel: channel in which we want to consult. By default, a
marketplace will be available.
Consult publications by promotion
This feature identifies all the publications associated with a promotion.
Request:
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN'
https://api.mercadolibre.com/seller-promotions/promotions/$PROMOTION_ID/items?channel=$CHANNEL&limit=$LIMIT&offset=$OFFSET
Example:
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/seller-promotions/promotions/TR-496907760-202112031641564156/items?channel=mshops&limit=100&offset=0
Response:
{
"items": [
{
"final_price": 90000,
"id": "MLA1123020613",
"original_price": 100000,
"title": "Samsung Galaxy A10 32 Gb Azul 2 Gb Ram"
},
{
"final_price": 1350,
"id": "MLA897947944",
"original_price": 1500,
"title": "Sticker Tarjetas"
},
{
"final_price": 1350,
"id": "MLA838847599",
"original_price": 1500,
"title": "Billetera Ideal Para Gente Como Vos!"
}
],
"pagination": {
"offset": 0,
"limit": 100,
"total": 3
}
}
Response of quantity offers:
{
"items": [
{
"final_price": 591600000,
"id": "MLA851258051",
"original_price": 102000000,
"title": "Smart Tv Tcl L50p8m Led 4k 50 100v/240v"
},
{
"final_price": 116000,
"id": "MLA1137574968",
"original_price": 20000,
"title": "Procesador De Alimentos"
}
],
"pagination": {
"offset": 0,
"limit": 50,
"total": 2
}
}
Parameters
promotion_id: identifier of the campaign/promotion to be
queried.
user_id: identification of the seller of which we want to
know the promotions he has in his store.
channel: channel in which we want to consult. By default, a
marketplace will be available.
limit: limit of the number of publications returned by the
query.
offset: number of publications to omit before starting to
return publications from the query (pagination).
Add publications to a promotion
Request:
curl -X PUT -H 'Authorization: Bearer $ACCESS_TOKEN' -H "Content-Type: application/json" -d {...}
https://api.mercadolibre.com/seller-promotions/users/$USER_ID/promotion/$PROMOTION_ID/items?channel=$CHANNEL
Example for traditional promotion:
curl -X PUT -H 'Authorization: Bearer $ACCESS_TOKEN' -H "Content-Type: application/json" -d
'{
"items": [
{
"item_id": "MLA930546850"
}
],
"action": "add"
}'
https://api.mercadolibre.com/seller-promotions/users/496907760/promotion/10038085/items?channel=mshops
Example for massive promotion:
curl -X PUT -H 'Authorization: Bearer $ACCESS_TOKEN' -H "Content-Type: application/json" -d
{
"items": [
{
"item_id": "MLA1112170643",
"value_discount":10,
"discount_type":"PERCENT"
},
{
"item_id": "MLA931566278",
"value_discount":10,
"discount_type":"FIXED_PRICE"
}
],
"action": "add"
}
https://api.mercadolibre.com/seller-promotions/users/496907760/promotion/10038085/items?channel=mshops
Example for quantity offers:
curl -X PUT -H 'Authorization: Bearer $ACCESS_TOKEN' -H "Content-Type: application/json" -d
{
"items": [
{
"item_id": "MLA854184492"
}
],
"action": "add"
}
https://api.mercadolibre.com/seller-promotions/users/553421365/promotion/DXV-553421365-20230131110752752/items?channel=mshops
Satisfactory response:
{
"status": "Success",
"code": "201"
}
Parameters
promotion_id: identifier of the campaign/promotion to be
queried.
channel: channel in which we want to consult. By default, a
marketplace will be available.
user_id: identification of the seller of which we want to
know the promotions that he has in his store.
Remove a publication from a promotion
Request:
curl -X PUT -H 'Authorization: Bearer $ACCESS_TOKEN' -H "Content-Type: application/json" -d {...}
https://api.mercadolibre.com/seller-promotions/users/$USER_ID/promotions/$PROMOTION_ID/items?channel=$CHANNEL
Example:
ccurl -X PUT -H 'Authorization: Bearer $ACCESS_TOKEN' -H "Content-Type: application/json" -d
'{
"items": [
{
"item_id": "MLA932423847"
}
],
"action": "delete"
}'
https://api.mercadolibre.com/seller-promotions/users/496907760/promotions/TR-496907760-202112031641564156/items?channel=mshops
Example of quantity offer:
curl -X PUT -H 'Authorization: Bearer $ACCESS_TOKEN' -H "Content-Type: application/json" -d
'{
"items": [
{
"item_id": "MLA854184492"
}
],
"action": "delete"
}'
https://api.mercadolibre.com/seller-promotions/users/553421365/promotions/DXV-553421365-20230131110752752/items?channel=mshops
Manage promotions by store
Consult promotions by store
This resource can be used to consult a store's active promotions.
Request:
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN'
https://api.mercadolibre.com/seller-promotions/users/$USER_ID?channel=$CHANNEL
Example:
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/seller-promotions/users/496907760?channel=mshops
Response:
{
"results": [
{
"id": "TR-496907760-202112031641564156",
"name": "Traditional Modificada 3",
"status": "ACTIVE",
"type": "TRADITIONAL",
"start_date": "2120-03-14T00:00:00.000+00:00",
"end_date": "2120-02-13T00:00:00.000+00:00",
"target": "SELECTED_PRODUCTS",
"discount_type": "PERCENT",
"value": 10,
"shop_id": 496907780
},
{
"id": "INDIVIDUAL-MLB2038165685-202111021040184018",
"status": "ACTIVE",
"type": "INDIVIDUAL",
"start_date": "2021-12-14T00:00:00.000+00:00",
"end_date": "2021-12-20T00:00:00.000+00:00",
"target": "SELECTED_PRODUCTS",
"discount_type": "PERCENT",
"value": 5,
"shop_id": 496907780,
"item_id": "MLB2038165685"
},
{
"id": "INDIVIDUAL-MLA930546840-20211103163908398",
"status": "ACTIVE",
"type": "INDIVIDUAL",
"start_date": "2021-12-14T00:00:00.000+00:00",
"end_date": "2021-12-20T00:00:00.000+00:00",
"target": "SELECTED_PRODUCTS",
"discount_type": "PERCENT",
"value": 50,
"shop_id": 496907780,
"item_id": "MLA930546840"
}
]
}
Response for invalid user_id:
{
"message": "Caller don't have permissions to access this user",
"error": "forbidden",
"status": 403,
"cause": []
}
Parameters
user_id: identification of the seller of which we want to
know the promotions he has in his store.
channel: channel in which we want to consult. By default, a
marketplace will be available.
Create promotion
Using the following resource you can create a promotion for the entire store, so it will be applied to all the items that are active in it.
Request:
curl -X POST -H 'Authorization: Bearer $ACCESS_TOKEN' -H "Content-Type: application/json" -d
{...}
https://api.mercadolibre.com/seller-promotions/users/$USER_ID?channel=$CHANNEL
Depends on the type of promotion you publish, the POST can have attributes such as: name, discount_type, value, campaign_type, start_date, end_date, target, description, code, item_id, min_payment_amount, items, action, status, buy_quantity.
Example of coupon:
curl -X POST -H 'Authorization: Bearer $ACCESS_TOKEN' -H "Content-Type: application/json" -d
'{
"name": "Nombre Promo Prueba",
"code": "PRUEBA3",
"description": "Descripción cupon",
"discount_type": "fixed",
"value": 50000,
"start_date": "2021-12-01T00:00:00.000+0000",
"end_date": "2021-12-02T00:00:00.000+0000",
"min_payment_amount": 50001,
"max_user_budget": 50000,
"budget": 100000,
"type": "coupon",
"one_coupon_per_user": true,
"status": "active"
}'
https://api.mercadolibre.com/seller-promotions/users/496907760?channel=mshops
Response of the promotion coupon created:
{
"id": "10029844",
"name": "Nombre Promo Prueba",
"status": "ACTIVE",
"type": "COUPON",
"start_date": "2021-12-01T00:00:00.000+00:00",
"target": "ALL_PRODUCTS",
"discount_type": "FIXED",
"value": 50000,
"shop_id": 496907780,
"description": "Descripcion cupon",
"code": "PRUEBA3"
}
Example bid by quantity, on all units (20%off on the 6th unit):
curl -X POST -H 'Authorization: Bearer $ACCESS_TOKEN' -H "Content-Type: application/json" -d
'{
"name": " DXV PRUEBA 1",
"discount_type": "percentage_by_unit",
"value": 20.0,
"start_date": "2023-02-02T00:00:00.000+0000",
"end_date": "2023-03-31T00:00:00.000+0000",
"type": "volume",
"target": "SELECTED_PRODUCTS",
"buy_quantity": 6,
"status": "ACTIVE"
}'
https://api.mercadolibre.com/seller-promotions/users/805246766?channel=mshops
Response of the promotion created:
{
"id": "DXV-553421365-20230131110752752",
"name": " DXV PRUEBA 1",
"status": "ACTIVE",
"type": "volume",
"start_date": "2023-02-02T00:00:00.000+00:00",
"end_date": "2023-03-31T00:00:00.000+00:00",
"target": "SELECTED_PRODUCTS",
"discount_type": "percentage_by_unit",
"value": 20,
"shop_id": 553421365,
"buy_quantity": 6
}
https://api.mercadolibre.com/seller-promotions/users/805246766?channel=mshops
Example of quantity offer on one unit (20%off on the 6th unit):
curl -X POST -H 'Authorization: Bearer $ACCESS_TOKEN' -H "Content-Type: application/json" -d
{
"name": " DXV PRUEBA 2",
"discount_type": "percentage_by_volume",
"value": 20.0,
"start_date": "2023-04-02T00:00:00.000+0000",
"end_date": "2023-04-31T00:00:00.000+0000",
"type": "individual_volume",
"target": "SELECTED_PRODUCTS",
"buy_quantity": 6,
"status": "ACTIVE",
"item_id": "MLA1137574968"
}
https://api.mercadolibre.com/seller-promotions/users/805246766?channel=mshops
Satisfactory response:
{
"status": "Success",
"code": "200"
}
Example of offers by quantity of free Units (2x1):
curl -X POST -H 'Authorization: Bearer $ACCESS_TOKEN' -H "Content-Type: application/json" -d
{
"name": " DXV PRUEBA 3 2x1",
"discount_type": "discount_by_quantity",
"start_date": "2023-05-02T00:00:00.000+0000",
"end_date": "2023-05-31T00:00:00.000+0000",
"type": "volume",
"target": "SELECTED_PRODUCTS",
"buy_quantity": 2,
"pay_quantity": 1,
"status": "ACTIVE"
}
https://api.mercadolibre.com/seller-promotions/users/805246766?channel=mshops
Satisfactory response:
{
"status": "Success",
"code": "200"
}
Parameters
user_id: user_id: Identification of the seller of which we
want to know the promotions he has in his store.
channel: channel in which we want to consult. By default, a
marketplace will be available.
Expected parameters by campaign type
PROPRIEDAD | BOLETO | COUPON | COUPON-FIXED | TRADITIONAL |
---|---|---|---|---|
Name | Promotion name | Promotion name | Promotion name | Promotion name |
Discount_type | PERCENT | PERCENT | FIXED | PERCENT |
Value | Promotion value | Promotion value | Promotion value (fixed price) | Promotion value |
type | boleto | coupon | coupon | traditional |
start_date | Start date | Start date | Start date | Start date |
end_date | End date | End date | End date | End date |
target | ALL_PRODUCTS | |||
min_payment_amount | Minimum amount | Minimum amount | ||
Code | Promotion code | Promotion code | ||
one_coupon_per_user | true our false | |||
items | ||||
Item_id | ||||
campaign_item_type | TRADITIONAL | |||
buy_quantity | ||||
pay_quantity |
TRADITIONAL-ITEM | TRADITIONAL-MASIVO | INDIVIDUAL | VOLUME |
---|---|---|---|
Promotion name | Promotion name | Promotion name | Promotion name |
PERCENT | BY_ITEM | discount_by_quantity , percentage_by_volume, percentage_by_unit | |
Promotion value | Promotion value | Promotion value (Except for discount_by_quantity) | |
traditional | traditional | individual | volume and individual_volume |
Start date | Start date | Start date | Start date |
End date | End date | End date | End date |
SELECTED_PRODUCTS | LISTED_PRODUCTS | SELECTED_PRODUCTS | |
Promotion items list | Promotion items list (for when type - individual_volume) | ||
Id do item | Id do item | ||
TRADITIONAL | MASSIVE | ||
number of items that apply to the promotion (between 2 and 10 units) | |||
amount of items to be paid (Less than the amount carried) |
Modify promotion by store
This resource can be used to make changes in the promotions of a store. To do this, it is necessary to have the ID of the store and the ID of the promotion to be modified.
Request:
curl -X PUT -H 'Authorization: Bearer $ACCESS_TOKEN' -H "Content-Type: application/json" -d {...}
https://api.mercadolibre.com/seller-promotions/users/$USER_ID/promotion/$PROMOTION_ID?channel=$CHANNEL
Details
The following properties can be changed for coupon and fixed coupon:
- name
- value (as long as it is programmed)
- start_date (as long as it is programmed)
- end_date (as long as it is programmed)
- description
- min Payment Amount (as long as it is programmed)
When you make a modification you must send at least the following data (only the properties mentioned above can be modified):
- name
- discount_type
- value
- type
- start_date
- end_date
- start_date
- code
- min_payment_amount
Coupon fixed example:
curl -X PUT -H 'Authorization: Bearer $ACCESS_TOKEN' -H "Content-Type: application/json" -d
'{
"name": "Nombre Promo 1 fixed",
"discount_type": "fixed",
"value": 3000,
"type": "coupon",
"start_date": "2023-02-08T20:57:00.000+0000",
"end_date": "2023-12-02T00:00:00.000+0000",
"code": "PRUEBA3",
"min_payment_amount": 50005
}'
https://api.mercadolibre.com/seller-promotions/users/496907760/promotions/TR-496907760-202112031641564156?channel=mshops
Coupon example:
curl -X PUT -H 'Authorization: Bearer $ACCESS_TOKEN' -H "Content-Type: application/json" -d
'{
"name": "Nombre Promo 1 PERCENT",
"discount_type": "percent",
"value": 3000,
"type": "coupon",
"start_date": "2023-02-08T20:57:00.000+0000",
"end_date": "2023-12-02T00:00:00.000+0000",
"code": "PRUEBA3",
"min_payment_amount": 1
}'
https://api.mercadolibre.com/seller-promotions/users/496907760/promotions/TR-496907760-202112031641564156?channel=mshops
Details
The following properties can be changed for boleto:
- name
- value (as long as it is programmed)
- start_date(as long as it is programmed)
- end_date (as long as it is programmed)
When you make a modification you must send at least the following data (only the properties mentioned above can be modified):
- name
- value
- type
- start_date
- end_date
Boleto example:
curl -X PUT -H 'Authorization: Bearer $ACCESS_TOKEN' -H "Content-Type: application/json" -d
'{
"name": "Nombre PROMO 1 BOLETO",
"value": 20,
"type": "boleto",
"start_date": "2022-02-08T20:57:00.000+0000",
"end_date": "2022-12-08T00:00:00.000+0000"
}'
https://api.mercadolibre.com/seller-promotions/users/496907760/promotions/TR-496907760-202112031641564156?channel=mshops
Details
For traditional (ALL_PRODUCTS) you can change the following properties:
- name
- start_date (as long as it is programmed)
- end_date (as long as it is programmed)
When you make a modification you must send at least the following data (only the properties mentioned above can be modified):
- name
- value
- type
- start_date
- end_date
- target
Traditional ALL_PRODUCTS example:
curl -X PUT -H 'Authorization: Bearer $ACCESS_TOKEN' -H "Content-Type: application/json" -d
'{
"name": "Traditional Mod",
"value":10,
"type": "traditional",
"start_date": "2022-02-18T08:00:00.000+0000",
"end_date": "2023-12-13T00:00:00.000+0000",
"target": "ALL_PRODUCTS"
}'
https://api.mercadolibre.com/seller-promotions/users/496907760/promotions/TR-496907760-202112031641564156?channel=mshops
Response with an incorrect parameter:
{
"message": "type mismatch for key [target]",
"error": "bad_request",
"status": 400,
"cause": []
}
Parameters
user_id: identification of the seller of which we want to
know the promotions he has in his store.
channel: channel in which we want to consult. By default, a
marketplace will be available.
promotion_id: identifier of the campaign/promotion to be
queried.
Remove promotion by store
Request:
curl -X DELETE -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/seller-promotions/users/$USER_ID/promotions/$PROMOTION_ID?channel=$CHANNEL
Example:
curl -X DELETE -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/seller-promotions/users/496907760/promotions/INDIVIDUAL-MLA930546840-2021110811090191?channel=mshops
Parameters
user_id: identification of the seller of which we want to
know the promotions he has in his store.
channel: channel in which we want to consult. By default, a
marketplace will be available.
promotion_id: identifier of the campaign/promotion to be
queried.
Manage coupon report
Parameters:
You can obtain the report of available coupons in a store by making a query with the following parameters.
Name | Type | Description | Example |
---|---|---|---|
Seller_id | String | ID of the seller/store | 594239600 |
Start_date | String | Start date of the report in the format yyyy-MM-dd | 2024-07-09 |
End_date | String | End date of the report in the format yyyy-MM-dd | 2024-07-12 |
Request:
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/seller-promotions/users/$SELLER_ID/coupons?start_date=$START_DATE&end_date=$END_DATE&channel=mshops
Example:
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/seller-promotions/users/123/coupons?start_date=2024-04-01&end_date=2024-04-30
Successful coupons response
{
"start_date": "2024-04-01",
"end_date": "2024-04-30",
"coupons": [
{
"id": 10996528,
"campaign_name": "Cupon test",
"coupon_code": "TESTCUPON",
"used_coupon": 0,
"total_sales": "$ 0",
"total_discount": "$ 0",
"created_date": "2024-03-30",
"start_date": "2024-03-30",
"end_date": "2024-05-14",
"status": "active"
},
{
"id": 10993413,
"campaign_name": "Cupon test 2",
"coupon_code": "TESTCUPON2",
"used_coupon": 0,
"total_sales": "$ 0",
"total_discount": "$ 0",
"created_date": "2024-03-24",
"start_date": "2024-03-28",
"end_date": "2024-04-30",
"status": "active"
},
{
"id": 10993343,
"campaign_name": "Cupon test 3",
"coupon_code": "TESTCUPON2",
"used_coupon": 0,
"total_sales": "$ 0",
"total_discount": "$ 0",
"created_date": "2024-03-24",
"start_date": "2024-03-28",
"end_date": "2024-04-13",
"status": "inactive"
}
]
}
Successful coupons response, but no coupons within the selected date range:
{
"start_date": "2024-04-01",
"end_date": "2024-04-30",
"coupons": []
}
Coupons retrieval without start date and/or end date:
Request-code: 400
{
"start and end dates must not be empty"
}
Response fields:
The response from a GET to the /coupons resource will provide the following parameters
- results:
- id: promotion/coupon id
- campaign_name: Promotion/coupon name
- coupon_code: Code assigned to redeem the coupon
- used_coupon: Boolean that lets me know if the coupon was used or not
- total_sales: Total sales generated with the products sold that applied the coupon
- total_discount: Total discount generated with the products sold that applied the coupon
- created_date: Promotion/coupon creation date
- start_date: Promotion/coupon start date
- end_date: Promotion/coupon end date
- status: Promotion status, its values can be active or inactive
Coupons Errors
Retrieval of coupons with incorrect date format
Request-code: 400
{
"Start and end dates must be in correct format: yyyy-MM-dd"
}
Error retrieving coupons from a seller
Request-code: 500
{
}
Error using the access token to obtain coupon information
Request-code: 401
{
"code": "unauthorized",
"message": "invalid access token"
}
Next: Guest users sales.