Create Order
Description
Creates a DID Order.
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. |
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
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": 15,
"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": 15, "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"
}
}
]
}
},
"meta": {
"api_version": "2017-09-18"
}
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"
}
}
]
}
},
"meta": {
"api_version": "2017-09-18"
}
}
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"
}
}
]
}
},
"meta": {
"api_version": "2017-09-18"
}
}
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"
}
}
]
}
},
"meta": {
"api_version": "2017-09-18"
}
}
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"
}
}
]
}
},
"meta": {
"api_version": "2017-09-18"
}
}
Other Responses
Code |
Success |
Description |
---|---|---|
404 |
No |
|
401 |
No |