openapi: 3.1.1
info:
  title: AckResponse
  version: 2.0.0
  description: Schema definition for AckResponse in the Beckn Protocol
  license:
    name: CC-BY-NC-SA 4.0 International
  contact:
    name: Beckn Labs
    url: https://beckn.io
components:
  schemas:
    AckResponse:
      x-iri: https://schema.nfh.global/AckResponse/v2.0
      description: Schema definition for AckResponse in the Beckn Protocol
      title: AckResponse
      type: object
      properties:
        transaction_id:
          type: string
        timestamp:
          type: string
          format: date-time
        ack_status:
          type: string
          enum:
          - ACK
          - NACK
        error:
          $ref: https://schema.nfh.global/Error/v2.0/attributes.yaml#/components/schemas/Error
      required:
      - transaction_id
      - timestamp
      - ack_status
      additionalProperties: false
      allOf:
      - if:
          properties:
            ack_status:
              const: NACK
          required:
          - ack_status
        then:
          properties:
            error: {}
          required:
          - error
      - if:
          properties:
            ack_status:
              const: ACK
          required:
          - ack_status
        then:
          not:
            properties:
              error: {}
            required:
            - error
