compute
POST /v1/compute/servers/{serverId}/traffic-packs
Order a prepaid traffic pack for a server.
Authentication
Send an API key as a bearer token. The key must carry the billing.payment.manage 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/compute/servers/{serverId}/traffic-packs \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "tb": <integer> }'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
⛔ Chargeable, once paid. Writes a pending pack and a taxed order for tb whole TB (unit price x TB, in the machine's billing currency). Nothing is charged here: pay the returned order with payOrder (wallet first, then any payment method). Paying activates the pack, which raises this month's cap at once and restarts a machine the cap stopped. Unused traffic expires when the allowance resets next month. A repeated idempotency_key (body or Idempotency-Key header) returns the same order. Refused (422) when the location sells no packs or the account is not in good standing. Requires billing.payment.manage.
Parameters
| Name | Type | Required | What it is |
|---|---|---|---|
serverId (path) | Uuid | Yes | 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. |
Idempotency-Key (header) | string | No | Client-generated key that makes an unsafe request replay-safe: the server stores the first response and returns it verbatim for repeats. |
Request body
| Name | Type | Required | What it is |
|---|---|---|---|
tb | integer | Yes | Whole TB to buy; no upper limit. |
idempotency_key | string | No | — |
Response
| Name | Type | Required | What it is |
|---|---|---|---|
pack | ComputeTrafficPack | Yes | — |
order_id | Uuid | Yes | UUIDv7 identifier — sortable by creation time. |
subtotal_minor | integer | Yes | — |
tax_minor | integer | Yes | — |
total_minor | integer | Yes | — |
currency | string | Yes | — |
expiry_note | string | Yes | — |
Errors this endpoint can return
401 · 403 · 404 · 422 · 429 · 503