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

# Get a payment

> Get payment



## OpenAPI

````yaml get /payments/{payment_id}
openapi: 3.0.3
info:
  version: '1.0'
  title: Togai Apis
  contact:
    email: engg@togai.com
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  description: APIs for Togai App
servers:
  - description: Api endpoint
    url: https://api.togai.com/
  - description: Sandbox api endpoint
    url: https://sandbox-api.togai.com/
security:
  - bearerAuth: []
tags:
  - name: Customers
    description: Customer level calls
  - name: Accounts
    description: Account level calls
  - name: Event Schemas
    description: Event Schema level calls
  - name: Usage Meters
    description: Usage Meter level calls
  - name: Price Plans
    description: (DEPRECATED) Price Plan level calls
  - name: PricePlanV2
    description: Price Plan V2 level calls
  - name: Schedules
    description: Account Schedule level calls
  - name: Pricing Rules
    description: Pricing Rules level calls
  - name: Settings
    description: Settings
  - name: Price Experimentation
    description: Price Experimentation apis
  - name: InvoiceGroups
    description: Invoice Group level calls
  - name: Organization
    description: Organization level calls
  - name: FileStorage
    description: File Storage level calls
  - name: Aliases
    description: Alias level calls
  - name: Reports
    description: Report level calls
  - name: ReportTemplates
    description: Report Template level calls
  - name: Customer Portal
    description: Portal level calls
  - name: Alerts
    description: Alert level calls
  - name: Event Management
    description: APIs for getting events ingested in Togai
    externalDocs:
      description: docs
      url: https://togai.com/docs/billing/events
  - name: Metrics
    description: APIs for getting Togai metrics
    externalDocs:
      description: docs
      url: https://togai.com/docs/metrics
  - name: Licenses
    description: APIs for getting or updating license records in Togai
  - name: Entitlements
    description: APIs related to entitlements
  - name: Invoices
    description: Invoices API
  - name: Credits
    description: Credits API
  - name: Wallet
    description: Wallet API
  - name: InvoiceTemplates
    description: InvoiceTemplates API
  - name: InvoiceSequence
    description: InvoiceSequence API
  - name: Payments
    description: Payments API
  - name: Authentication
    description: Authentication API
externalDocs:
  description: Find out more about Togai
  url: https://docs.togai.com/docs
paths:
  /payments/{payment_id}:
    get:
      tags:
        - Payments
      summary: Get a payment
      description: Get payment
      operationId: getPayment
      parameters:
        - $ref: '#/components/parameters/payment_id'
        - $ref: '#/components/parameters/version'
      responses:
        '200':
          $ref: '#/components/responses/PaymentResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
components:
  parameters:
    payment_id:
      in: path
      name: payment_id
      required: true
      schema:
        type: string
        example: payment.1zYnCiM9Bpg.lv25y
    version:
      in: query
      name: version
      description: >-
        Optional version to get a specific version. Gets latest version if it is
        not provided.
      required: false
      schema:
        type: integer
        format: int32
        example: 2
  responses:
    PaymentResponse:
      description: Response for POST payments requests
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Payment'
          examples:
            Payment:
              $ref: '#/components/examples/Payment'
    ErrorResponse:
      description: Error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            ErrorResponse:
              summary: Error message
              value:
                message: <Reason message>
  schemas:
    Payment:
      description: Payment object
      type: object
      additionalProperties: false
      required:
        - id
        - accountId
        - externalPaymentReferences
        - lineItemRecords
        - totalAmount
        - currency
        - version
        - createdBy
        - createdAt
      properties:
        id:
          type: string
          example: pay.w123rwe.1231
        description:
          type: string
        notes:
          type: string
        accountId:
          type: string
          example: ACC001
        externalPaymentReferences:
          $ref: '#/components/schemas/ExternalPaymentReference'
        lineItemRecords:
          type: array
          minLength: 1
          items:
            $ref: '#/components/schemas/PaymentLineItemRecord'
        totalAmount:
          type: number
        currency:
          type: string
        version:
          type: number
        createdBy:
          type: string
        createdAt:
          type: string
          format: date-time
    ErrorResponse:
      type: object
      additionalProperties: false
      required:
        - message
      properties:
        message:
          type: string
          description: error description
          maxLength: 500
    ExternalPaymentReference:
      type: object
      description: external payment reference object
      additionalProperties: false
      required:
        - sourceName
        - sourceType
        - transactionNumber
      properties:
        sourceName:
          type: string
        sourceType:
          type: string
          enum:
            - GATEWAY
            - CASH
            - CHEQUE
            - BANK_TRANSFER
            - CARD
        transactionNumber:
          description: Check number or Card transaction number
          type: string
        description:
          type: string
        metadata:
          type: object
          additionalProperties: true
    PaymentLineItemRecord:
      type: object
      description: payment line item record object
      additionalProperties: false
      required:
        - type
        - order
      properties:
        type:
          type: string
          enum:
            - INVOICE
            - CREDIT
            - WALLET_CREDIT
        togaiId:
          type: string
          example: inv.234.12efwe
        amount:
          type: number
        order:
          type: integer
          format: int32
  examples:
    Payment:
      summary: A sample Payment
      value:
        id: payment.1223dfs.234ds
        description: Payment for services
        notes: Invoice payment
        accountId: acc123
        currency: USD
        externalPaymentReferences:
          sourceName: XYZ Company
          sourceType: CARD
          transactionNumber: TXN123
          description: Card payment
        lineItemRecords:
          - togaiId: inv.234.12efwe
            amount: 1000
            type: INVOICE
            order: 1
          - togaiId: inv.235.12efwe
            amount: 600
            type: INVOICE
            order: 2
          - togaiId: cred.236.12efwe
            amount: 100
            type: CREDIT
            order: 3
        totalAmount: 1700
        version: 1
        createdBy: user123
        createdAt: '2023-01-01T12:00:00'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Bearer <credential>

````