Order-Products-Account
From Hostway API Documentation
Revision as of 04:40, 3 April 2014 by Angel.dinev (Talk)
Contents |
Set account on a later step when ordering products and services
This example provides the steps to set order's account on a later step.
Create a new order
Use POST /orders to create a new order
Request
POST /orders
Content-Type: application/json; charset=UTF-8
{}
Response
201 Created
Content-Type: application/json; charset=UTF-8
Location : https://api.hostway.com/orders/000001452259ee0103d4e652007f000000010001
Set-Cookie : OwnerId=d0977ed2-86e7-4101-adfe-2675ba0e26ac; Path=/
{
"orderId": "000001452259ee0103d4e652007f000000010001",
"links": [
{"href": "https://api.hostway.com/orders/", "rel": "self"},
{"href": "https://api.hostway.com/orders/000001452259ee0103d4e652007f000000010001", "rel": "item"}
]
}
Add a product
Use POST /orders/{order_id}/account/products to add a product
Request
POST /orders/000001452259ee0103d4e652007f000000010001/account/products
Content-Type: application/json; charset=UTF-8
{
"offering": "https://api.hostway.com/productSpecifications/core.plangroup.dedserver.plan4/offerings/USD-1"
}
Response
201 Created
Content-Type: application/json; charset=UTF-8
Location : https://api.hostway.com/orders/000001452259ee0103d4e652007f000000010001/account/products/00000145225a87f17bd8d66d007f000000010001/
{
"url": "https://api.hostway.com/orders/000001452259ee0103d4e652007f000000010001/account/products/00000145225a87f17bd8d66d007f000000010001/"
}
Add a service to the product with no attributes
Use POST /orders/{order_id}/account/products/{productId}/services to add a product's service
Request
POST /orders/000001452259ee0103d4e652007f000000010001/account/products/00000145225a87f17bd8d66d007f000000010001/services
Content-Type: application/json; charset=UTF-8
{
"name": "test123.com",
"serviceSpecification": "https://api.hostway.com/serviceSpecifications/core.dedserver",
"billingCycle": 1
}
Response
201 Created
Content-Type: application/json; charset=UTF-8
Location : https://api.hostway.com/orders/000001452292557b24c2acc0007f000000010001/account/products/0000014522925d3222f0ce5b007f000000010001/services/0000014522926e5b266b61ad007f000000010001/
{
"url": "https://api.hostway.com/orders/000001452292557b24c2acc0007f000000010001/account/products/0000014522925d3222f0ce5b007f000000010001/services/0000014522926e5b266b61ad007f000000010001/"
}
Create a new account for the order
Use PUT /orders/{order_id}/account to add a new account to the order
Request
PUT /orders/000001452292557b24c2acc0007f000000010001/account
Content-Type: application/json; charset=UTF-8
{
"currency": "USD",
"language": "en-US"
}
Response
204 No Content
Set an existing account for the order
Use PUT /orders/{order_id}/account to assign an existing account to the order
Request
PUT /orders/000001452292557b24c2acc0007f000000010001/account
Content-Type: application/json; charset=UTF-8
{
"accountNumber": "test793347"
}
Response
204 No Content
Submit the order
Use POST /orders/{order_id}/action to submit the order and to invoke the ordered product provisioning.
Request
POST /orders/000001452292557b24c2acc0007f000000010001/action
Content-Type: application/json; charset=UTF-8
{
"action": "submit"
}
Response
202 Accepted
See also