Purchase a number with requirements
curl --request POST \
--url https://dev-api.amplify.xyz/v1/numbers/purchase_with_requirements \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"number": "+41912470050",
"type": "fax",
"country_code": "CH",
"tier": 1,
"requirements": [
{
"requirement_id": "0b42b42a-d827-4b53-a2bb-8eeef919f798",
"type": "textual",
"data": "478458786548",
"other_data": ""
},
{
"requirement_id": "2708e569-696a-4fc7-9305-5fdb3eb9c7dd",
"type": "textual",
"data": "John doe",
"other_data": ""
},
{
"requirement_id": "9ef887b6-7a28-47c3-964e-380680776561",
"type": "document",
"data": "98853a6a-a3e2-4b59-b676-6bb081faf5e3.pdf",
"other_data": ""
},
{
"requirement_id": "a7d9a3a3-70ed-4cb4-821b-b94e8ea6dc9b",
"type": "address",
"data": "3034108885616035274",
"other_data": "Wilerstrasse 3918, Amlikon-Bissegg, Switzerland"
},
{
"requirement_id": "b0197fa1-c2fd-4500-9875-2c658b2396eb",
"type": "document",
"data": "811a8f00-41c3-4e2d-8050-58c4c57b2663.pdf",
"other_data": ""
},
{
"requirement_id": "bf1cb27c-3693-41af-bbf6-ff4de8d41006",
"type": "textual",
"data": "john@doe.com",
"other_data": ""
},
{
"requirement_id": "d3641c72-734e-4421-8bca-510b4137c0c5",
"type": "textual",
"data": "John fintech",
"other_data": ""
},
{
"requirement_id": "ec029bc6-357f-404d-bdfd-f61d4e578896",
"type": "document",
"data": "094ab602-4ea3-4497-836c-809a5d2ded86.pdf",
"other_data": ""
},
{
"requirement_id": "80b88912-a16a-401d-afe4-28a47d31bf89",
"type": "textual",
"data": "6985478521",
"other_data": ""
},
{
"requirement_id": "d28957ae-1170-4b17-919f-e78b5b6dcdba",
"type": "document",
"data": "67eb742d-e7ea-4e51-a144-f455037f2e92.pdf",
"other_data": ""
}
]
}
'import requests
url = "https://dev-api.amplify.xyz/v1/numbers/purchase_with_requirements"
payload = {
"number": "+41912470050",
"type": "fax",
"country_code": "CH",
"tier": 1,
"requirements": [
{
"requirement_id": "0b42b42a-d827-4b53-a2bb-8eeef919f798",
"type": "textual",
"data": "478458786548",
"other_data": ""
},
{
"requirement_id": "2708e569-696a-4fc7-9305-5fdb3eb9c7dd",
"type": "textual",
"data": "John doe",
"other_data": ""
},
{
"requirement_id": "9ef887b6-7a28-47c3-964e-380680776561",
"type": "document",
"data": "98853a6a-a3e2-4b59-b676-6bb081faf5e3.pdf",
"other_data": ""
},
{
"requirement_id": "a7d9a3a3-70ed-4cb4-821b-b94e8ea6dc9b",
"type": "address",
"data": "3034108885616035274",
"other_data": "Wilerstrasse 3918, Amlikon-Bissegg, Switzerland"
},
{
"requirement_id": "b0197fa1-c2fd-4500-9875-2c658b2396eb",
"type": "document",
"data": "811a8f00-41c3-4e2d-8050-58c4c57b2663.pdf",
"other_data": ""
},
{
"requirement_id": "bf1cb27c-3693-41af-bbf6-ff4de8d41006",
"type": "textual",
"data": "john@doe.com",
"other_data": ""
},
{
"requirement_id": "d3641c72-734e-4421-8bca-510b4137c0c5",
"type": "textual",
"data": "John fintech",
"other_data": ""
},
{
"requirement_id": "ec029bc6-357f-404d-bdfd-f61d4e578896",
"type": "document",
"data": "094ab602-4ea3-4497-836c-809a5d2ded86.pdf",
"other_data": ""
},
{
"requirement_id": "80b88912-a16a-401d-afe4-28a47d31bf89",
"type": "textual",
"data": "6985478521",
"other_data": ""
},
{
"requirement_id": "d28957ae-1170-4b17-919f-e78b5b6dcdba",
"type": "document",
"data": "67eb742d-e7ea-4e51-a144-f455037f2e92.pdf",
"other_data": ""
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
number: '+41912470050',
type: 'fax',
country_code: 'CH',
tier: 1,
requirements: [
{
requirement_id: '0b42b42a-d827-4b53-a2bb-8eeef919f798',
type: 'textual',
data: '478458786548',
other_data: ''
},
{
requirement_id: '2708e569-696a-4fc7-9305-5fdb3eb9c7dd',
type: 'textual',
data: 'John doe',
other_data: ''
},
{
requirement_id: '9ef887b6-7a28-47c3-964e-380680776561',
type: 'document',
data: '98853a6a-a3e2-4b59-b676-6bb081faf5e3.pdf',
other_data: ''
},
{
requirement_id: 'a7d9a3a3-70ed-4cb4-821b-b94e8ea6dc9b',
type: 'address',
data: '3034108885616035274',
other_data: 'Wilerstrasse 3918, Amlikon-Bissegg, Switzerland'
},
{
requirement_id: 'b0197fa1-c2fd-4500-9875-2c658b2396eb',
type: 'document',
data: '811a8f00-41c3-4e2d-8050-58c4c57b2663.pdf',
other_data: ''
},
{
requirement_id: 'bf1cb27c-3693-41af-bbf6-ff4de8d41006',
type: 'textual',
data: 'john@doe.com',
other_data: ''
},
{
requirement_id: 'd3641c72-734e-4421-8bca-510b4137c0c5',
type: 'textual',
data: 'John fintech',
other_data: ''
},
{
requirement_id: 'ec029bc6-357f-404d-bdfd-f61d4e578896',
type: 'document',
data: '094ab602-4ea3-4497-836c-809a5d2ded86.pdf',
other_data: ''
},
{
requirement_id: '80b88912-a16a-401d-afe4-28a47d31bf89',
type: 'textual',
data: '6985478521',
other_data: ''
},
{
requirement_id: 'd28957ae-1170-4b17-919f-e78b5b6dcdba',
type: 'document',
data: '67eb742d-e7ea-4e51-a144-f455037f2e92.pdf',
other_data: ''
}
]
})
};
fetch('https://dev-api.amplify.xyz/v1/numbers/purchase_with_requirements', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://dev-api.amplify.xyz/v1/numbers/purchase_with_requirements",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'number' => '+41912470050',
'type' => 'fax',
'country_code' => 'CH',
'tier' => 1,
'requirements' => [
[
'requirement_id' => '0b42b42a-d827-4b53-a2bb-8eeef919f798',
'type' => 'textual',
'data' => '478458786548',
'other_data' => ''
],
[
'requirement_id' => '2708e569-696a-4fc7-9305-5fdb3eb9c7dd',
'type' => 'textual',
'data' => 'John doe',
'other_data' => ''
],
[
'requirement_id' => '9ef887b6-7a28-47c3-964e-380680776561',
'type' => 'document',
'data' => '98853a6a-a3e2-4b59-b676-6bb081faf5e3.pdf',
'other_data' => ''
],
[
'requirement_id' => 'a7d9a3a3-70ed-4cb4-821b-b94e8ea6dc9b',
'type' => 'address',
'data' => '3034108885616035274',
'other_data' => 'Wilerstrasse 3918, Amlikon-Bissegg, Switzerland'
],
[
'requirement_id' => 'b0197fa1-c2fd-4500-9875-2c658b2396eb',
'type' => 'document',
'data' => '811a8f00-41c3-4e2d-8050-58c4c57b2663.pdf',
'other_data' => ''
],
[
'requirement_id' => 'bf1cb27c-3693-41af-bbf6-ff4de8d41006',
'type' => 'textual',
'data' => 'john@doe.com',
'other_data' => ''
],
[
'requirement_id' => 'd3641c72-734e-4421-8bca-510b4137c0c5',
'type' => 'textual',
'data' => 'John fintech',
'other_data' => ''
],
[
'requirement_id' => 'ec029bc6-357f-404d-bdfd-f61d4e578896',
'type' => 'document',
'data' => '094ab602-4ea3-4497-836c-809a5d2ded86.pdf',
'other_data' => ''
],
[
'requirement_id' => '80b88912-a16a-401d-afe4-28a47d31bf89',
'type' => 'textual',
'data' => '6985478521',
'other_data' => ''
],
[
'requirement_id' => 'd28957ae-1170-4b17-919f-e78b5b6dcdba',
'type' => 'document',
'data' => '67eb742d-e7ea-4e51-a144-f455037f2e92.pdf',
'other_data' => ''
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://dev-api.amplify.xyz/v1/numbers/purchase_with_requirements"
payload := strings.NewReader("{\n \"number\": \"+41912470050\",\n \"type\": \"fax\",\n \"country_code\": \"CH\",\n \"tier\": 1,\n \"requirements\": [\n {\n \"requirement_id\": \"0b42b42a-d827-4b53-a2bb-8eeef919f798\",\n \"type\": \"textual\",\n \"data\": \"478458786548\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"2708e569-696a-4fc7-9305-5fdb3eb9c7dd\",\n \"type\": \"textual\",\n \"data\": \"John doe\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"9ef887b6-7a28-47c3-964e-380680776561\",\n \"type\": \"document\",\n \"data\": \"98853a6a-a3e2-4b59-b676-6bb081faf5e3.pdf\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"a7d9a3a3-70ed-4cb4-821b-b94e8ea6dc9b\",\n \"type\": \"address\",\n \"data\": \"3034108885616035274\",\n \"other_data\": \"Wilerstrasse 3918, Amlikon-Bissegg, Switzerland\"\n },\n {\n \"requirement_id\": \"b0197fa1-c2fd-4500-9875-2c658b2396eb\",\n \"type\": \"document\",\n \"data\": \"811a8f00-41c3-4e2d-8050-58c4c57b2663.pdf\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"bf1cb27c-3693-41af-bbf6-ff4de8d41006\",\n \"type\": \"textual\",\n \"data\": \"john@doe.com\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"d3641c72-734e-4421-8bca-510b4137c0c5\",\n \"type\": \"textual\",\n \"data\": \"John fintech\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"ec029bc6-357f-404d-bdfd-f61d4e578896\",\n \"type\": \"document\",\n \"data\": \"094ab602-4ea3-4497-836c-809a5d2ded86.pdf\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"80b88912-a16a-401d-afe4-28a47d31bf89\",\n \"type\": \"textual\",\n \"data\": \"6985478521\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"d28957ae-1170-4b17-919f-e78b5b6dcdba\",\n \"type\": \"document\",\n \"data\": \"67eb742d-e7ea-4e51-a144-f455037f2e92.pdf\",\n \"other_data\": \"\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://dev-api.amplify.xyz/v1/numbers/purchase_with_requirements")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"number\": \"+41912470050\",\n \"type\": \"fax\",\n \"country_code\": \"CH\",\n \"tier\": 1,\n \"requirements\": [\n {\n \"requirement_id\": \"0b42b42a-d827-4b53-a2bb-8eeef919f798\",\n \"type\": \"textual\",\n \"data\": \"478458786548\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"2708e569-696a-4fc7-9305-5fdb3eb9c7dd\",\n \"type\": \"textual\",\n \"data\": \"John doe\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"9ef887b6-7a28-47c3-964e-380680776561\",\n \"type\": \"document\",\n \"data\": \"98853a6a-a3e2-4b59-b676-6bb081faf5e3.pdf\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"a7d9a3a3-70ed-4cb4-821b-b94e8ea6dc9b\",\n \"type\": \"address\",\n \"data\": \"3034108885616035274\",\n \"other_data\": \"Wilerstrasse 3918, Amlikon-Bissegg, Switzerland\"\n },\n {\n \"requirement_id\": \"b0197fa1-c2fd-4500-9875-2c658b2396eb\",\n \"type\": \"document\",\n \"data\": \"811a8f00-41c3-4e2d-8050-58c4c57b2663.pdf\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"bf1cb27c-3693-41af-bbf6-ff4de8d41006\",\n \"type\": \"textual\",\n \"data\": \"john@doe.com\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"d3641c72-734e-4421-8bca-510b4137c0c5\",\n \"type\": \"textual\",\n \"data\": \"John fintech\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"ec029bc6-357f-404d-bdfd-f61d4e578896\",\n \"type\": \"document\",\n \"data\": \"094ab602-4ea3-4497-836c-809a5d2ded86.pdf\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"80b88912-a16a-401d-afe4-28a47d31bf89\",\n \"type\": \"textual\",\n \"data\": \"6985478521\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"d28957ae-1170-4b17-919f-e78b5b6dcdba\",\n \"type\": \"document\",\n \"data\": \"67eb742d-e7ea-4e51-a144-f455037f2e92.pdf\",\n \"other_data\": \"\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev-api.amplify.xyz/v1/numbers/purchase_with_requirements")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"number\": \"+41912470050\",\n \"type\": \"fax\",\n \"country_code\": \"CH\",\n \"tier\": 1,\n \"requirements\": [\n {\n \"requirement_id\": \"0b42b42a-d827-4b53-a2bb-8eeef919f798\",\n \"type\": \"textual\",\n \"data\": \"478458786548\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"2708e569-696a-4fc7-9305-5fdb3eb9c7dd\",\n \"type\": \"textual\",\n \"data\": \"John doe\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"9ef887b6-7a28-47c3-964e-380680776561\",\n \"type\": \"document\",\n \"data\": \"98853a6a-a3e2-4b59-b676-6bb081faf5e3.pdf\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"a7d9a3a3-70ed-4cb4-821b-b94e8ea6dc9b\",\n \"type\": \"address\",\n \"data\": \"3034108885616035274\",\n \"other_data\": \"Wilerstrasse 3918, Amlikon-Bissegg, Switzerland\"\n },\n {\n \"requirement_id\": \"b0197fa1-c2fd-4500-9875-2c658b2396eb\",\n \"type\": \"document\",\n \"data\": \"811a8f00-41c3-4e2d-8050-58c4c57b2663.pdf\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"bf1cb27c-3693-41af-bbf6-ff4de8d41006\",\n \"type\": \"textual\",\n \"data\": \"john@doe.com\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"d3641c72-734e-4421-8bca-510b4137c0c5\",\n \"type\": \"textual\",\n \"data\": \"John fintech\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"ec029bc6-357f-404d-bdfd-f61d4e578896\",\n \"type\": \"document\",\n \"data\": \"094ab602-4ea3-4497-836c-809a5d2ded86.pdf\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"80b88912-a16a-401d-afe4-28a47d31bf89\",\n \"type\": \"textual\",\n \"data\": \"6985478521\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"d28957ae-1170-4b17-919f-e78b5b6dcdba\",\n \"type\": \"document\",\n \"data\": \"67eb742d-e7ea-4e51-a144-f455037f2e92.pdf\",\n \"other_data\": \"\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": 1,
"message": "Number purchased successfully",
"data": {
"number_id": 2650,
"order_id": "3042009471086757685"
}
}Numbers
Purchase a number with requirements
Purchase a phone number and submit its regulatory requirements.
POST
/
v1
/
numbers
/
purchase_with_requirements
Purchase a number with requirements
curl --request POST \
--url https://dev-api.amplify.xyz/v1/numbers/purchase_with_requirements \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"number": "+41912470050",
"type": "fax",
"country_code": "CH",
"tier": 1,
"requirements": [
{
"requirement_id": "0b42b42a-d827-4b53-a2bb-8eeef919f798",
"type": "textual",
"data": "478458786548",
"other_data": ""
},
{
"requirement_id": "2708e569-696a-4fc7-9305-5fdb3eb9c7dd",
"type": "textual",
"data": "John doe",
"other_data": ""
},
{
"requirement_id": "9ef887b6-7a28-47c3-964e-380680776561",
"type": "document",
"data": "98853a6a-a3e2-4b59-b676-6bb081faf5e3.pdf",
"other_data": ""
},
{
"requirement_id": "a7d9a3a3-70ed-4cb4-821b-b94e8ea6dc9b",
"type": "address",
"data": "3034108885616035274",
"other_data": "Wilerstrasse 3918, Amlikon-Bissegg, Switzerland"
},
{
"requirement_id": "b0197fa1-c2fd-4500-9875-2c658b2396eb",
"type": "document",
"data": "811a8f00-41c3-4e2d-8050-58c4c57b2663.pdf",
"other_data": ""
},
{
"requirement_id": "bf1cb27c-3693-41af-bbf6-ff4de8d41006",
"type": "textual",
"data": "john@doe.com",
"other_data": ""
},
{
"requirement_id": "d3641c72-734e-4421-8bca-510b4137c0c5",
"type": "textual",
"data": "John fintech",
"other_data": ""
},
{
"requirement_id": "ec029bc6-357f-404d-bdfd-f61d4e578896",
"type": "document",
"data": "094ab602-4ea3-4497-836c-809a5d2ded86.pdf",
"other_data": ""
},
{
"requirement_id": "80b88912-a16a-401d-afe4-28a47d31bf89",
"type": "textual",
"data": "6985478521",
"other_data": ""
},
{
"requirement_id": "d28957ae-1170-4b17-919f-e78b5b6dcdba",
"type": "document",
"data": "67eb742d-e7ea-4e51-a144-f455037f2e92.pdf",
"other_data": ""
}
]
}
'import requests
url = "https://dev-api.amplify.xyz/v1/numbers/purchase_with_requirements"
payload = {
"number": "+41912470050",
"type": "fax",
"country_code": "CH",
"tier": 1,
"requirements": [
{
"requirement_id": "0b42b42a-d827-4b53-a2bb-8eeef919f798",
"type": "textual",
"data": "478458786548",
"other_data": ""
},
{
"requirement_id": "2708e569-696a-4fc7-9305-5fdb3eb9c7dd",
"type": "textual",
"data": "John doe",
"other_data": ""
},
{
"requirement_id": "9ef887b6-7a28-47c3-964e-380680776561",
"type": "document",
"data": "98853a6a-a3e2-4b59-b676-6bb081faf5e3.pdf",
"other_data": ""
},
{
"requirement_id": "a7d9a3a3-70ed-4cb4-821b-b94e8ea6dc9b",
"type": "address",
"data": "3034108885616035274",
"other_data": "Wilerstrasse 3918, Amlikon-Bissegg, Switzerland"
},
{
"requirement_id": "b0197fa1-c2fd-4500-9875-2c658b2396eb",
"type": "document",
"data": "811a8f00-41c3-4e2d-8050-58c4c57b2663.pdf",
"other_data": ""
},
{
"requirement_id": "bf1cb27c-3693-41af-bbf6-ff4de8d41006",
"type": "textual",
"data": "john@doe.com",
"other_data": ""
},
{
"requirement_id": "d3641c72-734e-4421-8bca-510b4137c0c5",
"type": "textual",
"data": "John fintech",
"other_data": ""
},
{
"requirement_id": "ec029bc6-357f-404d-bdfd-f61d4e578896",
"type": "document",
"data": "094ab602-4ea3-4497-836c-809a5d2ded86.pdf",
"other_data": ""
},
{
"requirement_id": "80b88912-a16a-401d-afe4-28a47d31bf89",
"type": "textual",
"data": "6985478521",
"other_data": ""
},
{
"requirement_id": "d28957ae-1170-4b17-919f-e78b5b6dcdba",
"type": "document",
"data": "67eb742d-e7ea-4e51-a144-f455037f2e92.pdf",
"other_data": ""
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
number: '+41912470050',
type: 'fax',
country_code: 'CH',
tier: 1,
requirements: [
{
requirement_id: '0b42b42a-d827-4b53-a2bb-8eeef919f798',
type: 'textual',
data: '478458786548',
other_data: ''
},
{
requirement_id: '2708e569-696a-4fc7-9305-5fdb3eb9c7dd',
type: 'textual',
data: 'John doe',
other_data: ''
},
{
requirement_id: '9ef887b6-7a28-47c3-964e-380680776561',
type: 'document',
data: '98853a6a-a3e2-4b59-b676-6bb081faf5e3.pdf',
other_data: ''
},
{
requirement_id: 'a7d9a3a3-70ed-4cb4-821b-b94e8ea6dc9b',
type: 'address',
data: '3034108885616035274',
other_data: 'Wilerstrasse 3918, Amlikon-Bissegg, Switzerland'
},
{
requirement_id: 'b0197fa1-c2fd-4500-9875-2c658b2396eb',
type: 'document',
data: '811a8f00-41c3-4e2d-8050-58c4c57b2663.pdf',
other_data: ''
},
{
requirement_id: 'bf1cb27c-3693-41af-bbf6-ff4de8d41006',
type: 'textual',
data: 'john@doe.com',
other_data: ''
},
{
requirement_id: 'd3641c72-734e-4421-8bca-510b4137c0c5',
type: 'textual',
data: 'John fintech',
other_data: ''
},
{
requirement_id: 'ec029bc6-357f-404d-bdfd-f61d4e578896',
type: 'document',
data: '094ab602-4ea3-4497-836c-809a5d2ded86.pdf',
other_data: ''
},
{
requirement_id: '80b88912-a16a-401d-afe4-28a47d31bf89',
type: 'textual',
data: '6985478521',
other_data: ''
},
{
requirement_id: 'd28957ae-1170-4b17-919f-e78b5b6dcdba',
type: 'document',
data: '67eb742d-e7ea-4e51-a144-f455037f2e92.pdf',
other_data: ''
}
]
})
};
fetch('https://dev-api.amplify.xyz/v1/numbers/purchase_with_requirements', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://dev-api.amplify.xyz/v1/numbers/purchase_with_requirements",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'number' => '+41912470050',
'type' => 'fax',
'country_code' => 'CH',
'tier' => 1,
'requirements' => [
[
'requirement_id' => '0b42b42a-d827-4b53-a2bb-8eeef919f798',
'type' => 'textual',
'data' => '478458786548',
'other_data' => ''
],
[
'requirement_id' => '2708e569-696a-4fc7-9305-5fdb3eb9c7dd',
'type' => 'textual',
'data' => 'John doe',
'other_data' => ''
],
[
'requirement_id' => '9ef887b6-7a28-47c3-964e-380680776561',
'type' => 'document',
'data' => '98853a6a-a3e2-4b59-b676-6bb081faf5e3.pdf',
'other_data' => ''
],
[
'requirement_id' => 'a7d9a3a3-70ed-4cb4-821b-b94e8ea6dc9b',
'type' => 'address',
'data' => '3034108885616035274',
'other_data' => 'Wilerstrasse 3918, Amlikon-Bissegg, Switzerland'
],
[
'requirement_id' => 'b0197fa1-c2fd-4500-9875-2c658b2396eb',
'type' => 'document',
'data' => '811a8f00-41c3-4e2d-8050-58c4c57b2663.pdf',
'other_data' => ''
],
[
'requirement_id' => 'bf1cb27c-3693-41af-bbf6-ff4de8d41006',
'type' => 'textual',
'data' => 'john@doe.com',
'other_data' => ''
],
[
'requirement_id' => 'd3641c72-734e-4421-8bca-510b4137c0c5',
'type' => 'textual',
'data' => 'John fintech',
'other_data' => ''
],
[
'requirement_id' => 'ec029bc6-357f-404d-bdfd-f61d4e578896',
'type' => 'document',
'data' => '094ab602-4ea3-4497-836c-809a5d2ded86.pdf',
'other_data' => ''
],
[
'requirement_id' => '80b88912-a16a-401d-afe4-28a47d31bf89',
'type' => 'textual',
'data' => '6985478521',
'other_data' => ''
],
[
'requirement_id' => 'd28957ae-1170-4b17-919f-e78b5b6dcdba',
'type' => 'document',
'data' => '67eb742d-e7ea-4e51-a144-f455037f2e92.pdf',
'other_data' => ''
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://dev-api.amplify.xyz/v1/numbers/purchase_with_requirements"
payload := strings.NewReader("{\n \"number\": \"+41912470050\",\n \"type\": \"fax\",\n \"country_code\": \"CH\",\n \"tier\": 1,\n \"requirements\": [\n {\n \"requirement_id\": \"0b42b42a-d827-4b53-a2bb-8eeef919f798\",\n \"type\": \"textual\",\n \"data\": \"478458786548\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"2708e569-696a-4fc7-9305-5fdb3eb9c7dd\",\n \"type\": \"textual\",\n \"data\": \"John doe\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"9ef887b6-7a28-47c3-964e-380680776561\",\n \"type\": \"document\",\n \"data\": \"98853a6a-a3e2-4b59-b676-6bb081faf5e3.pdf\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"a7d9a3a3-70ed-4cb4-821b-b94e8ea6dc9b\",\n \"type\": \"address\",\n \"data\": \"3034108885616035274\",\n \"other_data\": \"Wilerstrasse 3918, Amlikon-Bissegg, Switzerland\"\n },\n {\n \"requirement_id\": \"b0197fa1-c2fd-4500-9875-2c658b2396eb\",\n \"type\": \"document\",\n \"data\": \"811a8f00-41c3-4e2d-8050-58c4c57b2663.pdf\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"bf1cb27c-3693-41af-bbf6-ff4de8d41006\",\n \"type\": \"textual\",\n \"data\": \"john@doe.com\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"d3641c72-734e-4421-8bca-510b4137c0c5\",\n \"type\": \"textual\",\n \"data\": \"John fintech\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"ec029bc6-357f-404d-bdfd-f61d4e578896\",\n \"type\": \"document\",\n \"data\": \"094ab602-4ea3-4497-836c-809a5d2ded86.pdf\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"80b88912-a16a-401d-afe4-28a47d31bf89\",\n \"type\": \"textual\",\n \"data\": \"6985478521\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"d28957ae-1170-4b17-919f-e78b5b6dcdba\",\n \"type\": \"document\",\n \"data\": \"67eb742d-e7ea-4e51-a144-f455037f2e92.pdf\",\n \"other_data\": \"\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://dev-api.amplify.xyz/v1/numbers/purchase_with_requirements")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"number\": \"+41912470050\",\n \"type\": \"fax\",\n \"country_code\": \"CH\",\n \"tier\": 1,\n \"requirements\": [\n {\n \"requirement_id\": \"0b42b42a-d827-4b53-a2bb-8eeef919f798\",\n \"type\": \"textual\",\n \"data\": \"478458786548\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"2708e569-696a-4fc7-9305-5fdb3eb9c7dd\",\n \"type\": \"textual\",\n \"data\": \"John doe\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"9ef887b6-7a28-47c3-964e-380680776561\",\n \"type\": \"document\",\n \"data\": \"98853a6a-a3e2-4b59-b676-6bb081faf5e3.pdf\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"a7d9a3a3-70ed-4cb4-821b-b94e8ea6dc9b\",\n \"type\": \"address\",\n \"data\": \"3034108885616035274\",\n \"other_data\": \"Wilerstrasse 3918, Amlikon-Bissegg, Switzerland\"\n },\n {\n \"requirement_id\": \"b0197fa1-c2fd-4500-9875-2c658b2396eb\",\n \"type\": \"document\",\n \"data\": \"811a8f00-41c3-4e2d-8050-58c4c57b2663.pdf\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"bf1cb27c-3693-41af-bbf6-ff4de8d41006\",\n \"type\": \"textual\",\n \"data\": \"john@doe.com\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"d3641c72-734e-4421-8bca-510b4137c0c5\",\n \"type\": \"textual\",\n \"data\": \"John fintech\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"ec029bc6-357f-404d-bdfd-f61d4e578896\",\n \"type\": \"document\",\n \"data\": \"094ab602-4ea3-4497-836c-809a5d2ded86.pdf\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"80b88912-a16a-401d-afe4-28a47d31bf89\",\n \"type\": \"textual\",\n \"data\": \"6985478521\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"d28957ae-1170-4b17-919f-e78b5b6dcdba\",\n \"type\": \"document\",\n \"data\": \"67eb742d-e7ea-4e51-a144-f455037f2e92.pdf\",\n \"other_data\": \"\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev-api.amplify.xyz/v1/numbers/purchase_with_requirements")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"number\": \"+41912470050\",\n \"type\": \"fax\",\n \"country_code\": \"CH\",\n \"tier\": 1,\n \"requirements\": [\n {\n \"requirement_id\": \"0b42b42a-d827-4b53-a2bb-8eeef919f798\",\n \"type\": \"textual\",\n \"data\": \"478458786548\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"2708e569-696a-4fc7-9305-5fdb3eb9c7dd\",\n \"type\": \"textual\",\n \"data\": \"John doe\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"9ef887b6-7a28-47c3-964e-380680776561\",\n \"type\": \"document\",\n \"data\": \"98853a6a-a3e2-4b59-b676-6bb081faf5e3.pdf\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"a7d9a3a3-70ed-4cb4-821b-b94e8ea6dc9b\",\n \"type\": \"address\",\n \"data\": \"3034108885616035274\",\n \"other_data\": \"Wilerstrasse 3918, Amlikon-Bissegg, Switzerland\"\n },\n {\n \"requirement_id\": \"b0197fa1-c2fd-4500-9875-2c658b2396eb\",\n \"type\": \"document\",\n \"data\": \"811a8f00-41c3-4e2d-8050-58c4c57b2663.pdf\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"bf1cb27c-3693-41af-bbf6-ff4de8d41006\",\n \"type\": \"textual\",\n \"data\": \"john@doe.com\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"d3641c72-734e-4421-8bca-510b4137c0c5\",\n \"type\": \"textual\",\n \"data\": \"John fintech\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"ec029bc6-357f-404d-bdfd-f61d4e578896\",\n \"type\": \"document\",\n \"data\": \"094ab602-4ea3-4497-836c-809a5d2ded86.pdf\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"80b88912-a16a-401d-afe4-28a47d31bf89\",\n \"type\": \"textual\",\n \"data\": \"6985478521\",\n \"other_data\": \"\"\n },\n {\n \"requirement_id\": \"d28957ae-1170-4b17-919f-e78b5b6dcdba\",\n \"type\": \"document\",\n \"data\": \"67eb742d-e7ea-4e51-a144-f455037f2e92.pdf\",\n \"other_data\": \"\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": 1,
"message": "Number purchased successfully",
"data": {
"number_id": 2650,
"order_id": "3042009471086757685"
}
}Purchases the specified number while submitting the textual, document, and address evidence required for regulatory approval.
The optional top-level
type field accepts fax or voice. Within each item in requirements, the observed type values are:
textualfor text-based evidencedocumentfor an uploaded verification documentaddressfor a verification address
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
