Skip to content

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: ​

ParameterTypeRequiredDescriptionSinceExample
codestringfalseFilter promotions by specific code-
namestringfalseSearch promotions by specific name-
descriptionstringfalseSearch promotions by specific description-
statusstringfalseFilter promotions by specific status-
startDatestringfalseFilter promotions by specific start date-
endDatestringfalseFilter promotions by specific end date-
createdAtstringfalseFilter promotions by specific created date-
updatedAtstringfalseFilter promotions by specific updated date-

Required Headers ​

json
{
  "Authorization": "Bearer JWT_TOKEN",
  "X-MerchantApiKey": "MERCHANT_API_KEY",
  "Content-Type": "application/json"
}

Example API Call (Using Fetch) ​

javascript
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) ​

json
{
  "status": true,
  "message": "",
  "data": [
    {
      "createdAt": "yyyy-MM-dd HH:mm:ss",
      "updatedAt": "yyyy-MM-dd HH:mm:ss",
      "id": "",
      "name": "",
      "code": "",
      "description": "",
      "startDate": "yyyy-MM-dd HH:mm:ss",
      "endDate": "yyyy-MM-dd HH:mm:ss",
      "discountType": "PERCENTAGE",
      "discountValue": 0,
      "maximumDiscountCap": 0,
      "minimumOrderValue": 0,
      "requiredQuantity": 0,
      "freeQuantity": 0,
      "usageLimit": 0,
      "usageCount": 0,
      "perCustomerUsageLimit": 0,
      "discount": 0,
      "status": "",
      "tenantId": ""
    }
  ]
}

Next Steps ​

Build with joy