Skip to Content
Developers
Buying numbers

Order numbers (costs money)

Needs the numbers-purchase:write scope. About scopes

Try it with a test key

Sends to https://api.traki.io

Test keys only. The key stays in this page while it is open and is never saved.

/v1/account/numbers/orders

Buys the numbers chosen from a search (phoneNumbers), or a quantity (returned numbers the account holds are reused first and the carrier supplies the rest), through the portal’s own purchase flow: the plan’s number limits (402 limit_reached), a card on file (402 card_required) and the balance for setup fees apply as they do in the portal. Each chosen number comes back purchased or failed with its reason. An order for a publisher without purchase bypass waits in pending_approval. Needs an Idempotency-Key: the same request sent again with the same key answers as the first did and buys once.

Authorization

key
headerAuthorizationBearer <traki_account_…>

Request Body

application/json
  1. body
type?string
Default"local"
Value in"local""toll_free"
country?string
Default"US"
Value in"US""CA"
areaCode?string

With quantity: the area code the carrier supplies numbers from.

Match^\d{3}$
quantity?integer
Range1 <= value <= 100
phoneNumbers?array<>

The numbers chosen from GET /numbers/available. Give these or quantity, not both.

Items1 <= items <= 50
campaignId?string

A call campaign of the account the numbers go on.

Formatuuid
publisherId?string

A publisher of the account the numbers are for; it must be approved on the campaign.

Formatuuid
purposeKind?string
Value in"CAMPAIGN_TRACKING""DNI_POOL""QUALIFIER_CALLBACK""LEAD_CALLS""TESTING""PORTED""OTHER"
purpose?string
Lengthlength <= 200

Response Body

Success

application/json
  1. response
id*string
Formatuuid
code*string
state*string
type*string
country*string
areaCode*string|null
requested*integer
Range-9007199254740991 <= value <= 9007199254740991
reused*integer

Numbers the account already held that the order reused.

Range-9007199254740991 <= value <= 9007199254740991
campaignId*|null
publisherId*|null
purposeKind*string|null
purpose*string|null
estimateMonthly*string|null
estimateSetup*string|null
estimateNote*string|null
currency*string
lines*array<>
fulfilledAt*string|null
createdAt*string
Example Request
curl -X POST 'https://api.traki.io/v1/account/numbers/orders' \  -H "Authorization: Bearer $TRAKI_KEY" \  -H 'Content-Type: application/json' \  -H 'Idempotency-Key: a-unique-id-for-this-change' \  -d '{}'
Example Response
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "code": "string",  "state": "string",  "type": "string",  "country": "string",  "areaCode": "string",  "requested": -9007199254740991,  "reused": -9007199254740991,  "campaignId": "13f8bf6d-dc27-4a04-bffe-6e5b13c19ddf",  "publisherId": "f1ba8124-cabe-46cd-b4f9-1189594ff7b3",  "purposeKind": "string",  "purpose": "string",  "estimateMonthly": "string",  "estimateSetup": "string",  "estimateNote": "string",  "currency": "string",  "lines": [    {      "number": "string",      "status": "string",      "failureReason": "string",      "numberId": "4960e75f-5738-4a19-bb92-2459f0660f6c",      "monthlyPrice": "string",      "setupPrice": "string"    }  ],  "fulfilledAt": "string",  "createdAt": "string"}