{"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> <br> <span style=\";word-break:break-all;cursor:default;pointer-events:none;text-decoration:none;color:black;\">Definition: https://sandbox.bluesnap.com/services/2/transactions/refund/merchant/:merchantTransactionId</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 `amount` *decimal* optional\n `taxAmount` *decimal* optional (included if a partial refund of transaction involving taxes)\n `reason` *string* optional\n `cancelSubscriptions` *boolean* optional\n `vendorsRefundInfo` *object* optional (see [vendorsRefundInfo](doc:vendorsrefundinfo))\n `transactionMetaData` *object* 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":"628531cd1258c8003f6dd275","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":"628531cd1258c8003f6dd1c4","version":"628531cd1258c8003f6dd27d","project":"57336fd5a6a9c40e00e13a0b","createdAt":"2016-08-19T11:04:31.283Z","__v":0},"version":{"version":"8976-JSON","version_clean":"8976.0.0-JSON","codename":"3.42 Release","is_stable":false,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["628531cd1258c8003f6dd1bf","628531cd1258c8003f6dd1c0","628531cd1258c8003f6dd1c1","628531cd1258c8003f6dd1c2","628531cd1258c8003f6dd1c3","628531cd1258c8003f6dd1c4","628531cd1258c8003f6dd1c5","628531cd1258c8003f6dd1c6","628531cd1258c8003f6dd1c7","628531cd1258c8003f6dd1c8","628531cd1258c8003f6dd1c9","628531cd1258c8003f6dd1ca","628531cd1258c8003f6dd1cb","628531cd1258c8003f6dd1cc","628531cd1258c8003f6dd1cd","628531cd1258c8003f6dd1ce","628531cd1258c8003f6dd1cf","628531cd1258c8003f6dd1d0","628531cd1258c8003f6dd1d1","628531cd1258c8003f6dd1d2"],"_id":"628531cd1258c8003f6dd27d","project":"57336fd5a6a9c40e00e13a0b","__v":0,"forked_from":"622783372cd60c003782d77e","createdAt":"2018-04-24T15:22:41.561Z","releaseDate":"2018-04-24T15:22:41.561Z"},"project":"57336fd5a6a9c40e00e13a0b","__v":84,"parentDoc":null}
postRefund
Definition
Parameters
Path Params
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).
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"
} '
{
"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
}
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"
}
]
}
}