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

# Get a payment

> Fetches a single payment. Accepts a pay_* payment ID or a chk_* checkout session ID.



## OpenAPI

````yaml /api-reference/openapi.json get /api/gateway/payments/{paymentId}
openapi: 3.1.0
info:
  title: Open Rails API
  version: 0.1.0
  description: >-
    Hosted checkout, provider routing, runtime schemas, and normalized webhook
    examples for Open Rails merchants and agents.
servers:
  - url: https://dash.getopenrails.com
    description: Production dashboard and API origin
security: []
tags:
  - name: Gateway
  - name: Agent
  - name: Routing
  - name: Webhooks
paths:
  /api/gateway/payments/{paymentId}:
    get:
      tags:
        - Gateway
      summary: Get a payment
      description: >-
        Fetches a single payment. Accepts a pay_* payment ID or a chk_* checkout
        session ID.
      operationId: getGatewayPayment
      parameters:
        - name: paymentId
          in: path
          required: true
          schema:
            type: string
          description: A pay_* payment ID or chk_* checkout session ID.
      responses:
        '200':
          description: Payment record
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Payment'
        '404':
          description: Payment not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
components:
  schemas:
    Payment:
      type: object
      required:
        - id
        - object
        - status
        - ledgerStatus
        - amount
        - currency
        - created
      properties:
        id:
          type: string
          description: Payment ID with pay_* prefix.
        object:
          type: string
          enum:
            - payment
        customerId:
          type: string
        invoiceId:
          type: string
        sessionId:
          type: string
        amount:
          type: number
        currency:
          type: string
        status:
          type: string
          enum:
            - pending
            - paid
            - failed
        ledgerStatus:
          type: string
          enum:
            - pending
            - settled
            - refunded
        route:
          type: object
          properties:
            id:
              type: string
            kind:
              $ref: '#/components/schemas/RouteKind'
            label:
              type: string
        fees:
          type: object
          properties:
            buyer_fee:
              type: number
            gateway_fee:
              type: number
            merchant_net:
              type: number
            total:
              type: number
        metadata:
          $ref: '#/components/schemas/Metadata'
        created:
          type: string
          format: date-time
    ApiErrorResponse:
      type: object
      required:
        - ok
        - error
      properties:
        ok:
          type: boolean
          enum:
            - false
        error:
          $ref: '#/components/schemas/ActionError'
    RouteKind:
      type: string
      enum:
        - card
        - wallet
        - local
    Metadata:
      type: object
      additionalProperties:
        type: string
        maxLength: 500
      default: {}
    ActionError:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
        message:
          type: string
        field:
          type: string
        suggestion:
          type: string
        issues:
          type: array
          items:
            type: object
            properties:
              path:
                type: string
              code:
                type: string
              message:
                type: string

````