{"_id":"59a45d2dd12e81000f842f65","category":{"_id":"59a45d2bd12e81000f842ee8","version":"59a45d2bd12e81000f842ee2","project":"57336fd5a6a9c40e00e13a0b","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-08-19T11:04:31.283Z","from_sync":false,"order":5,"slug":"refunds","title":"Refunds"},"user":"560d5913af97231900938124","project":"57336fd5a6a9c40e00e13a0b","parentDoc":null,"version":{"_id":"59a45d2bd12e81000f842ee2","project":"57336fd5a6a9c40e00e13a0b","__v":1,"createdAt":"2017-08-28T18:12:59.168Z","releaseDate":"2017-08-28T18:12:59.168Z","categories":["59a45d2bd12e81000f842ee3","59a45d2bd12e81000f842ee4","59a45d2bd12e81000f842ee5","59a45d2bd12e81000f842ee6","59a45d2bd12e81000f842ee7","59a45d2bd12e81000f842ee8","59a45d2bd12e81000f842ee9","59a45d2bd12e81000f842eea","59a45d2bd12e81000f842eeb","59a45d2bd12e81000f842eec","59a45d2bd12e81000f842eed","59a45d2bd12e81000f842eee","59a45d2bd12e81000f842eef","59a45d2bd12e81000f842ef0","59a45d2bd12e81000f842ef1"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":false,"codename":"3.22.1","version_clean":"8976.0.0-JSON","version":"8976-JSON"},"__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-01-12T17:43:39.621Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[]},"method":"put","results":{"codes":[{"language":"text","code":""}]},"settings":"57ee593a21ceb20e0061959e","auth":"optional","params":[{"_id":"57b6ec9e49a12a0e007b469d","ref":"","in":"path","required":true,"desc":"ID of the transaction to be refunded","default":"","type":"string","name":"transactionId"}],"url":"/transactions/:transactionId/refund"},"isReference":false,"order":13,"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)  or [Retrieve PayPal Transaction](doc:paypal-retrieve) request.\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Requirements\",\n  \"body\": \"* Only transactions that were created more than 24 hours ago can be partially refunded.\\n* The refund will automatically be performed in the currency that was used for the original transaction.\"\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\\\".\",\n    \"2-1\": \"*Optional*\\n**true** = 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\": \"`cancelsubscription=true`\",\n    \"3-0\": \"`vendoramount`\",\n    \"3-1\": \"*Optional*\\nAmount to be refunded to vendor.  If left blank the transaction will be refunded based on distribution from original transaction.\\n*Note:* Only used for Marketplace transactions that include `vendorId`.\",\n    \"3-2\": \"`vendoramount=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[block:callout]\n{\n  \"type\": \"success\",\n  \"body\": \"To view details about the refunds on a specific transaction, retrieve the transaction as described in [Retrieve Card Transaction](doc:retrieve) and [Retrieve PayPal Transaction](doc:paypal-retrieve).\",\n  \"title\": \"Refund details appear in retrieved transactions\"\n}\n[/block]\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 out a call, enter an existing transaction ID in the `transactionId` field. This will automatically insert the ID into the request URL. Leave the Body Content field empty.","excerpt":"","slug":"refund","type":"put","title":"Refund"}

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 or Retrieve PayPal Transaction request.

Requirements

  • Only transactions that were created more than 24 hours ago can be partially refunded.
  • The refund will automatically be performed in the currency that was used for the original transaction.

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

reason=unsatisfied+customer

cancelsubscriptions

Optional
true = Cancel the shopper's subscription associated with this invoice ID.
false = Just refund the selected purchase and do not cancel the subscription.

cancelsubscription=true

vendoramount

Optional
Amount to be refunded to vendor. If left blank the transaction will be refunded based on distribution from original transaction.
Note: Only used for Marketplace transactions that include vendorId.

vendoramount=4.10

Response Details

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

Refund details appear in retrieved transactions

To view details about the refunds on a specific transaction, retrieve the transaction as described in Retrieve Card Transaction and Retrieve PayPal Transaction.


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 out a call, enter an existing transaction ID in the transactionId field. This will automatically insert 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 }}