billing
POST /v1/pro-discounts/{product}/code
Your personal code for one Pro plugin — created on first ask, the same one after.
Authentication
Send an API key as a bearer token. The key must carry the billing.view permission; a key without it is refused with 403, not 404.
Where your organisation id goes
This endpoint takes org_id as a field in the JSON body.
Your organisation id is on the API keys screen in your dashboard, beside the key itself. It is the same id in every call you make.
Try it
Replace anything in angle brackets with your own values, and the key placeholder with a key from your dashboard.
curl -X POST https://api.zinndigital.com/v1/pro-discounts/{product}/code \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ }'Signed in? The API console in your dashboard fills in your real organisation id and your own key, and runs the request against the live API so you can see the actual response. Open this endpoint in the API console
Details
Returns your personal, single-use code for product and a checkout link with it already applied. The first call creates it (201); asking again while it is valid and unused returns the same code (200). A code lasts 30 days; after an unused expiry a new one is issued. Once a code has been used, no other is ever issued for that plugin — the discount is on the first payment only, and renewals are at the normal price. Requires billing.view. 403 when the account does not qualify, 404 when the plugin has no discount, 409 when it has already been used, 503 when the store could not be reached (nothing is created). Rate-limited.
Parameters
| Name | Type | Required | What it is |
|---|---|---|---|
product (path) | string | Yes | The Pro product's key, from listProDiscounts (offers[].product). |
Request body
| Name | Type | Required | What it is |
|---|---|---|---|
org_id | string | No | The account to act for. Required when you belong to more than one. |
Response
| Name | Type | Required | What it is |
|---|---|---|---|
product | string | Yes | — |
created | boolean | Yes | — |
code | ProDiscountCode | Yes | One personal, single-use code. The code itself is a credential worth one purchase. |
Errors this endpoint can return
401 · 403 · 404 · 409 · 422 · 429 · 503