Browse the API docs

Transactions

Money movements on an order, by gateway: payments (kind sale) and refunds (kind refund).

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 transaction object#

What the endpoints below return for one transaction, and the payload of the order_transactions/create webhooks.

transaction
{
  "id": "cm2tran0001",
  "order_id": "cm2ordr0001",
  "kind": "sale",
  "parent_id": null,
  "gateway": "manual",
  "amount": "122.00",
  "currency": "USD",
  "status": "success",
  "authorization": "BANK-20261023-117",
  "gift_card_id": null,
  "message": "Recorded through the Admin API",
  "created_at": "2026-10-23T09:30:00.000Z"
}

List an order's transactions#

GET/orders/{order_id}/transactions.jsonread_orders

Payments (kind sale) and refunds (kind refund, with parent_id pointing at the payment), oldest first.

Request
curl "https://store.weftgrid.com/api/admin/2026-10/orders/$ORDER_ID/transactions.json" \
  -H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"
Example responseShow
{
  "transactions": [
    {
      "id": "cm2tran0001",
      "order_id": "cm2ordr0001",
      "kind": "sale",
      "parent_id": null,
      "gateway": "manual",
      "amount": "122.00",
      "currency": "USD",
      "status": "success",
      "authorization": "BANK-20261023-117",
      "gift_card_id": null,
      "message": "Recorded through the Admin API",
      "created_at": "2026-10-23T09:30:00.000Z"
    }
  ]
}

Count an order's transactions#

GET/orders/{order_id}/transactions/count.jsonread_orders
Request
curl "https://store.weftgrid.com/api/admin/2026-10/orders/$ORDER_ID/transactions/count.json" \
  -H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"
Example responseShow
{
  "count": 2
}

Get a transaction#

GET/orders/{order_id}/transactions/{id}.jsonread_orders
Request
curl "https://store.weftgrid.com/api/admin/2026-10/orders/$ORDER_ID/transactions/$TRANSACTION_ID.json" \
  -H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"
Example responseShow
{
  "transaction": {
    "id": "cm2tran0001",
    "order_id": "cm2ordr0001",
    "kind": "sale",
    "parent_id": null,
    "gateway": "manual",
    "amount": "122.00",
    "currency": "USD",
    "status": "success",
    "authorization": "BANK-20261023-117",
    "gift_card_id": null,
    "message": "Recorded through the Admin API",
    "created_at": "2026-10-23T09:30:00.000Z"
  }
}

Record a payment#

POST/orders/{order_id}/transactions.jsonwrite_orders

Records a payment you took yourself: cash on delivery collected, a bank transfer arrived, an advance paid before shipping. kind must be sale; refunds go through POST /orders/{id}/refunds.json.

Without amount the payment covers the whole outstanding balance (total_outstanding). An amount below it is a **part payment** (since 7.3): the order becomes partially_paid, total_outstanding drops by it, and further part payments add up until the last one settles the order (paid, with orders/paid). An amount above the balance is refused. Send authorization (your reference) with part payments: the same reference sent again answers the payment already recorded (200) instead of recording it twice. gateway defaults to the order's payment method (manual for card orders). The customer's open Stripe pages for the order (its checkout, or a balance after an edit) are closed first: 422 if one turns out to be paid (that payment is recorded instead), 503 if Stripe can't be reached. While the customer is paying with JazzCash or Easypaisa (a wallet or card attempt still inside its window), it's refused with 409. Fires orders/paid, orders/updated and order_transactions/create.

For an order that sells gift cards (they're issued once it's paid), this needs the write_gift_cards scope (403 otherwise). A part payment fires orders/updated and order_transactions/create.

Request body
{
  "transaction": {
    "kind": "sale",
    "amount": "122.00",
    "gateway": "bank_transfer",
    "authorization": "BANK-20261023-117"
  }
}
Request with curl
curl -X POST "https://store.weftgrid.com/api/admin/2026-10/orders/$ORDER_ID/transactions.json" \
  -H "X-Storeloom-Access-Token: $STORELOOM_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "transaction": {
    "kind": "sale",
    "amount": "122.00",
    "gateway": "bank_transfer",
    "authorization": "BANK-20261023-117"
  }
}'
Example responseShow
{
  "transaction": {
    "id": "cm2tran0001",
    "order_id": "cm2ordr0001",
    "kind": "sale",
    "parent_id": null,
    "gateway": "bank_transfer",
    "amount": "122.00",
    "currency": "USD",
    "status": "success",
    "authorization": "BANK-20261023-117",
    "gift_card_id": null,
    "message": "Recorded through the Admin API",
    "created_at": "2026-10-23T09:30:00.000Z"
  }
}