{"_id":"5771c40901e8110e0041ad43","parentDoc":null,"project":"567f0c06143cc60d00c1fdbe","version":{"_id":"567f0c06143cc60d00c1fdc1","__v":9,"project":"567f0c06143cc60d00c1fdbe","createdAt":"2015-12-26T21:52:06.734Z","releaseDate":"2015-12-26T21:52:06.734Z","categories":["567f0c07143cc60d00c1fdc2","56a9783109cb9c0d00f0c7d3","56a97837f834950d0037b363","56a9783b2d8fd90d0036eed6","56a979912d8fd90d0036eed8","5834b5691a80690f00d31faf","5834b5e4f775120f00c45f9d","5bf1a1473031e4005075ae14","5c64c200244bda003204b97f"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1"},"__v":17,"category":{"_id":"56a9783b2d8fd90d0036eed6","version":"567f0c06143cc60d00c1fdc1","__v":10,"pages":["56a99246318e6c1700a19d06","56a9924c257fbc0d00d4763a","56a9926bf834950d0037b381","56a99273257fbc0d00d4763c","56a992863b04f20d00ecca87","56a9928df834950d0037b383","56a992aff834950d0037b385","56a992d413a69a0d00a778de","56a9f82aca491e0d00eb8b12","56a9f959257fbc0d00d476c2"],"project":"567f0c06143cc60d00c1fdbe","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-01-28T02:08:59.138Z","from_sync":false,"order":3,"slug":"orders","title":"Orders"},"user":"567f0baca74a1c0d003e1fba","editedParams":true,"editedParams2":true,"githubsync":"","updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-06-28T00:25:45.785Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"settings":"","examples":{"codes":[{"code":"curl -X POST https://tophatter.com/merchant_api/v1/orders/refund.json \\\n-d 'access_token=YOUR_ACCESS_TOKEN' \\\n-d 'order_id=40184783' \\\n-d 'type=full' \\\n-d 'reason=delay_in_shipping'","language":"curl"}]},"method":"post","results":{"codes":[{"status":200,"language":"json","code":"{  \n   \"order_id\": 40184783,\n   \"status\": \"refunded\",\n   \"carrier\": null,\n   \"tracking_number\": null,\n   \"product_name\": \"Winter Puffy Down Jacket\",\n   \"product_identifier\": \"32464821020\",\n\t \"product_internal_id\": fake-id (1111111),\n   \"variation_identifier\": \"32464821020-XL-Black\",\n   \"variation_internal_id\": fake-id (1111111),\n   \"annotation\": null,\n   \"customer_id\": 15513591,\n   \"customer_name\": \"Jane Doe\",\n   \"address1\": \"1108 118th AVE\",\n   \"address2\": \"\",\n   \"city\": \"Dawson Creek\",\n   \"state\": \"BC\",\n   \"postal_code\": \"V1G 3H5\",\n   \"country\": \"CAN\",\n   \"available_refunds\": {},\n   \"refund_amount\": fake-refund-amount (6),\n   \"disbursement_amount\": \"0.0\",\n   \"seller_fees_amount\": fake-fee-amount (21),\n   \"seller_fees\": [\n      {  \n         \"type\": \"commission_fee\",\n         \"amount\": fake-commission-fee (2.1)\n      },\n      {  \n         \"type\": \"success_fee\",\n         \"amount\": fake-success-fee (1)\n      },\n      {  \n         \"type\": \"refund_deduction_fee\",\n         \"amount\": fake-refund-deduction-fee (17.9)\n      }\n   ],\n    \"upsells\": [],\n    \"refunded_at\": \"2017-10-18T18:07:01-07:00\",\n    \"paid_at\": \"2017-10-12T01:13:50-07:00\",\n    \"created_at\": \"2017-10-12T01:13:18-07:00\",\n    \"updated_at\": \"2018-09-26T11:05:09-07:00\",\n    \"canceled_at\": null\n}","name":""}]},"auth":"required","params":[{"_id":"5771d33b92c56c0e00b38167","ref":"","in":"body","required":true,"desc":"The order_id of the order you wish to refund.","default":"","type":"int","name":"order_id"},{"_id":"5771d54792c56c0e00b3816c","ref":"","in":"body","required":true,"desc":"The type of refund. The only acceptable values are **full** and **partial**.","default":"","type":"string","name":"type"},{"_id":"5771d63d92c56c0e00b3816d","ref":"","in":"body","required":true,"desc":"The reason for the refund. See the \"Refund Reasons\" below for the complete list of acceptable reasons.","default":"","type":"string","name":"reason"},{"_id":"5771da3792c56c0e00b38170","ref":"","in":"body","required":false,"desc":"The fees you would like to refund. Only required for partial refunds. Must be one or more of the following values: **buyer_fee**, **shipping_fee**, **expedited_shipping_fee**, and **lot_upsell_fee**. When you [retrieve an order](doc:order-retrieve) the `available_refunds` field will tell you which fees can be refunded in a partial refund.","default":"","type":"array_string","name":"fees"}],"url":"/orders/refund.json"},"isReference":false,"order":4,"body":"[block:api-header]\n{\n  \"title\": \"Refund Reasons\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"`no_buyer_communication_regarding_size`\",\n    \"h-0\": \"Reason\",\n    \"h-1\": \"Description\",\n    \"1-0\": \"`incorrect_buyers_address`\",\n    \"2-0\": \"`buyer_requested_through_ticket`\",\n    \"3-0\": \"`buyer_requested_through_resolution_center`\",\n    \"4-0\": \"`buyer_requested_a_return`\",\n    \"5-0\": \"`delay_in_shipping`\",\n    \"6-0\": \"`out_of_stock`\",\n    \"7-0\": \"`in_stock_items_damaged`\",\n    \"8-0\": \"`untrackable`\",\n    \"9-0\": \"`other`\",\n    \"0-1\": \"The size and/or color the customer requested is not available, or you're not able to determine which size and/or color the customer wants.\",\n    \"1-1\": \"The customer's shipping address is not valid and you're not able to determine what the customer's valid shipping address is.\",\n    \"2-1\": \"The customer requested a refund via a [support ticket](https://tophatter.com/support_tickets?seller=true).\",\n    \"6-1\": \"You no longer have the item in stock.\",\n    \"5-1\": \"There will be a significant delay in shipping, which will likely leave the customer unsatisfied.\",\n    \"4-1\": \"The customer has returned the product.\",\n    \"3-1\": \"The customer requested a refund via the [resolution center](https://tophatter.com/resolution_cases).\",\n    \"7-1\": \"You have this product in stock, but it is damaged.\",\n    \"8-1\": \"The order has been lost while in transit to the customer.\",\n    \"9-1\": \"None of the other options are applicable.\"\n  },\n  \"cols\": 2,\n  \"rows\": 10\n}\n[/block]","excerpt":"","slug":"order-refund","type":"endpoint","title":"Refund an Order"}

postRefund an Order


Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

order_id:
required
integer
The order_id of the order you wish to refund.
type:
required
string
The type of refund. The only acceptable values are **full** and **partial**.
reason:
required
string
The reason for the refund. See the "Refund Reasons" below for the complete list of acceptable reasons.
fees:
array of strings
The fees you would like to refund. Only required for partial refunds. Must be one or more of the following values: **buyer_fee**, **shipping_fee**, **expedited_shipping_fee**, and **lot_upsell_fee**. When you [retrieve an order](doc:order-retrieve) the `available_refunds` field will tell you which fees can be refunded in a partial refund.

Examples


Result Format


Documentation

[block:api-header] { "title": "Refund Reasons" } [/block] [block:parameters] { "data": { "0-0": "`no_buyer_communication_regarding_size`", "h-0": "Reason", "h-1": "Description", "1-0": "`incorrect_buyers_address`", "2-0": "`buyer_requested_through_ticket`", "3-0": "`buyer_requested_through_resolution_center`", "4-0": "`buyer_requested_a_return`", "5-0": "`delay_in_shipping`", "6-0": "`out_of_stock`", "7-0": "`in_stock_items_damaged`", "8-0": "`untrackable`", "9-0": "`other`", "0-1": "The size and/or color the customer requested is not available, or you're not able to determine which size and/or color the customer wants.", "1-1": "The customer's shipping address is not valid and you're not able to determine what the customer's valid shipping address is.", "2-1": "The customer requested a refund via a [support ticket](https://tophatter.com/support_tickets?seller=true).", "6-1": "You no longer have the item in stock.", "5-1": "There will be a significant delay in shipping, which will likely leave the customer unsatisfied.", "4-1": "The customer has returned the product.", "3-1": "The customer requested a refund via the [resolution center](https://tophatter.com/resolution_cases).", "7-1": "You have this product in stock, but it is damaged.", "8-1": "The order has been lost while in transit to the customer.", "9-1": "None of the other options are applicable." }, "cols": 2, "rows": 10 } [/block]