Purchase Blooio numbers
/channels/blooio/purchasesPurchase 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
AuthorizationRequiredstringYour API key, sent as a bearer token: Authorization: Bearer <api_key>. Editing this stays in sync with the API key box on the right.
Idempotency-KeyRequiredstringUnique key that makes the billable purchase safe to retry.
Body parameters
JSONplanRequiredstringPlan id to purchase (determines shared / dedicated / inbound).
quantityoptionalintegerNumber 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
dataoptionalobjectpurchase_idoptionalstringstatusoptionalstring"provisioning""action_required"action_urloptionalstring | nullPresent when status is action_required: complete card authentication here.
Response codes
Sends a live request with your values and shows the real response below. Your key is stored only in this browser.
curl -X POST https://api.blooio.com/v4/channels/blooio/purchases \{ "data": { "purchase_id": "idem_abc123", "status": "provisioning" }}