example-data.com
Menu
Browse docs and collections

Overview

coupons / #35

coupons #35

code
5F9I37B
discountType
percent
value
18
minOrderAmount
maxRedemptions
43
redemptionCount
24
validFrom
validUntil
isActive
true
createdAt

Component variants

Request

curl example

curl -sS \
  "https://example-data.com/api/v1/coupons/35" \
  -H "Accept: application/json"

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/coupons/35"
);
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/35"
);
const coupon = (await res.json()) as Coupon;

Python example

import requests

res = requests.get(
    "https://example-data.com/api/v1/coupons/35"
)
coupon = res.json()

Response

{
  "id": 35,
  "code": "5F9I37B",
  "discountType": "percent",
  "value": 18,
  "minOrderAmount": null,
  "maxRedemptions": 43,
  "redemptionCount": 24,
  "validFrom": "2026-01-09T00:27:30.450Z",
  "validUntil": "2027-04-29T09:04:32.048Z",
  "isActive": true,
  "createdAt": "2026-01-08T16:57:32.315Z"
}