---
title: "Void credit"
method: POST
path: "/credits/{credit_id}/void"
tags: ["Credits"]
---

# Void credit

`POST /credits/{credit_id}/void`

## Request

- Base URL: `https://api.togai.com`
- URL: `https://api.togai.com/credits/{credit_id}/void`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/togaihq/apis/togai-apis/docs/credits/:credit_id/void/post.ts> (a function with typed inputs; its response is checked against the schema)

Void credit

## Path parameters

- `credit_id` string, required

## Response `200`

Response for Void credit request

- Credit: Payload to grant Credits
  - `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

## Changes

- **2024-03-18** `3135bb8c67b3`: 2 breaking, 1 info
  - the response's body type changed from `object` to no type for status `200`
  - removed the required property `credits` from the response with the `200` status
  - added `#/components/schemas/CreditRequest, subschema #2` to the response body `allOf` list for the response status `200`
- **2023-11-30** `b3351be4b462`: 1 breaking
  - the response property `credits/items/allOf[#/components/schemas/CreditRequest]/creditAmount` became optional for the status `200`
- **2023-09-25** `ae3b70608528`: 1 info
  - added the optional property `credits/items/allOf[#/components/schemas/CreditRequest]/idempotencyKey` to the response with the `200` status
- **2023-09-07** `cfabb13f9886`: 1 breaking, 2 info
  - the response's body type changed from no type to `object` for status `200`
  - removed `#/components/schemas/CreateCreditRequest, subschema #2` from the response body `allOf` list for the response status `200`
  - added the required property `credits` to the response with the `200` status
- **2023-09-02** `6b13f6f47735`: 2 info
  - added `#/components/schemas/CreateCreditRequest` to the response body `allOf` list for the response status `200`
  - removed `#/components/schemas/CreditRequest` from the response body `allOf` list for the response status `200`

[Operation history](https://skmtc.dev/togaihq/apis/togai-apis/changes/credits/:credit_id/void/post.md)

---

[API](https://skmtc.dev/togaihq/apis/togai-apis.md) - [All operations](https://skmtc.dev/togaihq/apis/togai-apis/llms.txt) - [OpenAPI document](https://skmtc.dev/togaihq/apis/togai-apis/revisions/442f5d8f4aa0?raw)
