> ## 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.

# List Terminal Payment Sessions



## OpenAPI

````yaml /openapi-spec.yaml get /v1/terminal/sessions
openapi: 3.0.3
info:
  title: Xendit in-person payments API (H2H)
  version: 0.5.1
  description: >-
    API specification for Xendit's in-person payments H2H payment sessions and
    command endpoints.
servers:
  - url: https://terminal-dev.xendit.co
    description: Development
  - url: https://terminal.xendit.co
    description: Live
security: []
paths:
  /v1/terminal/sessions:
    get:
      tags:
        - In-person payments H2H API
      summary: List Terminal Payment Sessions
      operationId: listTerminalPaymentSessions
      parameters:
        - name: reference_id
          in: query
          required: true
          schema:
            type: string
          description: Filter sessions by reference ID
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 10
          description: Maximum number of sessions to return
        - name: after_id
          in: query
          required: false
          schema:
            type: string
            pattern: >-
              ^[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}$
          description: Cursor for forward pagination
        - name: before_id
          in: query
          required: false
          schema:
            type: string
            pattern: >-
              ^[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}$
          description: Cursor for backward pagination
      responses:
        '200':
          description: Terminal Payment Sessions fetched successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListTerminalPaymentSessionsResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - BasicAuth: []
components:
  schemas:
    ListTerminalPaymentSessionsResponse:
      type: object
      required:
        - has_more
        - data
      properties:
        has_more:
          type: boolean
          example: false
        data:
          type: array
          items:
            $ref: '#/components/schemas/TerminalPaymentSessionResponse'
        links:
          type: array
          items:
            $ref: '#/components/schemas/Link'
    ErrorResponse:
      type: object
      required:
        - error_code
        - message
      properties:
        error_code:
          type: string
          enum:
            - INVALID_REQUEST
            - DUPLICATED_REQUEST
            - UNAUTHORIZED
            - CURRENCY_NOT_SUPPORTED
            - TERMINAL_NOT_FOUND
            - COMMAND_NOT_SUPPORTED
          example: INVALID_REQUEST
        message:
          type: string
          example: 'Missing required parameter: terminal_id'
    TerminalPaymentSessionResponse:
      type: object
      required:
        - payment_session_id
        - reference_id
        - business_id
        - session_type
        - mode
        - country
        - currency
        - amount
        - status
        - channel_properties
        - latest_payment_id
        - created
        - updated
      properties:
        payment_session_id:
          type: string
          pattern: >-
            ^[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}$
        latest_payment_id:
          type: string
          pattern: >-
            ^[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}$
        business_id:
          type: string
        reference_id:
          type: string
          example: ref_123456789
        customer_id:
          type: string
          example: cus_123456789
        session_type:
          type: string
          enum:
            - PAY
        currency:
          type: string
          enum:
            - IDR
            - VND
            - THB
            - MYR
        amount:
          type: number
          format: decimal
          minimum: 1
        country:
          type: string
          enum:
            - ID
            - VN
            - TH
            - MY
        mode:
          type: string
          enum:
            - TERMINAL
        status:
          type: string
          enum:
            - ACTIVE
            - COMPLETED
            - FAILED
            - CANCELED
        description:
          type: string
          nullable: true
          example: 'Payment for order #123'
        metadata:
          type: object
          additionalProperties: true
        canceled_at:
          type: string
          nullable: true
          format: date-time
        channel_properties:
          $ref: '#/components/schemas/ChannelProperties'
        created:
          type: string
          format: date-time
          example: '2024-11-06T15:32:42Z'
        updated:
          type: string
          format: date-time
          example: '2024-11-06T15:32:42Z'
    Link:
      type: object
      properties:
        rel:
          type: string
          example: next
        href:
          type: string
          example: >-
            /v1/terminal/sessions?reference_id=ref_123456789&after_id=00000000-0000-0000-0000-000000000000
        method:
          type: string
          example: GET
    ChannelProperties:
      type: object
      required:
        - terminal_id
      properties:
        terminal_id:
          type: string
          example: abcd-3254fsd-3242
        order_id:
          type: string
          example: order-12345
          maxLength: 255
        payment_methods:
          type: array
          nullable: true
          items:
            type: string
            enum:
              - ID_INSERT_CARD
              - ID_CONTACTLESS
              - ID_BRIZZI
              - ID_QRIS
              - VN_CARD
              - VN_QR
              - TH_ALIPAY_PLUS
              - TH_WECHATPAY
              - TH_TRUEMONEY
              - TH_LINEPAY
              - TH_SHOPEEPAY
              - TH_SABUYMONEY
              - TH_MAXME
              - TH_CARD
              - TH_BBL_QRCS
              - TH_MULTIIPP
              - TH_QRCODE
              - MY_QR
              - MY_CARD
              - MY_EWALLET
  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic

````