Create Order
Description
Creates a DID Order.
Request
HTTP Method: POST
URI Path: /v3/orders
Body:
Name |
Type |
Is Required? |
Description |
---|---|---|---|
allow_back_ordering |
|
No |
Allowing back ordering. |
items |
|
Yes |
Order items array. |
callback_url |
|
No |
The HTTP or HTTPS endpoint to where events related to order will be delivered. |
allow_back_ordering |
|
No |
The HTTP Method used for order events. POST, GET are supported methods. |
See Callback details for information about callback_url and callback_method.
Order Item:
Name |
Type |
Is Required? |
Description |
---|---|---|---|
type |
|
No |
Item object type: |
attributes |
One of DID Order Item Attributes, |
No |
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 |
|
No |
Specific DID Reservation ID. |
nanpa_prefix_id |
|
No |
The ID of NPA NXX Group. |
billing_cycles_count |
|
No |
The number of Billing Cycles that this DID Number will renew until expiration. |
available_did_id |
|
No |
Specific Available DID ID. |
prorate_days_qty |
|
No |
Amount of service time (days). |
Name |
Type |
Is Required? |
Description |
---|---|---|---|
qty |
|
No |
Quantity of DIDs. |
capacity_pool_id |
|
Yes |
Capacity Pool ID. |
Attention
Please note that “prorate_days_qty” attribute will be ignored if Prorate billing is not enabled per your DIDWW account. To enabled this billing option billing please contact Sales department via email sales@didww.com
Examples
POST /v3/orders HTTP/1.1
Host: api.didww.com
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]
{
"data": {
"type": "orders",
"attributes": {
"allow_back_ordering": true,
"items": [
{
"type": "did_order_items",
"attributes": {
"qty": 1,
"sku_id": "a78bb6d8-b05e-4e12-afe6-ad84ac979088"
}
}
]
}
}
}
curl -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": 1, "sku_id": "a78bb6d8-b05e-4e12-afe6-ad84ac979088"}}]}, "type": "orders"}}'
HTTP/1.1 201 Created
Content-Type: application/vnd.api+json
{
"data": {
"id": "9eeaab6c-b758-41b8-af86-8978a86603a2",
"type": "orders",
"attributes": {
"reference": "FZH-374899",
"amount": "79.2",
"status": "Pending",
"created_at": "2017-06-25T14:56:31.513Z",
"description": "DID",
"items": [
{
"type": "did_order_items",
"attributes": {
"qty": 15,
"nrc": "5.00",
"mrc": "5.00",
"prorated_mrc": true,
"billed_from": "2018-08-15",
"billed_to": "2018-09-15",
"did_group_id": "d01704b0-6522-47d5-8865-3398c417ed1d"
}
}
]
}
}
}
POST /v3/orders HTTP/1.1
Host: api.didww.com
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]
{
"data": {
"type": "orders",
"attributes": {
"allow_back_ordering": false,
"items": [
{
"type": "did_order_items",
"attributes": {
"qty": 15,
"sku_id": "b6d9d793-578d-42d3-bc33-73dd8155e615"
}
}
]
}
}
}
curl -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"}}'
HTTP/1.1 201 Created
Content-Type: application/vnd.api+json
{
"data": {
"id": "75dae051-7508-4a9b-ab1b-9bbd75de18c5",
"type": "orders",
"attributes": {
"amount": "79.2",
"status": "Pending",
"created_at": "2017-06-25T14:56:31.513Z",
"description": "DID",
"reference": "NXH-560588",
"items": [
{
"type": "did_order_items",
"attributes": {
"qty": 15,
"nrc": "5.00",
"mrc": "5.00",
"prorated_mrc": true,
"billed_from": "2018-08-15",
"billed_to": "2018-09-15",
"did_group_id": "a7b2abcb-6251-475f-b6e0-fd9acf2579ef"
}
}
]
}
}
}
POST /v3/orders HTTP/1.1
Host: api.didww.com
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]
{
"data": {
"type": "orders",
"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"
}
}
]
}
}
}
curl -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"}}'
HTTP/1.1 201 Created
Content-Type: application/vnd.api+json
{
"data": {
"id": "75dae051-7508-4a9b-ab1b-9bbd75de18c5",
"type": "orders",
"attributes": {
"amount": "10.0",
"status": "Pending",
"created_at": "2017-06-25T14:56:31.513Z",
"description": "DID",
"reference": "NXH-560588",
"items": [
{
"type": "did_order_items",
"attributes": {
"qty": 1,
"nrc": "5.00",
"mrc": "5.00",
"prorated_mrc": true,
"billed_from": "2018-08-15",
"billed_to": "2018-09-15",
"did_group_id": "a7b2abcb-6251-475f-b6e0-fd9acf2579ef"
}
}
]
}
}
}
POST /v3/orders HTTP/1.1
Host: api.didww.com
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]
{
"data": {
"type": "orders",
"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"
}
}
]
}
}
}
curl -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"}}'
HTTP/1.1 201 Created
Content-Type: application/vnd.api+json
{
"data": {
"id": "75dae051-7508-4a9b-ab1b-9bbd75de18c5",
"type": "orders",
"attributes": {
"amount": "10.0",
"status": "Pending",
"created_at": "2017-06-25T14:56:31.513Z",
"description": "DID",
"reference": "NXH-560588",
"items": [
{
"type": "did_order_items",
"attributes": {
"qty": 1,
"nrc": "5.00",
"mrc": "5.00",
"prorated_mrc": true,
"billed_from": "2018-08-15",
"billed_to": "2018-09-15",
"did_group_id": "a7b2abcb-6251-475f-b6e0-fd9acf2579ef"
}
}
]
}
}
}
POST /v3/orders HTTP/1.1
Host: api.didww.com
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]
{
"data": {
"type": "orders",
"attributes": {
"allow_back_ordering": true,
"callback_url": "http://example.com",
"callback_method": "GET",
"items": [
{
"type": "did_order_items",
"attributes": {
"qty": 1,
"sku_id": "a7a7ffae-14cc-4e24-8682-6083a050fae7"
}
}
]
}
}
}
curl -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, "callback_method": "GET", "callback_url": "http://example.com", "items": [{"type": "did_order_items", "attributes": {"qty": 1, "sku_id": "a7a7ffae-14cc-4e24-8682-6083a050fae7"}}]}, "type": "orders"}}'
HTTP/1.1 201 Created
Content-Type: application/vnd.api+json
{
"data": {
"id": "76b20d6b-f9a8-47bf-8715-bc5fbfd59f55",
"type": "orders",
"attributes": {
"amount": "0.5",
"status": "Pending",
"created_at": "2021-09-06T16:54:28.659Z",
"description": "DID",
"reference": "TQR-660582",
"items": [
{
"type": "did_order_items",
"attributes": {
"qty": 1,
"nrc": "0.0",
"mrc": "0.5",
"prorated_mrc": false,
"billed_from": null,
"billed_to": null,
"setup_price": "0.0",
"monthly_price": "0.5",
"did_group_id": "fce19421-b6b4-4f31-99f4-699bc0300bbc"
}
}
],
"callback_method": "GET",
"callback_url": "http://example.com"
}
},
"meta": {
"api_version": "2022-05-10"
}
}
POST /v3/orders HTTP/1.1
Host: api.didww.com
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]
{
"data": {
"type": "orders",
"attributes": {
"items": [
{
"type": "capacity_order_items",
"attributes": {
"capacity_pool_id": "c5f87307-7c80-417c-9ec3-18e0241c4228",
"qty": 1
}
}
]
}
}
}
curl -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"}}'
HTTP/1.1 201 Created
Content-Type: application/vnd.api+json
{
"data": {
"id": "75dae051-7508-4a9b-ab1b-9bbd75de18c5",
"type": "orders",
"attributes": {
"amount": "21.33",
"status": "Completed",
"created_at": "2017-06-25T14:56:31.513Z",
"description": "Capacity",
"reference": "NXH-560588",
"items": [
{
"type": "capacity_order_items",
"attributes": {
"qty": 1,
"nrc": "20.0",
"mrc": "1.33",
"prorated_mrc": true,
"billed_from": "2018-08-15",
"billed_to": "2018-09-15",
"capacity_pool_id": "c5f87307-7c80-417c-9ec3-18e0241c4228"
}
}
]
}
}
}
POST /v3/orders HTTP/1.1
Host: api.didww.com
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]
{
"data": {
"type": "orders",
"attributes": {
"allow_back_ordering": false,
"items": [
{
"type": "did_order_items",
"attributes": {
"nanpa_prefix_id": "2a1d98d2-eafd-4332-80d5-5ecd36411eb3",
"sku_id": "b6d9d793-578d-42d3-bc33-73dd8155e615"
}
}
]
}
}
}
curl -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": {"nanpa_prefix_id": "2a1d98d2-eafd-4332-80d5-5ecd36411eb3", "sku_id": "b6d9d793-578d-42d3-bc33-73dd8155e615"}}]}, "type": "orders"}}'
HTTP/1.1 201 Created
Content-Type: application/vnd.api+json
{
"data": {
"id": "75dae051-7508-4a9b-ab1b-9bbd75de18c5",
"type": "orders",
"attributes": {
"amount": "10.0",
"status": "Pending",
"created_at": "2017-06-25T14:56:31.513Z",
"description": "DID",
"reference": "NXH-560588",
"items": [
{
"type": "did_order_items",
"attributes": {
"qty": 1,
"nrc": "5.00",
"mrc": "5.00",
"prorated_mrc": true,
"billed_from": "2018-08-15",
"billed_to": "2018-09-15",
"did_group_id": "a7b2abcb-6251-475f-b6e0-fd9acf2579ef"
}
}
]
}
}
}
POST /v3/orders HTTP/1.1
Host: api.didww.com
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]
{
"data": {
"type": "orders",
"attributes": {
"allow_back_ordering": false,
"items": [
{
"type": "did_order_items",
"attributes": {
"available_did_id": "6c82282c-8193-43ca-9876-8ddef1ade253",
"sku_id": "644c2449-0e23-4a67-9f81-565ad5137bb6",
"prorate_days_qty": 10
}
}
]
}
}
}
curl -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": "6c82282c-8193-43ca-9876-8ddef1ade253", "sku_id": "644c2449-0e23-4a67-9f81-565ad5137bb6", "prorate_days_qty": 10}}]}, "type": "orders"}}'
HTTP/1.1 201 Created
Content-Type: application/vnd.api+json
{
"data": {
"id": "3276e7e6-559a-4344-95d8-1a83657f46ba",
"type": "orders",
"attributes": {
"amount": "0.03",
"status": "Pending",
"created_at": "2022-03-04T07:45:24.471Z",
"description": "DID",
"reference": "EHF-778400",
"items": [
{
"type": "did_order_items",
"attributes": {
"qty": 1,
"nrc": "0.0",
"mrc": "0.03",
"prorated_mrc": true,
"billed_from": null,
"billed_to": null,
"setup_price": "0.0",
"monthly_price": "0.03",
"did_group_id": "239e74ad-9da1-4802-90dd-e1ce148da19e"
}
}
],
"callback_method": null,
"callback_url": null
}
},
"meta": {
"api_version": "2022-05-10"
}
}
Other Responses
Code |
Success |
Description |
---|---|---|
404 |
No |
|
401 |
No |