{"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","required":true,"in":"path","ref":"","_id":"57b6ec9e49a12a0e007b469d"}]},"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 `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}\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\\\",\\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}\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\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##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":"5ff39c284be5f0001a16d0d0","createdAt":"2021-01-04T22:52:24.204Z","user":"5ea72d649148ff00653f6bbc","category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"Refunds","slug":"refunds","order":8,"from_sync":false,"reference":false,"_id":"5ff39c12e2e8fa00503ad532","version":"5ff39c12e2e8fa00503ad5e4","project":"57336fd5a6a9c40e00e13a0b","createdAt":"2016-08-19T11:04:31.283Z","__v":0},"version":{"version":"8976-JSON","version_clean":"8976.0.0-JSON","codename":"3.36.1 Release","is_stable":false,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["5ff39c12e2e8fa00503ad52d","5ff39c12e2e8fa00503ad52e","5ff39c12e2e8fa00503ad52f","5ff39c12e2e8fa00503ad530","5ff39c12e2e8fa00503ad531","5ff39c12e2e8fa00503ad532","5ff39c12e2e8fa00503ad533","5ff39c12e2e8fa00503ad534","5ff39c12e2e8fa00503ad535","5ff39c12e2e8fa00503ad536","5ff39c12e2e8fa00503ad537","5ff39c12e2e8fa00503ad538","5ff39c12e2e8fa00503ad539","5ff39c12e2e8fa00503ad53a","5ff39c12e2e8fa00503ad53b","5ff39c12e2e8fa00503ad53c","5ff39c12e2e8fa00503ad53d","5ff39c12e2e8fa00503ad53e","5ff39c12e2e8fa00503ad53f"],"_id":"5ff39c12e2e8fa00503ad5e4","project":"57336fd5a6a9c40e00e13a0b","__v":0,"forked_from":"5fc6c6094cb8fa066b0d2ea3","createdAt":"2018-04-24T15:22:41.561Z","releaseDate":"2018-04-24T15:22:41.561Z"},"project":"57336fd5a6a9c40e00e13a0b","__v":49,"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
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
}'
{
"refundTransactionId": 1039288153,
"transactionMetaData": {
"metaData": [
{
"metaKey": "refundedItems",
"metaValue": "1552,8832",
"metaDescription": "Refunded Items"
},
{
"metaKey": "metaKey2",
"metaValue": "Value 2",
"metaDescription": "Metadata 2"
}
]
},
"reason": "Refund for order #1992",
"cancelSubscriptions": false
}
{
"refundTransactionId": 1039288355,
"amount": 10.75,
"cancelSubscriptions": false
}
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.
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"
}
]
}
}