{"metadata":{"image":[],"title":"","description":""},"api":{"url":"/transactions/refund/:transactionId","auth":"optional","examples":{"codes":[]},"method":"post","results":{"codes":[{"code":"","language":"text"}]},"settings":"57ee593a21ceb20e0061959e","params":[{"name":"transactionId","type":"string","default":"","desc":"ID of the transaction to be refunded <br><span style=\"color:#F37500\">*required if not using `merchantTransactionId`* </span>","required":false,"in":"path","ref":"","_id":"57b6ec9e49a12a0e007b469d"},{"name":"merchantTransactionId","type":"string","default":"","desc":"ID of the merchant transaction to be refunded <br><span style=\"color:#F37500\">*required if not using `transactionId`*</span>","required":false,"in":"path","ref":"","_id":"61080fadeea914000fc20680"}]},"next":{"description":"","pages":[]},"title":"Refund","type":"endpoint","slug":"refund","excerpt":"","body":"The Refund request allows you to perform a full or partial refund on a transaction that was processed through the Payment API.   \n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Notes\",\n  \"body\": \"**Refund currency**\\nThe refund is automatically performed in the currency of the original transaction. \\n\\n**Refunds for card and ACH transactions**\\nFor card and ACH transactions, when you issue a refund, we will first attempt to void the transaction. \\n   * For cards, if the transaction cannot be voided, a refund will be issued.\\n   * For ACH, you will need to issue a refund once the transaction has been settled.\\n\\n**Retrieving refund details**\\nTo view details about the refunds on a specific transaction, use the **Retrieve** call for that transaction type (such as [Retrieve Card Transaction](doc:retrieve) or [Retrieve ACH/ECP Transaction](doc:retrieve-ecp-transaction)). \\n  * Retrieve the transaction using the `transactionId` to view **all refunds** for that transaction. \\n  * Retrieve the transaction using the `refundTransactionId` to view a **specific refund** and all its details (such as metadata).\"\n}\n[/block]\n<a class=\"btn btn-success\" href=\"#section-api-explorer\" role=\"button\">Try it in the API Explorer</a>\n\n###Request Content\nSend a **[refund](doc:refund-1)** object, with the following: \n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`amount` &nbsp;&nbsp;&nbsp; *decimal* &nbsp;&nbsp;&nbsp;optional\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`taxAmount` &nbsp;&nbsp;&nbsp; *decimal* &nbsp;&nbsp;&nbsp;optional (included if a partial refund of transaction involving taxes)\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`reason` &nbsp;&nbsp;&nbsp; *string* &nbsp;&nbsp;&nbsp;optional\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`cancelSubscriptions` &nbsp;&nbsp;&nbsp; *boolean* &nbsp;&nbsp;&nbsp;optional\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`vendorsRefundInfo` &nbsp;&nbsp;&nbsp; *object* &nbsp;&nbsp;&nbsp;optional (see [vendorsRefundInfo](doc:vendorsrefundinfo))\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`transactionMetaData` &nbsp;&nbsp;&nbsp; *object* &nbsp;&nbsp;&nbsp;optional (see [transactionMetaData](doc:transaction-meta-data))\n\n###Response Details\nIf successful, the response HTTP status code is 200 OK and contains the [**refund**](doc:refund-1) object.\n\n<hr>\n\n##Examples\n\n###Request Examples\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/transactions/refund/1039287689 \\\\\\n-H 'Content-Type: application/json' \\\\\\n-H 'Accept: application/json' \\\\ \\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n{\\n  \\\"reason\\\": \\\"Refund for order #1992\\\",\\n  \\\"cancelSubscriptions\\\": false,\\n  \\\"transactionMetaData\\\": {\\n    \\\"metaData\\\": [\\n      {\\n        \\\"metaValue\\\": \\\"1552,8832\\\",\\n        \\\"metaKey\\\": \\\"refundedItems\\\",\\n        \\\"metaDescription\\\": \\\"Refunded Items\\\"\\n      },\\n      {\\n        \\\"metaValue\\\": \\\"Value 2\\\",\\n        \\\"metaKey\\\": \\\"metaKey2\\\",\\n        \\\"metaDescription\\\": \\\"Metadata 2\\\"\\n      }\\n    ]\\n  }\\n}'\",\n      \"language\": \"curl\",\n      \"name\": \"Refund Request: Full refund with metadata\"\n    },\n    {\n      \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/transactions/refund/1039287997 \\\\\\n-H 'Content-Type: application/json' \\\\\\n-H 'Accept: application/json' \\\\ \\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n{\\n  \\\"amount\\\": 10.75,\\n  \\\"cancelSubscriptions\\\": false\\n}'\",\n      \"language\": \"curl\",\n      \"name\": \"Partial refund\"\n    },\n    {\n      \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/transactions/refund/1039287997 \\\\\\n-H 'Content-Type: application/json' \\\\\\n-H 'Accept: application/json' \\\\ \\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n{\\n  \\\"amount\\\": 52.50,\\n  \\\"taxAmount\\\": 2.50\\n}'\",\n      \"language\": \"curl\",\n      \"name\": \"Partial refund with tax\"\n    },\n    {\n      \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/transactions/refund/merchant/1011671987  \\\\\\n-H 'Content-Type: application/json' \\\\\\n-H 'Accept: application/json' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n{\\n    \\\"reason\\\": \\\"Refund for order #1992\\\"\\n} '\",\n      \"language\": \"curl\",\n      \"name\": \"with Merchant Transaction ID\"\n    }\n  ]\n}\n[/block]\n###Response Examples\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"refundTransactionId\\\": 1039288153,\\n  \\\"transactionMetaData\\\": {\\n    \\\"metaData\\\": [\\n      {\\n        \\\"metaKey\\\": \\\"refundedItems\\\",\\n        \\\"metaValue\\\": \\\"1552,8832\\\",\\n        \\\"metaDescription\\\": \\\"Refunded Items\\\"\\n      },\\n      {\\n        \\\"metaKey\\\": \\\"metaKey2\\\",a\\n        \\\"metaValue\\\": \\\"Value 2\\\",\\n        \\\"metaDescription\\\": \\\"Metadata 2\\\"\\n      }\\n    ]\\n  },\\n  \\\"reason\\\": \\\"Refund for order #1992\\\",\\n  \\\"cancelSubscriptions\\\": false\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Full refund with metadata\"\n    },\n    {\n      \"code\": \"{\\n  \\\"refundTransactionId\\\": 1039288355,\\n  \\\"amount\\\": 10.75,\\n  \\\"cancelSubscriptions\\\": false\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Partial refund\"\n    },\n    {\n      \"code\": \"{\\n  \\\"refundTransactionId\\\": 1039288356,\\n  \\\"amount\\\": 52.50,\\n  \\\"taxAmount\\\": 2.50\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Partial refund with tax\"\n    }\n  ]\n}\n[/block]\n<a class=\"btn btn-primary\" href=\"#\" role=\"button\">Back to Top</a>\n\n<hr>\n\n##Example Descriptions\nFor details about the above examples, see:\n\n* [Full refund with metadata](#section-full-refund-with-metadata)\n* [Partial refund](#section-partial-refund)\n* [Partial refund with tax](#section-partial-refund-with-tax)\n* [with Merchant Transaction ID](#section-with-merchant-transaction-id)\n\n### Full refund with metadata\nThis example shows a refund request with metadata for the full transaction amount. Simply omit `amount` to refund the full transaction amount. To pass metadata, include `transactionMetaData` in the request. \n\n### Partial refund  \nThis example shows a partial refund, with the amount specified by the `amount` parameter. \n\n### Partial refund with tax\nThis example shows a partial refund for a transaction involving taxes. The refund amount, including tax, is specified by the `amount` parameter, and the tax amount to be refunded is specified in the `taxAmount` parameter. See the [Taxes guide](https://developers.bluesnap.com/v8976-Basics/docs/taxes) for more information. \n\n### with Merchant Transaction ID\nThis example shows a basic refund request using the `merchantTransactionId` at the end of the request URL instead of the `transactionId`.\n\n##API Explorer\nTo test a call, enter an existing transaction ID in the `transactionId` field. This automatically inserts the ID into the request URL. Enter any relevant parameters in the request body. You can use the code below as a starting point. Click **Try It** when you're ready to run your request.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"reason\\\": \\\"Refund for order #1992\\\",\\n  \\\"cancelSubscriptions\\\": false,\\n  \\\"transactionMetaData\\\": {\\n    \\\"metaData\\\": [\\n      {\\n        \\\"metaValue\\\": \\\"1552,8832\\\",\\n        \\\"metaKey\\\": \\\"refundedItems\\\",\\n        \\\"metaDescription\\\": \\\"Refunded Items\\\"\\n      },\\n      {\\n        \\\"metaValue\\\": \\\"Value 2\\\",\\n        \\\"metaKey\\\": \\\"metaKey2\\\",\\n        \\\"metaDescription\\\": \\\"Metadata 2\\\"\\n      }\\n    ]\\n  }\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]","updates":[],"order":0,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"61a51e4adca83b015f8acb9c","createdAt":"2021-01-04T22:52:24.204Z","user":"5ea72d649148ff00653f6bbc","category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"Refunds","slug":"refunds","order":9,"from_sync":false,"reference":false,"_id":"61a51e4adca83b015f8acaeb","version":"61a51e4adca83b015f8acba4","project":"57336fd5a6a9c40e00e13a0b","createdAt":"2016-08-19T11:04:31.283Z","__v":0},"version":{"version":"8976-JSON","version_clean":"8976.0.0-JSON","codename":"3.40 Release","is_stable":false,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["61a51e4adca83b015f8acae6","61a51e4adca83b015f8acae7","61a51e4adca83b015f8acae8","61a51e4adca83b015f8acae9","61a51e4adca83b015f8acaea","61a51e4adca83b015f8acaeb","61a51e4adca83b015f8acaec","61a51e4adca83b015f8acaed","61a51e4adca83b015f8acaee","61a51e4adca83b015f8acaef","61a51e4adca83b015f8acaf0","61a51e4adca83b015f8acaf1","61a51e4adca83b015f8acaf2","61a51e4adca83b015f8acaf3","61a51e4adca83b015f8acaf4","61a51e4adca83b015f8acaf5","61a51e4adca83b015f8acaf6","61a51e4adca83b015f8acaf7","61a51e4adca83b015f8acaf8","61a51e4adca83b015f8acaf9"],"_id":"61a51e4adca83b015f8acba4","project":"57336fd5a6a9c40e00e13a0b","__v":0,"forked_from":"60fed21a76106200102eaec3","createdAt":"2018-04-24T15:22:41.561Z","releaseDate":"2018-04-24T15:22:41.561Z"},"project":"57336fd5a6a9c40e00e13a0b","__v":67,"parentDoc":null}

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

transactionId:
string
ID of the transaction to be refunded <br><span style="color:#F37500">*required if not using `merchantTransactionId`* </span>
merchantTransactionId:
string
ID of the merchant transaction to be refunded <br><span style="color:#F37500">*required if not using `transactionId`*</span>

Documentation

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.

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.

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).

Try it in the API Explorer

Request Content

Send a refund object, with the following:
      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.


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


Example Descriptions

For details about the above examples, see:

Full refund with metadata

This example shows a refund request with metadata for the full transaction amount. Simply omit amount to refund the full transaction amount. To pass metadata, include transactionMetaData in the request.

Partial refund

This example shows a partial refund, with the amount specified by the amount parameter.

Partial refund with tax

This example shows a partial refund for a transaction involving taxes. The refund amount, including tax, is specified by the amount parameter, and the tax amount to be refunded is specified in the taxAmount parameter. See the Taxes guide for more information.

with Merchant Transaction ID

This example shows a basic refund request using the merchantTransactionId at the end of the request URL instead of the transactionId.

API Explorer

To test a call, enter an existing transaction ID in the transactionId field. This automatically inserts the ID into the request URL. Enter any relevant parameters in the request body. You can use the code below as a starting point. Click Try It when you're ready to run your request.

{
  "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"
      }
    ]
  }
}

User Information

Try It Out


post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}