Order-Email-Domain
Contents |
Order a new email domain
This example provides the steps to order a new email domain through the Hostway Ordering API.
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/0000013ad6dd95746a399f90000a71384bf242cf Set-Cookie : OwnerId=b0d6352a-f66a-476d-8e1d-2f3f9dea5c49; Path=/ { "orderId": "0000013ad6dd95746a399f90000a71384bf242cf", "links": [ {"href": "https://api.hostway.com/orders/", "rel": "self"}, {"href": "https://api.hostway.com/orders/0000013ad6dd95746a399f90000a71384bf242cf", "rel": "item"} ] }
Create a new account for the order
Use PUT /orders/{order_id}/account to create an account or add an existing one to the order.
Request
PUT /orders/0000013ad6dd95746a399f90000a71384bf242cf/account Content-Type: application/json; charset=UTF-8 Cookie: OwnerId=b0d6352a-f66a-476d-8e1d-2f3f9dea5c49; Path=/ { "currency": "USD", "language": "en-US" }
Response
204 No Content
Add the email domain product
The email domain product specification offerings can be determined using the Hostway Product Catalog API. Then add a new email domain product to the order by using POST /orders/{order_id}/account/products.
Request
POST /orders/0000013ad6dd95746a399f90000a71384bf242cf/account/products Content-Type: application/json; charset=UTF-8 Cookie: OwnerId=b0d6352a-f66a-476d-8e1d-2f3f9dea5c49; Path=/ { "offering": "https://api.hostway.com/productSpecifications/core.plan.email.business/offerings/USD-12" }
Response
201 Created Content-Type: application/json; charset=UTF-8 Location : https://api.hostway.com/orders/0000013ad6dd95746a399f90000a71384bf242cf/account/products/0000013fd6dd95726c399e90000a71384bf242cf
Add the email service to the new product
The email service specification offerings can be determined using the Hostway Product Catalog API for the core.plan.email.business product. Then add a new email service to the order by using POST /orders/{order_id}/account/products/{product_id}/services.
Request
POST /orders/0000013ad6dd95746a399f90000a71384bf242cf/account/products/0000013fd6dd95726c399e90000a71384bf242cf/services Content-Type: application/json; charset=UTF-8 Cookie: OwnerId=b0d6352a-f66a-476d-8e1d-2f3f9dea5c49; Path=/ { "name": "test-email-domain.com", "serviceSpecification": "https://api.hostway.com/serviceSpecifications/core.email.mfg2", "billingCycle": 1 }
Response
201 Created Content-Type: application/json; charset=UTF-8 Location : https://api.hostway.com/orders/0000013ad6dd95746a399f90000a71384bf242cf/account/products/0000013fd6dd95726c399e90000a71384bf242cf/services/0000013fe6dd95726c399e54500a71384bf242cf
Add service attributes
Use the PUT /orders/{order_id}/account/products/{product_id}/services/{service_id}/attributes call to add the domain name for the email service.
Request
POST /orders/0000013ad6dd95746a399f90000a71384bf242cf/account/products/0000013fd6dd95726c399e90000a71384bf242cf/services/0000013fe6dd95726c399e54500a71384bf242cf/attributes Content-Type: application/json; charset=UTF-8 Cookie: OwnerId=b0d6352a-f66a-476d-8e1d-2f3f9dea5c49; Path=/ { "domain": "test-email-domain.com" }
Response
204 No content
Submit the order
Use POST /orders/{order_id}/action to submit the order and invoke the email domain provisioning.
Request
POST /orders/0000013ad6dd95746a399f90000a71384bf242cf/action Content-Type: application/json; charset=UTF-8 { "action": "submit" }
Response
202 Accepted
See also