Create an order

POST
/v1/numbers/orders

Charges your wallet and returns the order with its numbers. Send an Idempotency-Key header so a retry can never buy twice. Check status: an order can be failed (nothing charged) or still provisioning when this returns.

Authorization

apiKey
headerAuthorizationBearer <token>

An API key from the Developers page. rhq_test_ keys reach the sandbox, rhq_live_ keys the live side.

Header Parameters

Idempotency-Key?string

A value unique to this request, such as a UUID. A retry with the same key within 24 hours returns the first outcome instead of running again.

Length8 <= length <= 200

Request Body

application/json
  1. body
country*string

ISO 3166-1 alpha-2 country code, for example US or GB

Match^[A-Z]{2}$
product?string

any_service receives SMS from anyone; single_service is locked to one sender

Default"any_service"
Value in"any_service""single_service"
service?string

Service id from the offers list; required for single_service

Length1 <= length <= 40
duration*string

Length of the rental

Value in"12h""1d""7d""30d""180d""365d"
quantity?integer

How many numbers to buy

Range1 <= value <= 50
Default1
autoRenew?boolean

Extend each number shortly before it ends

Defaultfalse
receiveCalls?boolean

Ask for numbers that also take calls, where inboundVoice is on offer

customerId*string

Required: every purchase belongs to one of your customers

Response Body

Created

application/json
  1. response

Created

id*string
status*string

completed: all numbers delivered. failed: nothing charged. provisioning: the carrier is still assigning some numbers. needs_reconciliation: being verified with the carrier.

Value in"created""purchasing""provisioning""completed""failed""needs_reconciliation"
customerId*|

The customer this was bought for, if any

country*string

ISO 3166-1 alpha-2 country code, for example US or GB

Match^[A-Z]{2}$
product*string

any_service receives SMS from anyone; single_service is locked to one sender

Value in"any_service""single_service"
service*string|null
duration*string

Length of the rental

Value in"12h""1d""7d""30d""180d""365d"
quantity*integer
fulfilledCount*integer

Numbers delivered so far

autoRenew*boolean
unitPrice*integer

Amount in minor units (US cents)

totalPrice*integer

Charged for the numbers delivered, in minor units

currency*"USD"
Value in"USD"
failure*|

Why the order failed, when it did

numbers*array<>
createdAt*string

ISO 8601 timestamp

Formatdate-time
updatedAt*string

ISO 8601 timestamp

Formatdate-time
curl -X POST "https://example.com/v1/numbers/orders" \  -H "Idempotency-Key: 2f1c9a52-7d0e-4a8e-9a53-0c1f6f3f2b11" \  -H "Content-Type: application/json" \  -d '{    "country": "US",    "duration": "30d",    "customerId": "cus_01K6XJ4Q8ZT3M9R5V2B7WDHNCA"  }'
{  "id": "ord_01K6XJ4Q8ZT3M9R5V2B7WDHNCA",  "status": "completed",  "customerId": "cus_01K6XJ4Q8ZT3M9R5V2B7WDHNCA",  "country": "US",  "product": "any_service",  "service": null,  "duration": "30d",  "quantity": 1,  "fulfilledCount": 1,  "autoRenew": true,  "unitPrice": 1200,  "totalPrice": 1200,  "currency": "USD",  "failure": null,  "numbers": [    {      "id": "num_01K6XJ4Q8ZT3M9R5V2B7WDHNCA",      "number": "15550100002",      "country": "US",      "product": "any_service",      "service": null,      "status": "active",      "customerId": "cus_01K6XJ4Q8ZT3M9R5V2B7WDHNCA",      "orderId": "ord_01K6XJ4Q8ZT3M9R5V2B7WDHNCA",      "nickname": "Support line",      "startsAt": "2026-10-07T11:04:31.000Z",      "endsAt": "2026-11-06T11:04:31.000Z",      "autoRenew": true,      "renewDuration": "30d",      "unitPrice": 1200,      "customerPrice": null,      "paidTotal": 1200,      "messageCount": 3,      "createdAt": "2026-10-07T11:04:31.000Z"    }  ],  "createdAt": "2026-10-07T11:04:31.000Z",  "updatedAt": "2026-10-07T11:04:31.000Z"}