XM

Retrieve Payment

Path:

GET https://{baseurl}/api-payment/payment/{cartId}

Enables you to retrieve payment details, by cart ID. Query parameters such as offset and limit can be specified to narrow down the results. When no payment intent is associated with the cart, the response includes a blank array of payments.

Headers

Content-Type : application/json

x-site-context : { "date": "2020-08-28T02:35:27.787Z", "channel": 12, "account": 5f493c9f30ec2a0007a94fc8", "stage": "sandbox" }

Parameters

Type : path

Name : The 24 character cart ID (from the Add Items to Cart or Retrieve Cart by userAuthToken API)

Required: true

Type : query

Name: The offset and limit values to retrieve order details in a paginated response. When no value is specified, the default value used are 0 and 10, respectively.

Required: true

Sample Request

GET https://{baseurl}/api-payment/payment/60b90dd7308ded0008ee3c5d?offset=1&limit=1

Response

Response Code: 200

Message: OK

Description: You'll see this message when the cart details are successfully retrieved.

{
"query": {
"limit": 3,
"offset": 1,
"count": 3
},
"payments": [
{
"_id": "60b931403de01200093818cd",
"paymentDetails": {
"transactionDetails": {
"paymentType": "CARD_STRIPE",
"paymentToken": "pi_1IyMTI2YBvYaVyBQS18E6wWG"
},
"paymentStatus": {
"cardHolderFullName": "First Last",
"paymentMethod": "visa",
"last4": "4242",
"amountCapturable": 119900,
"status": "cancelled"
},
"amount": 0,
"currency": "USD"
},
"billToAddress": {
"name": {
"first": "John",
"last": "Smith"
},
"phone": {
"number": "07780811973",
"kind": "mobile"
},
"email": "[email protected]",
"street1": "600 Congress Ave",
"street2": "suite 219",
"city": "Austin",
"state": "Tx",
"country": "US",
"zipCode": "10033"
},
"isValid": false,
"cartId": "60b90dd7308ded0008ee3c5d",
"createdAt": "2021-06-03T19:45:04.070Z",
"updatedAt": "2021-06-03T19:48:35.151Z",
"__v": 0
},
{
"_id": "60b92ff03de01200093818cc",
"paymentDetails": {
"transactionDetails": {
"paymentType": "CARD_STRIPE",
"paymentToken": "pi_1IyMNg2YBvYaVyBQZ3tXWJ4R"
},
"paymentStatus": {
"cardHolderFullName": "First Last",
"paymentMethod": "visa",
"last4": "4242",
"amountCapturable": 1199,
"status": "succeeded"
},
"amount": 11.99,
"currency": "USD"
},
"billToAddress": {
"name": {
"first": "John",
"last": "Smith"
},
"phone": {
"number": "07780811973",
"kind": "mobile"
},
"email": "[email protected]",
"street1": "600 Congress Ave",
"street2": "suite 219",
"city": "Austin",
"state": "Tx",
"country": "US",
"zipCode": "10033"
},
"isValid": true,
"cartId": "60b90dd7308ded0008ee3c5d",
"createdAt": "2021-06-03T19:39:28.680Z",
"updatedAt": "2021-06-03T19:39:28.680Z",
"__v": 0
}
]
}

Error Code: 404

Message: Not found

Description: You will see this error when the specified cart ID doesn't exist in the system.

{
"code": "CART_NOT_FOUND",
"message": "Cart not found."
}

Error Code: 500

Message: Internal Server Error

Description: You will see this error when the account number is incorrect in the x-site-context (for a multi-tenent client).

Change Log

  • June - 2021 First updated