BetaThe V4 API is in beta — endpoints and functionality may change.
Channelsv4

Purchase Blooio numbers

POST/channels/blooio/purchases

Purchase one or more Blooio lines. Purchases are asynchronous and billable: the call charges the organization's default payment method and returns a purchase_id; the lines are provisioned when Stripe confirms the invoice, at which point a number.purchase.completed webhook fires (or number.purchase.failed). A card requiring 3DS/SCA returns status: action_required with an action_url, and also emits number.purchase.action_required. Idempotency is required — send a unique Idempotency-Key header; replaying the same key returns the same purchase rather than charging twice. Rules enforced server-side (identically to the dashboard): the organization must have a saved payment method (else 402 no_payment_method); shared plans are limited to one line per organization (409 shared_number_limit); and a single order may not exceed the per-order line cap (400 line_limit_exceeded, default 10 — apply for an increase in the dashboard Limits tab). Requested area codes that are out of stock incur a custom area-code fee and open a provisioning ticket; in-stock codes are assigned immediately with no custom fee. Requires the number purchase API feature to be enabled, and the numbers:manage scope for OAuth apps.

Headers

AuthorizationRequiredstring

Your API key, sent as a bearer token: Authorization: Bearer <api_key>. Editing this stays in sync with the API key box on the right.

Bearer
Idempotency-KeyRequiredstring

Unique key that makes the billable purchase safe to retry.

Body parameters

JSON
planRequiredstring

Plan id to purchase (determines shared / dedicated / inbound).

quantityoptionalinteger

Number of new lines (dedicated/inbound). Shared is always 1.

area_codesoptionalstring[]

Preferred 3-digit US area codes (dedicated/inbound). Out-of-stock codes incur a custom fee and open a ticket.

zip_codesoptionalstring[]

Preferred ZIP codes (dedicated/inbound), used when an area code is not specified.

Returns

dataoptionalobject
purchase_idoptionalstring
statusoptionalstring
"provisioning""action_required"
action_urloptionalstring | null

Present when status is action_required: complete card authentication here.

Response codes

202Purchase accepted; provisioning proceeds asynchronously.
400The request was malformed — check the path, query parameters, and body.
401Your API key is missing or invalid. Pass it as a bearer token.
402Payment required or failed. `code` is `no_payment_method` (no saved card) or `payment_failed` (the card was declined).
403Your API key isn't allowed to access this channel (blocked key or plan limit).
409Conflicts with a purchase rule, e.g. `shared_number_limit`.

Sends a live request with your values and shows the real response below. Your key is stored only in this browser.

Request
curl -X POST https://api.blooio.com/v4/channels/blooio/purchases \
Body object
Response objectexample
{  "data": {    "purchase_id": "idem_abc123",    "status": "provisioning"  }}