Orders-orderId-action:POST
From Hostway API Documentation
Revision as of 11:48, 20 August 2014 by Mike.robski (Talk | contribs)
POST /orders/{orderId}/action
Performs an action like validating or submitting an order.
Contents |
Request
POST /orders/{orderId}/action
Parameters
- orderId - string
- The unique order Id. The URI of the order is returned by the POST /orders call.
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
{ "action": "{action}", "actionData": {actionData} "quoteHash": {quoteId} }
Parameters
- action - string
- The action that should be performed. Allowed values are:
- validate - checks the integrity of the order.
- submit - submits the order for processing.
- actionData - dictionary
- Optional. Reserved for data specific for the requested action.
- quoteHash - string
- Optional. Specifies the Id of the previously obtained quote to be used with the action.
Response
Status Code
- 200 OK
- The requested action was successfully completed.
- 202 Accepted
- The requested action was initiated successfully. Check the status of the order for future updates.
- 400 Bad Request
- Invalid action requested or the order is invalid. The response body contains details.
- 401 Unauthorized
- No owner Id specified or the specified owner is not authorized to perform actions on this order.
- 403 Forbidden
- The requested action is forbidden.
- 404 Not Found
- The specified order does not exist.
- 409 Conflict
A conflict has occurred preventing the order to processed. There are different conflict situations for different products/services
- Domain-dependent services
- One of the domains to be ordered is already owned by another account or is blacklisted.
- Email domain alias service
- A domain alias would produce impossible to delivery loops namely:
- - There is an email forwarder from the target domain name to a mailbox of the domain alias with the same username, OR
- - There is an email forwarder from the domain alias to a mailbox of the target domain name with the same username
Response Body
Depends on the result.
Error Response
{
"{errorType}": { "message": "{errorMessage}", "code": {errorCode}, "details": "{errorDetails}" }
}
Examples
Submit an order
Request
POST /orders/0000013ca61880fbfc068b33000a02c9d8ef861c/action Content-Type:application/json; Charset=UTF-8 Cookie: OwnerId=948ce0d4-7cf0-43b6-88a5-2b3f1331b689; Path=/ { "action": "submit" }
Response
202 Accepted
Validate an order
Request
POST /orders/0000013ca61880fbfc068b33000a02c9d8ef861c/action Content-Type:application/json; Charset=UTF-8 Cookie: OwnerId=948ce0d4-7cf0-43b6-88a5-2b3f1331b689; Path=/ { "action": "validate" }
Response
204 No Body
Submit an order with invalid quote
Request
POST /orders/0000013ca61880fbfc068b33000a02c9d8ef861c/action Content-Type:application/json; Charset=UTF-8 Cookie: OwnerId=948ce0d4-7cf0-43b6-88a5-2b3f1331b689; Path=/ { "action" : "submit", "quoteHash" : "invalid_quote_id" }
Response
400 Bad Request { "computeFault": { "message": "Account has not been set", "code": 400, "details": "" } }
OPTIONS /orders/{orderId}/action
In addition to the POST method the API supports the OPTIONS method for direct browser access to the API. The format of the request is:
OPTIONS /orders/{orderId}/action
Parameters
- orderId - string
- The unique order Id. The full URI of each order is returned by the POST /orders call.
Request Headers
- 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.
Response Status Code
- 200 OK
- Success
- 404 Not Found
- The specified order does not exist.
Response Headers
- Access-Control-Allow-Methods
- A comma-separated list of request methods supported on this URI.
- Access-Control-Allow-Origin
- All origins are allowed. This header has value *.
See also