v1

latestOpenAPI 3.0.3MIT2026-07-2428350487.0 KB
Payments

Refund a payment

Initiates a new refund against a previously captured payment

post/payments/{paymentId}/refund

Path parameters

paymentIdstring required

The unique identifier for the payment.

This can be sourced from the paymentId field in the response we sent to you when creating the payment or payout.

Request body

amountinteger

Amount to be refunded on this transaction, or null for full refund. In the lowest denomination of the currency of the payment. This means that 1234 in GBP represents £12.34.

merchantTransactionIdstring

Your unique identifier that can be used when a connection issue occurs and you don't receive a paymentId. This is an optional field that can be used when querying GET v1/payments, GET v1/payouts or GET v1/payments/{paymentId}/refunds. We will validate the uniqueness of the merchantTransactionId value per retail channel. If a payment/payout/refund is created with merchantTransactionId abc, no other payment/payout/refund can be created with abc.

The merchantTransactionId is a contract between BR-DGE and a merchant. This field will not be mapped downstream to any PSP.

In the event that you provide a merchantTransactionId in the second (or third) leg of a 3DS payment, we will ignore this value and will only use the value provided in the initial request.

customerRefundCodestring

You may provide your own code to be used in refunds, which will be provided to the PSP if it is supported. Each PSP may have different validation requirements for this code.

Example request

{
  "amount": 1234,
  "merchantTransactionId": "yourUniqueRequestId",
  "customerRefundCode": "ABC123"
}

Response

Refund request completed successfully.

codestring

Response Code signifying the outcome of the request.

messagestring

A description of the outcome of the request.

idstring

The ID of this request. If you can include these when querying the outcome of individual requests, we can track down the root cause faster.

merchantTransactionIdstring

Your unique identifier that can be used when a connection issue occurs and you don't receive a paymentId. This is an optional field that can be used when querying GET v1/payments, GET v1/payouts or GET v1/payments/{paymentId}/refunds. We will validate the uniqueness of the merchantTransactionId value per retail channel. If a payment/payout/refund is created with merchantTransactionId abc, no other payment/payout/refund can be created with abc.

The merchantTransactionId is a contract between BR-DGE and a merchant. This field will not be mapped downstream to any PSP.

In the event that you provide a merchantTransactionId in the second (or third) leg of a 3DS payment, we will ignore this value and will only use the value provided in the initial request.

customerRefundCodestring

You may provide your own code to be used in refunds, which will be provided to the PSP if it is supported. Each PSP may have different validation requirements for this code.

Example response

{
  "code": "1000",
  "id": "463ac35c9f6413ad48485a3953bb6124",
  "psp": {
    "name": "Checkout.com",
    "transactionId": "6418da68-0b3d-4409-ab14-1ceb752b0b1f",
    "switchAccountId": "switch-account-123",
    "provisionedUserId": "Vx0H4pdAtPCz",
    "additionalInfo": {
      "customerFirstName": "John",
      "customerLastName": "Smith",
      "customerDateOfBirth": "2000-01-01",
      "customerIpAddress": "123.100.100.200",
      "customerId": "de5d7b4a-9410-40e1-85fd-8ceee23c9fd0",
      "paysafecardCustomerId": "151743187547"
    },
    "rawPspResponses": [
      {
        "httpStatusCode": 200,
        "pspName": "Checkout.com",
        "headers": {
          "content-type": [
            "application/json"
          ]
        }
      }
    ]
  },
  "installmentsPlan": {
    "code": "1000",
    "message": "Approved",
    "provider": "Visa Installments",
    "operation": "cancellation",
    "planActivationId": "6ccc5c91-f869-4063-9368-40b4cb30c6ce"
  },
  "merchantTransactionId": "yourUniqueRequestId",
  "customerRefundCode": "ABC123"
}