Skip to main content

Refund Processing

note

Because a Refund is a reverse payment, the authorisation of this 'payment' is initiated by you. We refer below to the browser user, which is the merchant representative initiating this refund.

Refund Request

The request is completed by a POST to the above URL's with these headers:

HTTP Header
Field NameStateData TypeDescription
Content-TypeMandatoryStringapplication/json
AuthorizationMandatoryStringBearer access_token

And the refund payload as shown here:

Transaction Refund
Field NameStateData TypeDescription
idMandatoryStringId of the transaction that needs to be refunded.
amountOptionalDecimalValue of transaction to refund. This value cannot be higher than the original authorisation amount. If not supplied the full original transaction amount will be refunded.
bankIdMandatoryStringUnique identification string assigned to the bank by Ecospend’s system.
merchantCustomDataMandatoryStringAddress where the consumer is to be returned following a successful refund.

Refund Response

If successful, this method returns 200 OK response code and the below response fields.

Refund Response
Field NameData TypeDescription
accountIdStringUnique reference for the store processing the transaction, as passed in the request.
amountDecimalTotal amount of the order including decimal places where applicable. ‘Whole’ amounts (e.g. “1”) on a GBP
account represents £1.00.
bankUrlStringA unique and one time use only URL of the debtor's banking system. You will need to redirect a merchant to
this link in order the payment to proceed.
currencyStringCurrency of the transaction GBP
errorCodeIntegerProvides additional detail should an error have occurred with the transaction.
idStringUnique transaction ID. This ID should be stored as it is required for later transaction actions.
invoiceIdStringOrder/invoice/transaction/basket number generated by the host website, as passed in the request.
rrnStringUnique reference allocated by Ecospend.
statusStringEcospend payment status.
successBooleanConfirms whether the transaction has been successful.

Example Request and Response

{
"id": "9de52ca0-19ed-4467-8cdc-2c11a715d7da",
"amount": 9.99,
"bankId": "obie-coutts-sandbox",
"returnUrl": "https://test.com"
}

Final Steps including Redirection

Like the Sale request, several steps take place outside of your interaction with us. Unlike the Sale request however, this is a shorter process with reduced requirements.

  • You should redirect the browser user to the bankUrl returned in the Refund Response.
  • The browser user will then be redirected to the Bank, Ecospend and finally back to us, where we will display the payment outcome.

If you require a programmatic response, you should use our Transaction Management API to query the status of the transaction, which will provide a response as detailed here.