Skip to content
On this page

Fetch Discounts ​

Retrieve a list of discounts from your store.

Endpoint ​

GET /api/discount/search

Query Parameters ​

NameTypeDescription
pageintPage number (optional)
limitintItems per page (optional)
codestringFilter by discount code
activeboolFilter by active status

Response ​

json
{
  
  "results": [
    {
      "_id": "string",
      "storeId": "string",
      "createdBy": "string",
      "code": "SUMMER2024",
      "type": "percentage",
      "percentage": 10,
      "value": null,
      "startDate": "2024-06-01T00:00:00.000Z",
      "endDate": "2024-06-30T23:59:59.000Z",
      "usedCount": 5,
      "products": [
        {
          "_id": "string",
          "by_quantity": false,
          "quantity": 0
        }
      ],
      "customers": ["string"],
      "requirements": {
        "price": 100,
        "quantity": 0
      },
      "countries": ["string"],
      "province": ["string"],
      "cities": ["string"],
      "target": "ALL",
      "active": true,
      "limits": {
        "per_customer": -1,
        "all": -1
      },
      "currencies": [
        {
          "currency": "USD",
          "properties": [
            { "name": "value", "value": 10 }
          ]
        }
      ]
    }
  ],
  "paginate": {
        "total": 2,
        "per_page": 20,
        "current_page": 1,
        "last_page": 1
    }
}

Released under the MIT License.