coupons #1
- code
- 0V9WU1MP5
- discountType
- percent
- value
- 37
- minOrderAmount
- —
- maxRedemptions
- 705
- redemptionCount
- 459
- validFrom
- validUntil
- isActive
- true
- createdAt
Overview
Request
curl example
curl -sS \ "https://example-data.com/api/v1/coupons/1" \ -H "Accept: application/json"
JavaScript example
const res = await fetch( "https://example-data.com/api/v1/coupons/1" ); const coupon = await res.json();
TypeScript example
// Download once: mkdir -p types && curl -o types/coupons.d.ts https://example-data.com/types/coupons.d.ts
import type { Coupon } from "./types/coupons";
const res = await fetch(
"https://example-data.com/api/v1/coupons/1"
);
const coupon = (await res.json()) as Coupon; Python example
import requests
res = requests.get(
"https://example-data.com/api/v1/coupons/1"
)
coupon = res.json() Response
{
"id": 1,
"code": "0V9WU1MP5",
"discountType": "percent",
"value": 37,
"minOrderAmount": null,
"maxRedemptions": 705,
"redemptionCount": 459,
"validFrom": "2025-06-06T05:46:20.110Z",
"validUntil": "2026-12-19T09:53:50.275Z",
"isActive": true,
"createdAt": "2025-06-04T22:00:40.253Z"
}