Browse the API docs

Store credit

Money a customer holds with the store, one account per currency, to spend at checkout or at the point of sale. Every change is kept in the account's history.

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.

List a customer's store credit accounts#

GET/customers/{id}/store_credit_accounts.jsonread_store_credit

One account per currency, the store's own first; an order placed in another market's currency refunds into an account in that currency. Customers who never had credit have none.

Request
curl "https://store.weftgrid.com/api/admin/2026-10/customers/$CUSTOMER_ID/store_credit_accounts.json" \
  -H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"
Example responseShow
{
  "store_credit_accounts": [
    {
      "id": "cm2scac0001",
      "customer_id": "cm2cust0001",
      "currency": "USD",
      "balance": "40.00",
      "created_at": "2026-10-12T15:20:00.000Z",
      "updated_at": "2026-10-24T10:05:00.000Z"
    }
  ]
}

List an account's transactions#

GET/store_credit_accounts/{id}/transactions.jsonread_store_credit

The account's history, oldest first, like every list: each change with the balance after it. amount is negative when credit was spent or taken away. reason is one of: refund, return (a return refunded as store credit), adjustment (staff or an app), order (spent at checkout), order_refund (credit spent on an order, given back), pos (spent at the point of sale), cancellation (an order cancelled).

Query parameters
ParameterDescription
created_at_min / created_at_maxISO 8601 bounds on when the change was made.
limit, page_info, since_idPagination, as for every list (limit 1–250, default 50).
Request
curl "https://store.weftgrid.com/api/admin/2026-10/store_credit_accounts/$STORE_CREDIT_ACCOUNT_ID/transactions.json" \
  -H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"
Example responseShow
{
  "transactions": [
    {
      "id": "cm2sctx0001",
      "account_id": "cm2scac0001",
      "kind": "credit",
      "amount": "25.00",
      "balance_after": "40.00",
      "currency": "USD",
      "reason": "adjustment",
      "note": "Sorry for the late delivery",
      "order_id": null,
      "return_id": null,
      "created_at": "2026-10-24T10:05:00.000Z"
    }
  ]
}

Add or remove store credit#

POST/customers/{id}/store_credit_account_transactions.jsonwrite_store_credit

kind is credit (adds to the balance) or debit (takes it away; never below zero, so a debit larger than the balance is refused with a 422 on amount). amount is a positive decimal string ("25.00"). currency defaults to the store's; it can be the store's or one the customer already has an account in. note (up to 500 characters) is for staff; customers see "Added by the store". notify_customer (default false) emails the customer about added credit, as Settings → Notifications allows. Responds with the new transaction and the account.

Request body
{
  "transaction": {
    "kind": "credit",
    "amount": "25.00",
    "currency": "USD",
    "note": "Sorry for the late delivery",
    "notify_customer": true
  }
}
Request with curl
curl -X POST "https://store.weftgrid.com/api/admin/2026-10/customers/$CUSTOMER_ID/store_credit_account_transactions.json" \
  -H "X-Storeloom-Access-Token: $STORELOOM_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "transaction": {
    "kind": "credit",
    "amount": "25.00",
    "currency": "USD",
    "note": "Sorry for the late delivery",
    "notify_customer": true
  }
}'
Example responseShow
{
  "transaction": {
    "id": "cm2sctx0001",
    "account_id": "cm2scac0001",
    "kind": "credit",
    "amount": "25.00",
    "balance_after": "40.00",
    "currency": "USD",
    "reason": "adjustment",
    "note": "Sorry for the late delivery",
    "order_id": null,
    "return_id": null,
    "created_at": "2026-10-24T10:05:00.000Z"
  },
  "store_credit_account": {
    "id": "cm2scac0001",
    "customer_id": "cm2cust0001",
    "currency": "USD",
    "balance": "40.00",
    "created_at": "2026-10-12T15:20:00.000Z",
    "updated_at": "2026-10-24T10:05:00.000Z"
  }
}