Skip to main content

Get payment information

You can query information about a single payment and multiple payments using the API.

Prerequisites

You need a project access token run these queries.

Multiple payments​

Get information about multiple payments using the API. This sample queries the project's Rejected payments.

  1. Call the payments query.
  2. Add all the information you'd like to review.
    • The sample query uses several payments query options, including filtering for only Rejected payments.
  3. Add optional messages to the success payload, either for validation or in case of rejection.
    • The sample query adds a more thorough Rejected payload.

Query​

🔎 Open the query in API Explorer

query RejectedPayments {
payments(filters: { status: Rejected }) {
edges {
node {
createdAt
id
statusInfo {
status
... on PaymentRejected {
__typename
reason
status
}
}
updatedAt
}
}
totalCount
}
}

Payload​

Review all Rejected payments for your project and the reason for rejection.

{
"data": {
"payments": {
"edges": [
{
"node": {
"createdAt": "2023-03-30T14:12:18.874Z",
"id": "$PAYMENT_ID",
"statusInfo": {
"status": "Rejected",
"__typename": "PaymentRejected",
"reason": "Expired"
},
"updatedAt": "2023-03-30T14:12:18.989Z"
}
},
{
"node": {
"createdAt": "2023-03-30T14:12:18.874Z",
"id": "$PAYMENT_ID",
"statusInfo": {
"status": "Rejected",
"__typename": "PaymentRejected",
"reason": "AccountNotFound"
},
"updatedAt": "2023-03-30T14:12:18.989Z"
}
},
],
"totalCount": 2
}
}
}

Single payment​

Get information about a single payment using the API.

  1. Call the payment query.
  2. Enter the payment ID for the payment you're querying.
  3. Add all the information you'd like to review. The sample query uses several payment query options.
  4. Add optional messages to the success payload, either for validation or in case of rejection.

Query​

🔎 Open the query in API Explorer

query PaymentInfo {
payment(id: "$YOUR_PAYMENT_ID") {
createdAt
id
statusInfo {
status
... on PaymentRejected {
__typename
reason
status
}
}
transactions {
totalCount
edges {
node {
amount {
currency
value
}
}
}
}
updatedAt
}
}

Payload​

View all the requested information about the single payment.

{
"data": {
"payment": {
"createdAt": "2023-05-03T12:34:05.227Z",
"id": "$PAYMENT_ID",
"statusInfo": {
"status": "Initiated"
},
"transactions": {
"totalCount": 1,
"edges": [
{
"node": {
"amount": {
"currency": "EUR",
"value": "250.00"
}
}
}
]
},
"updatedAt": "2023-05-03T12:34:05.227Z"
}
}
}