Order numbers (costs money)
Needs the numbers-purchase:write scope. About scopes
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.
keyAuthorizationBearer <traki_account_…>application/json- body
type?string"local""local""toll_free"country?string"US""US""CA"areaCode?stringWith quantity: the area code the carrier supplies numbers from.
^\d{3}$quantity?integer1 <= value <= 100phoneNumbers?array<>The numbers chosen from GET /numbers/available. Give these or quantity, not both.
1 <= items <= 50campaignId?stringA call campaign of the account the numbers go on.
uuidpublisherId?stringA publisher of the account the numbers are for; it must be approved on the campaign.
uuidpurposeKind?string"CAMPAIGN_TRACKING""DNI_POOL""QUALIFIER_CALLBACK""LEAD_CALLS""TESTING""PORTED""OTHER"purpose?stringlength <= 200Success
application/json- response
id*stringuuidcode*stringstate*stringtype*stringcountry*stringareaCode*string|nullrequested*integer-9007199254740991 <= value <= 9007199254740991reused*integerNumbers the account already held that the order reused.
-9007199254740991 <= value <= 9007199254740991campaignId*|nullpublisherId*|nullpurposeKind*string|nullpurpose*string|nullestimateMonthly*string|nullestimateSetup*string|nullestimateNote*string|nullcurrency*stringlines*array<>fulfilledAt*string|nullcreatedAt*stringcurl -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 '{}'{ "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"}Search numbers for sale GET
Searches the carrier’s numbers by country, type and area code or prefix, as the portal’s Buy numbers search does. Nothing is reserved: order the ones you want with POST /numbers/orders.
Give a number back to the carrier POST
Releases a number the account owns at the carrier, for good: it stops ringing and leaves the account’s bill. The portal asks for the release and confirms it in two steps; this route does both. The number must be on no campaign and in no pool (422 number_assigned, pooled_number), and no visitor session may hold it (422 number_leased). `state` is `confirmed`, or `failed` with the carrier’s reason in `checksNote` (the number then stays in the account as returned). To take a number off its campaign without giving it up, use POST /numbers/{id}/release. Needs an Idempotency-Key.