example-data.com
Menu
Browse docs and collections

Overview

coupons / #24

coupons #24

code
MT2HYI
discountType
fixed
value
32.64
minOrderAmount
maxRedemptions
redemptionCount
82
validFrom
validUntil
isActive
true
createdAt

Component variants

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 24,
  "code": "MT2HYI",
  "discountType": "fixed",
  "value": 32.64,
  "minOrderAmount": null,
  "maxRedemptions": null,
  "redemptionCount": 82,
  "validFrom": "2026-01-06T17:06:41.924Z",
  "validUntil": "2026-10-21T20:54:33.761Z",
  "isActive": true,
  "createdAt": "2026-01-03T22:50:37.976Z"
}