example-data.com
Menu
Browse docs and collections

Overview

coupons / #38

coupons #38

code
B25BIU
discountType
fixed
value
23.44
minOrderAmount
15.23
maxRedemptions
355
redemptionCount
339
validFrom
validUntil
isActive
true
createdAt

Component variants

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 38,
  "code": "B25BIU",
  "discountType": "fixed",
  "value": 23.44,
  "minOrderAmount": 15.23,
  "maxRedemptions": 355,
  "redemptionCount": 339,
  "validFrom": "2025-11-26T18:45:08.689Z",
  "validUntil": "2026-07-27T20:53:45.689Z",
  "isActive": true,
  "createdAt": "2025-11-21T08:12:47.927Z"
}