Orders-orderId-account-paymentInfo:GET
From Hostway API Documentation
(Difference between revisions)
Mike.robski (Talk | contribs) m (1 revision) |
Mike.robski (Talk | contribs) m (1 revision: Release 109) |
||
(7 intermediate revisions by 4 users not shown) | |||
Line 18: | Line 18: | ||
=== Status Code === | === Status Code === | ||
− | + | {| class='wikitable' | |
− | + | |- | |
− | + | ! Status Code | |
− | + | ! Error Message | |
− | + | ! Description | |
+ | |- | ||
+ | | 200 OK | ||
+ | | align="center" | - | ||
+ | | The operation was successfully completed. | ||
+ | |- | ||
+ | | 401 Unauthorized | ||
+ | | align="center" | - | ||
+ | | 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. | ||
+ | |- | ||
+ | | rowspan="3" | 404 Not Found | ||
+ | | Resource not found | ||
+ | | The specified order does not exist. | ||
+ | |- | ||
+ | | rowspan="2" align="center" | - | ||
+ | | An account was not set for the order. | ||
+ | |- | ||
+ | | No payment info for the order was found. | ||
+ | |- | ||
+ | | 502 Bad Gateway | ||
+ | | align="center" | - | ||
+ | | Unexpected backend error | ||
+ | |} | ||
=== Response Body === | === Response Body === | ||
+ | The following is the response body for credit cards. | ||
<nowiki> | <nowiki> | ||
{ | { | ||
Line 31: | Line 58: | ||
"creditCardType": "visa", | "creditCardType": "visa", | ||
"expirationDate": "2012-08", | "expirationDate": "2012-08", | ||
+ | "links": [ | ||
+ | {"href": "</nowiki>{{APIBaseURL}}<nowiki>/orders/{order_id}/account/paymentInfo/", "rel": "self"} | ||
+ | ] | ||
+ | } | ||
+ | </nowiki> | ||
+ | |||
+ | The following is the response for Verizon payment information. | ||
+ | <nowiki> | ||
+ | { | ||
+ | "paymentInfoType": "vz_payment", | ||
+ | "paymentReference": "123432429034", | ||
+ | "sessionId": "23432434244", | ||
+ | "links": [ | ||
+ | {"href": "</nowiki>{{APIBaseURL}}<nowiki>/orders/{order_id}/account/paymentInfo/", "rel": "self"} | ||
+ | ] | ||
+ | } | ||
+ | </nowiki> | ||
+ | |||
+ | The following is the response for offline payment information. | ||
+ | <nowiki> | ||
+ | { | ||
+ | "paymentInfoType": "offline", | ||
"links": [ | "links": [ | ||
{"href": "</nowiki>{{APIBaseURL}}<nowiki>/orders/{order_id}/account/paymentInfo/", "rel": "self"} | {"href": "</nowiki>{{APIBaseURL}}<nowiki>/orders/{order_id}/account/paymentInfo/", "rel": "self"} | ||
Line 41: | Line 90: | ||
: The type of payment method. Possible value(s) are: | : The type of payment method. Possible value(s) are: | ||
:: '''credit_card''' | :: '''credit_card''' | ||
+ | :: '''vz_payment''' | ||
+ | :: '''offline''' | ||
; accountNumber - ''string'' | ; accountNumber - ''string'' | ||
Line 50: | Line 101: | ||
; expirationDate - ''string'' | ; expirationDate - ''string'' | ||
: The credit card expiration date in YYYY-MM format. Only applies for credit cards. | : 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'' | ; links - ''list'' | ||
: [[Hypermedia]] for this resource. Links to self. | : [[Hypermedia]] for this resource. Links to self. | ||
+ | |||
+ | == Example == | ||
+ | === Success === | ||
+ | '''Request''' | ||
+ | <nowiki> | ||
+ | GET /orders/{orderId}/account/paymentInfo | ||
+ | Cookie: OwnerId={owner_id}; Path=/</nowiki> | ||
+ | |||
+ | '''Response''' | ||
+ | <nowiki> | ||
+ | 200 OK | ||
+ | Content-Type : application/json; charset=UTF-8 | ||
+ | |||
+ | { | ||
+ | "links": [{ | ||
+ | "href": "</nowiki>{{APIBaseURL}}<nowiki>/orders/00000148546ce1ac1d12585e007f000000010001/account/paymentinfo/", | ||
+ | "rel": "self" | ||
+ | }], | ||
+ | "creditCardType": "visa", | ||
+ | "expirationDate": "2015-06", | ||
+ | "paymentInfoType": "credit_card", | ||
+ | "accountNumber": "************1111" | ||
+ | }</nowiki> | ||
+ | |||
+ | === No authorization === | ||
+ | '''Request''' | ||
+ | <nowiki> | ||
+ | GET /orders/{orderId}/account/paymentInfo | ||
+ | Cookie: OwnerId={wrong_owner_id}; Path=/</nowiki> | ||
+ | |||
+ | '''Response''' | ||
+ | <nowiki> | ||
+ | 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.</nowiki> | ||
+ | |||
+ | === Unauthorized user === | ||
+ | '''Request''' | ||
+ | <nowiki> | ||
+ | GET /orders/{orderId}/account/paymentInfo | ||
+ | Authorization: Basic {wrong_user_authorization}</nowiki> | ||
+ | |||
+ | '''Response''' | ||
+ | <nowiki> | ||
+ | 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": "" | ||
+ | } | ||
+ | }</nowiki> | ||
+ | |||
+ | === Order does not exist === | ||
+ | '''Request''' | ||
+ | <nowiki> | ||
+ | GET /orders/{non-existent_orderId}/account/paymentInfo | ||
+ | Cookie: OwnerId={owner_id}; Path=/</nowiki> | ||
+ | |||
+ | '''Response''' | ||
+ | <nowiki> | ||
+ | 404 Not found | ||
+ | Content-Type : application/json; charset=UTF-8 | ||
+ | |||
+ | { | ||
+ | "itemNotFound": { | ||
+ | "guid": "cca219c5-3e2b-481d-8e7f-7083064872ff", | ||
+ | "message": "Resource not found", | ||
+ | "code": 404, | ||
+ | "details": "" | ||
+ | } | ||
+ | }</nowiki> | ||
+ | |||
+ | === Account has not been set === | ||
+ | '''Request''' | ||
+ | <nowiki> | ||
+ | GET /orders/{orderId}/account/paymentInfo | ||
+ | Cookie: OwnerId={owner_id}; Path=/</nowiki> | ||
+ | |||
+ | '''Response''' | ||
+ | <nowiki> | ||
+ | 404 Not found | ||
+ | Content-Type : application/json; charset=UTF-8 | ||
+ | |||
+ | { | ||
+ | "itemNotFound": { | ||
+ | "guid": "9ae11205-0650-471a-9ed7-7642107011dc", | ||
+ | "message": "", | ||
+ | "code": 404, | ||
+ | "details": "" | ||
+ | } | ||
+ | }</nowiki> | ||
+ | |||
+ | === Payment info has not been set === | ||
+ | '''Request''' | ||
+ | <nowiki> | ||
+ | GET /orders/{orderId}/account/paymentInfo | ||
+ | Cookie: OwnerId={owner_id}; Path=/</nowiki> | ||
+ | |||
+ | '''Response''' | ||
+ | <nowiki> | ||
+ | 404 Not found | ||
+ | Content-Type : application/json; charset=UTF-8 | ||
+ | |||
+ | { | ||
+ | "itemNotFound": { | ||
+ | "guid": "9ae11205-0650-471a-9ed7-7642107011dc", | ||
+ | "message": "", | ||
+ | "code": 404, | ||
+ | "details": "" | ||
+ | } | ||
+ | }</nowiki> | ||
== See also == | == See also == |
Latest revision as of 13:12, 24 July 2015
[edit] 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 |
[edit] Request
GET /orders/{orderId}/account/paymentInfo
[edit] Request Parameters
- orderId - string
- The unique order Id. The URI of the order is returned by the POST /orders call.
[edit] URI Parameters
None.
[edit] 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.
[edit] Response
[edit] 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 |
[edit] 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"} ] }
[edit] 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.
[edit] Example
[edit] 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" }
[edit] 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.
[edit] 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": "" } }
[edit] 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": "" } }
[edit] 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": "" } }
[edit] 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": "" } }
[edit] See also