Box’a’Fox
API referenceCheckout

Buy GB from credit

POST
/v1/checkout

Pays for the cart from the account's credit and returns 201 with the order; the data is added to the balance once the order is provisioned. Requires an Idempotency-Key header. Errors: 402 insufficient_credit; 422 with the reason the cart cannot be bought; 409 idempotency_conflict or idempotency_in_flight.

Authorization

ApiKey
headerX-API-Key<token>

prx_live_<40 base62>

Header Parameters

Idempotency-Key*string

A unique value per purchase. Repeating a request with the same key within 24 hours returns the first response.

Length1 <= length <= 255

Request Body

application/json
  1. body
items*array<>|

One item per network max.

Items1 <= items <= 2
promo_code?string

Response Body

Created

application/json
  1. response
data*
message*string

Human-readable status, safe to show to end users.

curl -X POST "https://example.com/v1/checkout" \  -H "Idempotency-Key: string" \  -H "Content-Type: application/json" \  -d '{    "items": [      {        "gb": 1,        "product_code": "residential_gb"      }    ]  }'
{  "data": {    "activated_at": "2019-08-24T14:15:22Z",    "created_at": "2019-08-24T14:15:22Z",    "credit_after_cents": 0,    "credit_before_cents": 0,    "discount_cents": 0,    "failure_reason": "string",    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "items": [      {        "bytes": 0,        "gb": 0,        "price_per_gb_cents": 0,        "product_code": "residential_gb",        "total_cents": 0      }    ],    "number": "ORD-2026-000123",    "promo_code": "string",    "status": "paid",    "subtotal_cents": 0,    "total_cents": 0,    "valid_until": "2019-08-24T14:15:22Z"  },  "message": "OK"}