Skip to content

Read Coupons API

A read-only REST API that returns approved coupons from What’s Good. Each coupon includes its venue listing ID and its custom field values.

Base URL https://whatsgoodapi.up.railway.app/v1
Format JSON, UTF-8
Auth API key in the X-API-Key header

Send the API key in the X-API-Key header on every request. The key that reads your events also reads your coupons.

Terminal window
curl https://whatsgoodapi.up.railway.app/v1/coupons \
-H "X-API-Key: wg_live_YOUR_KEY"
  • Keys are read-only, and each key is limited to one account.
  • Keys are accepted only in the header, never in the URL.
  • Keep keys on the server. Don’t put them in browser JavaScript or commit them to a public repository.

Keys are issued by What’s Good. To request one, or to replace a key that may have leaked, contact dustin@whatsgood.city.

Method Path Returns
GET /v1/coupons A page of coupons
GET /v1/coupons/{id} One coupon
GET /v1/custom-fields Custom fields and their options, for events and coupons

Returns coupons, oldest change first (sorted by updated_at, then id).

Parameter Type Default Description
updated_since ISO 8601 datetime none Only coupons created or changed after this time.
status active | inactive | all active Use all to include expired and withdrawn coupons.
limit integer, 1–200 100 Page size.
cursor string none The next_cursor value from the previous page.

With no parameters, the endpoint returns every coupon that can be redeemed today or later.

{
"data": [ { "...": "coupon object" } ],
"next_cursor": "eyJ1IjoiMjAyNi0xMC0wMVQxNDowMDowMFoiLCJpIjoiNWYwYyJ9",
"has_more": true
}

Keep requesting with cursor=<next_cursor> until has_more is false.

Syncing changes: call GET /v1/coupons?updated_since=<last sync>&status=all. Create or update active coupons by id, and unpublish inactive ones. Use the largest updated_at received as the next updated_since, minus a few minutes of overlap.

When a coupon’s redeem_to date passes it becomes inactive and its updated_at is set to that moment, so the sync above picks up expiries. You don’t need to check redeem_to yourself.

Returns one coupon object, including inactive coupons. Returns 404 if the coupon doesn’t exist.

Returns the custom fields configured for the account, with every option, so the option IDs on coupons can be mapped to names. This is the same endpoint the Read Events API uses: event fields and coupon fields are in one list, and no key is shared between the two.

{
"data": [
{
"key": "deal_category",
"label": "Deal Category",
"options": [
{ "id": 1, "parent": null, "name": "Hotel Packages" },
{ "id": 2, "parent": null, "name": "Dining" },
{ "id": 3, "parent": null, "name": "Attractions" }
]
},
{
"key": "event_category",
"label": "Event Category",
"options": [
{ "id": 21, "parent": "Music & Entertainment", "name": "Concerts" }
]
}
]
}

parent is the heading an option sits under, or null for fields with only one level. Custom fields are configured per account by What’s Good during setup to match the fields in your CRM or CMS, using your system’s own option IDs. Which fields exist depends on the account. Treat the keys as data, not as a fixed set.

{
"id": "6f1c2a9e-4b7d-4e1a-9c3f-2d8e5a7b1c0d",
"status": "active",
"title": "Fall Getaway Package",
"description": "Stay two nights and get the third night free. Includes daily breakfast for two and late checkout. Book by November 15.",
"url": "https://example.com/offers/fall-getaway",
"photos": [
"https://res.cloudinary.com/checkwhatsgood/image/upload/v1790000000/example-destination/coupons/fall-getaway.jpg"
],
"redeem_from": "2026-10-01",
"redeem_to": "2026-11-15",
"venue": {
"listing_id": "4821",
"name": "Harbor Hotel"
},
"custom_fields": {
"deal_category": [1]
},
"approved_at": "2026-09-30T14:12:05-04:00",
"updated_at": "2026-10-01T09:30:44-04:00"
}
Field Type Notes
id string Stable for the life of the coupon.
status active | inactive active means approved and redeemable today or later. inactive means the coupon has expired or was withdrawn, and should be unpublished.
title string The offer’s name.
description string Plain text, no HTML.
url string The offer’s page on the venue’s own site.
photos array of URLs Full https image URLs, main image first. Empty when the offer has no image.
redeem_from date | null First day the offer can be redeemed. null when it’s available now.
redeem_to date Last day the offer can be redeemed. When an offer has both a booking deadline and a stay window, this is the booking deadline.
venue.listing_id string | null Venue listing ID in your account. null if no listing is set.
venue.name string | null Plain-text venue name.
custom_fields object Custom field key → array of option IDs. Which keys appear depends on the account; see /v1/custom-fields.
approved_at datetime When the coupon was first approved.
updated_at datetime When the coupon last changed, including becoming inactive.

redeem_from and redeem_to are calendar dates, ISO 8601 without a time, e.g. 2026-11-15, inclusive. A coupon with redeem_to of 2026-11-15 stays active until midnight at the end of that day in the account’s time zone (the timezone reported on events).

approved_at and updated_at are timestamps, ISO 8601 with a UTC offset, e.g. 2026-09-30T14:12:05-04:00. The updated_since parameter accepts either form; a value without an offset is read in the account’s time zone.

New fields may be added, so ignore any that aren’t recognized.

Errors return JSON with a detail message, e.g. { "detail": "Invalid or missing API key" }.

Status Meaning
400 Invalid parameter
401 Missing, invalid or revoked API key
404 Coupon not found
429 Rate limit exceeded. Wait for the number of seconds in the Retry-After header
5xx Server error. Retry with backoff

Rate limit: 60 requests per minute per key, shared with the Read Events API.