openapi: 3.1.1
info:
  title: Payment
  version: 2.0.0
  description: Schema definition for Payment in the Beckn Protocol
  license:
    name: CC-BY-NC-SA 4.0 International
  contact:
    name: Beckn Labs
    url: https://beckn.io
components:
  schemas:
    Payment:
      x-iri: https://schema.nfh.global/Payment/v2.0
      description: Schema definition for Payment in the Beckn Protocol
      title: Payment
      type: object
      properties:
        beckn:id:
          type: string
          description: Payment record identifier
          x-jsonld:
            '@id': schema:identifier
        beckn:paymentStatus:
          type: string
          description: "Payment lifecycle status (Pending | Authorized | Captured\
            \ | Failed | Refunded | PartialRefund \u2026)"
          enum:
          - INITIATED
          - PENDING
          - AUTHORIZED
          - CAPTURED
          - COMPLETED
          - FAILED
          - CANCELLED
          - REFUNDED
          - PARTIALLY_REFUNDED
          - CHARGEBACK
          - DISPUTED
          - EXPIRED
          - REVERSED
          - VOIDED
          - SETTLED
          - ON_HOLD
          - ADJUSTED
          x-jsonld:
            '@id': beckn:paymentStatus
        beckn:amount:
          type: object
          description: Amount associated with this payment action
          properties:
            currency:
              type: string
              x-jsonld:
                '@id': schema:priceCurrency
            value:
              type: number
              x-jsonld:
                '@id': schema:price
        beckn:paymentURL:
          type: string
          format: uri
          description: URL for payment processing/redirection
          example: https://payments.example.com/pay?transaction_id=123&amount=100
          x-jsonld:
            '@id': schema:url
        beckn:txnRef:
          type: string
          description: PSP/gateway/bank transaction reference
          x-jsonld:
            '@id': schema:transactionNumber
        beckn:paidAt:
          type:
          - string
          - 'null'
          format: date-time
          description: When the last terminal event (capture/refund) happened
          x-jsonld:
            '@id': schema:paymentDueDate
        beckn:acceptedPaymentMethod:
          $ref: https://schema.nfh.global/AcceptedPaymentMethod/v2.0/attributes.yaml#/components/schemas/AcceptedPaymentMethod
        beckn:beneficiary:
          type: string
          description: Who will be the beneficiary or recipient of the payment
          enum:
          - BPP
          - BAP
          - BUYER
          example: BPP
          x-jsonld:
            '@id': schema:beneficiary
        beckn:paymentAttributes:
          $ref: https://schema.nfh.global/Attributes/v2.0/attributes.yaml#/components/schemas/Attributes
          description: 'Rail-specific attribute pack (e.g., UPI: VPA/UTR; CARD: token/3DS;
            BNPL: plan/schedule)

            '
      required:
      - beckn:paymentStatus
      additionalProperties: false
