{"metadata":{"image":[],"title":"","description":""},"api":{"url":"/transactions/:transactionId/refund","auth":"optional","examples":{"codes":[]},"method":"put","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 enables you to perform a full or partial refund on a transaction that was processed through the Payment API. \n\nTo retrieve a transaction that has been refunded, use the [Retrieve Card Transaction](doc:retrieve),\n [Retrieve PayPal Transaction](doc:paypal-retrieve), [Retrieve ECP Transaction](doc:retrieve-ecp-transaction), or [Retrieve SEPA DD Transaction](doc:retrieve-sepa-dd-transaction) request.\n&nbsp;\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Notes\",\n  \"body\": \"* The refund is automatically performed in the currency that was used for the original transaction.\\n* For 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* To view details about the refunds on a specific transaction, use the **Retrieve** call corresponding to the type of transaction (such as card or ECP).\"\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\nEnter the transaction ID and any of the optional query parameters below into the request URL. For example:\n`services/2/transactions/1111111/refund?amount=9.20`\n\n**Query Parameters**\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter Name\",\n    \"h-1\": \"Description\",\n    \"h-2\": \"Example\",\n    \"0-0\": \"`amount`\",\n    \"1-0\": \"`reason`\",\n    \"2-0\": \"`cancelsubscriptions`\",\n    \"0-1\": \"*Optional*\\nAmount to be refunded, if this is a partial refund.\\nThe amount parameter value must be greater than 0 and no more than the total amount.\",\n    \"1-1\": \"*Optional*\\nReason the shopper cancelled or requested a refund for the order. If this parameter is empty, the default string is \\\"Per your instructions\\\". Maximum 4000 characters.\",\n    \"2-1\": \"*Optional*\\n**Note**: Set to true if not passed.\\n**true** = (default) Cancel the shopper's subscription associated with this invoice ID. \\n**false** = Just refund the selected purchase and do not cancel the subscription.\",\n    \"0-2\": \"`amount=9.20`\",\n    \"1-2\": \"`reason=unsatisfied+customer`\",\n    \"2-2\": \"`cancelsubscriptions=true`\",\n    \"3-0\": \"`vendor.{vendor ID}.amount`\",\n    \"3-1\": \"*Optional*\\nAmount to be refunded to vendor. If no vendor amount parameters are passed, the transaction is refunded based on the original commission split.\\n\\n*Note:* Only used for Marketplace transactions with vendors when `amount` parameter is passed.\",\n    \"3-2\": \"`vendor.10398030.amount=4.10`\"\n  },\n  \"cols\": 3,\n  \"rows\": 4\n}\n[/block]\n###Response Details\nIf successful, the response HTTP status code is 204 No Content.\nThere is no content in the response body.\n\n<hr>\n\n##Example\n\n###Request Example\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -v -X PUT https://sandbox.bluesnap.com/services/2/transactions/1111111/refund?amount=9.20 \\\\\\n-H 'Content-Type: application/json' \\\\\\n-H 'Accept: application/json' \\\\ \\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\",\n      \"language\": \"curl\",\n      \"name\": \"Refund Request\"\n    }\n  ]\n}\n[/block]\n###Response Example\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"HTTP/ 1.1 204 No Content\",\n      \"language\": \"json\",\n      \"name\": \"Refund Response: 204 No Content\"\n    }\n  ]\n}\n[/block]\n<hr>\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. Leave the `Body Content` field empty.","updates":["5db33e046d35fd006085e509","5db33e568e6c9c0022d0eba4"],"order":0,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"5ed0377101fdb400214ded19","category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"Refunds","slug":"refunds","order":6,"from_sync":false,"reference":false,"_id":"5ed0377101fdb400214ded05","version":"5ed0377101fdb400214dedaa","project":"57336fd5a6a9c40e00e13a0b","createdAt":"2016-08-19T11:04:31.283Z","__v":0},"user":"560d5913af97231900938124","project":"57336fd5a6a9c40e00e13a0b","parentDoc":null,"version":{"version":"8976-JSON","version_clean":"8976.0.0-JSON","codename":"3.34.0 Release","is_stable":false,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["5ed0377101fdb400214ded00","5ed0377101fdb400214ded01","5ed0377101fdb400214ded02","5ed0377101fdb400214ded03","5ed0377101fdb400214ded04","5ed0377101fdb400214ded05","5ed0377101fdb400214ded06","5ed0377101fdb400214ded07","5ed0377101fdb400214ded08","5ed0377101fdb400214ded09","5ed0377101fdb400214ded0a","5ed0377101fdb400214ded0b","5ed0377101fdb400214ded0c","5ed0377101fdb400214ded0d","5ed0377101fdb400214ded0e","5ed0377101fdb400214ded0f","5ed0377101fdb400214ded10"],"_id":"5ed0377101fdb400214dedaa","project":"57336fd5a6a9c40e00e13a0b","__v":0,"forked_from":"5e5d3aa2dc4d35003d784d9d","createdAt":"2018-04-24T15:22:41.561Z","releaseDate":"2018-04-24T15:22:41.561Z"},"createdAt":"2016-01-12T17:43:39.621Z","githubsync":"","__v":9}

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

transactionId:
required
string
ID of the transaction to be refunded

Documentation

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

To retrieve a transaction that has been refunded, use the Retrieve Card Transaction,
Retrieve PayPal Transaction, Retrieve ECP Transaction, or Retrieve SEPA DD Transaction request.
 

Notes

  • The refund is automatically performed in the currency that was used for the original transaction.
  • 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.
  • To view details about the refunds on a specific transaction, use the Retrieve call corresponding to the type of transaction (such as card or ECP).

Try it in the API Explorer

Request Content

Enter the transaction ID and any of the optional query parameters below into the request URL. For example:
services/2/transactions/1111111/refund?amount=9.20

Query Parameters

Parameter Name
Description
Example

amount

Optional
Amount to be refunded, if this is a partial refund.
The amount parameter value must be greater than 0 and no more than the total amount.

amount=9.20

reason

Optional
Reason the shopper cancelled or requested a refund for the order. If this parameter is empty, the default string is "Per your instructions". Maximum 4000 characters.

reason=unsatisfied+customer

cancelsubscriptions

Optional
Note: Set to true if not passed.
true = (default) Cancel the shopper's subscription associated with this invoice ID.
false = Just refund the selected purchase and do not cancel the subscription.

cancelsubscriptions=true

vendor.{vendor ID}.amount

Optional
Amount to be refunded to vendor. If no vendor amount parameters are passed, the transaction is refunded based on the original commission split.

Note: Only used for Marketplace transactions with vendors when amount parameter is passed.

vendor.10398030.amount=4.10

Response Details

If successful, the response HTTP status code is 204 No Content.
There is no content in the response body.


Example

Request Example

curl -v -X PUT https://sandbox.bluesnap.com/services/2/transactions/1111111/refund?amount=9.20 \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \ 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '

Response Example

HTTP/ 1.1 204 No Content


API Explorer

To test a call, enter an existing transaction ID in the transactionId field. This automatically inserts the ID into the request URL. Leave the Body Content field empty.


User Information

Try It Out


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