example-data.com
Menu
Browse docs and collections

Overview

coupons / #10

coupons #10

code
FQHLHP
discountType
fixed
value
40.5
minOrderAmount
72.74
maxRedemptions
899
redemptionCount
64
validFrom
validUntil
isActive
false
createdAt

Component variants

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 10,
  "code": "FQHLHP",
  "discountType": "fixed",
  "value": 40.5,
  "minOrderAmount": 72.74,
  "maxRedemptions": 899,
  "redemptionCount": 64,
  "validFrom": "2025-11-25T06:36:41.264Z",
  "validUntil": "2026-07-04T20:03:35.160Z",
  "isActive": false,
  "createdAt": "2025-11-19T01:53:26.072Z"
}