Quickstart - International Number Search and Order
Step 1: Query requirement
Before searching or ordering phone numbers, you might want to understand the requirements of successfully ordering a number type in a particular market. In this example, to successfully order local numbers in Germany, the user needs to provide all the enumerated information for admin review.Request Sample
Don’t forget to update
YOUR_API_KEY here.Step 2: Search for desired numbers
Using the existing number searching V2 API or portal UI, you can search for the desired numbers. In this example, the user searches for 2 numbers in Nice, France and 2 numbers in Berlin. Request 1You can also search for numbers in the Telnyx Portal. Simply click on “Numbers,” then “Search & Buy Numbers.” Select “Local Numbers” then choose the Region. Click “Search Numbers.”
Step 3: Order desired numbers
Using the existing number ordering V2 API, you can put in the order for the four numbers returned in the previous step.- CH (Switzerland)
- DK (Denmark)
- IT (Italy)
- NO (Norway)
- PT (Portugal)
- SE (Sweden)
Step 4: Find the sub orders
Because the order created previously contains numbers from two countries. They might have different requirements. Hence, they are grouped into logical sub orders for easier management subsequently. There are two ways to get the sub orders of a number order. Method 1: Include thefilter[include_sub_orders]=true in the number order request.
Step 5: Get the human readable requirement
Requirement Types
There are four possiblefield_type (from GET v2/sub_number_orders) or requirement_type (from GET v2/requirement_types/{{id}}) values:
textualaddressdocumentaction
Textual type
To fulfill atextual requirement, any string can be provided. Assuming it complies with the requirement’s acceptance_criteria.
Address type
To fulfill anaddress requirement, an address id must be provided as the field value.
Create an address using the POST v2/addresses endpoint (API reference here). Upon successful creation, the address will have a unique id associated with it (for example 1293384261075731499). Pass that id as the field_value for the address ordering requirement.
You cannot write out the address as a string (i.e. “312 W Superior St, Chicago, IL, 60654”) to fulfill the requirement. You must create the address, and pass the address id as the field_value.
Document type
To fulfill adocument requirement, a document id must be provided as the field value.
Upload the document using the Documents API. Upon successful upload, an id will be returned in the response that corresponds to the document (for example 6a09cdc3-8948-47f0-aa62-74ac943d6c58). Pass that id as the field_value for the document ordering requirement.
There are a few ways that you can upload a document. You can upload a document by providing the URL to a publicly hosted document:
You can check your documents in the Telnyx Portal by following these steps: Click on the dropdown arrow next to your profile icon in the upper right corner. Select “Documents.” Click “Preview” on the document you want to view.
Action type
Anaction requirement is unique, and very rare. Please see our separate developer guide to learn more about how to handle action requirement types.