public
POST /v1/wp/pro-discount/{siteId}
The hosting-customer Pro discount, asked for from a hosted site's wp-admin.
Аутентификација
Пошаљите API кључ као bearer токен. Ова крајња тачка не наводи конкретну дозволу у спецификацији, па свом кључу доделите најмања неопходна овлашћења и проверите одговор уместо да претпостављате.
Ова крајња тачка не прихвата id организације. Ваш кључ већ идентификује организацију којој припада, а одговор је ограничен на њу.
Испробајте
Замените све што је у угластим заградама сопственим вредностима, а чувар места кључа кључем са своје контролне табле.
curl -X POST https://api.zinndigital.com/v1/wp/pro-discount/{siteId} \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "plugin": <string> }'Пријављени сте? API конзола на вашој контролној табли попуњава ваш прави id организације и ваш сопствени кључ, и покреће захтев према живом API-ју како бисте могли да видите стварни одговор. Отворите ову крајњу тачку у API конзоли
Детаљи
Called by a Zinn® free plugin's upgrade card on a WordPress site we host, not by a person. action: status says whether the site's owner qualifies and returns a live code if one exists, without creating anything; action: issue returns the owner's code, creating it if needed. It is the SAME code the owner sees in the dashboard — one per customer per Pro plugin, whichever door they use. Authenticated by the site's own secret, exactly as getSitePanel: X-Zinn-Cache-Signature: sha256=HMAC(timestamp + "\n" + body) keyed with the site's ZINN_UPDATE_SECRET, and the response is signed back in X-Zinn-Signature over the request's timestamp and the response body. Anything unauthenticated, stale, unknown or deleted is a 404.
Параметри
| Назив | Тип | Обавезно | Шта је ово |
|---|---|---|---|
siteId (path) | Uuid | Да | Site ID (UUIDv7). |
Тело захтева
| Назив | Тип | Обавезно | Шта је ово |
|---|---|---|---|
plugin | string | Да | The free plugin whose upgrade card is asking. |
action | string<status, issue> | Не | — |
locale | string | Не | — |
Одговор
| Назив | Тип | Обавезно | Шта је ово |
|---|---|---|---|
terms | ProDiscountTerms | Да | The hosting-customer discount's terms, read from the plugin registry. |
offer | object | Да | — |
state | string<not_offered, not_eligible, available, active, redeemed, unavailable> | Да | unavailable means the store could not be reached just now — try again; it is never the customer's fault and never names a vendor. |
code | ProDiscountCode | Не | — |
Грешке које ова крајња тачка може вратити
404 · 429