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#
- GET
/customers/{id}/store_credit_accounts.jsonList a customer's store credit accounts - GET
/store_credit_accounts/{id}/transactions.jsonList an account's transactions - POST
/customers/{id}/store_credit_account_transactions.jsonAdd or remove store credit
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#
/customers/{id}/store_credit_accounts.jsonread_store_creditOne 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.
curl "https://store.weftgrid.com/api/admin/2026-10/customers/$CUSTOMER_ID/store_credit_accounts.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"Example responseShowHide
{
"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#
/store_credit_accounts/{id}/transactions.jsonread_store_creditThe 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).
| Parameter | Description |
|---|---|
created_at_min / created_at_max | ISO 8601 bounds on when the change was made. |
limit, page_info, since_id | Pagination, as for every list (limit 1–250, default 50). |
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 responseShowHide
{
"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#
/customers/{id}/store_credit_account_transactions.jsonwrite_store_creditkind 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.
{
"transaction": {
"kind": "credit",
"amount": "25.00",
"currency": "USD",
"note": "Sorry for the late delivery",
"notify_customer": true
}
}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 responseShowHide
{
"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"
}
}