Skip to main content

Refund

View as Markdown

An authorization reserves an amount on the buyer's payment instrument, temporarily reducing its available balance. The authorized amount can either be captured, which starts the process that leads to the merchant being credited, or released through a cancellation and made available to the buyer again, according to the timings of the Issuer or of the payment method provider.

Unlike a cancel, which releases an amount that has been authorized but not yet captured, a refund lets you request the full or partial reversal of an amount that has already been captured. The refund starts the process that debits the requested amount to the merchant and returns it to the buyer, according to the timings of the Issuer or of the payment method provider. The refund currency is the same as that of the original transaction.

More details on the state and events of a transaction are available on the Transaction state page.

Payload​

POST payment/refund​

Capture payload > POST payment/capture.

Request

POST /api/v1/payment/refund
Host (sandbox): sandbox.gestpay.net
Host (production): ecomms2s.sella.it
Authorization: apikey ****************
{
"shopLogin":"GESPAY12345",
"amount":"0.01",
"currency":"EUR",
"bankTransactionID":"",
"shopTransactionID":"",
"settlementID":"",
"paymentID":"1234567891234"
}

Response

{
"error": {
"code": "0",
"description": "request correctly processed"
},
"payload": {
"transactionType": "refund",
"transactionResult": "OK",
"shopTransactionID": "OrderID001",
"bankTransactionID": "123",
"paymentID": "1234567891234"
}
}

POST Refund payload with settlementID​

Capture payload with settlementID > POST payment/capture with settlementID.

Request

POST /api/v1/payment/refund
Host (sandbox): sandbox.gestpay.net
Host (production): ecomms2s.sella.it
Authorization: apikey ****************
Content-Type: application/json
{
"shopLogin":"GESPAY12345",
"amount":"18.50",
"currency":"EUR",
"paymentID":"1234567891234",
"settlementID":"Capture_02"
}

Response

{
"error": {
"code": "0",
"description": "request correctly processed"
},
"payload": {
"transactionType": "refund",
"transactionResult": "OK",
"shopTransactionID": "OrderID001",
"bankTransactionID": "123",
"paymentID": "1234567891234"
}
}

Error scenarios​

Error code 2018​

  • If you request to refund more than the captured amount.
  • If you request a refund using a settlementID that is not among those used in the captures of the transaction.
  • If you request to refund a transaction that has already been cancelled. More details on the cancel page.

you get the following:

Response

{
"error": {
"code": "2018",
"description": "Transazione non stornabile"
},
"payload": {}
}

Error code 2011​

  • If you request to refund a transaction that does not exist, you get the following:

Response

{
"error": {
"code": "2011",
"description": "Transaction not found"
},
"payload": {}
}

Error code 1144​

  • If you request to refund a transaction without specifying the transaction identifier (paymentID), you get the following:

Response

{
"error": {
"code": "1144",
"description": "Campo obbligatorio non valorizzato"
},
"payload": {}
}

Support​

Fabrick