---
title: "Grant credit"
method: POST
path: "/credits"
tags: ["Credits"]
---

# Grant credit

`POST /credits`

Grant credit

## Request body

- CreateCreditRequest — payload to create credits
  - `creditRequests` CreditRequest[], required
    - `accountId` string, required
    - `purpose` string, required
    - `applicableEntityIds` string[] — List of entity ids for which the credit is applicable. If null or empty, the credit is applicable to all ids. This list can accept special values like: - ALL_USAGE_METER_RATE_CARDS: To apply the credit to all usage meter rate cards - ALL_FIXED_FEE_RATE_CARDS: To apply the credit to all fixed fee rate cards
    - `effectiveFrom` string, date, required
    - `effectiveUntil` string, date
    - `creditAmount` number
    - `priority` integer, required
    - `grantorId` string — The entity through which the credit has been granted
    - `idempotencyKey` string — The idempotency key for uniqueness of the credit record

## Response `200`

Response for List credits request

- CreateCreditResponse
  - `credits` Credit[], required
    - `accountId` string, required
    - `purpose` string, required
    - `applicableEntityIds` string[] — List of entity ids for which the credit is applicable. If null or empty, the credit is applicable to all ids. This list can accept special values like: - ALL_USAGE_METER_RATE_CARDS: To apply the credit to all usage meter rate cards - ALL_FIXED_FEE_RATE_CARDS: To apply the credit to all fixed fee rate cards
    - `effectiveFrom` string, date, required
    - `effectiveUntil` string, date
    - `creditAmount` number
    - `priority` integer, required
    - `grantorId` string — The entity through which the credit has been granted
    - `idempotencyKey` string — The idempotency key for uniqueness of the credit record
    - `id` string, required — Identifier of credits
    - `customerId` string, required
    - `status` 'ACTIVE' | 'CONSUMED' | 'EXPIRED' | 'VOIDED', required
    - `creditUnit` string
    - `holdAmount` number
    - `consumedAmount` number
    - `createdAt` string, date-time, required
    - `updatedAt` string, date-time

## Other responses

- `400` — Error response
- `401` — Error response
- `403` — Error response
- `404` — Error response
- `429` — Error response
- `default` — Error response

---

[API](https://skmtc.net/togaihq/apis/togai-apis.md) · [All operations](https://skmtc.net/togaihq/apis/togai-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/togaihq/togai-apis/versions/442f5d8f4aa0/schema)
