Orders-orderId-account-products-productId-services:POST
From Hostway API Documentation
Revision as of 00:49, 16 February 2013 by Mike.robski (Talk | contribs)
POST /orders/{orderId}/account/products/{productId}/services
Adds a new service to a product in the order.
Contents |
Request
POST /orders/{orderId}/account/products/{productId}/services
Request Parameters
- orderId - string
- The unique order Id. The URI of the order is returned by the POST /orders call.
- productId - string
- UUID specifying the product
URI Parameters
None.
Request Headers
- Content-Type
- Required. Set this header to
application/json; charset=UTF-8
- Cookie
- A cookie named OwnerId to identify the client (for most browser clients, the browser will do this automatically, depending on the browser configuration). The value of the cookie would come from the response to the create order request in the Set-Cookie response header.
Request Body
{ "name": "john.smith1", "relatedTo": [ "https://api.hostway.com/orders/{orderId}/account/products/{productId}/services/{serviceId}" ], "serviceSpecification": "https://api.hostway.com/serviceSpecifications/{serviceSpecificationId}", "billingCycle": 1 }
Parameters
- name - string
- The name of the new service
- relatedTo - list
- (OPTIONAL)
- A list containing other services related in some way to the newly created service. The relatedTo may be omitted, but relationships between some types of services have to be established for the order to be validated or submitted.
- serviceSpecification - string
- Link to the product catalog specification describing the new service
- billingCycle - integer
- Billing cycle (length of billing period in months) of the service. Allowed values are from 1 to 120
Response
Status Code
- 201 Created
- The product was successfully added to the order.
- 400 Bad Request
- The request body contains invalid JSON or the values do not adhere to the restrictions set for them.
- 401 Unauthorized
- The OwnerId cookie was not specified or is incorrect.
- 403 Forbidden
- The client does not have permissions to add services.
- 404 Not Found
- An account has not been added to the given order or the order does not exist.
Response Headers
- Location
- Returned with successful response. Contains the URI of the newly added service.
Response Body
None.
See also