Check payment details
Check the status, amounts, resources, and transactions related to a payment.
Overview
When you make a charge, authorize or payout call, the Unzer system creates a unique payment
resource. This resource contains all the information about the payment, giving you a good overview of its state.
Information included in the payment
resource:
- payment state
- payment amounts and currency
- details of all transactions linked to the payment
- additional resources linked to the payment:
customers
,baskets
,metadata
You can also check a payment’s details through the Unzer Insights platform.
Check payment details
To check payment details, make a GET call to the dedicated /payments
endpoint. In the request path, add either the payment ID (paymentId
) or the order ID (orderId
):
GET https://api.unzer.com/v1/payments/s-pay-1
// or:
GET https://api.unzer.com/v1/payments/merchant-order-1
{
"id": "s-pay-1",
"state": {
"id": 3,
"name": "partly"
},
"amount": {
"total": "100.0000",
"charged": "50.0000",
"canceled": "00.0000",
"remaining": "50.0000"
},
"currency": "EUR",
"orderId": "merchant-order-1",
"resources": {
"customerId": "",
"paymentId": "s-pay-1",
"basketId": "",
"metadataId": "",
"traceId": "bf4ce634575d479eaaac4e6ad436d95d",
"typeId": "s-crd-bltpvrcnqeq2"
},
"transactions": [
{
"date": "2018-09-24 18:01:02",
"type": "authorize",
"status": "success",
"url": "https://api.unzer.com/v1/payments/s-pay-1/authorize/s-aut-1",
"amount": "100.0000"
},
{
"date": "2018-09-24 18:01:12",
"type": "charge",
"status": "success",
"url": "https://api.unzer.com/v1/payments/s-pay-1/charges/s-chg-1",
"amount": "50.0000"
},
]
}
Parameter | Type | Description |
---|---|---|
id | string | The payment’s unique ID. |
state | Object | |
state.id | integer | The current payment status code. |
state.name | string | The current payment status name. |
amount | Object | |
amount.total | string | The maximum amount for this order. Initially, this is the amount that was authorized or charged. The total amount can only be reduced if an authorization was canceled. |
amount.charged | string | The amount transferred from the customer to you. |
amount.canceled | string | The amount refunded from you to the customer. |
amount.remaining | string | The difference between the total amount and the charged amount. |
currency | string | ISO currency code: For a list of possible codes, see Amounts and Currencies. |
orderId | string | A unique order ID that identifies the payment on your side. |
resources | Object | |
resources.customerId | string | The ID of the related customers resource. |
resources.paymentId | string | Id of the payment. |
resources.basketId | string | The ID of the related baskets resource. |
resources.metadataId | string | The ID of the related metadata resource. |
resources.traceId | string | The unique traceId of the transaction. Used for internal API purposes. |
resources.typeId | string | The payment type ID. |
transactions | Object | |
transactions.date | string | Transaction date and time. |
transactions.type | string | Transaction type:authorize , charge , cancel-authorize , cancel-charge |
transactions.status | string | Transaction status:success , pending , error |
transactions.url | string | Transaction resource URL. |
transactions.amount | string | Transaction amount. |
For a reference of the payment
resource, refer to the API reference guide.
To learn about possible payment states and payment state flow, see Payment states page.