> ## 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.

# Apply a vendor credits

> Apply a vendor credits

### Path parameters

<ParamField path="id" type="string" required>
  Vendor credit ID
</ParamField>

### Request body

`ApplyVendorCreditRequest`

<ParamField body="amount" type="string" required>
  Amount to apply as a string.
</ParamField>

<ParamField body="target_id" type="string" required />

<ParamField body="target_type" type="string" required>
  `bill` or `payment_obligation`.
</ParamField>

### Responses

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

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

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

<ResponseExample>
  ```json 200 theme={null}
  {
    "amount": "string",
    "currency": "string",
    "id": "string",
    "number": "string",
    "remaining": "string",
    "status": "string",
    "supplier_id": "string"
  }
  ```
</ResponseExample>
