Orders-orderId-account-products:POST

From Hostway API Documentation
Revision as of 18:06, 15 February 2013 by Mike.robski (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

POST /orders/{orderId}/account/products

Adds a new Product to the Account's Order.

If, at the time the product is created, there is not yet an Account in the order, then this call will implicitly add a very rudimentary Account (containing only a default language & the currency of this product).

If there is already an Account in the order at the time this call is made, the currency of the specified product offering *must* match the currency of the Account.

Contents


Request

POST /orders/{orderId}/account/products

Request 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

{
  "offering": "https://api.hostway.com/productSpecifications/{productSpecificationId}/offerings/{productOfferingId}"
}
 

Parameters

offering - string
Link to the product catalog offering specifying the new product.

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 products.
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 product.

Response Body

None.

See also


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox