example-data.com
Menu
Browse docs and collections

Overview

coupons / #3

coupons #3

code
XZ437MJ3
discountType
fixed
value
36.16
minOrderAmount
44
maxRedemptions
808
redemptionCount
489
validFrom
validUntil
isActive
true
createdAt

Component variants

Medium

#3

#3

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 3,
  "code": "XZ437MJ3",
  "discountType": "fixed",
  "value": 36.16,
  "minOrderAmount": 44,
  "maxRedemptions": 808,
  "redemptionCount": 489,
  "validFrom": "2026-03-03T23:21:16.401Z",
  "validUntil": "2027-02-15T07:58:28.855Z",
  "isActive": true,
  "createdAt": "2026-02-27T07:23:13.420Z"
}