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
| Name | In | Type | Description |
|---|---|---|---|
Idempotency-Key required | header | string | Send 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
| Name | Type | Description |
|---|---|---|
code required | string | |
target required | one of object, object |
Responses
| Status | Body | Description |
|---|---|---|
200 | PromoValidation | The result |
400 | Problem | The request could not be read: bad JSON, a bad header, or a malformed value. |
401 | Problem | The credentials are missing, expired, or revoked. The WWW-Authenticate header names the Bearer scheme. |
403 | Problem | The credentials are valid but may not do this: the role, the API key scope, or a required confirmation is missing. |
409 | Problem | The current state does not allow this: the same change is already running, or another change got there first. |
422 | Problem | The request was read but a value is not valid, or a required confirmation or Idempotency-Key is missing. The errors list names each field. |
429 | Problem | A rate limit was reached. Wait Retry-After seconds. Limits are per caller, per company, and per address. |
4XX | Problem | Problem 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
| Name | In | Type | Description |
|---|---|---|---|
limit | query | integer | How many rows to return in one page: at most 200, and 200 when left out. Default: 200. Range: 1 to 200. |
cursor | query | string | The next_cursor of the page before. Leave it out for the first page. |
Responses
| Status | Body | Description |
|---|---|---|
200 | PromoRedemptionList | Redemptions |
400 | Problem | The request could not be read: bad JSON, a bad header, or a malformed value. |
401 | Problem | The credentials are missing, expired, or revoked. The WWW-Authenticate header names the Bearer scheme. |
403 | Problem | The credentials are valid but may not do this: the role, the API key scope, or a required confirmation is missing. |
422 | Problem | The request was read but a value is not valid, or a required confirmation or Idempotency-Key is missing. The errors list names each field. |
429 | Problem | A rate limit was reached. Wait Retry-After seconds. Limits are per caller, per company, and per address. |
4XX | Problem | Problem Details (RFC 9457) |
200 response fields
| Name | Type | Description |
|---|---|---|
data required | array of object | |
data[].id required | string (uuid) | UUIDv7 |
data[].promo_code_id required | string (uuid) | UUIDv7 |
data[].company_id required | string (uuid) | UUIDv7 |
data[].code required | string | |
data[].target required | string | One of: plan, addon. |
data[].target_key required | string | The plan lookup key or the add-on key. |
data[].stripe_subscription_id required | string or null | |
data[].addon_id required | string or null (uuid) | |
data[].discount_cents required | integer | Taken off the first charge, in cents. |
data[].status required | string | One of: reserved, applied, released. |
data[].discount_ends_at required | string or null (date-time) | When a repeating discount ends. Null for once and forever. |
data[].description required | string | The code's plain description, for the customer's view. |
data[].created_at required | string (date-time) | |
data[].applied_at required | string or null (date-time) | |
next_cursor | string or null |