Browse the API docs

Refunds

Money given back on an order, for items, shipping or both, with the items optionally put back into stock.

Endpoints#

Paths are relative to https://store.weftgrid.com/api/admin/2026-10. The examples read the token from $STORELOOM_TOKEN and ids from variables like $ORDER_ID.

The refund object#

What the endpoints below return for one refund, and the payload of the refunds/create webhooks.

refund
{
  "id": "cm2rfnd0001",
  "order_id": "cm2ordr0001",
  "amount": "58.00",
  "shipping_amount": "0.00",
  "note": "Returned: too small",
  "restock": true,
  "refund_line_items": [
    {
      "line_item_id": "cm2line0001",
      "quantity": 1,
      "subtotal": "58.00"
    }
  ],
  "created_at": "2026-10-25T14:00:00.000Z"
}

List an order's refunds#

GET/orders/{order_id}/refunds.jsonread_orders
Request
curl "https://store.weftgrid.com/api/admin/2026-10/orders/$ORDER_ID/refunds.json" \
  -H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"
Example responseShow
{
  "refunds": [
    {
      "id": "cm2rfnd0001",
      "order_id": "cm2ordr0001",
      "amount": "58.00",
      "shipping_amount": "0.00",
      "note": "Returned: too small",
      "restock": true,
      "refund_line_items": [
        {
          "line_item_id": "cm2line0001",
          "quantity": 1,
          "subtotal": "58.00"
        }
      ],
      "created_at": "2026-10-25T14:00:00.000Z"
    }
  ]
}

Get a refund#

GET/orders/{order_id}/refunds/{id}.jsonread_orders
Request
curl "https://store.weftgrid.com/api/admin/2026-10/orders/$ORDER_ID/refunds/$REFUND_ID.json" \
  -H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"
Example responseShow
{
  "refund": {
    "id": "cm2rfnd0001",
    "order_id": "cm2ordr0001",
    "amount": "58.00",
    "shipping_amount": "0.00",
    "note": "Returned: too small",
    "restock": true,
    "refund_line_items": [
      {
        "line_item_id": "cm2line0001",
        "quantity": 1,
        "subtotal": "58.00"
      }
    ],
    "created_at": "2026-10-25T14:00:00.000Z"
  }
}

Calculate a refund#

POST/orders/{order_id}/refunds/calculate.jsonread_orders

What a refund of these items and shipping would be, without making it: each line's amount (its price after discounts, plus its tax when tax was added on top), the suggested total (capped at what's left to refund) and which payments it would go back to. shipping takes { amount } or { full_refund: true }.

Request body
{
  "refund": {
    "refund_line_items": [
      {
        "line_item_id": "cm2line0001",
        "quantity": 1
      }
    ],
    "shipping": {
      "amount": "0.00"
    }
  }
}
Request with curl
curl -X POST "https://store.weftgrid.com/api/admin/2026-10/orders/$ORDER_ID/refunds/calculate.json" \
  -H "X-Storeloom-Access-Token: $STORELOOM_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "refund": {
    "refund_line_items": [
      {
        "line_item_id": "cm2line0001",
        "quantity": 1
      }
    ],
    "shipping": {
      "amount": "0.00"
    }
  }
}'
Example responseShow
{
  "refund": {
    "refund_line_items": [
      {
        "line_item_id": "cm2line0001",
        "quantity": 1,
        "subtotal": "58.00"
      }
    ],
    "shipping": {
      "amount": "0.00",
      "maximum_refundable": "6.00"
    },
    "amount": "58.00",
    "maximum_refundable": "122.00",
    "currency": "USD",
    "transactions": [
      {
        "kind": "suggested_refund",
        "parent_id": "cm2tran0001",
        "gateway": "manual",
        "amount": "58.00"
      }
    ]
  }
}

Refund an order#

POST/orders/{order_id}/refunds.jsonwrite_orders

refund_line_items lists { line_item_id, quantity }; shipping takes { amount } or { full_refund: true }. amount overrides the suggested total (see calculate), for example to keep a restocking fee.

restock (default false) puts the refunded items back into stock. Shopify's per-line restock_type (no_restock, return, cancel) works too, when it's the same on every line.

Money goes back to the order's payments automatically: card and cash payments first, gift cards last (credited back onto the card). Card refunds go through the store's Stripe account. notify (default false) emails the customer, unless the store has turned that email off. Fires refunds/create, order_transactions/create and orders/updated.

Request body
{
  "refund": {
    "refund_line_items": [
      {
        "line_item_id": "cm2line0001",
        "quantity": 1
      }
    ],
    "restock": true,
    "note": "Returned: too small",
    "notify": true
  }
}
Request with curl
curl -X POST "https://store.weftgrid.com/api/admin/2026-10/orders/$ORDER_ID/refunds.json" \
  -H "X-Storeloom-Access-Token: $STORELOOM_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "refund": {
    "refund_line_items": [
      {
        "line_item_id": "cm2line0001",
        "quantity": 1
      }
    ],
    "restock": true,
    "note": "Returned: too small",
    "notify": true
  }
}'
Example responseShow
{
  "refund": {
    "id": "cm2rfnd0001",
    "order_id": "cm2ordr0001",
    "amount": "58.00",
    "shipping_amount": "0.00",
    "note": "Returned: too small",
    "restock": true,
    "refund_line_items": [
      {
        "line_item_id": "cm2line0001",
        "quantity": 1,
        "subtotal": "58.00"
      }
    ],
    "created_at": "2026-10-25T14:00:00.000Z"
  }
}