{"_id":"59e8f600aa561e00241c44b8","category":{"_id":"59e8f600aa561e00241c44ac","version":"59e8f600aa561e00241c44aa","project":"57336fd5a6a9c40e00e13a0b","__v":0,"sync":{"url":"","isSync":false},"reference":true,"createdAt":"2015-11-03T20:45:01.593Z","from_sync":false,"order":1,"slug":"topics","title":"Orders"},"parentDoc":null,"user":"560d5913af97231900938124","project":"57336fd5a6a9c40e00e13a0b","version":{"_id":"59e8f600aa561e00241c44aa","project":"57336fd5a6a9c40e00e13a0b","__v":1,"createdAt":"2017-10-19T18:59:12.596Z","releaseDate":"2017-10-19T18:59:12.596Z","categories":["59e8f600aa561e00241c44ab","59e8f600aa561e00241c44ac","59e8f600aa561e00241c44ad","59e8f600aa561e00241c44ae","59e8f600aa561e00241c44af","59e8f600aa561e00241c44b0","59e8f600aa561e00241c44b1","59e8f600aa561e00241c44b2","59e8f600aa561e00241c44b3","59e8f600aa561e00241c44b4","59e8f600aa561e00241c44b5"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":false,"codename":"3.23 Release","version_clean":"8976.0.0-Extended","version":"8976-Extended"},"__v":0,"updates":["588a589aa1592e1b004508f5"],"next":{"pages":[],"description":""},"createdAt":"2016-05-12T14:58:51.697Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[]},"method":"put","results":{"codes":[]},"settings":"","auth":"optional","params":[],"url":""},"isReference":true,"order":3,"body":"##Definition\nhttps<span>://sandbox.bluesnap.com/services/2/orders/refund?:query-parameters</span>\n\n<hr>\n\n##Documentation\nThe Refund Invoice request enables you to refund either the full amount or a partial amount of a given invoice. You can provide a cancellation reason and determine whether to cancel a subscription at the same time.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"\",\n  \"body\": \"Partial refunds can only be performed on transactions that were created more than 24 hours ago.\"\n}\n[/block]\n###Request Content\nEnter the relevant query parameters into the web service URL, in the format:\n`services/2/orders/refund?{query-parameters}`\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-1\": \"<span style=\\\"color:#F37500\\\">**Required**</span>\\nID of the invoice to refund.\",\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-0\": \"`invoiceId`\",\n    \"1-0\": \"`reason`\",\n    \"2-0\": \"`cancelSubscriptions`\",\n    \"2-2\": \"`cancelSubscription=true`\",\n    \"1-2\": \"`reason=unsatisfied+customer`\",\n    \"0-2\": \"`invoiceid=38420528`\",\n    \"3-0\": \"`amount`\",\n    \"3-1\": \"*Optional*\\nAmount to be refunded, if this is a partial refund.\\nThe amount parameter value must be:\\n  * Greater than 0.\\n  * Less than the maximum refundable amount.\",\n    \"3-2\": \"`amount=9.20`\",\n    \"4-0\": \"`sku.{sku ID}.amount`\",\n    \"4-1\": \"*Required if performing a partial refund on an order with multiple SKUs*\\nThe amount parameter value must be:\\n  * Greater than 0.\\n  * Less than the maximum refundable amount for this SKU.\",\n    \"4-2\": \"`sku.789.amount=20.00`\"\n  },\n  \"cols\": 3,\n  \"rows\": 5\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.\nFor details about possible errors, see: [General Errors](doc:general-errors) and [Payment & Processor Errors](doc:payment-errors).\n\n<hr>\n\n##Examples\n\n###Request Examples\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -v -X PUT https://sandbox.bluesnap.com/services/2/orders/refund?invoiceId=38410844&reason=unsatisfied+customer \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='\",\n      \"language\": \"curl\",\n      \"name\": \"Refund Invoice Request: refund and provide refund reason\"\n    },\n    {\n      \"code\": \"curl -v -X PUT https://sandbox.bluesnap.com/services/2/orders/refund?invoiceid=38420528&cancelsubscriptions=true \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='\",\n      \"language\": \"curl\",\n      \"name\": \"refund and cancel subscription\"\n    },\n    {\n      \"code\": \"curl -v -X PUT https://sandbox.bluesnap.com/services/2/orders/refund?invoiceid=38420528&amount=9.20 \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='\",\n      \"language\": \"curl\",\n      \"name\": \"partial refund\"\n    },\n    {\n      \"code\": \"curl -v -X PUT https://sandbox.bluesnap.com/services/2/orders/refund?invoiceid=38420528&sku.789.amount=20.00 \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='\",\n      \"language\": \"curl\",\n      \"name\": \"refund for specific SKU\"\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\": \"http\",\n      \"name\": \"Refund Invoice Response\"\n    }\n  ]\n}\n[/block]\n<br>\n<a class=\"btn btn-primary\" href=\"#\" role=\"button\">Back to Top</a>","excerpt":"","slug":"refund-invoice","type":"put","title":"Refund Invoice"}

Definition

https://sandbox.bluesnap.com/services/2/orders/refund?:query-parameters


Documentation

The Refund Invoice request enables you to refund either the full amount or a partial amount of a given invoice. You can provide a cancellation reason and determine whether to cancel a subscription at the same time.

Partial refunds can only be performed on transactions that were created more than 24 hours ago.

Request Content

Enter the relevant query parameters into the web service URL, in the format:
services/2/orders/refund?{query-parameters}

Query Parameters

Parameter Name
Description
Example

invoiceId

Required
ID of the invoice to refund.

invoiceid=38420528

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

amount

Optional
Amount to be refunded, if this is a partial refund.
The amount parameter value must be:

  • Greater than 0.
  • Less than the maximum refundable amount.

amount=9.20

sku.{sku ID}.amount

Required if performing a partial refund on an order with multiple SKUs
The amount parameter value must be:

  • Greater than 0.
  • Less than the maximum refundable amount for this SKU.

sku.789.amount=20.00

Response Details

If successful, the response HTTP status code is 204 No Content.
There is no content in the response body.
For details about possible errors, see: General Errors and Payment & Processor Errors.


Examples

Request Examples

curl -v -X PUT https://sandbox.bluesnap.com/services/2/orders/refund?invoiceId=38410844&reason=unsatisfied+customer \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='
curl -v -X PUT https://sandbox.bluesnap.com/services/2/orders/refund?invoiceid=38420528&cancelsubscriptions=true \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='
curl -v -X PUT https://sandbox.bluesnap.com/services/2/orders/refund?invoiceid=38420528&amount=9.20 \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='
curl -v -X PUT https://sandbox.bluesnap.com/services/2/orders/refund?invoiceid=38420528&sku.789.amount=20.00 \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='

Response Example

HTTP/ 1.1 204 No Content