API Referencev1Discounts

List discounts

GET
/v1/discounts
X-API-Key<token>

Per-store API key created in the dashboard at Settings > Developer > API Keys.

In: header

Query Parameters

page?integer
Default1
Range1 <= value
per_page?integer
Default25
Range1 <= value <= 100
status?string
Default"active"
Value in"active" | "inactive" | "expired" | "all"

Response Body

application/json

curl -X GET "https://api.whatalo.com/v1/discounts"
{
  "data": [
    {
      "id": "disc_abc123",
      "code": "SUMMER20",
      "type": "percentage",
      "value": 20,
      "min_order_amount": 0,
      "max_uses": 0,
      "current_uses": 0,
      "starts_at": "string",
      "expires_at": "string",
      "is_active": true,
      "applies_to_all": true,
      "applicable_product_ids": [
        "string"
      ],
      "applicable_category_ids": [
        "string"
      ],
      "is_expired": true,
      "is_usable": true,
      "has_usage_limit": true,
      "created_at": "string",
      "updated_at": "string"
    }
  ],
  "pagination": {
    "page": 1,
    "per_page": 25,
    "total": 100,
    "total_pages": 4
  }
}