Fetch Promotion Codes
2/12/25Less than 1 minute
Fetch Promotion Codes
Description
This API retrieves a list of promotional ads filtered by status and paginated using a cursor. The response includes promotional ads in either DRAFT or PUBLISHED status.
Endpoint
- URL:
/v1/promotions - Method:
GET
Query Parameters:
| Parameter | Type | Required | Description | Since | Example |
|---|---|---|---|---|---|
| code | string | false | Filter promotions by specific code | - | |
| name | string | false | Search promotions by specific name | - | |
| description | string | false | Search promotions by specific description | - | |
| status | string | false | Filter promotions by specific status | - | |
| startDate | string | false | Filter promotions by specific start date | - | |
| endDate | string | false | Filter promotions by specific end date | - | |
| createdAt | string | false | Filter promotions by specific created date | - | |
| updatedAt | string | false | Filter promotions by specific updated date | - |
Required Headers
{
"Authorization": "Bearer JWT_TOKEN",
"X-MerchantApiKey": "MERCHANT_API_KEY",
"Content-Type": "application/json"
}Example API Call (Using Fetch)
fetch("https://api.shopsynch.com/v1/promo-ads?status=DRAFT&cursor=2025-02-11T18:21:53Z&limit=1", {
method: "GET",
headers: {
"Authorization": "Bearer JWT_TOKEN",
"X-MerchantApiKey": "MERCHANT_API_KEY",
"Content-Type": "application/json"
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error("Error:", error));✅ Sample 200 Response (Success)
{
"data": {
"data": [
{
"id": "67abd011ea45dd1b9222e591",
"adName": "Biggest Sale Ever",
"images": [
"https://example.com/sale1.jpg",
"https://example.com/sale2.jpg"
],
"ctaText": "Shop Now!",
"promoCode": "BIGSALE50",
"buttons": [
{
"type": "primary",
"position": "bottom-center",
"color": "#FF0000",
"textColor": "#FFFFFF",
"link": "https://example.com/shop",
"metadata": null
}
],
"status": "DRAFT",
"metadata": null,
"createdAt": "2025-02-11T23:32:49.254",
"updatedAt": "2025-02-11T23:32:49.254"
}
],
"nextCursor": "2025-02-11T18:21:53.148Z"
},
"message": "Promo Ads retrieved successfully",
"status": true
}Next Steps
- Learn more about Adding a Promo Code
- Learn more about Updating a Promo Code
- Learn more about Deleting a Promo Code
