Skip to content

Promo codes

2 operations in the WP Waterfall API.

Check a promo code for a plan or an add-on

post/billing/promo-codes/validatePermalink to Check a promo code for a plan or an add-on

  • Scope: billing:read
  • Permission: billing.write

Answers valid with the order the code produces (the discount, the first charge, the price after the discount, and whether it replaces a free first month), or valid false with one generic sentence for every reason: unknown, expired, used up, already used, off, or not for this plan. Changes nothing. A wrong guess counts against the company and the caller's address; past the limit this answers 429 promo_rate_limited with Retry-After.

Parameters

NameInTypeDescription
Idempotency-Key requiredheaderstringSend a fresh unique value on every POST: a POST without it answers 422. The answer is stored for 24 hours, so a retry with the same key and body returns the first answer, and the same key with a different body returns 422.

Request body application/json, required, ValidatePromoCodeRequest

Fields

NameTypeDescription
code requiredstring
target requiredone of object, object

Responses

StatusBodyDescription
200PromoValidationThe result
400ProblemThe request could not be read: bad JSON, a bad header, or a malformed value.
401ProblemThe credentials are missing, expired, or revoked. The WWW-Authenticate header names the Bearer scheme.
403ProblemThe credentials are valid but may not do this: the role, the API key scope, or a required confirmation is missing.
409ProblemThe current state does not allow this: the same change is already running, or another change got there first.
422ProblemThe request was read but a value is not valid, or a required confirmation or Idempotency-Key is missing. The errors list names each field.
429ProblemA rate limit was reached. Wait Retry-After seconds. Limits are per caller, per company, and per address.
4XXProblemProblem Details (RFC 9457)

The company's promo code uses

get/billing/promo-redemptionsPermalink to The company's promo code uses

  • Scope: billing:read
  • Permission: billing.read

Codes this company used, with the discount and when a repeating discount ends.

Parameters

NameInTypeDescription
limitqueryintegerHow many rows to return in one page: at most 200, and 200 when left out. Default: 200. Range: 1 to 200.
cursorquerystringThe next_cursor of the page before. Leave it out for the first page.

Responses

StatusBodyDescription
200PromoRedemptionListRedemptions
400ProblemThe request could not be read: bad JSON, a bad header, or a malformed value.
401ProblemThe credentials are missing, expired, or revoked. The WWW-Authenticate header names the Bearer scheme.
403ProblemThe credentials are valid but may not do this: the role, the API key scope, or a required confirmation is missing.
422ProblemThe request was read but a value is not valid, or a required confirmation or Idempotency-Key is missing. The errors list names each field.
429ProblemA rate limit was reached. Wait Retry-After seconds. Limits are per caller, per company, and per address.
4XXProblemProblem Details (RFC 9457)

200 response fields

NameTypeDescription
data requiredarray of object
data[].id requiredstring (uuid)UUIDv7
data[].promo_code_id requiredstring (uuid)UUIDv7
data[].company_id requiredstring (uuid)UUIDv7
data[].code requiredstring
data[].target requiredstringOne of: plan, addon.
data[].target_key requiredstringThe plan lookup key or the add-on key.
data[].stripe_subscription_id requiredstring or null
data[].addon_id requiredstring or null (uuid)
data[].discount_cents requiredintegerTaken off the first charge, in cents.
data[].status requiredstringOne of: reserved, applied, released.
data[].discount_ends_at requiredstring or null (date-time)When a repeating discount ends. Null for once and forever.
data[].description requiredstringThe code's plain description, for the customer's view.
data[].created_at requiredstring (date-time)
data[].applied_at requiredstring or null (date-time)
next_cursorstring or null