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

# Create transaction state



## OpenAPI

````yaml /openapi/issuer-api.json post /api/v1/issuers/{slug}/cards/{cardId}/transaction_states
openapi: 3.0.3
info:
  title: OpenCard Issuer API
  version: '1.0'
  description: >-
    Card issuers register cards and push transaction states. Replace {slug} with
    your assigned issuer identifier.
  contact:
    email: support@opencard.io
servers:
  - url: https://api.opencard.io
    description: Production
  - url: https://sandbox-api.opencard.io
    description: Sandbox
security: []
tags:
  - name: Cards
    description: Card registry
  - name: Transaction States
    description: Transaction lifecycle events
paths:
  /api/v1/issuers/{slug}/cards/{cardId}/transaction_states:
    post:
      tags:
        - Transaction States
      summary: Create transaction state
      operationId: createIssuerTransactionState
      parameters:
        - name: slug
          in: path
          required: true
          description: Issuer slug assigned by OpenCard
          schema:
            type: string
        - name: cardId
          in: path
          required: true
          description: Your card id from POST /cards
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IssuerTransactionStateCreate'
            example:
              id: tx_1234567891
              state: cleared
              type: CARD_PURCHASE
              invoice_number: null
              original_amount: 109.38
              original_currency: SEK
              accounting_amount: 109.38
              accounting_currency: SEK
              exchange_rate: 1
              vat_rate: 0.25
              vat_amount: 21.88
              vat_currency: SEK
              purchase_merchant: Coop Vasagatan
              purchase_time: '2025-11-17T15:35:11Z'
              purchase_country: SE
              purchase_city: STOCKHOLM
              mcc_code: '5411'
              merchant_number: '12345678'
              terminal_id: TERM001
              rrn: '123456789012'
              auth_code: A1B2C3
      responses:
        '202':
          description: Accepted
          content:
            application/json: {}
        '409':
          description: Duplicate
          content:
            application/json:
              example:
                ok: false
                error: duplicate_transaction_state
      security:
        - bearer: []
components:
  schemas:
    IssuerTransactionStateCreate:
      type: object
      required:
        - id
        - state
        - type
        - original_amount
        - original_currency
        - accounting_amount
        - accounting_currency
        - exchange_rate
        - purchase_merchant
        - purchase_time
        - purchase_country
        - mcc_code
        - merchant_number
        - terminal_id
        - rrn
        - auth_code
      properties:
        id:
          type: string
        state:
          type: string
          enum:
            - authorized
            - cleared
            - invoiced
            - deleted
        type:
          type: string
          enum:
            - CARD_PURCHASE
            - CASH_WITHDRAWAL
            - FEE_AND_DISCOUNT
        invoice_number:
          type: string
          nullable: true
        original_amount:
          type: number
        original_currency:
          type: string
        accounting_amount:
          type: number
        accounting_currency:
          type: string
        exchange_rate:
          type: number
        vat_rate:
          type: number
        vat_amount:
          type: number
        vat_currency:
          type: string
        purchase_merchant:
          type: string
        purchase_time:
          type: string
          format: date-time
        purchase_country:
          type: string
        purchase_city:
          type: string
        mcc_code:
          type: string
        merchant_number:
          type: string
        terminal_id:
          type: string
        rrn:
          type: string
        auth_code:
          type: string
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````