Orders-orderId-account:GET

(Difference between revisions)
Jump to: navigation, search
m (1 revision: Release 98)

Revision as of 07:51, 15 September 2014

GET /orders/{orderId}/account

Get details of an Account in a given Order. It must be added to an order before details can be retrieved.

Contents


Request

GET /orders/{orderId}/account

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

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

Status Code Error Message Description
204 No Content - The operation was successfully completed.
401 Unauthorized - No owner Id specified or the specified owner is not authorized to perform add account for this order.
404 Not Found Resource not found An account has not been added to the given order.
The order does not exist.

Response Body

{
  "status": "{status}",
  "paymentInfo": "https://api.hostway.com/orders/{orderId}/account/paymentInfo/",
  "links": [
    {"href": "https://api.hostway.com/orders/{orderId}/account/", "rel": "self"}
  ]
  "language": "{language}",
  "number": "{accountId}"
  "currency": "{currency}",
  "products": "https://api.hostway.com/orders/{orderId}/account/products/",
  "user": "https://api.hostway.com/orders/{orderId}/account/user/",
  "attributes": "https://api.hostway.com/orders/{orderId}/account/attributes/",
  "contactInfo": "https://api.hostway.com/orders/{orderId}/account/contactInfo/",
}
 

Parameters

currency - string
An ISO-4217[1] currency code assigned to the account.
language - string
An IETF[2] language tag (ex. en, en-CA, en-US, etc.) specifying account's language.
number - string
The account's Id.
status - string
The account's current status. Accounts that have not been provisioned will have a status of "new".
attributes - string
A link to the account's attributes.
contactInfo - string
A link to the account's contact info.
paymentInfo - string
A link to the account's payment information.
user - string
A link to the account's user.
products - string
A link to the account's products.
links - list
Hypermedia for this resource.


Example

Wrong authorization

Request

GET /orders/{orderId}/account
Cookie: OwnerId={wrong_owner_id}; Path=/

Response

401 Unauthorized
Content-Type : text/plain; charset=UTF-8

401 Unauthorized

This server could not verify that you are authorized to access the document you requested.
Either you supplied the wrong credentials (e.g., bad password),
or your browser does not understand how to supply the credentials required.

Account has not been set

Request

GET /orders/{orderId}/account
Cookie: OwnerId={owner_id}; Path=/

Response

404 Not Found
Content-Type : application/json; charset=UTF-8

{
  "itemNotFound": {
    "guid": "9c2bf07d-4e74-4434-9d3e-77d57408d839",
    "message": "Resource not found",
    "code": 404,
    "details": ""
  }
}

Order does not exist

Request

GET /orders/{non-existent_orderId}/account
Cookie: OwnerId={owner_id}; Path=/

Response

404 Not Found
Content-Type : application/json; charset=UTF-8

{
  "itemNotFound": {
    "guid": "402282af-9f53-4973-8437-469087465843",
    "message": "Resource not found",
    "code": 404,
    "details": ""
  }
}


See also


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox