Order-Exchange
From Hostway API Documentation
(Difference between revisions)
Mike.robski (Talk | contribs) |
Mike.robski (Talk | contribs) m (1 revision: Release 97) |
Latest revision as of 12:48, 20 August 2014
Contents |
Order a new Exchange domain
This example provides the steps for ordering a new Exchange domain
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/00000143d407b34742ee26ae007f000000010001
Set-Cookie : OwnerId=09185e9b-2ea0-4bef-950e-fc9f8b89861f; Path=/
{
"orderId": "00000143d407b34742ee26ae007f000000010001",
"links": [
{"href": "https://api.hostway.com/orders/", "rel": "self"},
{"href": "https://api.hostway.com/orders/00000143d407b34742ee26ae007f000000010001", "rel": "item"}
]
}
Create a new acout for the order
Use PUT /orders/{order_id}/account to create an account or add an existing one to the order.
Request
PUT /orders/00000143d407b34742ee26ae007f000000010001/account
Content-Type: application/json; charset=UTF-8
Cookie: OwnerId=09185e9b-2ea0-4bef-950e-fc9f8b89861f; Path=/
{
"currency": "USD",
"language": "en-US"
}
Response
204 No Content
Add an Exchange product to the order
The Exchange product specification offerings can be determined using the Hostway Product Catalog API. Then add a new websplanet product to the order by using POST /orders/{order_id}/account/products.
Request
POST /orders/00000143d407b34742ee26ae007f000000010001/account/products
Content-Type: application/json; charset=UTF-8
Cookie: OwnerId=09185e9b-2ea0-4bef-950e-fc9f8b89861f; Path=/
{
"offering": "https://api.hostway.com/productSpecifications/core.plan.email.exchange2010/offerings/USD-1"
}
Response
201 Created Content-Type: application/json; charset=UTF-8 Location : https://api.hostway.com/orders/00000143d407b34742ee26ae007f000000010001/account/products/00000143d407b725d9eb9a41007f000000010001
Add an Exchange service to the new product
Request
POST /orders/00000143d407b34742ee26ae007f000000010001/account/products/00000143d407b725d9eb9a41007f000000010001/services
Content-Type: application/json; charset=UTF-8
Cookie: OwnerId=09185e9b-2ea0-4bef-950e-fc9f8b89861f; Path=/
{"name": "myexchangedomain.com",
"serviceSpecification": "https://api.hostway.com/serviceSpecifications/core.email.exchange2010",
"billingCycle": 1,
"attributes": {
"domain": "myexchangedomain.com"
}
}
Response
201 Created Content-Type: application/json; charset=UTF-8 Location : https://api.hostway.com/orders/00000143d407b34742ee26ae007f000000010001/account/products/00000143d407b725d9eb9a41007f000000010001/services/00000143d407b34742ed9lker8007f000000010001
Obtain a quote
Request
GET /orders/00000143d407b34742ee26ae007f000000010001/quote Cookie: OwnerId=09185e9b-2ea0-4bef-950e-fc9f8b89861f; Path=/
Response
200 OK
Content-Type: application/json; charset=UTF-8
{
"quote" : {
"Hash" : "b6a714a2ba76b6f15df9e46964df21ca726594a0",
"Currency" : "USD",
"Total" : "0.00",
"SubTotal" : "0.00",
"OneTimeFeeAmount" : "0",
"TaxTotal" : "0"
},
"links" : {
"self" : {
"href" : "http://coreapi01.ote.chicago.hostway:8092/orders/00000143d407b34742ee26ae007f000000010001/quote/",
"rel" : "self"
}
}
}
Submit the order
Request
POST /orders/00000143d407b34742ee26ae007f000000010001/action
Content-Type: application/json; charset=UTF-8
Cookie: OwnerId=09185e9b-2ea0-4bef-950e-fc9f8b89861f; Path=/
{"action": "submit"}
Response
202 Accepted no-body
Check for status
Request
GET /orders/00000143d407b34742ee26ae007f000000010001 Cookie: OwnerId=09185e9b-2ea0-4bef-950e-fc9f8b89861f; Path=/ Authorization: Basic cXdlQHBhcnRuZXJfYXBpX2RldmVsb3Blcl91c19tYWluOml1MzR0OGhm <- credentials that have access to the account
Response
200 OK
{
"order" : {
"Status" : "Processing", <- "Completed" means that everything has provisioned successfully
"Account" : "http://coreapi01.ote.chicago.hostway:8092/accounts/acct999999"
},
"links" : [ {
"href" : "http://coreapi01.ote.chicago.hostway:8092/orders/00000143d407b34742ee26ae007f000000010001/",
"rel" : "self"
} ]
}
See also