You can get a list of refunds for a specific payment by using an action based on GET HTTP request. Please be aware that only a limited amount of details for each refund will be provided.
Definition: GET /v1/payments/{id}/refunds/
Where:
- {id} – GlobalPay Payment ID
Request:
GET https://paytest.smart2pay.com/v1/payments/3006286/refunds
Authorization: Basic MzAyMDE6KzlLZUd6S0Y3VzhTLzc5YTVSMzNZSlVnN0U3V0ZOY1piakdmekxWM2JYU25GQ095RnQ=
Response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"Refunds": [
{
"ID": 16410,
"Created": "20170803131840",
"MerchantTransactionID": "s2ptest_g104",
"OriginatorTransactionID": null,
"InitialPaymentID": 3006286,
"Amount": "20",
"Currency": "EUR",
"Description": null,
"TypeID": 5,
"SiteID": 30201,
"Details": null,
"Customer": null,
"BillingAddress": null,
"BankAddress": null,
"Articles": null,
"Status": {
"ID": 4,
"Info": "Failed",
"Reasons": null
},
"SplitID": 0
},
{
"ID": 16408,
"Created": "20170803131825",
"MerchantTransactionID": "s2ptest_g103",
"OriginatorTransactionID": null,
"InitialPaymentID": 3006286,
"Amount": "20",
"Currency": "EUR",
"Description": null,
"TypeID": 5,
"SiteID": 30201,
"Details": null,
"Customer": null,
"BillingAddress": null,
"BankAddress": null,
"Articles": null,
"Status": {
"ID": 1,
"Info": "Open",
"Reasons": null
},
"SplitID": 0
}
]
}
The same action can be used to get information on a specific refund for a card payment.
Request:
GET https://securetest.smart2pay.com/v1/payments/202247/refunds
Authorization: Basic MTAxMDpnYWJp
Response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"Refunds": [
{
"ID": 266,
"SiteID": 1010,
"Created": "20161205095522",
"MerchantTransactionID": "s2ptest_h22",
"OriginatorTransactionID": null,
"InitialPaymentID": 202247,
"Amount": "1000",
"Currency": "EUR",
"Description": "refund reason",
"StatementDescriptor": null,
"Customer": null,
"BillingAddress": null,
"BankAddress": null,
"Articles": null,
"Status": {
"ID": 4,
"Info": "Failed",
"Reasons": [
{
"Code": "2206",
"Info": "Refund.Amount exceeds initial payment available amount"
}
]
},
"SplitID": 0
},
{
"ID": 265,
"SiteID": 1010,
"Created": "20161205095515",
"MerchantTransactionID": "s2ptest_h21",
"OriginatorTransactionID": null,
"InitialPaymentID": 202247,
"Amount": "1000",
"Currency": "EUR",
"Description": "refund reason",
"StatementDescriptor": null,
"Customer": null,
"BillingAddress": null,
"BankAddress": null,
"Articles": null,
"Status": {
"ID": 2,
"Info": "Success",
"Reasons": []
},
"SplitID": 0
},
{
"ID": 264,
"SiteID": 1010,
"Created": "20161205095505",
"MerchantTransactionID": "s2ptest_h20",
"OriginatorTransactionID": null,
"InitialPaymentID": 202247,
"Amount": "1000",
"Currency": "EUR",
"Description": "refund reason",
"StatementDescriptor": null,
"Customer": null,
"BillingAddress": null,
"BankAddress": null,
"Articles": null,
"Status": {
"ID": 2,
"Info": "Success",
"Reasons": []
},
"SplitID": 0
}
]
}