Orders-orderId-account-paymentInfo:GET
From Hostway API Documentation
Revision as of 12:12, 24 July 2015 by Mike.robski (Talk | contribs)
GET /orders/{orderId}/account/paymentInfo
Get the payment method information for a given order. Only a minimum amount of information will be returned to recognize the payment method.
Contents |
Request
GET /orders/{orderId}/account/paymentInfo
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 |
---|---|---|
200 OK | - | The operation was successfully completed. |
401 Unauthorized | - | No owner Id specified or the specified owner is not authorized to get payment info for this order. |
403 Forbidden | Unauthorized: PaymentInfo failed permission check | An unauthorized user cannot set or get payment info. |
404 Not Found | Resource not found | The specified order does not exist. |
- | An account was not set for the order. | |
No payment info for the order was found. | ||
502 Bad Gateway | - | Unexpected backend error |
Response Body
The following is the response body for credit cards.
{ "paymentInfoType": "credit_card", "accountNumber": "************1111", "creditCardType": "visa", "expirationDate": "2012-08", "links": [ {"href": "https://api.hostway.com/orders/{order_id}/account/paymentInfo/", "rel": "self"} ] }
The following is the response for Verizon payment information.
{ "paymentInfoType": "vz_payment", "paymentReference": "123432429034", "sessionId": "23432434244", "links": [ {"href": "https://api.hostway.com/orders/{order_id}/account/paymentInfo/", "rel": "self"} ] }
The following is the response for offline payment information.
{ "paymentInfoType": "offline", "links": [ {"href": "https://api.hostway.com/orders/{order_id}/account/paymentInfo/", "rel": "self"} ] }
Parameters
- paymentInfoType - string
- The type of payment method. Possible value(s) are:
- credit_card
- vz_payment
- offline
- accountNumber - string
- The credit card number. Only the last four digits will be revealed. Only applies for credit cards.
- creditCardType - string
- The type of credit card such as visa, mastercard, discover, etc. Only applies for credit cards.
- expirationDate - string
- The credit card expiration date in YYYY-MM format. Only applies for credit cards.
- paymentReference - string
- Verizon payment reference id. Only applies for Verizon payment type.
- sessionId - string
- Verizon payment session id. Only applies for Verizon payment type.
- links - list
- Hypermedia for this resource. Links to self.
Example
Success
Request
GET /orders/{orderId}/account/paymentInfo Cookie: OwnerId={owner_id}; Path=/
Response
200 OK Content-Type : application/json; charset=UTF-8 { "links": [{ "href": "https://api.hostway.com/orders/00000148546ce1ac1d12585e007f000000010001/account/paymentinfo/", "rel": "self" }], "creditCardType": "visa", "expirationDate": "2015-06", "paymentInfoType": "credit_card", "accountNumber": "************1111" }
No authorization
Request
GET /orders/{orderId}/account/paymentInfo 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.
Unauthorized user
Request
GET /orders/{orderId}/account/paymentInfo Authorization: Basic {wrong_user_authorization}
Response
403 Forbidden Content-Type : application/json; charset=UTF-8 { "forbidden": { "guid": "5a199170-843a-44fc-bbb0-87155eb15fc6", "message": "Unauthorized: PaymentInfo failed permission check", "code": 403, "details": "" } }
Order does not exist
Request
GET /orders/{non-existent_orderId}/account/paymentInfo Cookie: OwnerId={owner_id}; Path=/
Response
404 Not found Content-Type : application/json; charset=UTF-8 { "itemNotFound": { "guid": "cca219c5-3e2b-481d-8e7f-7083064872ff", "message": "Resource not found", "code": 404, "details": "" } }
Account has not been set
Request
GET /orders/{orderId}/account/paymentInfo Cookie: OwnerId={owner_id}; Path=/
Response
404 Not found Content-Type : application/json; charset=UTF-8 { "itemNotFound": { "guid": "9ae11205-0650-471a-9ed7-7642107011dc", "message": "", "code": 404, "details": "" } }
Payment info has not been set
Request
GET /orders/{orderId}/account/paymentInfo Cookie: OwnerId={owner_id}; Path=/
Response
404 Not found Content-Type : application/json; charset=UTF-8 { "itemNotFound": { "guid": "9ae11205-0650-471a-9ed7-7642107011dc", "message": "", "code": 404, "details": "" } }
See also