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 11:48, 20 August 2014
Contents |
[edit] Order a new Exchange domain
This example provides the steps for ordering a new Exchange domain
[edit] Create a new order
Use POST /orders to create a new order
[edit] Request
POST /orders Content-Type: application/json; charset=UTF-8 {}
[edit] 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"} ] }
[edit] 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.
[edit] 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" }
[edit] Response
204 No Content
[edit] 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.
[edit] 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" }
[edit] Response
201 Created Content-Type: application/json; charset=UTF-8 Location : https://api.hostway.com/orders/00000143d407b34742ee26ae007f000000010001/account/products/00000143d407b725d9eb9a41007f000000010001
[edit] Add an Exchange service to the new product
[edit] 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" } }
[edit] Response
201 Created Content-Type: application/json; charset=UTF-8 Location : https://api.hostway.com/orders/00000143d407b34742ee26ae007f000000010001/account/products/00000143d407b725d9eb9a41007f000000010001/services/00000143d407b34742ed9lker8007f000000010001
[edit] Obtain a quote
[edit] Request
GET /orders/00000143d407b34742ee26ae007f000000010001/quote Cookie: OwnerId=09185e9b-2ea0-4bef-950e-fc9f8b89861f; Path=/
[edit] 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" } } }
[edit] Submit the order
[edit] Request
POST /orders/00000143d407b34742ee26ae007f000000010001/action Content-Type: application/json; charset=UTF-8 Cookie: OwnerId=09185e9b-2ea0-4bef-950e-fc9f8b89861f; Path=/ {"action": "submit"}
[edit] Response
202 Accepted no-body
[edit] Check for status
[edit] Request
GET /orders/00000143d407b34742ee26ae007f000000010001 Cookie: OwnerId=09185e9b-2ea0-4bef-950e-fc9f8b89861f; Path=/ Authorization: Basic cXdlQHBhcnRuZXJfYXBpX2RldmVsb3Blcl91c19tYWluOml1MzR0OGhm <- credentials that have access to the account
[edit] 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