Create DID order
POST https://{{host}}/v3/orders
Request Body Scheme
{data (object, required)
{type (string, required): orders
attributes (object, required)
{allowbackordering (boolean, optional)
Allowing back ordering.callback_url (string, optional)
The HTTP or HTTPS endpoint to where events related to order will be delivered.
See Callback details for information about callback_url.callback_method (string, optional)
The HTTP Method used for order events. POST, GET are supported methods.
See Callback details for information about callback_method.items (Array[CreateOrderItem], required)
[
Order items array.
{type (string): didorderitems
attributes (object)
{sku_id (string, required)
Stock Keeping Unit Object ID. Should be used with one of optional parametersqty,available_did_idordid_reservation_id.qty (integer, required)
Quantity if ordering items. Should NOT be used with optional parametersavailable_did_idordid_reservation_id.billingcyclescount (integer, optional)
The number of Billing Cycles that this DID Number will renew until expiration.
nullvalue means that DID will be renewed infinitely.0value means that DID will not be renewed.2value means that DID will be renewed only twice. After each renew value will be decreased by 1 if it is set. Value can be set from0to999.
By default value isnull.didreservationid (string, optional)
Specific DID Reservation Object ID.availabledidid (string, optional)
Specific Available DID Object ID.proratedaysqty (integer, optional)
Amount of service time (days).nanpaprefixid (string, optional)
The ID of NPA NXX Group.
}
}
]
}
}
}Attention
Please note that
prorate_days_qtyattribute will be ignored if Prorate billing is not enabled per your DIDWW account. To enabled this billing option please contact Sales department via email sales@didww.com
Request Body Example:
Allowing back ordering
{
"data": {
"type": "orders",
"attributes": {
"allow_back_ordering": true,
"items": [
{
"type": "did_order_items",
"attributes": {
"qty": 15,
"sku_id": "a78bb6d8-b05e-4e12-afe6-ad84ac979088"
}
}
]
}
}
}
{
"data": {
"type": "orders",
"attributes": {
"allow_back_ordering": true,
"items": [
{
"type": "did_order_items",
"attributes": {
"qty": 15,
"sku_id": "b6d9d793-578d-42d3-bc33-73dd8155e615"
}
}
]
}
}
}
Specific Available DID
{
"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"
}
}
]
}
}
}
Specific DID Reservation
{
"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"
}
}
]
}
}
}
Request Body
{"data"=>{"type"=>"orders", "attributes"=>{"allow_back_ordering"=>false, "items"=>[{"type"=>"did_order_items", "attributes"=>{"nanpa_prefix_id"=>"{{nanpa_prefix.id}}", "sku_id"=>"{{stock_keeping_unit.id}}"}}]}}}
HEADERS
| Key | Datatype | Required | Description |
|---|---|---|---|
Accept | string | ||
Content-Type | string | ||
Api-Key | string |
RESPONSES
status: Created
{"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":"2022-05-10"}}