---
title: "Post a transaction"
method: POST
path: "/v1/customer-credits/transactions"
tags: ["Customer Credits - Transactions"]
---

# Post a transaction

`POST /v1/customer-credits/transactions`

## Request

- Base URL: `https://api.creem.io`
- URL: `https://api.creem.io/v1/customer-credits/transactions`
- Auth: API key in header `x-api-key`
- TypeScript: <https://skmtc.dev/creem/apis/creem-api/docs/v1/customer-credits/transactions/post.ts> (a function with typed inputs; its response is checked against the schema)

Post a multi-entry transaction. Entries must balance (total debits must equal total credits).

## Request body

- PostTransactionDto
  - `reference` string, required: Your reference ID to link this transaction to an event in your system
  - `idempotency_key` string, required: Idempotency key to prevent duplicate transactions
  - `entries` EntryInputDto[], required: Array of entries. Must have at least 2 entries and the total debits must equal total credits.
    - `account_id` string, required: The account ID for this entry
    - `side` 'debit' | 'credit', required: Debit or credit side
    - `amount` string, required: Entry amount (string to support large numbers)

## Response `201`

Transaction posted

- 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
- `422`: Unbalanced transaction — debits must equal credits

## Changes

- **2026-09-15** `4b5d3db71ff5`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/creem/apis/creem-api/changes/v1/customer-credits/transactions/post.md)

---

[API](https://skmtc.dev/creem/apis/creem-api.md) - [All operations](https://skmtc.dev/creem/apis/creem-api/llms.txt) - [OpenAPI document](https://skmtc.dev/creem/apis/creem-api/revisions/3f39a8f266c3?raw)
