Index » Acquire Phone Number
Acquire Phone Number
Description
Usage
Authorization
Payload JSON Fields
Example
Description
Use this method to acquire the Phone Numbers, when user added them to cart and purchased it.
Please remember to check number availability before adding to cart to avoid issues with unavailable numbers.
You can acquire multiple phone numbers in your order at once. The endpoint accepts multiple phone numbers, but for single customer and single order information.
Usage
POST https://api.phonenumberexpert.net/numbers/acquire
JSON Payload: {numbers: [...], customer: {...}, order: {...}} (see details below)
Authorization
Basic Authentication: username (Account Name) and password (API Key) can be obtained from PNE owner, please contact him at https://www.phonenumberexpert.com/contacts/
Payload JSON Fields
numbers - Array of acquiring numbers in the following format: [{d10, pattern, price}, {d10, pattern, price}, ...], where:
d10 - ten-digital number (just 10 digits in a row, without spaces or any other characters between them)
pattern - optional field, e.g. if pattern: 'MAX', then number 2018888629 will be represented as "(201) 8888-MAX". Otherwise - if pattern is omitted, - same number is represented as "(201) 888-8629",
price - number, amount in US dollars (just a number, not a string, so no "$" sign here)
customer - Object with customer information like this: { name, email, phone, address: { street, city, zip } }. Here, name and email are required, all the rest can be any field (you can put your own fields here as well).
order - optional object field, can be provided to save any order-related information, e.g. { orderId, comment }.
Example
POST https://api.phonenumberexpert.net/numbers/acquire
{
"numbers": [
{
"d10": "2016422222",
"price": 599.99
},
{
"d10": "2018888629",
"pattern": "MAX",
"price": 319.99
}
],
"customer": {
"name" : "John Doe",
"email" : "john.doe@gmail.com",
"phone" : "(888) 345-6789",
"company" : "Example Company",
"address" : {
"street" : [
"25 Freedom Av.",
"Apt. 83"
],
"city" : "NYC",
"state" : "New York",
"country" : "US",
"zip" : "11111"
}
},
"order": {
"orderId": 12345,
"promoCode": "DISCOUNT30",
"comment": "Hello, world!"
}
}