Skip to content
PharmaFlow Knowledgebase
Esc
↑↓navigate↵open⌘Jpreview

List coupons

Admin only. Returns every coupon ordered by code, with numeric discount and an active flag. The whole registry is returned, not a page, so the console can hold coupon admin offline.

GET/api/v1/coupons
Authorization
AuthorizationBearer token (JWT) · headerrequired

JWT from POST /api/v1/auth/login sent as Authorization Bearer.

Responses
200

Every coupon

Array of object
idstringrequired
codestringrequired
typestringrequired
discount_typestringrequired
discount_valuenumberrequired
descriptionstringrequired
valid_fromstring | nullrequired
valid_untilstring | nullrequired
max_usesinteger | nullrequired
Show properties
Any of:
integer
integer
null
null
usage_countintegerrequired
min -9007199254740991 · max 9007199254740991
is_activebooleanrequired
401

Not authenticated

detailstringrequired
403

Caller is not an admin

detailstringrequired
Try it
Server
Authorization
Request
curl -X GET 'http://localhost:8000/api/v1/coupons' \
  -H 'Authorization: Bearer YOUR_TOKEN'
Response
[
  {
    "id": "string",
    "code": "string",
    "type": "string",
    "discount_type": "string",
    "discount_value": 0,
    "description": "string",
    "valid_from": "string",
    "valid_until": "string",
    "max_uses": -9007199254740991,
    "usage_count": -9007199254740991,
    "is_active": true
  }
]