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

# Print Receipt

> Triggers the printing of a transaction receipt on the terminal.



## OpenAPI

````yaml /openapi-spec-c2c.yaml post /commands/receipt
openapi: 3.1.0
info:
  title: Xendit in-person payments API (C2C)
  description: >-
    This specification documents the client-to-client command API for Xendit
    in-person payments. Use it for local-network terminal commands such as pay,
    cancel, receipt, settlement, and transaction history.
  version: 1.3.0
servers:
  - url: http://{IP_ADDRESS}:{PORT}
    description: Client-to-Client Endpoint
    variables:
      IP_ADDRESS:
        default: 172.0.0.1
        description: The IP address displayed on the Terminal Gateway App main screen.
      PORT:
        default: '8189'
        description: The port number configured in the Terminal Gateway App.
  - url: https://{IP_ADDRESS}:{PORT}
    description: Secure Client-to-Client Endpoint
    variables:
      IP_ADDRESS:
        default: 172.0.0.1
        description: The IP address displayed on the Terminal Gateway App main screen.
      PORT:
        default: '8189'
        description: The port number configured in the Terminal Gateway App.
security:
  - ApiKeyAuth: []
tags:
  - name: In-person payments C2C API
    description: Payment operations and transactions
paths:
  /commands/receipt:
    post:
      tags:
        - In-person payments C2C API
      summary: Print Receipt
      description: Triggers the printing of a transaction receipt on the terminal.
      operationId: printReceipt
      parameters:
        - name: provider
          in: header
          required: true
          schema:
            type: string
            enum:
              - BRI
              - NTT
              - CASHUP
              - SHC
          description: Provider name.
        - name: simulation
          in: header
          required: false
          schema:
            type: boolean
          description: Simulation/mock response flag.
          example: false
        - name: pretty-print
          in: header
          required: false
          schema:
            type: boolean
          description: Json Pretty Formatter flag.
          example: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReceiptRequest'
            example:
              terminal_id: '10362517'
              payment_method: QRIS
              terminal_reference: 1750407594445|1750407594
      responses:
        '200':
          description: Successful receipt print response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReceiptResponse'
              example:
                terminal_id: '10362517'
                terminal_reference: N/A|1750407594
                payment_method: QRIS
                amount: 1000
                currency: IDR
                transaction_date: '2025-06-20T08:26:19.000Z'
                status: SUCCESS
        '400':
          description: Bad request - invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error_code: INVALREQUEST
                message: Invalid terminal ID
        '401':
          description: Unauthorized - invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error_code: INVALCREDENTIAL
                message: Invalid API key
        '404':
          description: Transaction not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error_code: NO_DATA_FOUND
                message: Transaction not found
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error_code: INTERNAL_SERVER_ERROR
                message: Internal server error
        default:
          description: An error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ReceiptRequest:
      allOf:
        - $ref: '#/components/schemas/BaseRequest'
        - type: object
          required:
            - terminal_reference
          properties:
            terminal_reference:
              type: string
              minLength: 1
              maxLength: 100
              description: terminal_reference from /pay response.
              example: 1750407594445|1750407594
    ReceiptResponse:
      allOf:
        - $ref: '#/components/schemas/BaseResponse'
        - type: object
          required:
            - order_id
            - status
          properties:
            order_id:
              type: string
              description: >-
                Merchant's order ID. Uses only letters and numbers
                (alphanumeric). Hyphens, underscores, and other special
                characters are not allowed and may cause the transaction to fail
                to execute or complete.
              example: test1223323
    Error:
      type: object
      required:
        - error_code
        - message
      properties:
        error_code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
          description: Error message.
          example: Transaction Failed
    BaseRequest:
      type: object
      required:
        - terminal_id
        - payment_method
      properties:
        terminal_id:
          type: string
          minLength: 1
          maxLength: 50
          description: Terminal's ID.
          example: '10362517'
        payment_method:
          $ref: '#/components/schemas/PaymentMethod'
    BaseResponse:
      type: object
      properties:
        status:
          $ref: '#/components/schemas/TransactionStatus'
        terminal_reference:
          type: string
          description: Reference for Void & Receipt.
          example: 1750407594445|1750407594
        payment_method:
          $ref: '#/components/schemas/PaymentMethod'
        amount:
          type: number
          format: double
          minimum: 0
          description: The transaction amount.
          example: 100
        currency:
          type: string
          minLength: 3
          maxLength: 3
          description: The transaction currency (ISO 4217).
          example: IDR
        transaction_date:
          type: string
          format: date-time
          description: The date and time of the transaction.
          example: '2025-06-20T08:19:54.000Z'
    ErrorCode:
      type: string
      enum:
        - INVALCREDENTIAL
        - INVALREQUEST
        - INTERNAL_SERVER_ERROR
        - UNKNOWN_ERROR
        - KEY_INVALID
        - SEND_FAILED
        - NOT_CONNECTED
        - FAILED_TO_CONNECT
        - UNSUPPORTED
        - TERMINAL_BUSY
        - ENCRYPTION_FAILED
        - DECLINED_BY_READER
        - PAYMENT_UNPAID
        - DUPLICATED
        - CANCELLED
        - TIMEOUT
        - NO_DATA_FOUND
        - VOFAILED
        - REFUNDED
        - NEED_DO_SETTLEMENT
        - CHIP_CARD_DETECTED
        - TRANSACTION_FAILED
        - TNOT_SET
        - TNOT_MATCH
        - TNOT_FOUND
        - AUTHENTICATION_FAILED
        - WRONG_PIN
      description: Error codes returned by the API
      example: INVALREQUEST
    PaymentMethod:
      type: string
      enum:
        - CARD
        - EWALLET
        - QRIS
      description: Available payment methods
      example: QRIS
    TransactionStatus:
      type: string
      enum:
        - SUCCESS
        - FAILED
      description: Transaction status values
      example: SUCCESS
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: API key for authentication

````