---
title: "Debit an account"
method: POST
path: "/v1/customer-credits/accounts/{id}/debit"
tags: ["Customer Credits - Accounts (Experimental)"]
---

# Debit an account

`POST /v1/customer-credits/accounts/{id}/debit`

Deduct credits from a customer account. Returns the resulting transaction record.

## Path parameters

- `id` string, required

## Request body

- CreditDebitRequestDto
  - `amount` string, required — Amount to credit or debit (string to support large numbers)
  - `reference` string, required — Your reference ID to link this transaction to an event in your system (e.g. order ID, campaign ID)
  - `idempotency_key` string, required — Idempotency key to prevent duplicate transactions

## Response `201`

Debit transaction created

- TransactionResponseDto
  - `id` string, required — Transaction ID
  - `store_id` string, required — Store ID
  - `reference` string, required — Reference string
  - `idempotency_key` string, required — Idempotency key
  - `reversal_of` string, nullable — ID of the transaction this reverses, if applicable
  - `entries` EntryResponseDto[], required — Transaction entries
    - `id` string, required — Entry ID
    - `transaction_id` string, required — Transaction ID
    - `account_id` string, required — Account ID
    - `side` 'debit' | 'credit', required — Debit or credit side
    - `amount` string, required — Amount as string for bigint safety
    - `created_at` string, required — Creation timestamp
  - `created_at` string, required — Creation timestamp

## Other responses

- `400` — Bad Request - Invalid input parameters
- `401` — Unauthorized - Invalid or missing API key
- `404` — Not Found - Resource does not exist
- `409` — Account frozen or closed

---

[API](https://skmtc.net/creem/apis/creem-api.md) · [All operations](https://skmtc.net/creem/apis/creem-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/creem/creem-api/revisions/11305a63d3c9/schema)
