partner
POST /v1/partner/pro-discount-codes
One of your hosting customers' personal code for a Pro plugin.
Authentication
Send an API key as a bearer token. The key must carry the partner.domains permission; a key without it is refused with 403, not 404.
This endpoint takes no organisation id. Your key already identifies the organisation it belongs to, and the response is scoped to it.
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/partner/pro-discount-codes \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "external_id": <string>, "email": <string>, "product": <string>, "hosting_in_good_standing": <boolean> }'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 the customer's personal, single-use code for product and a checkout link with it applied — created on the first call (201), the same code on later calls while it is valid and unused (200). Codes last 30 days; after an unused expiry a new one is issued; after a redemption none ever is (409). The discount is on the first payment only. ⛔ hosting_in_good_standing is YOUR assertion, made on every call, that this customer holds a paid hosting plan in good standing with you right now. V2 cannot see your billing, so it relies on it; false is refused (403) and an omitted field is a 422, never a yes. Requires partner.domains. Rate-limited.
Request body
| Name | Type | Required | What it is |
|---|---|---|---|
external_id | string | Yes | — |
email | string | Yes | — |
product | string | Yes | — |
hosting_in_good_standing | boolean | Yes | Your assertion, on every call, that this customer holds a paid hosting plan in good standing with you now. false is refused. |
Response
| Name | Type | Required | What it is |
|---|---|---|---|
external_id | string | Yes | — |
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