Create Order#
Creates a new DID Order to purchase phone numbers (DIDs) based on availability, reservations, or predefined stock-keeping units (SKUs). This request allows to order specific available DIDs, reserve numbers from a particular region, or request multiple DIDs in bulk.
Request#
HTTP Method: POST
URI Path: /v3/orders
Body:
Name |
Type |
Is Required? |
Description |
|---|---|---|---|
allow_back_ordering |
|
Optional |
Allowing back ordering. |
items |
|
Yes |
Order items array. |
Note
allow_back_ordering =
true: Proceeds with the order when items are not in stock.allow_back_ordering =
false: Does not proceed with the order when items are not in stock.
Order Item:
Name |
Type |
Is Required? |
Description |
|---|---|---|---|
type |
|
Optional |
Item object type: |
attributes |
One of DID Order Item Attributes , |
Optional |
Order Item Attributes object. |
Order Item Attributes:
Name |
Type |
Is Required? |
Description |
|---|---|---|---|
sku_id |
|
Yes |
Stock Keeping Unit ID. Should be used with one of optional parameters |
qty |
|
Yes |
Quantity of DIDs. |
did_reservation_id |
|
Optional |
Specific DID Reservation ID. |
billing_cycles_count |
|
Optional |
The number of Billing Cycles that this DID Number will renew until expiration. |
available_did_id |
|
Optional |
Specific Available DID ID. |
Name |
Type |
Is Required? |
Description |
|---|---|---|---|
qty |
|
Optional |
Quantity of Channels. |
capacity_pool_id |
|
Yes |
Capacity Pool ID. |
Examples#
http
1POST /v3/orders HTTP/1.1
2Host: api.didww.com
3Content-Type: application/vnd.api+json
4Accept: application/vnd.api+json
5Api-Key: [API token]
6
7{
8 "data": {
9 "type": "orders",
10 "attributes": {
11 "allow_back_ordering": true,
12 "items": [
13 {
14 "type": "did_order_items",
15 "attributes": {
16 "qty": 15,
17 "sku_id": "a78bb6d8-b05e-4e12-afe6-ad84ac979088"
18 }
19 }
20 ]
21 }
22 }
23}
curl
1curl -i -X POST https://api.didww.com/v3/orders -H "Accept: application/vnd.api+json" -H "Api-Key: [API token]" -H "Content-Type: application/vnd.api+json" --data-raw '{"data": {"attributes": {"allow_back_ordering": true, "items": [{"type": "did_order_items", "attributes": {"qty": 15, "sku_id": "a78bb6d8-b05e-4e12-afe6-ad84ac979088"}}]}, "type": "orders"}}'
response
1HTTP/1.1 201 Created
2Content-Type: application/vnd.api+json
3
4{
5 "data": {
6 "id": "9eeaab6c-b758-41b8-af86-8978a86603a2",
7 "type": "orders",
8 "attributes": {
9 "reference": "FZH-374899",
10 "amount": "79.2",
11 "status": "Pending",
12 "created_at": "2017-06-25T14:56:31.513Z",
13 "description": "DID",
14 "items": [
15 {
16 "type": "did_order_items",
17 "attributes": {
18 "qty": 15,
19 "nrc": "5.00",
20 "mrc": "5.00",
21 "prorated_mrc": true,
22 "billed_from": "2018-08-15",
23 "billed_to": "2018-09-15",
24 "did_group_id": "d01704b0-6522-47d5-8865-3398c417ed1d"
25 }
26 }
27 ]
28 }
29 },
30 "meta": {
31 "api_version": "2017-09-18"
32}
http
1POST /v3/orders HTTP/1.1
2Host: api.didww.com
3Content-Type: application/vnd.api+json
4Accept: application/vnd.api+json
5Api-Key: [API token]
6
7{
8 "data": {
9 "type": "orders",
10 "attributes": {
11 "allow_back_ordering": false,
12 "items": [
13 {
14 "type": "did_order_items",
15 "attributes": {
16 "qty": 15,
17 "sku_id": "b6d9d793-578d-42d3-bc33-73dd8155e615"
18 }
19 }
20 ]
21 }
22 }
23}
curl
1curl -i -X POST https://api.didww.com/v3/orders -H "Accept: application/vnd.api+json" -H "Api-Key: [API token]" -H "Content-Type: application/vnd.api+json" --data-raw '{"data": {"attributes": {"allow_back_ordering": false, "items": [{"type": "did_order_items", "attributes": {"qty": 15, "sku_id": "b6d9d793-578d-42d3-bc33-73dd8155e615"}}]}, "type": "orders"}}'
response
1HTTP/1.1 201 Created
2Content-Type: application/vnd.api+json
3
4{
5 "data": {
6 "id": "75dae051-7508-4a9b-ab1b-9bbd75de18c5",
7 "type": "orders",
8 "attributes": {
9 "amount": "79.2",
10 "status": "Pending",
11 "created_at": "2017-06-25T14:56:31.513Z",
12 "description": "DID",
13 "reference": "NXH-560588",
14 "items": [
15 {
16 "type": "did_order_items",
17 "attributes": {
18 "qty": 15,
19 "nrc": "5.00",
20 "mrc": "5.00",
21 "prorated_mrc": true,
22 "billed_from": "2018-08-15",
23 "billed_to": "2018-09-15",
24 "did_group_id": "a7b2abcb-6251-475f-b6e0-fd9acf2579ef"
25 }
26 }
27 ]
28 }
29 },
30 "meta": {
31 "api_version": "2017-09-18"
32 }
33}
http
1POST /v3/orders HTTP/1.1
2Host: api.didww.com
3Content-Type: application/vnd.api+json
4Accept: application/vnd.api+json
5Api-Key: [API token]
6
7{
8 "data": {
9 "type": "orders",
10 "attributes": {
11 "allow_back_ordering": false,
12 "items": [
13 {
14 "type": "did_order_items",
15 "attributes": {
16 "available_did_id": "7f44285d-20ef-4773-953f-ba012adafed3",
17 "sku_id": "b6d9d793-578d-42d3-bc33-73dd8155e615"
18 }
19 }
20 ]
21 }
22 }
23}
curl
1curl -i -X POST https://api.didww.com/v3/orders -H "Accept: application/vnd.api+json" -H "Api-Key: [API token]" -H "Content-Type: application/vnd.api+json" --data-raw '{"data": {"attributes": {"allow_back_ordering": false, "items": [{"type": "did_order_items", "attributes": {"available_did_id": "7f44285d-20ef-4773-953f-ba012adafed3", "sku_id": "b6d9d793-578d-42d3-bc33-73dd8155e615"}}]}, "type": "orders"}}'
response
1HTTP/1.1 201 Created
2Content-Type: application/vnd.api+json
3
4{
5 "data": {
6 "id": "75dae051-7508-4a9b-ab1b-9bbd75de18c5",
7 "type": "orders",
8 "attributes": {
9 "amount": "10.0",
10 "status": "Pending",
11 "created_at": "2017-06-25T14:56:31.513Z",
12 "description": "DID",
13 "reference": "NXH-560588",
14 "items": [
15 {
16 "type": "did_order_items",
17 "attributes": {
18 "qty": 1,
19 "nrc": "5.00",
20 "mrc": "5.00",
21 "prorated_mrc": true,
22 "billed_from": "2018-08-15",
23 "billed_to": "2018-09-15",
24 "did_group_id": "a7b2abcb-6251-475f-b6e0-fd9acf2579ef"
25 }
26 }
27 ]
28 }
29 },
30 "meta": {
31 "api_version": "2017-09-18"
32 }
33}
http
1POST /v3/orders HTTP/1.1
2Host: api.didww.com
3Content-Type: application/vnd.api+json
4Accept: application/vnd.api+json
5Api-Key: [API token]
6
7{
8 "data": {
9 "type": "orders",
10 "attributes": {
11 "allow_back_ordering": false,
12 "items": [
13 {
14 "type": "did_order_items",
15 "attributes": {
16 "did_reservation_id": "2a1d98d2-eafd-4332-80d5-5ecd36411eb3",
17 "sku_id": "b6d9d793-578d-42d3-bc33-73dd8155e615"
18 }
19 }
20 ]
21 }
22 }
23}
curl
1curl -i -X POST https://api.didww.com/v3/orders -H "Accept: application/vnd.api+json" -H "Api-Key: [API token]" -H "Content-Type: application/vnd.api+json" --data-raw '{"data": {"attributes": {"allow_back_ordering": false, "items": [{"type": "did_order_items", "attributes": {"did_reservation_id": "2a1d98d2-eafd-4332-80d5-5ecd36411eb3", "sku_id": "b6d9d793-578d-42d3-bc33-73dd8155e615"}}]}, "type": "orders"}}'
response
1HTTP/1.1 201 Created
2Content-Type: application/vnd.api+json
3
4{
5 "data": {
6 "id": "75dae051-7508-4a9b-ab1b-9bbd75de18c5",
7 "type": "orders",
8 "attributes": {
9 "amount": "10.0",
10 "status": "Pending",
11 "created_at": "2017-06-25T14:56:31.513Z",
12 "description": "DID",
13 "reference": "NXH-560588",
14 "items": [
15 {
16 "type": "did_order_items",
17 "attributes": {
18 "qty": 1,
19 "nrc": "5.00",
20 "mrc": "5.00",
21 "prorated_mrc": true,
22 "billed_from": "2018-08-15",
23 "billed_to": "2018-09-15",
24 "did_group_id": "a7b2abcb-6251-475f-b6e0-fd9acf2579ef"
25 }
26 }
27 ]
28 }
29 },
30 "meta": {
31 "api_version": "2017-09-18"
32 }
33}
http
1POST /v3/orders HTTP/1.1
2Host: api.didww.com
3Content-Type: application/vnd.api+json
4Accept: application/vnd.api+json
5Api-Key: [API token]
6
7{
8 "data": {
9 "type": "orders",
10 "attributes": {
11 "items": [
12 {
13 "type": "capacity_order_items",
14 "attributes": {
15 "capacity_pool_id": "c5f87307-7c80-417c-9ec3-18e0241c4228",
16 "qty" : 1
17 }
18 }
19 ]
20 }
21 }
22}
curl
1curl -i -X POST https://api.didww.com/v3/orders -H "Accept: application/vnd.api+json" -H "Api-Key: [API token]" -H "Content-Type: application/vnd.api+json" --data-raw '{"data": {"attributes": {"items": [{"type": "capacity_order_items", "attributes": {"capacity_pool_id": "c5f87307-7c80-417c-9ec3-18e0241c4228", "qty": 1}}]}, "type": "orders"}}'
response
1HTTP/1.1 201 Created
2Content-Type: application/vnd.api+json
3
4{
5 "data": {
6 "id": "75dae051-7508-4a9b-ab1b-9bbd75de18c5",
7 "type": "orders",
8 "attributes": {
9 "amount": "21.33",
10 "status": "Completed",
11 "created_at": "2017-06-25T14:56:31.513Z",
12 "description": "Capacity",
13 "reference": "NXH-560588",
14 "items": [
15 {
16 "type": "capacity_order_items",
17 "attributes": {
18 "qty": 1,
19 "nrc": "20.0",
20 "mrc": "1.33",
21 "prorated_mrc": true,
22 "billed_from": "2018-08-15",
23 "billed_to": "2018-09-15",
24 "capacity_pool_id": "c5f87307-7c80-417c-9ec3-18e0241c4228"
25 }
26 }
27 ]
28 }
29 },
30 "meta": {
31 "api_version": "2017-09-18"
32 }
33}
Other Responses#
Code |
Success |
Description |
|---|---|---|
404 |
No |
|
401 |
No |