Refund

The Refund request allows you to perform a full or partial refund on a transaction that was processed through the Payment API.

πŸ“˜

Notes

Refund Currency: The refund is automatically performed in the currency of the original transaction.

Retrieving Refund Details: To view details about the refunds on a specific transaction, use the Retrieve call for that transaction type (such as Retrieve Card Transaction or Retrieve ACH/ECP Transaction).

  • Retrieve the transaction using the transactionId to view all refunds for that transaction.
  • Retrieve the transaction using the refundTransactionId to view a specific refund and all its details (such as metadata).

Refunds for Card and ACH Transactions: For card and ACH transactions, when you issue a refund, we will first attempt to void the transaction.

  • For cards, if the transaction cannot be voided, a refund will be issued.
  • For ACH, you will need to issue a refund once the transaction has been settled.

Supported Payment Methods

We support refunds through our API if any of the following payment methods were used:

  • ACH
  • Cards/Wallets
  • PayPal
  • SEPA

πŸ“˜

Tip

You can test out a request that hits our sandbox in real-time. Follow the instructions here to use the "Try It!" feature on the right side.

Request Content

Path Params

To complete a refund using transactionId, use the following request URL: https://sandbox.bluesnap.com/services/2/transactions/refund/merchant/:transactionId

To complete a refund using merchantTransactionId, use the following request URL: https://sandbox.bluesnap.com/services/2/transactions/refund/merchant/:merchantTransactionId

Send a refund object, with the following:

Property

Type

Requirement

amount

decimal

optional

taxAmount

decimal

optional (included if a partial refund of transaction involving taxes)

reason

string

optional

cancelSubscriptions

boolean

optional

vendorsRefundInfo

object

optional (see vendorsRefundInfo)

transactionMetaData

object

optional (see transactionMetaData)

Response Details

If successful, the response HTTP status code is 200 OK and contains the refund object.

Back to Top


Examples

Request Examples

curl -v -X POST https://sandbox.bluesnap.com/services/2/transactions/refund/1039287689 \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \ 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
  "reason": "Refund for order #1992",
  "cancelSubscriptions": false,
  "transactionMetaData": {
    "metaData": [
      {
        "metaValue": "1552,8832",
        "metaKey": "refundedItems",
        "metaDescription": "Refunded Items"
      },
      {
        "metaValue": "Value 2",
        "metaKey": "metaKey2",
        "metaDescription": "Metadata 2"
      }
    ]
  }
}'
curl -v -X POST https://sandbox.bluesnap.com/services/2/transactions/refund/1039287997 \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \ 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
  "amount": 10.75,
  "cancelSubscriptions": false
}'
curl -v -X POST https://sandbox.bluesnap.com/services/2/transactions/refund/1039287997 \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \ 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
  "amount": 52.50,
  "taxAmount": 2.50
}'
curl -v -X POST https://sandbox.bluesnap.com/services/2/transactions/refund/merchant/1011671987  \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
    "reason": "Refund for order #1992"
} '

Response Examples

{
  "refundTransactionId": 1039288153,
  "transactionMetaData": {
    "metaData": [
      {
        "metaKey": "refundedItems",
        "metaValue": "1552,8832",
        "metaDescription": "Refunded Items"
      },
      {
        "metaKey": "metaKey2",a
        "metaValue": "Value 2",
        "metaDescription": "Metadata 2"
      }
    ]
  },
  "reason": "Refund for order #1992",
  "cancelSubscriptions": false
}
{
  "refundTransactionId": 1039288355,
  "amount": 10.75,
  "cancelSubscriptions": false
}
{
  "refundTransactionId": 1039288356,
  "amount": 52.50,
  "taxAmount": 2.50
}

Back to Top


API Explorer

To test a call, enter an existing transaction ID in the transactionId field. This automatically inserts the ID into the request URL. Click the "Try It!" button to submit your test request and see a response.

Language
Authentication
Header
Click Try It! to start a request and see the response here!