Refund

A refund is a record of the money returned to the customer, and/or the return of any items on an order which may or may not have been restocked.

What can you do with Refund?

The haravan API lets you do the following with the Refund resource. More detailed versions of these general actions may be available:

Refund Properties

created_at
{ "created_at" : "2008-01-10T11:00:00-05:00" }

The date and time when the refund was created. The API returns this value in ISO 8601 format.

id
{ "id" : 92738740 }

The unique numeric identifier for the refund. This one is used for API purposes.

note
{ "note" : "Item was damaged during shipping" }

The optional note attached to a refund.

refund_line_items
{ "id" : 209341123 }
{ "line_item" : {} }
{ "line_item_id" : 128323456 }
{ "quantity" : 2 }

Details about one returned/refunded item. It has the following properties:

  • id: The unique identifier of the refund line item.
  • line_item: The single line item being returned.
  • line_item_id: The id of the related line item.
  • quantity: The quantity of the associated line item that was returned.


restock
{ "restock" : true }

Whether or not the line items were added back to the store inventory.

transactions

The list of transactions involved in the refund.

user_id
{ "user_id" : 238478920 }

The unique identifier of the user who performed the refund.

Endpoints

GET/admin/orders/450789469/refunds/509562969.json

Retrieve a specific refund

fields

comma-separated list of fields to include in the response

Get a representation of a single refund

GET /admin/orders/#{id}/refunds/#{id}.json
View Response
HTTP/1.1 200 OK
{
  "refund": {
    "created_at": "2015-03-28T13:31:19-04:00",
    "id": 509562969,
    "note": "it broke during shipping",
    "order_id": 450789469,
    "restock": true,
    "user_id": 799407056,
    "refund_line_items": [
      {
        "id": 104689539,
        "line_item_id": 703073504,
        "quantity": 1,
        "line_item": {
          "fulfillment_service": "manual",
          "fulfillment_status": null,
          "gift_card": false,
          "grams": 200,
          "id": 703073504,
          "price": "199.00",
          "product_id": 632910392,
          "quantity": 1,
          "requires_shipping": true,
          "sku": "IPOD2008BLACK",
          "taxable": true,
          "title": "IPod Nano - 8gb",
          "variant_id": 457924702,
          "variant_title": "black",
          "vendor": null,
          "name": "IPod Nano - 8gb - black",
          "variant_inventory_management": "haravan",
          "properties": [
          ],
          "product_exists": true,
          "fulfillable_quantity": 1,
          "total_discount": "0.00",
          "tax_lines": [
          ]
        }
      },
      {
        "id": 709875399,
        "line_item_id": 466157049,
        "quantity": 1,
        "line_item": {
          "fulfillment_service": "manual",
          "fulfillment_status": null,
          "gift_card": false,
          "grams": 200,
          "id": 466157049,
          "price": "199.00",
          "product_id": 632910392,
          "quantity": 1,
          "requires_shipping": true,
          "sku": "IPOD2008GREEN",
          "taxable": true,
          "title": "IPod Nano - 8gb",
          "variant_id": 39072856,
          "variant_title": "green",
          "vendor": null,
          "name": "IPod Nano - 8gb - green",
          "variant_inventory_management": "haravan",
          "properties": [
            {
              "name": "Custom Engraving Front",
              "value": "Happy Birthday"
            },
            {
              "name": "Custom Engraving Back",
              "value": "Merry Christmas"
            }
          ],
          "product_exists": true,
          "fulfillable_quantity": 1,
          "total_discount": "0.00",
          "tax_lines": [
          ]
        }
      }
    ],
    "transactions": [
      {
        "amount": "209.00",
        "authorization": "authorization-key",
        "created_at": "2005-08-05T12:59:12-04:00",
        "currency": "USD",
        "gateway": "bogus",
        "id": 179259969,
        "kind": "refund",
        "location_id": null,
        "message": null,
        "order_id": 450789469,
        "parent_id": null,
        "status": "success",
        "test": false,
        "user_id": null,
        "device_id": null,
        "receipt": {},
        "error_code": null,
        "source_name": "web"
      }
    ]
  }
}