> ## Documentation Index
> Fetch the complete documentation index at: https://docs.creem.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Reverse a transaction

> Reverse a previous credit or debit on this account. Creates a new transaction that undoes the original, preserving the full history.



## OpenAPI

````yaml post /v1/customer-credits/accounts/{id}/reverse
openapi: 3.0.0
info:
  title: Creem API
  description: >-
    Creem is an all-in-one platform for managing subscriptions and recurring
    revenue, tailored specifically for today's SaaS companies. It enables you to
    boost revenue, enhance customer retention, and scale your operations
    seamlessly.
  version: v1
  contact:
    name: Creem Support
    url: https://creem.io
    email: support@creem.io
  license:
    name: Commercial
    url: https://creem.io/terms
  termsOfService: https://creem.io/terms
servers:
  - url: https://api.creem.io
    description: Production — live API for processing real transactions and data.
    x-speakeasy-server-id: prod
  - url: https://test-api.creem.io
    description: Test — sandbox API for development and testing with no real charges.
    x-speakeasy-server-id: test
security: []
tags: []
externalDocs:
  description: Creem Documentation
  url: https://docs.creem.io
paths:
  /v1/customer-credits/accounts/{id}/reverse:
    post:
      tags:
        - Customer Credits - Accounts (Experimental)
      summary: Reverse a transaction
      description: >-
        Reverse a previous credit or debit on this account. Creates a new
        transaction that undoes the original, preserving the full history.
      operationId: reverseCustomerCreditsAccountTransaction
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReverseTransactionRequestDto'
      responses:
        '201':
          description: Reversal transaction created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionResponseDto'
        '400':
          description: Bad Request - Invalid input parameters
        '401':
          description: Unauthorized - Invalid or missing API key
        '404':
          description: Not Found - Resource does not exist
      security:
        - ApiKey: []
components:
  schemas:
    ReverseTransactionRequestDto:
      type: object
      properties:
        transaction_id:
          type: string
          description: ID of the transaction to reverse
          example: cct_abc123
      required:
        - transaction_id
    TransactionResponseDto:
      type: object
      properties:
        id:
          type: string
          description: Transaction ID
          example: cct_abc123
        store_id:
          type: string
          description: Store ID
        reference:
          type: string
          description: Reference string
          example: order_xyz
        idempotency_key:
          type: string
          description: Idempotency key
        reversal_of:
          type: object
          description: ID of the transaction this reverses, if applicable
          example: cct_abc123
        entries:
          description: Transaction entries
          type: array
          items:
            $ref: '#/components/schemas/EntryResponseDto'
        created_at:
          type: string
          description: Creation timestamp
      required:
        - id
        - store_id
        - reference
        - idempotency_key
        - entries
        - created_at
    EntryResponseDto:
      type: object
      properties:
        id:
          type: string
          description: Entry ID
          example: cce_abc123
        transaction_id:
          type: string
          description: Transaction ID
          example: cct_abc123
        account_id:
          type: string
          description: Account ID
          example: cca_abc123
        side:
          type: string
          description: Debit or credit side
          enum:
            - debit
            - credit
        amount:
          type: string
          description: Amount as string for bigint safety
          example: '1000'
        created_at:
          type: string
          description: Creation timestamp
      required:
        - id
        - transaction_id
        - account_id
        - side
        - amount
        - created_at
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key for authentication. You can find your API key in the Creem
        dashboard under Settings > API Keys.

````