> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# `POST /api/v1/store-credits/&#123;id&#125;/apply` — debit a store credit (e.g. against an order). Rejected for non-positive amounts, non-active or expired credits, and insufficient balance.

> `POST /api/v1/store-credits/&#123;id&#125;/apply` — debit a store credit (e.g. against an order). Rejected for non-positive amounts, non-active or expired credits, and insufficient balance.

### Path parameters

<ParamField path="id" type="string" required>
  Store credit ID (UUID)
</ParamField>

### Request body

`ApplyStoreCreditRequest`

<ParamField body="amount" type="string" required>
  Amount to debit from the credit. Must be positive.
</ParamField>

<ParamField body="reference_id" type="string,null">
  Optional reference (e.g. order ID) recorded on the transaction.
</ParamField>

### Responses

<ResponseField name="200" type="StoreCreditTransactionResponse" />

<ResponseField name="404" type="ErrorBody" />

<ResponseField name="422" type="ErrorBody" />

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.stateset.com/api/v1/store-credits/{id}/apply' \
    --header 'Authorization: Bearer YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
    "amount": "string",
    "reference_id": null
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "amount": "string",
    "balance_after": "string",
    "created_at": "string",
    "id": "string",
    "reference_id": null,
    "store_credit_id": "string",
    "transaction_type": "string"
  }
  ```
</ResponseExample>
