v1
latestOpenAPI 3.0.02026-08-0696238481.7 KBPayments
Refund a payment
Use this endpoint to refund an already captured payment session. Unlike voids, which are typically completed in minutes, refunds can take several days to be cleared by the card schemes.
post/payment-sessions/{paymentSessionId}/refunds
Path parameters
paymentSessionIdstring required
Payment Id to refund
Headers
Accountstring
Example:ac_3fe8398f-8cdb-43a3-9be2-806c4f84c327
The linked accountId (use this when operating on payments related to a linked account)
Request body
Example request
{
"amount": 500,
"reason": "Requested by the customer",
"splits": {
"items": [
{
"id": "sp_01FCTS1XMKH9FF43CAFA4CXT3P",
"amount": 50,
"fee": {
"amount": 5
}
}
]
},
"captureTransaction": {
"id": "txn_01FCTS1XMKH9FF43CAFA4CXT3P_01FCTS1XMKH9FF43CAFA4CXT3P"
}
}Response
Refund request successfully accepted (Pending / Succeeded / Failed). If the status is Pending then the transaction will be completed asynchronously. Listen to the PaymentSession.refunded event on your webhook to be notified of the outcome.
Example response
{
"id": "txn_01FCTS1XMKH9FF43CAFA4CXT3P_01FCTS1XMKH9FF43CAFA4CXT3P",
"paymentSessionId": "ps_01FCTS1XMKH9FF43CAFA4CXT3P",
"amount": 250,
"currency": "GBP",
"type": "Capture",
"status": "Succeeded",
"refundedAmount": 50,
"platformFee": 50,
"platformFeeRefundedAmount": 50,
"processingFee": 7,
"reason": "Requested by the customer",
"captureType": "Final",
"paymentMethod": {
"type": "Card",
"tokenizedDetails": {
"id": "pmt_01G0EYVFR02KBBVE2YWQ8AKMGJ",
"stored": true
},
"card": {
"scheme": "Mastercard",
"last4": "4242",
"binDetails": {
"issuer": "Ryft Bank Ltd",
"issuerCountry": "GB",
"fundingType": "Debit",
"productType": "Consumer"
}
},
"wallet": {
"type": "ApplePay"
},
"billingAddress": {
"firstName": "Nathan",
"lastName": "Jones",
"lineOne": "123 Test Street",
"lineTwo": "456 Lane",
"city": "Manchester",
"country": "GB",
"postalCode": "SP4 7DE",
"region": "NY"
},
"checks": {
"avsResponseCode": "Y",
"cvvResponseCode": "M"
}
},
"splitPaymentDetail": {
"items": [
{
"id": "sp_01FCTS1XMKH9FF43CAFA4CXT3P",
"accountId": "ac_b83f2653-06d7-44a9-a548-5825e8186004",
"amount": 50,
"fee": {
"amount": 50
},
"description": "2 x The Selfish Gene",
"metadata": {
"productId": "123",
"productDescription": "The Selfish Gene"
}
}
]
},
"processingDetail": {
"issuerResponseCode": "00",
"authorizationCode": "123456",
"acquirerReferenceNumber": "12093810928309123"
},
"inPersonDetail": {
"terminalDetail": {
"id": "tml_01FCTS1XMKH9FF43CAFA4CXT3P"
}
},
"createdTimestamp": 1470989538,
"lastUpdatedTimestamp": 1470989538
}