example-data.com
Menu
Browse docs and collections

Overview

coupons / #25

coupons #25

code
Q0I3VRC
discountType
percent
value
26
minOrderAmount
maxRedemptions
redemptionCount
481
validFrom
validUntil
isActive
true
createdAt

Component variants

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 25,
  "code": "Q0I3VRC",
  "discountType": "percent",
  "value": 26,
  "minOrderAmount": null,
  "maxRedemptions": null,
  "redemptionCount": 481,
  "validFrom": "2025-07-22T16:18:49.541Z",
  "validUntil": "2027-03-24T23:15:17.893Z",
  "isActive": true,
  "createdAt": "2025-07-22T07:52:48.450Z"
}