compute
POST /v1/compute/servers/{serverId}/plan
Buy one paid option for this machine.
احراز هویت
یک کلید API را به عنوان یک توکن برbearer ارسال کنید. این نقطه پایانی مجوز خاصی را در مشخصات خود ذکر نمیکند، بنابراین به جای فرض کردن، حداقل نیازهای کلید خود را بدهید و پاسخ را بررسی کنید.
این نقطه پایانی هیچ شناسه سازمانی را دریافت نمیکند. کلید شما در حال حاضر سازمان مربوطه را مشخص میکند و پاسخ در همان محدوده ارائه میشود.
امتحان کنید
هر چیزی را که داخل براکتهای زاویهدار قرار دارد با مقادیر خودتان جایگزین کنید، و نگهدارنده کلید را با کلیدی از داشبورد خود جایگزین نمایید.
curl -X POST https://api.zinndigital.com/v1/compute/servers/{serverId}/plan \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "offer_id": <Uuid> }'وارد شدهاید؟ کنسول API در داشبورد شما شناسه سازمان واقعی و کلید خودتان را پر میکند و درخواست را روی API زنده اجرا میکند تا بتوانید پاسخ واقعی را ببینید. این نقطه پایانی را در کنسول API باز کنید
جزئیات
⛔⛔ **Chargeable twice over, and both are immediate.** It debits Zinn®'s reseller balance at the provider *and* starts a recurring charge on the customer, so it sits behind `billing.payment.manage` rather than `sites.create`. The provider offers no idempotency header on this operation, so the request is keyed by (machine, option) on our side and a repeat returns the original purchase rather than buying a second one. `422` when the machine cannot carry the option — cPanel below 2 GB, a second cPanel licence, backups already on.
پارامترها
| نام | نوع | الزامی | چیست |
|---|---|---|---|
serverId (path) | Uuid | بله | The server's id, as `listComputeServers` reports it. **Ours** (UUIDv7), minted when the order row was written — never the provider's own identifier for the machine. |
بدنه درخواست
| نام | نوع | الزامی | چیست |
|---|---|---|---|
offer_id | Uuid | بله | The offer to buy, from `getComputeServerPlan`'s `available` or `getVpsAddonOptions`. ⛔ There is deliberately no price field: a price sent by a client is not read, and the charge… |
پاسخ
| نام | نوع | الزامی | چیست |
|---|---|---|---|
data | ComputeAddonPurchase | بله | One paid option a tenant actually bought against one machine. ⛔ `status` is `cancelling`, not `ended`, after a removal. The thing is still running and still ours to pay for unti… |
خطاهایی که این نقطه پایانی میتواند برگرداند
401 · 403 · 404 · 422 · 429 · 503