# Store Credit **Category:** Admin **Base URL:** `/admin/store-credit-accounts` **Authentication:** Required **Routes:** 4 routes documented ## Overview This section documents 4 API routes for store credit. A store credit account holds a balance for one customer in one currency, drawn down by credit and debit transactions. For a balance that travels with a code instead, see [gift cards](/admin/gift-cards). Customers reach their own accounts through the [storefront endpoints](/store/store-credit). Applying a balance to a cart does not spend it. The deduction happens when the order completes, and is undone if payment fails. See [Gift Cards & Store Credit](/guides/gift-cards-store-credit) for the full lifecycle, the differences between the two, refunds, and troubleshooting. > ⚠️ **These endpoints operate on your live store.** `POST`/`PUT`/`DELETE` operations here — including sync, push, resync, and cache operations — modify or delete production data, and some trigger downstream effects such as warehouse orders or customer emails. `DELETE` operations are generally irreversible. Verify IDs and parameters carefully before calling them from scripts. ## Quick Reference | Method | Endpoint | Description | |--------|----------|-------------| | POST | `/admin/store-credit-accounts` | Open a store credit account for a customer. Takes `customer_... | | GET | `/admin/store-credit-accounts` | List store credit accounts. Supports `q` and pagination. | | GET | `/admin/store-credit-accounts/:id` | Retrieve one account and its current balance. | | POST | `/admin/store-credit-accounts/:id/credit` | Add credit to an account. Takes `amount` and an optional `no... | | GET | `/admin/store-credit-accounts/:id/transactions` | List the account ledger: the CREDIT and DEBIT entries that p... | --- ## POST Admin Store-credit-accounts **Endpoint:** `POST /admin/store-credit-accounts` **Authentication:** Admin (Required) ### Description Open a store credit account for a customer. Takes `customer_id` and `currency_code`. The account starts empty — add funds with the credit endpoint below. ### Request Body | Field | Type | Required | |-------|------|----------| | `currency_code` | string | Yes | | `customer_id` | string | No | | `metadata` | record | No | ### Response **Success:** ```typescript { store_credit_account, } ``` ### Example Request ```bash curl -X POST 'https://your-store.omnicart.cc/admin/store-credit-accounts' \ -H 'Authorization: Bearer YOUR_TOKEN' \ -H 'Content-Type: application/json' ``` --- ## GET Admin Store-credit-accounts **Endpoint:** `GET /admin/store-credit-accounts` **Authentication:** Admin (Required) ### Description List store credit accounts. Supports `q` and pagination. ### Response **Success:** ```typescript { store_credit_accounts, count, offset, limit, } ``` ### Example Request ```bash curl -X GET 'https://your-store.omnicart.cc/admin/store-credit-accounts' \ -H 'Authorization: Bearer YOUR_TOKEN' \ -H 'Content-Type: application/json' ``` --- ## GET Admin Store-credit-accounts :id **Endpoint:** `GET /admin/store-credit-accounts/:id` **Authentication:** Admin (Required) ### Description Retrieve one account and its current balance. ### URL Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `id` | string | Yes | Id identifier | ### Response **Success:** ```typescript { store_credit_account, } ``` ### Example Request ```bash curl -X GET 'https://your-store.omnicart.cc/admin/store-credit-accounts/:id' \ -H 'Authorization: Bearer YOUR_TOKEN' \ -H 'Content-Type: application/json' ``` --- ## POST Admin Store-credit-accounts :id Credit **Endpoint:** `POST /admin/store-credit-accounts/:id/credit` **Authentication:** Admin (Required) ### Description Add credit to an account. Takes `amount` and an optional `note`, which is worth setting — it is what appears in the transaction ledger when someone later asks why the balance changed. ### URL Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `id` | string | Yes | Id identifier | ### Request Body | Field | Type | Required | |-------|------|----------| | `amount` | number | Yes | | `note` | string | No | ### Response **Success:** ```typescript { store_credit_account, } ``` ### Example Request ```bash curl -X POST 'https://your-store.omnicart.cc/admin/store-credit-accounts/:id/credit' \ -H 'Authorization: Bearer YOUR_TOKEN' \ -H 'Content-Type: application/json' ``` --- ## GET Admin Store-credit-accounts :id Transactions **Endpoint:** `GET /admin/store-credit-accounts/:id/transactions` **Authentication:** Admin (Required) ### Description List the account ledger: the CREDIT and DEBIT entries that produced the current balance, rather than the balance alone. ### URL Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `id` | string | Yes | Id identifier | ### Response **Success:** ```typescript { transactions, count, offset, limit, } ``` ### Example Request ```bash curl -X GET 'https://your-store.omnicart.cc/admin/store-credit-accounts/:id/transactions' \ -H 'Authorization: Bearer YOUR_TOKEN' \ -H 'Content-Type: application/json' ``` ---