Skip to content

Coupons

The Coupons resource provides fake coupon data with discount types, values, usage limits, and expiration dates.

MethodEndpointDescription
GET/v1/couponsList all coupons
GET/v1/coupons/:idGet a specific coupon
{
"id": 1,
"code": "SAVE50",
"description": "50% off on all electronics",
"discountType": "percentage",
"discountValue": 50,
"minPurchase": 100,
"maxDiscount": 200,
"usageLimit": 100,
"usedCount": 25,
"expiresAt": "2026-12-31T23:59:59.000Z",
"isActive": true,
"createdAt": "2026-01-15T10:30:00.000Z",
"updatedAt": "2026-01-15T10:30:00.000Z"
}
Field Type Description
id number Unique identifier
code string Unique coupon code
description string Coupon description
discountType string Type (percentage or fixed)
discountValue number Discount amount or percentage
minPurchase number Minimum purchase amount (optional)
maxDiscount number Maximum discount cap (optional)
usageLimit number Max number of times coupon can be used
usedCount number Number of times coupon has been used
expiresAt string Expiration date (ISO 8601)
isActive boolean Whether coupon is currently active
createdAt string ISO 8601 timestamp
updatedAt string ISO 8601 timestamp
Terminal window
curl https://api.phantomjson.app/v1/coupons
Parameter Type Default Description
page number 1 Page number
limit number 20 Items per page (max: 100)
sort string Sort field and direction
q string Search query
fields string Fields to return
code string Filter by code
isActive boolean Filter by active status
{
"data": [
{
"id": 1,
"code": "SAVE50",
"description": "50% off on all electronics",
"discountType": "percentage",
"discountValue": 50,
"isActive": true
}
],
"meta": {
"total": 50,
"page": 1,
"limit": 20,
"totalPages": 3
}
}
Terminal window
curl https://api.phantomjson.app/v1/coupons/1
{
"data": {
"id": 1,
"code": "SAVE50",
"description": "50% off on all electronics",
"discountType": "percentage",
"discountValue": 50,
"minPurchase": 100,
"maxDiscount": 200,
"usageLimit": 100,
"usedCount": 25,
"expiresAt": "2026-12-31T23:59:59.000Z",
"isActive": true,
"createdAt": "2026-01-15T10:30:00.000Z",
"updatedAt": "2026-01-15T10:30:00.000Z"
}
}
Terminal window
curl "https://api.phantomjson.app/v1/coupons?code=SAVE50"
Terminal window
curl "https://api.phantomjson.app/v1/coupons?isActive=true"
Terminal window
curl "https://api.phantomjson.app/v1/coupons?q=electronics"
Terminal window
curl "https://api.phantomjson.app/v1/coupons?sort=discountValue:desc"
Terminal window
curl "https://api.phantomjson.app/v1/coupons?fields=id,code,discountType,discountValue"
  • Coupons are standalone resources with no relationships to other endpoints.