openapi: 3.1.0
info:
  description: Adaptation of beckn protocol for the mobility sector. Compatible with core version V1.1.
  title: Beckn Mobility API Specification
  version: 0.8.3
security:
  - SubscriberAuth: []
servers:
  - url: 'https://ps-bap-client.becknprotocol.io'
    description: BOC Network
paths:
  /search:
    post:
      description: Search for services by intent
      operationId: search
      tags:
        - Beckn Provider Platform (BPP)
        - Beckn Gateway (BG)
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - type: object
                  properties:
                    context:
                      allOf:
                        - $ref: '#/components/schemas/Context'
                    message:
                      properties:
                        intent:
                          $ref: '#/components/schemas/Intent'
                      type: object
                  required:
                    - context
                    - message
                - allOf:
                    - properties:
                        context:
                          properties:
                            location:
                              properties:
                                city:
                                  properties:
                                    code:
                                      type: string
                                  required:
                                    - code
                                country:
                                  properties:
                                    code:
                                      type: string
                                      enum:
                                        - IND
                                  required:
                                    - code
                            bap_id:
                              type: string
                              pattern: '^(?!https?://).*$'
                            bpp_id:
                              type: string
                              pattern: '^(?!https?://).*$'
                            ttl:
                              type: string
                              format: date-time
                            timestamp:
                              type: string
                              format: date-time
                          required:
                            - location
                            - domain
                            - action
                            - message_id
                            - transaction_id
                            - timestamp
                            - bap_id
                            - bap_uri
                            - ttl
                    - properties:
                        context:
                          properties:
                            action:
                              type: string
                              enum:
                                - search
                    - properties:
                        message:
                          properties:
                            intent:
                              properties:
                                tags:
                                  items:
                                    properties:
                                      list:
                                        items:
                                          properties:
                                            value:
                                              type: string
                                              enum:
                                                - START
                                                - STOP
                                payment:
                                  properties:
                                    collected_by:
                                      type: string
                                      enum:
                                        - BPP
                                        - BAP
                                  required:
                                    - collected_by
                              required:
                                - payment
                                - tags
                          required:
                            - intent
                    - properties:
                        message:
                          properties:
                            intent:
                              properties:
                                payment:
                                  properties:
                                    tags:
                                      items:
                                        if:
                                          properties:
                                            descriptor:
                                              properties:
                                                code:
                                                  const: SETTLEMENT_TERMS
                                        then:
                                          properties:
                                            list:
                                              allOf:
                                                - contains:
                                                    type: object
                                                    properties:
                                                      descriptor:
                                                        type: object
                                                        properties:
                                                          code:
                                                            const: STATIC_TERMS
                                                        required:
                                                          - code
                                                      value:
                                                        type: string
                                                        format: uri
                                                    required:
                                                      - descriptor
                                                      - value
                                                - contains:
                                                    type: object
                                                    properties:
                                                      descriptor:
                                                        type: object
                                                        properties:
                                                          code:
                                                            const: SETTLEMENT_TYPE
                                                        required:
                                                          - code
                                                      value:
                                                        type: string
                                                        enum:
                                                          - upi
                                                          - neft
                                                          - rtgs
                                                    required:
                                                      - descriptor
                                                      - value
                                                - contains:
                                                    type: object
                                                    properties:
                                                      descriptor:
                                                        type: object
                                                        properties:
                                                          code:
                                                            const: SETTLEMENT_WINDOW
                                                        required:
                                                          - code
                                                      value:
                                                        type: string
                                                        pattern: '^PT\d+[MH]$'
                                                    required:
                                                      - descriptor
                                                      - value
                    - properties:
                        message:
                          properties:
                            intent:
                              properties:
                                fulfillment:
                                  properties:
                                    stops:
                                      allOf:
                                        - contains:
                                            type: object
                                            properties:
                                              location:
                                                type: object
                                                properties:
                                                  gps:
                                                    type: string
                                                required:
                                                  - gps
                                              type:
                                                const: START
                                            required:
                                              - location
                                              - type
                                        - contains:
                                            type: object
                                            properties:
                                              location:
                                                type: object
                                                properties:
                                                  gps:
                                                    type: string
                                                required:
                                                  - gps
                                              type:
                                                const: END
                                            required:
                                              - location
                                              - type
                                  required:
                                    - stops
                              required:
                                - fulfillment
            examples:
              Search for services in the city of Bengaluru by pickup and drop location:
                value:
                  context:
                    action: search
                    bap_id: example-bap.com
                    bap_uri: 'https://api.example-bap.com/pilot/bap/cab/v1'
                    domain: 'nic2004:60221'
                    location:
                      city:
                        code: 'std:080'
                      country:
                        code: IND
                    message_id: 6743e9e2-4fb5-487c-92b7-13ba8018f176
                    timestamp: '2023-03-23T04:41:16Z'
                    transaction_id: 6743e9e2-4fb5-487c-92b7-13ba8018f176
                    version: 1.1.0
                  message:
                    intent:
                      fulfillment:
                        stops:
                          - location:
                              gps: '12.923608703179461, 77.61462964117527'
                            type: start
                          - location:
                              gps: '12.9346302, 77.61533969999999'
                            type: end
              Search by pickup and drop location with localization info:
                value:
                  context:
                    action: search
                    bap_id: example-bap.com
                    bap_uri: 'https://api.example-bap.com/pilot/bap/cab/v1'
                    domain: 'nic2004:60221'
                    location:
                      city:
                        code: 'std:080'
                      country:
                        code: IND
                    message_id: 6743e9e2-4fb5-487c-92b7-13ba8018f176
                    timestamp: '2023-03-23T04:41:16Z'
                    transaction_id: 6743e9e2-4fb5-487c-92b7-13ba8018f176
                    version: 1.1.0
                  message:
                    intent:
                      fulfillment:
                        customer:
                          person:
                            languages:
                              - code: en
                                name: English
                        stops:
                          - location:
                              gps: '12.923608703179461, 77.61462964117527'
                            type: start
                          - location:
                              gps: '12.9346302, 77.61533969999999'
                            type: end
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
                  message:
                    properties:
                      ack:
                        $ref: '#/components/schemas/Ack'
                    required:
                      - ack
                    type: object
                required:
                  - message
                type: object
          description: Acknowledgement of message received
  /select:
    post:
      description: Select items from the catalog and build your order
      operationId: select
      tags:
        - Beckn Provider Platform (BPP)
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - type: object
                  properties:
                    context:
                      allOf:
                        - $ref: '#/components/schemas/Context'
                    message:
                      properties:
                        order:
                          allOf:
                            - $ref: '#/components/schemas/Order'
                      required:
                        - order
                      type: object
                  required:
                    - context
                    - message
                - allOf:
                    - $ref: '#/paths/~1init/post/requestBody/content/application~1json/schema/allOf/1/allOf/0'
                    - properties:
                        context:
                          properties:
                            action:
                              type: string
                              enum:
                                - select
                    - $ref: '#/paths/~1init/post/requestBody/content/application~1json/schema/allOf/1/allOf/2'
            examples:
              Get a quote for a fare product selected from a public transit catalog:
                value:
                  context:
                    action: select
                    bap_id: 'https://example-bap.com'
                    bap_uri: 'https://mock_bap.com/beckn/'
                    bpp_id: 'https://kmrl-bpp.com'
                    bpp_uri: 'https://kmrl-bpp.com/beckn/'
                    domain: 'nic2004:60221'
                    location:
                      city:
                        code: 'std:080'
                      country:
                        code: IND
                    message_id: fde8b8b6-c2e5-49f7-b254-720843d528bd
                    timestamp: '2021-03-23T10:00:40.065Z'
                    transaction_id: 6f339232-2bc3-44d2-915c-30d2b053ce1d
                    version: 1.1.0
                  message:
                    order:
                      items:
                        - id: '1'
                      provider:
                        id: '1'
              Get quote for a specific product from a mobility catalog:
                value:
                  context:
                    action: select
                    bap_id: example-bap.com
                    bap_uri: 'https://api.example-bap.com/pilot/bap/cab/v1'
                    bpp_id: example-bpp.com
                    bpp_uri: 'https://api.example-bpp.com/dobpp/beckn/7f7896dd-787e-4a0b-8675-e9e6fe93bb8f'
                    domain: 'nic2004:60221'
                    location:
                      city:
                        code: 'std:080'
                      country:
                        code: IND
                    max_callbacks: 3
                    message_id: 432fdfd6-0457-47b6-9fac-80cbe5c0a75b
                    timestamp: '2023-03-23T04:46:45Z'
                    transaction_id: 870782be-6757-43f1-945c-8eeaf9536259
                    ttl: P120S
                    version: 1.1.0
                  message:
                    order:
                      fulfillments:
                        - stops:
                            - location:
                                gps: '12.910458, 77.543089'
                              type: start
                            - location:
                                gps: '12.9535139,  77.5710434'
                              type: end
                      items:
                        - id: 5777a0bf-9a08-49aa-a97d-1e5561a9622e
                      provider:
                        id: '1'
              Get quote for a specific product from a mobility catalog with gps and address details:
                value:
                  context:
                    action: select
                    bap_id: example-bap.com
                    bap_uri: 'https://api.example-bap.com/pilot/bap/cab/v1'
                    bpp_id: example-bpp.com
                    bpp_uri: 'https://api.example-bpp.com/dobpp/beckn/7f7896dd-787e-4a0b-8675-e9e6fe93bb8f'
                    domain: 'nic2004:60221'
                    location:
                      city:
                        code: 'std:080'
                      country:
                        code: IND
                    max_callbacks: 3
                    message_id: 432fdfd6-0457-47b6-9fac-80cbe5c0a75b
                    timestamp: '2023-03-23T04:46:45Z'
                    transaction_id: 870782be-6757-43f1-945c-8eeaf9536259
                    ttl: P120S
                    version: 1.1.0
                  message:
                    order:
                      fulfillments:
                        - stops:
                            - location:
                                address: '98 A, 6th Main Rd, Uttarahalli Hobli, Ramanjaneyanagar'
                                area_code: 560061
                                city:
                                  name: Bengaluru
                                country:
                                  name: India
                                district: Ramanjaneyanagar
                                gps: '12.910458, 77.543089'
                                state:
                                  name: Karnataka
                              type: start
                            - location:
                                address: 'Basavanagudi, Chikkanna Garden, Rangadore Memorial Hospital'
                                area_code: 560061
                                city:
                                  name: Bengaluru
                                country:
                                  name: India
                                district: Chikkanna Garden
                                gps: '12.9535139,  77.5710434'
                                state:
                                  name: Karnataka
                              type: end
                      items:
                        - id: 5777a0bf-9a08-49aa-a97d-1e5561a9622e
                      provider:
                        id: '1'
              Get quote for a specific product from a mobility catalog with localization:
                value:
                  context:
                    action: select
                    bap_id: example-bap.com
                    bap_uri: 'https://api.example-bap.com/pilot/bap/cab/v1'
                    bpp_id: example-bpp.com
                    bpp_uri: 'https://api.example-bpp.com/dobpp/beckn/7f7896dd-787e-4a0b-8675-e9e6fe93bb8f'
                    domain: 'nic2004:60221'
                    location:
                      city:
                        code: 'std:080'
                      country:
                        code: IND
                    max_callbacks: 3
                    message_id: 432fdfd6-0457-47b6-9fac-80cbe5c0a75b
                    timestamp: '2023-03-23T04:46:45Z'
                    transaction_id: 870782be-6757-43f1-945c-8eeaf9536259
                    ttl: P120S
                    version: 1.1.0
                  message:
                    order:
                      fulfillments:
                        - customer:
                            person:
                              languages:
                                - code: en
                                  name: English
                          stops:
                            - location:
                                address: '98 A, 6th Main Rd, Uttarahalli Hobli, Ramanjaneyanagar'
                                area_code: 560061
                                city:
                                  name: Bengaluru
                                country:
                                  name: India
                                district: Ramanjaneyanagar
                                gps: '12.910458, 77.543089'
                                state:
                                  name: Karnataka
                              type: start
                            - location:
                                address: 'Basavanagudi, Chikkanna Garden, Rangadore Memorial Hospital'
                                area_code: 560061
                                city:
                                  name: Bengaluru
                                country:
                                  name: India
                                district: Chikkanna Garden
                                gps: '12.9535139,  77.5710434'
                                state:
                                  name: Karnataka
                              type: end
                      items:
                        - id: 5777a0bf-9a08-49aa-a97d-1e5561a9622e
                      provider:
                        id: '1'
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
                  message:
                    properties:
                      ack:
                        $ref: '#/components/schemas/Ack'
                    required:
                      - ack
                    type: object
                required:
                  - message
                type: object
          description: Acknowledgement of message received
  /init:
    post:
      description: Initialize an order by providing billing and/or shipping details
      operationId: init
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - type: object
                  properties:
                    context:
                      allOf:
                        - $ref: '#/components/schemas/Context'
                    message:
                      properties:
                        order:
                          allOf:
                            - $ref: '#/components/schemas/Order'
                      required:
                        - order
                  required:
                    - context
                    - message
                - allOf:
                    - allOf:
                        - $ref: '#/paths/~1search/post/requestBody/content/application~1json/schema/allOf/1/allOf/0'
                        - properties:
                            context:
                              required:
                                - bpp_id
                                - bpp_uri
                    - properties:
                        context:
                          properties:
                            action:
                              type: string
                              enum:
                                - init
                    - properties:
                        message:
                          properties:
                            order:
                              type: object
                              properties:
                                provider:
                                  type: object
                                  properties:
                                    id:
                                      type: string
                                  required:
                                    - id
                                items:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      id:
                                        type: string
                                    required:
                                      - id
                              required:
                                - provider
                                - items
                    - allOf:
                        - $ref: '#/paths/~1confirm/post/requestBody/content/application~1json/schema/allOf/1/allOf/3'
                        - $ref: '#/paths/~1on_select/post/requestBody/content/application~1json/schema/allOf/1/allOf/8'
                        - properties:
                            message:
                              properties:
                                order:
                                  required:
                                    - fulfillments
                    - allOf:
                        - properties:
                            message:
                              properties:
                                order:
                                  properties:
                                    payments:
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          type:
                                            type: string
                                            enum:
                                              - PRE-ORDER
                                              - ON-FULFILLMENT
                                              - POST-FULFILLMENT
                                          status:
                                            type: string
                                            enum:
                                              - PAID
                                              - NOT-PAID
                                          collected_by:
                                            type: string
                                            enum:
                                              - BAP
                                              - BPP
                                          params:
                                            type: object
                                            properties:
                                              amount:
                                                type: string
                                                pattern: '^\d+(\.\d{1,2})?$'
                                              currency:
                                                type: string
                                        required:
                                          - type
                                          - status
                                          - collected_by
                                          - params
                                  required:
                                    - payments
                        - properties:
                            message:
                              properties:
                                order:
                                  properties:
                                    payments:
                                      items:
                                        properties:
                                          params:
                                            required:
                                              - bank_code
                                              - bank_account_number
                                              - virtual_payment_address
                                        required:
                                          - type
                                          - status
                                          - collected_by
                                          - params
                                  required:
                                    - payments
                    - properties:
                        message:
                          properties:
                            order:
                              properties:
                                billing:
                                  required:
                                    - name
                              required:
                                - billing
            examples:
              Initialize draft order and request for terms of service:
                value:
                  context:
                    action: init
                    bap_id: example-bap.com
                    bap_uri: 'https://api.example-bap.com/pilot/bap/cab/v1'
                    bpp_id: example-bpp.com
                    bpp_uri: 'https://api.example-bpp.com/dobpp/beckn/7f7896dd-787e-4a0b-8675-e9e6fe93bb8f'
                    domain: 'nic2004:60221'
                    location:
                      city:
                        code: 'std:080'
                      country:
                        code: IND
                    message_id: 8926b747-0362-4fcc-b795-0994a6287700
                    timestamp: '2023-03-23T04:48:53Z'
                    transaction_id: b580c989-f84d-4abe-af28-2c818aafce3b
                    version: 1.1.0
                  message:
                    order:
                      fulfillments:
                        - customer:
                            contact:
                              phone: +91-9897867564
                            person:
                              language:
                                code: en
                                name: English
                              name: John Doe
                          id: fulf_5cf064d5-4c0a-42d3-b73d-5f19a6f7468e
                          stops:
                            - location:
                                address: '98 A, 6th Main Rd, Uttarahalli Hobli, Ramanjaneyanagar'
                                area_code: 560061
                                city:
                                  name: Bengaluru
                                country:
                                  name: India
                                district: Ramanjaneyanagar
                                gps: '12.910458, 77.543089'
                                state:
                                  name: Karnataka
                              type: start
                            - location:
                                address: 'Basavanagudi, Chikkanna Garden, Rangadore Memorial Hospital'
                                area_code: 560061
                                city:
                                  name: Bengaluru
                                country:
                                  name: India
                                district: Chikkanna Garden
                                gps: '12.9535139,  77.5710434'
                                state:
                                  name: Karnataka
                              type: end
                      items:
                        - fulfillment_ids:
                            - fulf_5cf064d5-4c0a-42d3-b73d-5f19a6f7468e
                          id: 5777a0bf-9a08-49aa-a97d-1e5561a9622e
                          payment_ids:
                            - 7f7896dd-787e-4a0b-8675-e9e6fe93bb8f
                      payment:
                        - collected_by: BPP
                          id: 7f7896dd-787e-4a0b-8675-e9e6fe93bb8f
                          type: ON-FULFILLMENT
                      provider:
                        id: '1'
              Initialize the order by providing billing details:
                value:
                  context:
                    action: init
                    bap_id: 'https://example-bap.com'
                    bap_uri: 'https://mock_bap.com/beckn/'
                    bpp_id: 'https://kmrl-bpp.com'
                    bpp_uri: 'https://kmrl-bpp.com/beckn/'
                    domain: 'nic2004:60221'
                    location:
                      city:
                        code: 'std:080'
                      country:
                        code: IND
                    message_id: fde8b8b6-c2e5-49f7-b254-720843d528bd
                    timestamp: '2021-03-23T10:00:40.065Z'
                    transaction_id: 6f339232-2bc3-44d2-915c-30d2b053ce1d
                    version: 1.1.0
                  message:
                    order:
                      billing:
                        email: john.doe@example.com
                        name: John Doe
                      items:
                        - id: '1'
                      provider:
                        id: '1'
        description: TODO
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
                  message:
                    properties:
                      ack:
                        $ref: '#/components/schemas/Ack'
                    required:
                      - ack
                    type: object
                required:
                  - message
                type: object
          description: Acknowledgement of message received
      tags:
        - Beckn Provider Platform (BPP)
  /confirm:
    post:
      description: Initialize an order by providing billing and/or shipping details
      operationId: confirm
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - properties:
                    context:
                      allOf:
                        - $ref: '#/components/schemas/Context'
                    message:
                      properties:
                        order:
                          allOf:
                            - $ref: '#/components/schemas/Order'
                      required:
                        - order
                      type: object
                  required:
                    - context
                    - message
                  type: object
                - allOf:
                    - $ref: '#/paths/~1init/post/requestBody/content/application~1json/schema/allOf/1/allOf/0'
                    - properties:
                        context:
                          properties:
                            action:
                              type: string
                              enum:
                                - confirm
                    - $ref: '#/paths/~1init/post/requestBody/content/application~1json/schema/allOf/1/allOf/2'
                    - allOf:
                        - $ref: '#/paths/~1on_select/post/requestBody/content/application~1json/schema/allOf/1/allOf/6'
                        - properties:
                            message:
                              properties:
                                order:
                                  properties:
                                    fulfillments:
                                      type: array
                                      items:
                                        allOf:
                                          - properties:
                                              customer:
                                                properties:
                                                  contact:
                                                    properties:
                                                      phone:
                                                        type: string
                                                        pattern: '^\+?[1-9]\d{1,14}$'
                                                    required:
                                                      - phone
                                                  person:
                                                    properties:
                                                      name:
                                                        type: string
                                                    required:
                                                      - name
                                                required:
                                                  - contact
                                                  - person
                                            required:
                                              - customer
                    - allOf:
                        - properties:
                            message:
                              properties:
                                order:
                                  properties:
                                    items:
                                      type: array
                                      minItems: 1
                                      items:
                                        type: object
                                        properties:
                                          id:
                                            type: string
                                          descriptor:
                                            type: object
                                            properties:
                                              name:
                                                type: string
                                              code:
                                                type: string
                                                enum:
                                                  - RIDE
                                            required:
                                              - code
                                          price:
                                            type: object
                                            properties:
                                              value:
                                                type: string
                                            required:
                                              - value
                                          fulfillment_ids:
                                            minItems: 1
                                          location_ids:
                                            minItems: 1
                                        required:
                                          - id
                                          - price
                                          - descriptor
                                  required:
                                    - items
                        - allOf:
                            - properties:
                                message:
                                  properties:
                                    order:
                                      properties:
                                        items:
                                          items:
                                            properties:
                                              tags:
                                                items:
                                                  if:
                                                    properties:
                                                      descriptor:
                                                        properties:
                                                          code:
                                                            const: FARE_POLICY
                                                  then:
                                                    properties:
                                                      list:
                                                        type: array
                                                        items:
                                                          type: object
                                                          properties:
                                                            descriptor:
                                                              properties:
                                                                code:
                                                                  type: string
                                                                  enum:
                                                                    - MIN_FARE
                                                                    - MIN_FARE_DISTANCE_KM
                                                                    - PER_KM_CHARGE
                                                                    - PICKUP_CHARGE
                                                                    - WAITING_CHARGE_PER_MIN
                                                                    - NIGHT_CHARGE_MULTIPLIER
                                                                    - NIGHT_SHIFT_START_TIME
                                                                    - NIGHT_SHIFT_END_TIME
                                                                    - EXTERNAL_REF
                            - properties:
                                message:
                                  properties:
                                    order:
                                      properties:
                                        items:
                                          items:
                                            properties:
                                              tags:
                                                items:
                                                  if:
                                                    properties:
                                                      descriptor:
                                                        properties:
                                                          code:
                                                            const: FARE_POLICY
                                                  then:
                                                    properties:
                                                      list:
                                                        allOf:
                                                          - contains:
                                                              type: object
                                                              properties:
                                                                descriptor:
                                                                  type: object
                                                                  properties:
                                                                    code:
                                                                      const: MIN_FARE
                                                                  required:
                                                                    - code
                                                                value:
                                                                  type: string
                                                                  pattern: '^[0-9]+(\.[0-9]+)?$'
                                                              required:
                                                                - descriptor
                                                                - value
                                                          - contains:
                                                              type: object
                                                              properties:
                                                                descriptor:
                                                                  type: object
                                                                  properties:
                                                                    code:
                                                                      const: MIN_FARE_DISTANCE_KM
                                                                  required:
                                                                    - code
                                                                value:
                                                                  type: string
                                                                  pattern: '^[0-9]+(\.[0-9]+)?$'
                                                              required:
                                                                - descriptor
                                                                - value
                                                          - contains:
                                                              type: object
                                                              properties:
                                                                descriptor:
                                                                  type: object
                                                                  properties:
                                                                    code:
                                                                      const: PER_KM_CHARGE
                                                                  required:
                                                                    - code
                                                                value:
                                                                  type: string
                                                                  pattern: '^[0-9]+(\.[0-9]+)?$'
                                                              required:
                                                                - descriptor
                                                                - value
                                                          - contains:
                                                              type: object
                                                              properties:
                                                                descriptor:
                                                                  type: object
                                                                  properties:
                                                                    code:
                                                                      const: PICKUP_CHARGE
                                                                  required:
                                                                    - code
                                                                value:
                                                                  type: string
                                                                  pattern: '^[0-9]+(\.[0-9]+)?$'
                                                              required:
                                                                - descriptor
                                                                - value
                                                          - contains:
                                                              type: object
                                                              properties:
                                                                descriptor:
                                                                  type: object
                                                                  properties:
                                                                    code:
                                                                      const: WAITING_CHARGE_PER_MIN
                                                                  required:
                                                                    - code
                                                                value:
                                                                  type: string
                                                                  pattern: '^[0-9]+(\.[0-9]+)?$'
                                                              required:
                                                                - descriptor
                                                                - value
                                                          - contains:
                                                              type: object
                                                              properties:
                                                                descriptor:
                                                                  type: object
                                                                  properties:
                                                                    code:
                                                                      const: NIGHT_CHARGE_MULTIPLIER
                                                                  required:
                                                                    - code
                                                                value:
                                                                  type: string
                                                                  pattern: '^[0-9]+(\.[0-9]+)?$'
                                                              required:
                                                                - descriptor
                                                                - value
                                                          - contains:
                                                              type: object
                                                              properties:
                                                                descriptor:
                                                                  type: object
                                                                  properties:
                                                                    code:
                                                                      const: NIGHT_SHIFT_START_TIME
                                                                  required:
                                                                    - code
                                                                value:
                                                                  type: string
                                                                  pattern: '^([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$'
                                                              required:
                                                                - descriptor
                                                                - value
                            - properties:
                                message:
                                  properties:
                                    order:
                                      properties:
                                        items:
                                          items:
                                            properties:
                                              tags:
                                                items:
                                                  if:
                                                    properties:
                                                      descriptor:
                                                        properties:
                                                          code:
                                                            const: FARE_POLICY
                                                  then:
                                                    properties:
                                                      list:
                                                        type: array
                                                        items:
                                                          allOf:
                                                            - if:
                                                                properties:
                                                                  descriptor:
                                                                    properties:
                                                                      code:
                                                                        enum:
                                                                          - MIN_FARE
                                                                          - MIN_FARE_DISTANCE_KM
                                                                          - PER_KM_CHARGE
                                                                          - PICKUP_CHARGE
                                                                          - WAITING_CHARGE_PER_MIN
                                                                          - NIGHT_CHARGE_MULTIPLIER
                                                              then:
                                                                properties:
                                                                  value:
                                                                    type: string
                                                                    pattern: ^-?\d+(\.\d+)?$
                                                                required:
                                                                  - descriptor
                                                                  - value
                                                            - if:
                                                                properties:
                                                                  descriptor:
                                                                    properties:
                                                                      code:
                                                                        enum:
                                                                          - NIGHT_SHIFT_START_TIME
                                                                          - NIGHT_SHIFT_END_TIME
                                                              then:
                                                                properties:
                                                                  value:
                                                                    type: string
                                                                    pattern: '^([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$'
                                                                required:
                                                                  - descriptor
                                                                  - value
                                                            - if:
                                                                properties:
                                                                  descriptor:
                                                                    properties:
                                                                      code:
                                                                        const: EXTERNAL_REF
                                                              then:
                                                                properties:
                                                                  value:
                                                                    type: string
                                                                    pattern: '^https?://[^\s/$.?#].[^\s]*$'
                                                                required:
                                                                  - descriptor
                                                                  - value
                        - allOf:
                            - properties:
                                message:
                                  properties:
                                    order:
                                      properties:
                                        items:
                                          items:
                                            properties:
                                              tags:
                                                items:
                                                  if:
                                                    properties:
                                                      descriptor:
                                                        properties:
                                                          code:
                                                            const: INFO
                                                  then:
                                                    properties:
                                                      list:
                                                        type: array
                                                        items:
                                                          type: object
                                                          properties:
                                                            descriptor:
                                                              properties:
                                                                code:
                                                                  type: string
                                                                  enum:
                                                                    - DISTANCE_TO_NEAREST_DRIVER_METER
                                                                    - ETA_TO_NEAREST_DRIVER_MIN
                            - properties:
                                message:
                                  properties:
                                    order:
                                      properties:
                                        items:
                                          items:
                                            properties:
                                              tags:
                                                items:
                                                  if:
                                                    properties:
                                                      descriptor:
                                                        properties:
                                                          code:
                                                            const: INFO
                                                  then:
                                                    properties:
                                                      list:
                                                        allOf:
                                                          - contains:
                                                              type: object
                                                              properties:
                                                                descriptor:
                                                                  type: object
                                                                  properties:
                                                                    code:
                                                                      const: ETA_TO_NEAREST_DRIVER_MIN
                                                                  required:
                                                                    - code
                                                                value:
                                                                  type: string
                                                                  pattern: ^\d+(\.\d+)?$
                                                              required:
                                                                - descriptor
                                                                - value
                                                          - contains:
                                                              type: object
                                                              properties:
                                                                descriptor:
                                                                  type: object
                                                                  properties:
                                                                    code:
                                                                      const: DISTANCE_TO_NEAREST_DRIVER_METER
                                                                  required:
                                                                    - code
                                                                value:
                                                                  type: string
                                                                  pattern: ^\d+(\.\d+)?$
                                                              required:
                                                                - descriptor
                                                                - value
                            - properties:
                                message:
                                  properties:
                                    order:
                                      properties:
                                        items:
                                          type: array
                                          items:
                                            properties:
                                              tags:
                                                items:
                                                  if:
                                                    properties:
                                                      descriptor:
                                                        properties:
                                                          code:
                                                            const: INFO
                                                  then:
                                                    properties:
                                                      list:
                                                        type: array
                                                        items:
                                                          allOf:
                                                            - if:
                                                                properties:
                                                                  descriptor:
                                                                    properties:
                                                                      code:
                                                                        enum:
                                                                          - DISTANCE_TO_NEAREST_DRIVER_METER
                                                                          - ETA_TO_NEAREST_DRIVER_MIN
                                                              then:
                                                                properties:
                                                                  value:
                                                                    type: string
                                                                    pattern: ^-?\d+(\.\d+)?$
                                                                required:
                                                                  - descriptor
                                                                  - value
                    - allOf:
                        - $ref: '#/paths/~1init/post/requestBody/content/application~1json/schema/allOf/1/allOf/4'
                        - allOf:
                            - allOf:
                                - properties:
                                    message:
                                      properties:
                                        order:
                                          properties:
                                            payments:
                                              items:
                                                properties:
                                                  tags:
                                                    items:
                                                      if:
                                                        properties:
                                                          descriptor:
                                                            properties:
                                                              code:
                                                                const: BUYER_FINDER_FEES
                                                      then:
                                                        properties:
                                                          list:
                                                            type: array
                                                            items:
                                                              type: object
                                                              properties:
                                                                descriptor:
                                                                  properties:
                                                                    code:
                                                                      type: string
                                                                      enum:
                                                                        - BUYER_FINDER_FEES_PERCENTAGE
                                - properties:
                                    message:
                                      properties:
                                        order:
                                          properties:
                                            payments:
                                              items:
                                                properties:
                                                  tags:
                                                    items:
                                                      if:
                                                        properties:
                                                          descriptor:
                                                            properties:
                                                              code:
                                                                const: BUYER_FINDER_FEES
                                                      then:
                                                        properties:
                                                          list:
                                                            allOf:
                                                              - contains:
                                                                  type: object
                                                                  properties:
                                                                    descriptor:
                                                                      type: object
                                                                      properties:
                                                                        code:
                                                                          const: BUYER_FINDER_FEES_PERCENTAGE
                                                                      required:
                                                                        - code
                                                                    value:
                                                                      type: string
                                                                  required:
                                                                    - descriptor
                                                                    - value
                                - properties:
                                    message:
                                      properties:
                                        order:
                                          properties:
                                            payments:
                                              items:
                                                properties:
                                                  tags:
                                                    items:
                                                      if:
                                                        properties:
                                                          descriptor:
                                                            properties:
                                                              code:
                                                                const: BUYER_FINDER_FEES
                                                      then:
                                                        properties:
                                                          list:
                                                            type: array
                                                            items:
                                                              allOf:
                                                                - if:
                                                                    properties:
                                                                      descriptor:
                                                                        properties:
                                                                          code:
                                                                            enum:
                                                                              - BUYER_FINDER_FEES_PERCENTAGE
                                                                  then:
                                                                    properties:
                                                                      value:
                                                                        type: string
                                                                        pattern: ^-?\d+(\.\d+)?$
                                                                    required:
                                                                      - descriptor
                                                                      - value
                            - allOf:
                                - properties:
                                    message:
                                      properties:
                                        order:
                                          properties:
                                            payments:
                                              items:
                                                properties:
                                                  tags:
                                                    items:
                                                      if:
                                                        properties:
                                                          descriptor:
                                                            properties:
                                                              code:
                                                                const: SETTLEMENT_TERMS
                                                      then:
                                                        properties:
                                                          list:
                                                            type: array
                                                            items:
                                                              type: object
                                                              properties:
                                                                descriptor:
                                                                  properties:
                                                                    code:
                                                                      type: string
                                                                      enum:
                                                                        - SETTLEMENT_WINDOW
                                                                        - SETTLEMENT_BASIS
                                                                        - SETTLEMENT_TYPE
                                                                        - MANDATORY_ARBITRATION
                                                                        - COURT_JURISDICTION
                                                                        - DELAY_INTEREST
                                                                        - STATIC_TERMS
                                                                        - SETTLEMENT_AMOUNT
                                - properties:
                                    message:
                                      properties:
                                        order:
                                          properties:
                                            payments:
                                              items:
                                                properties:
                                                  tags:
                                                    items:
                                                      if:
                                                        properties:
                                                          descriptor:
                                                            properties:
                                                              code:
                                                                const: SETTLEMENT_TERMS
                                                      then:
                                                        properties:
                                                          list:
                                                            allOf:
                                                              - contains:
                                                                  type: object
                                                                  properties:
                                                                    descriptor:
                                                                      type: object
                                                                      properties:
                                                                        code:
                                                                          const: STATIC_TERMS
                                                                      required:
                                                                        - code
                                                                    value:
                                                                      type: string
                                                                  required:
                                                                    - descriptor
                                                                    - value
                                                              - contains:
                                                                  type: object
                                                                  properties:
                                                                    descriptor:
                                                                      type: object
                                                                      properties:
                                                                        code:
                                                                          const: SETTLEMENT_TYPE
                                                                      required:
                                                                        - code
                                                                    value:
                                                                      type: string
                                                                  required:
                                                                    - descriptor
                                                                    - value
                                                              - contains:
                                                                  type: object
                                                                  properties:
                                                                    descriptor:
                                                                      type: object
                                                                      properties:
                                                                        code:
                                                                          const: SETTLEMENT_WINDOW
                                                                      required:
                                                                        - code
                                                                    value:
                                                                      type: string
                                                                  required:
                                                                    - descriptor
                                                                    - value
                                - properties:
                                    message:
                                      properties:
                                        order:
                                          properties:
                                            payments:
                                              items:
                                                properties:
                                                  tags:
                                                    items:
                                                      if:
                                                        properties:
                                                          descriptor:
                                                            properties:
                                                              code:
                                                                const: SETTLEMENT_TERMS
                                                      then:
                                                        properties:
                                                          list:
                                                            type: array
                                                            items:
                                                              allOf:
                                                                - if:
                                                                    properties:
                                                                      descriptor:
                                                                        properties:
                                                                          code:
                                                                            const: SETTLEMENT_WINDOW
                                                                  then:
                                                                    properties:
                                                                      value:
                                                                        type: string
                                                                        pattern: '^P(?!$)(?:\d+Y)?(?:\d+M)?(?:\d+W)?(?:\d+D)?(?:T(?=\d)(?:\d+H)?(?:\d+M)?(?:\d+S)?)?$'
                                                                    required:
                                                                      - descriptor
                                                                      - value
                                                                - if:
                                                                    properties:
                                                                      descriptor:
                                                                        properties:
                                                                          code:
                                                                            const: SETTLEMENT_BASIS
                                                                  then:
                                                                    properties:
                                                                      value:
                                                                        type: string
                                                                        enum:
                                                                          - INVOICE_RECEIPT
                                                                          - DELIVERY
                                                                    required:
                                                                      - descriptor
                                                                      - value
                                                                - if:
                                                                    properties:
                                                                      descriptor:
                                                                        properties:
                                                                          code:
                                                                            const: MANDATORY_ARBITRATION
                                                                  then:
                                                                    properties:
                                                                      value:
                                                                        type: string
                                                                        pattern: ^(true|false)$
                                                                    required:
                                                                      - descriptor
                                                                      - value
                                                                - if:
                                                                    properties:
                                                                      descriptor:
                                                                        properties:
                                                                          code:
                                                                            const: STATIC_TERMS
                                                                  then:
                                                                    properties:
                                                                      value:
                                                                        type: string
                                                                        format: uri
                                                                    required:
                                                                      - descriptor
                                                                      - value
                                                                - if:
                                                                    properties:
                                                                      descriptor:
                                                                        properties:
                                                                          code:
                                                                            const: COURT_JURISDICTION
                                                                  then:
                                                                    properties:
                                                                      value:
                                                                        type: string
                                                                    required:
                                                                      - descriptor
                                                                      - value
                                                                - if:
                                                                    properties:
                                                                      descriptor:
                                                                        properties:
                                                                          code:
                                                                            const: DELAY_INTEREST
                                                                  then:
                                                                    properties:
                                                                      value:
                                                                        type: string
                                                                        pattern: '^\d+(\.\d{1,2})?$'
                                                                    required:
                                                                      - descriptor
                                                                      - value
                                                                - if:
                                                                    properties:
                                                                      descriptor:
                                                                        properties:
                                                                          code:
                                                                            const: SETTLEMENT_TYPE
                                                                  then:
                                                                    properties:
                                                                      value:
                                                                        type: string
                                                                        enum:
                                                                          - UPI
                                                                          - NEFT
                                                                          - RTGS
                                                                    required:
                                                                      - descriptor
                                                                      - value
                                                                - if:
                                                                    properties:
                                                                      descriptor:
                                                                        properties:
                                                                          code:
                                                                            const: SETTLEMENT_AMOUNT
                                                                  then:
                                                                    properties:
                                                                      value:
                                                                        type: string
                                                                        pattern: '^\d+(\.\d{1,2})?$'
                                                                    required:
                                                                      - descriptor
                                                                      - value
                            - properties:
                                message:
                                  properties:
                                    order:
                                      properties:
                                        payments:
                                          items:
                                            properties:
                                              tags:
                                                allOf:
                                                  - contains:
                                                      properties:
                                                        descriptor:
                                                          type: object
                                                          properties:
                                                            code:
                                                              const: BUYER_FINDER_FEES
                                                          required:
                                                            - code
                                                  - contains:
                                                      properties:
                                                        descriptor:
                                                          type: object
                                                          properties:
                                                            code:
                                                              const: SETTLEMENT_TERMS
                                                          required:
                                                            - code
                    - $ref: '#/paths/~1init/post/requestBody/content/application~1json/schema/allOf/1/allOf/5'
                    - properties:
                        message:
                          properties:
                            order:
                              properties:
                                payments:
                                  type: array
                                  items:
                                    properties:
                                      type:
                                        type: string
                                      params:
                                        type: object
                                        properties:
                                          transaction_id:
                                            type: string
                                    required:
                                      - type
                                  allOf:
                                    - if:
                                        properties:
                                          type:
                                            const: PRE-ORDER
                                      then:
                                        properties:
                                          params:
                                            required:
                                              - transaction_id
                              required:
                                - payments
                    - properties:
                        message:
                          properties:
                            order:
                              not:
                                required:
                                  - id
            examples:
              Confirm ride booking:
                value:
                  context:
                    action: confirm
                    bap_id: example-bap.com
                    bap_uri: 'https://api.example-bap.com/pilot/bap/cab/v1'
                    bpp_id: example-bpp.com
                    bpp_uri: 'https://api.example-bpp.com/dobpp/beckn/7f7896dd-787e-4a0b-8675-e9e6fe93bb8f'
                    domain: 'nic2004:60221'
                    location:
                      city:
                        code: 'std:080'
                      country:
                        code: IND
                    message_id: 8926b747-0362-4fcc-b795-0994a6287700
                    timestamp: '2023-03-23T04:48:53Z'
                    transaction_id: b580c989-f84d-4abe-af28-2c818aafce3b
                    version: 1.1.0
                  message:
                    order:
                      fulfillments:
                        - customer:
                            contact:
                              phone: +91-9897867564
                            person:
                              language:
                                code: en
                                name: English
                              name: John Doe
                          id: fulf_5cf064d5-4c0a-42d3-b73d-5f19a6f7468e
                          stops:
                            - location:
                                address: '98 A, 6th Main Rd, Uttarahalli Hobli, Ramanjaneyanagar'
                                area_code: 560061
                                city:
                                  name: Bengaluru
                                country:
                                  name: India
                                district: Ramanjaneyanagar
                                gps: '12.910458, 77.543089'
                                state:
                                  name: Karnataka
                              type: start
                            - location:
                                address: 'Basavanagudi, Chikkanna Garden, Rangadore Memorial Hospital'
                                area_code: 560061
                                city:
                                  name: Bengaluru
                                country:
                                  name: India
                                district: Chikkanna Garden
                                gps: '12.9535139,  77.5710434'
                                state:
                                  name: Karnataka
                              type: end
                          vehicle:
                            category: AUTO_RICKSHAW
                      items:
                        - fulfillment_ids:
                            - fb5c84d4-1b59-4b9d-96b5-9d79107432c5
                          id: 5777a0bf-9a08-49aa-a97d-1e5561a9622e
                          payment_ids:
                            - '1'
                      payments:
                        - id: 7f7896dd-787e-4a0b-8675-e9e6fe93bb8f
                          params:
                            amount: '81'
                            currency: INR
                          status: NOT-PAID
                          type: ON-FULFILLMENT
                      provider:
                        id: '1'
              Confirm ticket booking:
                value:
                  context:
                    action: confirm
                    bap_id: 'https://example-bap.com'
                    bap_uri: 'https://mock_bap.com/beckn/'
                    bpp_id: 'https://kmrl-bpp.com'
                    bpp_uri: 'https://kmrl-bpp.com/beckn/'
                    domain: 'nic2004:60221'
                    location:
                      city:
                        code: 'std:080'
                      country:
                        code: IND
                    message_id: fde8b8b6-c2e5-49f7-b254-720843d528bd
                    timestamp: '2021-03-23T10:00:40.065Z'
                    transaction_id: 6f339232-2bc3-44d2-915c-30d2b053ce1d
                    version: 1.1.0
                  message:
                    order:
                      billing:
                        email: john.doe@example.com
                        name: John Doe
                      items:
                        - id: '1'
                      payment:
                        params:
                          amount: '55'
                          currency: INR
                          transaction_id: '24566345563'
                      provider:
                        id: '1'
        description: TODO
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
                  message:
                    properties:
                      ack:
                        $ref: '#/components/schemas/Ack'
                    required:
                      - ack
                    type: object
                required:
                  - message
                type: object
          description: Acknowledgement of message received
      tags:
        - Beckn Provider Platform (BPP)
  /status:
    post:
      description: Fetch the latest order object
      operationId: status
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - properties:
                    context:
                      allOf:
                        - $ref: '#/components/schemas/Context'
                    message:
                      properties:
                        order_id:
                          $ref: '#/components/schemas/Order/properties/id'
                      type: object
                  required:
                    - context
                    - message
                  type: object
                - allOf:
                    - $ref: '#/paths/~1init/post/requestBody/content/application~1json/schema/allOf/1/allOf/0'
                    - properties:
                        context:
                          properties:
                            action:
                              type: string
                              enum:
                                - status
                    - properties:
                        message:
                          properties:
                            order_id:
                              type: string
                          required:
                            - order_id
            examples:
              Get latest fulfillment status of a booking:
                value:
                  context:
                    action: status
                    bap_id: example-bap.com
                    bap_uri: 'https://api.example-bap.com/pilot/bap/cab/v1'
                    bpp_id: example-bpp.com
                    bpp_uri: 'https://api.example-bpp.com/dobpp/beckn/7f7896dd-787e-4a0b-8675-e9e6fe93bb8f'
                    domain: 'nic2004:60221'
                    location:
                      city:
                        code: 'std:080'
                      country:
                        code: IND
                    message_id: 8926b747-0362-4fcc-b795-0994a6287700
                    timestamp: '2023-03-23T04:48:53Z'
                    transaction_id: b580c989-f84d-4abe-af28-2c818aafce3b
                    version: 1.1.0
                  message:
                    order_id: 7751bd26-3fdc-47ca-9b64-e998dc5abe68
              Get latest status of a transit ticket booking:
                value:
                  context:
                    action: status
                    bap_id: 'https://example-bap.com'
                    bap_uri: 'https://api.example-bap.com/beckn/'
                    bpp_id: 'https://transit-solutions.com'
                    bpp_uri: 'https://api.transit-solutions.com/beckn/'
                    domain: 'nic2008:49213'
                    location:
                      city:
                        code: 'std:080'
                      country:
                        code: IND
                    message_id: fde8b8b6-c2e5-49f7-b254-720843d528bd
                    timestamp: '2021-03-23T10:00:40.065Z'
                    transaction_id: 6f339232-2bc3-44d2-915c-30d2b053ce1d
                    version: 1.1.0
                  message:
                    order_id: '123413'
        description: TODO
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
                  message:
                    properties:
                      ack:
                        $ref: '#/components/schemas/Ack'
                    required:
                      - ack
                    type: object
                required:
                  - message
                type: object
          description: Acknowledgement of message received
      tags:
        - Beckn Provider Platform (BPP)
  /update:
    post:
      description: Remove object
      operationId: update
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - properties:
                    context:
                      allOf:
                        - $ref: '#/components/schemas/Context'
                        - properties:
                            action:
                              enum:
                                - update
                          required:
                            - bpp_id
                            - bpp_uri
                    message:
                      properties:
                        order:
                          allOf:
                            - $ref: '#/components/schemas/Order'
                          description: Updated order object
                          required:
                            - id
                        update_target:
                          description: 'Comma separated values of order objects being updated. For example: ```"update_target":"item,billing,fulfillment"```'
                          type: string
                      required:
                        - update_target
                        - order
                      type: object
                  required:
                    - context
                    - message
                  type: object
                - allOf:
                    - $ref: '#/paths/~1init/post/requestBody/content/application~1json/schema/allOf/1/allOf/0'
                    - properties:
                        context:
                          properties:
                            action:
                              type: string
                              enum:
                                - update
                    - properties:
                        message:
                          type: object
                          properties:
                            order:
                              type: object
                              properties:
                                id:
                                  type: string
                              required:
                                - id
                            update_target:
                              type: string
                              pattern: '^[^,]+(,[^,]+)*$'
                          required:
                            - order
                            - update_target
        description: TODO
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
                  message:
                    properties:
                      ack:
                        $ref: '#/components/schemas/Ack'
                    required:
                      - ack
                    type: object
                required:
                  - message
                type: object
          description: Acknowledgement of message received
      tags:
        - Beckn Provider Platform (BPP)
  /rating:
    post:
      description: Provide feedback on a service
      operationId: rating
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - properties:
                    context:
                      allOf:
                        - $ref: '#/components/schemas/Context'
                        - properties:
                            action:
                              enum:
                                - rating
                    message:
                      properties:
                        ratings:
                          type: array
                          items:
                            $ref: '#/components/schemas/Rating'
                      type: object
                  required:
                    - context
                    - message
                  type: object
                - allOf:
                    - $ref: '#/paths/~1init/post/requestBody/content/application~1json/schema/allOf/1/allOf/0'
                    - properties:
                        context:
                          properties:
                            action:
                              type: string
                              enum:
                                - rating
                    - properties:
                        message:
                          properties:
                            ratings:
                              type: array
                              minItems: 1
                              items:
                                type: object
                                properties:
                                  id:
                                    type: string
                                  value:
                                    type: number
                                  rating_category:
                                    type: string
                                    enum:
                                      - RIDER
                                      - DRIVER
                                      - SERVICE
                                required:
                                  - id
                                  - value
                                  - rating_category
            examples:
              Provide a rating:
                value:
                  context:
                    action: rating
                    bap_id: example-bap.com
                    bap_uri: 'https://api.example-bap.com/pilot/bap/cab/v1'
                    bpp_id: example-bpp.com
                    bpp_uri: 'https://api.example-bpp.com/dobpp/beckn/7f7896dd-787e-4a0b-8675-e9e6fe93bb8f'
                    domain: 'nic2004:60221'
                    location:
                      city:
                        code: 'std:080'
                      country:
                        code: IND
                    message_id: 432fdfd6-0457-47b6-9fac-80cbe5c0a75b
                    timestamp: '2023-03-23T04:46:45Z'
                    transaction_id: 870782be-6757-43f1-945c-8eeaf9536259
                    version: 1.1.0
                  message:
                    ratings:
                      - id: b0462745-f6c9-4100-bbe7-4fa3648b6b40
                        rating_category: DRIVER
                        value: 4
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
                  message:
                    properties:
                      ack:
                        $ref: '#/components/schemas/Ack'
                    required:
                      - ack
                    type: object
                required:
                  - message
                type: object
          description: Acknowledgement of message received
      tags:
        - Beckn Provider Platform (BPP)
  /support:
    post:
      description: Contact support
      operationId: support
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - properties:
                    context:
                      allOf:
                        - $ref: '#/components/schemas/Context'
                        - properties:
                            action:
                              enum:
                                - support
                    message:
                      properties:
                        support:
                          $ref: '#/components/schemas/Support'
                      type: object
                  required:
                    - context
                    - message
                  type: object
                - allOf:
                    - $ref: '#/paths/~1init/post/requestBody/content/application~1json/schema/allOf/1/allOf/0'
                    - properties:
                        context:
                          properties:
                            action:
                              type: string
                              enum:
                                - support
                    - properties:
                        message:
                          properties:
                            support:
                              properties:
                                ref_id:
                                  type: string
                              required:
                                - ref_id
            examples:
              Fetch support information related to a particular order:
                value:
                  context:
                    action: support
                    bap_id: example-bap.com
                    bap_uri: 'https://api.example-bap.com/pilot/bap/cab/v1'
                    bpp_id: example-bpp.com
                    bpp_uri: 'https://api.example-bpp.com/dobpp/beckn/7f7896dd-787e-4a0b-8675-e9e6fe93bb8f'
                    domain: 'nic2004:60221'
                    location:
                      city:
                        code: 'std:080'
                      country:
                        code: IND
                    message_id: 8926b747-0362-4fcc-b795-0994a6287700
                    timestamp: '2023-03-23T04:48:53Z'
                    transaction_id: 870782be-6757-43f1-945c-8eeaf9536259
                    version: 1.1.0
                  message:
                    support:
                      email: johndoe@gmail.com
                      phone: 91-876787656
                      ref_id: 7751bd26-3fdc-47ca-9b64-e998dc5abe68
        description: TODO
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
                  message:
                    properties:
                      ack:
                        $ref: '#/components/schemas/Ack'
                    required:
                      - ack
                    type: object
                required:
                  - message
                type: object
          description: Acknowledgement of message received
      tags:
        - Beckn Provider Platform (BPP)
  /track:
    post:
      description: Track an active order
      operationId: track
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - properties:
                    context:
                      allOf:
                        - $ref: '#/components/schemas/Context'
                        - properties:
                            action:
                              enum:
                                - track
                    message:
                      additionalProperties: false
                      properties:
                        callback_url:
                          format: uri
                          type: string
                        order_id:
                          $ref: '#/components/schemas/Order/properties/id'
                      type: object
                  required:
                    - context
                    - message
                  type: object
                - allOf:
                    - $ref: '#/paths/~1init/post/requestBody/content/application~1json/schema/allOf/1/allOf/0'
                    - properties:
                        context:
                          properties:
                            action:
                              type: string
                              enum:
                                - track
                    - properties:
                        message:
                          properties:
                            order_id:
                              type: string
                          required:
                            - order_id
            examples:
              Track an active ride:
                value:
                  context:
                    action: track
                    bap_id: example-bap.com
                    bap_uri: 'https://api.example-bap.com/pilot/bap/cab/v1'
                    bpp_id: example-bpp.com
                    bpp_uri: 'https://api.example-bpp.com/dobpp/beckn/7f7896dd-787e-4a0b-8675-e9e6fe93bb8f'
                    domain: 'nic2004:60221'
                    location:
                      city:
                        code: 'std:080'
                      country:
                        code: IND
                    message_id: 8926b747-0362-4fcc-b795-0994a6287700
                    timestamp: '2023-03-23T04:48:53Z'
                    transaction_id: 870782be-6757-43f1-945c-8eeaf9536259
                    version: 1.1.0
                  message:
                    order_id: 22e090fc-b8b1-4437-9126-ff7a71c7845c
        description: TODO
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
                  message:
                    properties:
                      ack:
                        $ref: '#/components/schemas/Ack'
                    required:
                      - ack
                    type: object
                required:
                  - message
                type: object
          description: Acknowledgement of message received
      tags:
        - Beckn Provider Platform (BPP)
  /cancel:
    post:
      description: Cancel an order
      operationId: cancel
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - properties:
                    context:
                      allOf:
                        - $ref: '#/components/schemas/Context'
                        - properties:
                            action:
                              enum:
                                - cancel
                    message:
                      properties:
                        cancellation_reason_id:
                          $ref: '#/components/schemas/Option/properties/id'
                        descriptor:
                          $ref: '#/components/schemas/Descriptor'
                        order_id:
                          $ref: '#/components/schemas/Order/properties/id'
                      type: object
                  required:
                    - context
                    - message
                  type: object
                - allOf:
                    - $ref: '#/paths/~1init/post/requestBody/content/application~1json/schema/allOf/1/allOf/0'
                    - properties:
                        context:
                          properties:
                            action:
                              type: string
                              enum:
                                - cancel
                    - properties:
                        message:
                          properties:
                            order_id:
                              type: string
                            descriptor:
                              properties:
                                code:
                                  type: string
                                  enum:
                                    - SOFT_CANCEL
                                    - CONFIRM_CANCEL
                              required:
                                - code
                            cancellation_reason_id:
                              type: string
                              pattern: '^[0-9]+$'
                          required:
                            - order_id
                            - descriptor
                            - cancellation_reason_id
            examples:
              Cancel a ride with selected reason:
                value:
                  context:
                    action: cancel
                    bap_id: api.beckn.juspay.in/pilot/bap/cab/v1
                    bap_uri: 'https://api.example-bap.com/pilot/bap/cab/v1'
                    bpp_id: api.beckn.juspay.in/dobpp/beckn/7f7896dd-787e-4a0b-8675-e9e6fe93bb8f
                    bpp_uri: 'https://api.example-bpp.com/dobpp/beckn/7f7896dd-787e-4a0b-8675-e9e6fe93bb8f'
                    domain: 'nic2004:60221'
                    location:
                      city:
                        code: 'std:080'
                      country:
                        code: IND
                    message_id: be6a495a-e941-4fbf-9d59-f1e6166cccc8
                    timestamp: '2023-03-23T05:15:08Z'
                    version: 1.1.0
                  message:
                    cancellation_reason_id: '5'
                    order_id: b4232ad4-19ee-4c67-9223-a5189b13a741
              Cancel a ride with user provided information:
                value:
                  context:
                    action: cancel
                    bap_id: api.beckn.juspay.in/pilot/bap/cab/v1
                    bap_uri: 'https://api.example-bap.com/pilot/bap/cab/v1'
                    bpp_id: api.beckn.juspay.in/dobpp/beckn/7f7896dd-787e-4a0b-8675-e9e6fe93bb8f
                    bpp_uri: 'https://api.example-bpp.com/dobpp/beckn/7f7896dd-787e-4a0b-8675-e9e6fe93bb8f'
                    domain: 'nic2004:60221'
                    location:
                      city:
                        code: 'std:080'
                      country:
                        code: IND
                    message_id: be6a495a-e941-4fbf-9d59-f1e6166cccc8
                    timestamp: '2023-03-23T05:15:08Z'
                    version: 1.1.0
                  message:
                    cancellation_reason_id: '7'
                    descriptor:
                      short_desc: Accidenally booked the ride
                    order_id: b4232ad4-19ee-4c67-9223-a5189b13a741
              Cancel a transit ticket booking before the cancellation period:
                value:
                  context:
                    action: cancel
                    bap_id: 'https://example-bap.com'
                    bap_uri: 'https://api.example-bap.com/beckn/'
                    bpp_id: 'https://transit-solutions.com'
                    bpp_uri: 'https://api.transit-solutions.com/beckn/'
                    domain: 'nic2008:49213'
                    location:
                      city:
                        code: 'std:080'
                      country:
                        code: IND
                    message_id: fde8b8b6-c2e5-49f7-b254-720843d528bd
                    timestamp: '2021-03-23T10:00:40.065Z'
                    transaction_id: 6f339232-2bc3-44d2-915c-30d2b053ce1d
                    version: 1.1.0
                  message:
                    order:
                      cancellation_reason_id: '2'
                      id: '123413'
        description: TODO
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
                  message:
                    properties:
                      ack:
                        $ref: '#/components/schemas/Ack'
                    required:
                      - ack
                    type: object
                required:
                  - message
                type: object
          description: Acknowledgement of message received
      tags:
        - Beckn Provider Platform (BPP)
  /on_search:
    post:
      description: Send catalog
      operationId: on_search
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - type: object
                  properties:
                    context:
                      allOf:
                        - $ref: '#/components/schemas/Context'
                    error:
                      $ref: '#/components/schemas/Error'
                    message:
                      properties:
                        catalog:
                          $ref: '#/components/schemas/Catalog'
                      required:
                        - catalog
                      type: object
                  required:
                    - context
                    - message
                - allOf:
                    - $ref: '#/paths/~1init/post/requestBody/content/application~1json/schema/allOf/1/allOf/0'
                    - properties:
                        context:
                          properties:
                            action:
                              type: string
                              enum:
                                - on_search
                    - properties:
                        message:
                          properties:
                            catalog:
                              type: object
                              properties:
                                descriptor:
                                  type: object
                                  properties:
                                    name:
                                      type: string
                                    images:
                                      type: array
                                      items:
                                        minItems: 1
                                  required:
                                    - name
                              required:
                                - descriptor
                    - properties:
                        message:
                          properties:
                            catalog:
                              type: object
                              properties:
                                providers:
                                  type: array
                                  minItems: 1
                                  items:
                                    type: object
                                    properties:
                                      id:
                                        type: string
                                    required:
                                      - id
                              required:
                                - providers
                    - properties:
                        message:
                          properties:
                            catalog:
                              properties:
                                providers:
                                  items:
                                    properties:
                                      fulfillments:
                                        type: array
                                        minItems: 1
                                        items:
                                          properties:
                                            vehicle:
                                              properties:
                                                category:
                                                  type: string
                                                  enum:
                                                    - AUTO_RICKSHAW
                                                    - CAB
                                              required:
                                                - category
                                            type:
                                              type: string
                                              enum:
                                                - DELIVERY
                                          required:
                                            - id
                                            - vehicle
                                            - type
                                    required:
                                      - fulfillments
                    - properties:
                        message:
                          properties:
                            catalog:
                              properties:
                                providers:
                                  items:
                                    properties:
                                      items:
                                        type: array
                                        minItems: 1
                                        items:
                                          type: object
                                          properties:
                                            descriptor:
                                              type: object
                                              properties:
                                                name:
                                                  type: string
                                                code:
                                                  type: string
                                                  enum:
                                                    - RIDE
                                              required:
                                                - code
                                            price:
                                              type: object
                                              properties:
                                                value:
                                                  type: string
                                                  pattern: ^-?\d+(\.\d+)?$
                                              required:
                                                - value
                                                - currency
                                            fulfillment_ids:
                                              type: array
                                              minItems: 1
                                            payment_ids:
                                              type: array
                                              minItems: 1
                                          required:
                                            - id
                                            - descriptor
                                            - price
                                            - fulfillment_ids
                                            - payment_ids
                                    required:
                                      - items
                    - properties:
                        message:
                          properties:
                            catalog:
                              properties:
                                providers:
                                  items:
                                    properties:
                                      payments:
                                        type: array
                                        minItems: 1
                                        items:
                                          type: object
                                          properties:
                                            type:
                                              type: string
                                            collected_by:
                                              type: string
                                          required:
                                            - collected_by
                                    required:
                                      - payments
                    - properties:
                        message:
                          properties:
                            catalog:
                              properties:
                                providers:
                                  items:
                                    properties:
                                      fulfillments:
                                        items:
                                          properties:
                                            stops:
                                              allOf:
                                                - contains:
                                                    type: object
                                                    properties:
                                                      location:
                                                        type: object
                                                        properties:
                                                          gps:
                                                            type: string
                                                        required:
                                                          - gps
                                                      type:
                                                        const: START
                                                    required:
                                                      - location
                                                      - type
                                                - contains:
                                                    type: object
                                                    properties:
                                                      location:
                                                        type: object
                                                        properties:
                                                          gps:
                                                            type: string
                                                        required:
                                                          - gps
                                                      type:
                                                        const: END
                                                    required:
                                                      - location
                                                      - type
                                          required:
                                            - stops
                    - allOf:
                        - allOf:
                            - properties:
                                message:
                                  properties:
                                    catalog:
                                      properties:
                                        providers:
                                          items:
                                            properties:
                                              payments:
                                                items:
                                                  properties:
                                                    tags:
                                                      items:
                                                        if:
                                                          properties:
                                                            descriptor:
                                                              properties:
                                                                code:
                                                                  const: BUYER_FINDER_FEES
                                                        then:
                                                          properties:
                                                            list:
                                                              type: array
                                                              items:
                                                                type: object
                                                                properties:
                                                                  descriptor:
                                                                    properties:
                                                                      code:
                                                                        type: string
                                                                        enum:
                                                                          - BUYER_FINDER_FEES_PERCENTAGE
                            - properties:
                                message:
                                  properties:
                                    catalog:
                                      properties:
                                        providers:
                                          items:
                                            properties:
                                              payments:
                                                items:
                                                  properties:
                                                    tags:
                                                      items:
                                                        if:
                                                          properties:
                                                            descriptor:
                                                              properties:
                                                                code:
                                                                  const: BUYER_FINDER_FEES
                                                        then:
                                                          properties:
                                                            list:
                                                              allOf:
                                                                - contains:
                                                                    type: object
                                                                    properties:
                                                                      descriptor:
                                                                        type: object
                                                                        properties:
                                                                          code:
                                                                            const: BUYER_FINDER_FEES_PERCENTAGE
                                                                        required:
                                                                          - code
                                                                      value:
                                                                        type: string
                                                                    required:
                                                                      - descriptor
                                                                      - value
                            - properties:
                                message:
                                  properties:
                                    catalog:
                                      properties:
                                        providers:
                                          items:
                                            properties:
                                              payments:
                                                items:
                                                  properties:
                                                    tags:
                                                      items:
                                                        if:
                                                          properties:
                                                            descriptor:
                                                              properties:
                                                                code:
                                                                  const: BUYER_FINDER_FEES
                                                        then:
                                                          properties:
                                                            list:
                                                              type: array
                                                              items:
                                                                allOf:
                                                                  - if:
                                                                      properties:
                                                                        descriptor:
                                                                          properties:
                                                                            code:
                                                                              enum:
                                                                                - BUYER_FINDER_FEES_PERCENTAGE
                                                                    then:
                                                                      properties:
                                                                        value:
                                                                          type: string
                                                                          pattern: ^-?\d+(\.\d+)?$
                                                                      required:
                                                                        - descriptor
                                                                        - value
                        - allOf:
                            - properties:
                                message:
                                  properties:
                                    catalog:
                                      properties:
                                        providers:
                                          items:
                                            properties:
                                              payments:
                                                items:
                                                  properties:
                                                    tags:
                                                      items:
                                                        if:
                                                          properties:
                                                            descriptor:
                                                              properties:
                                                                code:
                                                                  const: SETTLEMENT_TERMS
                                                        then:
                                                          properties:
                                                            list:
                                                              type: array
                                                              items:
                                                                type: object
                                                                properties:
                                                                  descriptor:
                                                                    properties:
                                                                      code:
                                                                        type: string
                                                                        enum:
                                                                          - SETTLEMENT_WINDOW
                                                                          - SETTLEMENT_BASIS
                                                                          - SETTLEMENT_TYPE
                                                                          - MANDATORY_ARBITRATION
                                                                          - COURT_JURISDICTION
                                                                          - DELAY_INTEREST
                                                                          - STATIC_TERMS
                                                                          - SETTLEMENT_AMOUNT
                            - properties:
                                message:
                                  properties:
                                    catalog:
                                      properties:
                                        providers:
                                          items:
                                            properties:
                                              payments:
                                                items:
                                                  properties:
                                                    tags:
                                                      items:
                                                        if:
                                                          properties:
                                                            descriptor:
                                                              properties:
                                                                code:
                                                                  const: SETTLEMENT_TERMS
                                                        then:
                                                          properties:
                                                            list:
                                                              allOf:
                                                                - contains:
                                                                    type: object
                                                                    properties:
                                                                      descriptor:
                                                                        type: object
                                                                        properties:
                                                                          code:
                                                                            const: STATIC_TERMS
                                                                        required:
                                                                          - code
                                                                      value:
                                                                        type: string
                                                                    required:
                                                                      - descriptor
                                                                      - value
                                                                - contains:
                                                                    type: object
                                                                    properties:
                                                                      descriptor:
                                                                        type: object
                                                                        properties:
                                                                          code:
                                                                            const: SETTLEMENT_TYPE
                                                                        required:
                                                                          - code
                                                                      value:
                                                                        type: string
                                                                    required:
                                                                      - descriptor
                                                                      - value
                                                                - contains:
                                                                    type: object
                                                                    properties:
                                                                      descriptor:
                                                                        type: object
                                                                        properties:
                                                                          code:
                                                                            const: SETTLEMENT_WINDOW
                                                                        required:
                                                                          - code
                                                                      value:
                                                                        type: string
                                                                    required:
                                                                      - descriptor
                                                                      - value
                            - properties:
                                message:
                                  properties:
                                    catalog:
                                      properties:
                                        providers:
                                          items:
                                            properties:
                                              payments:
                                                items:
                                                  properties:
                                                    tags:
                                                      items:
                                                        if:
                                                          properties:
                                                            descriptor:
                                                              properties:
                                                                code:
                                                                  const: SETTLEMENT_TERMS
                                                        then:
                                                          properties:
                                                            list:
                                                              type: array
                                                              items:
                                                                allOf:
                                                                  - if:
                                                                      properties:
                                                                        descriptor:
                                                                          properties:
                                                                            code:
                                                                              const: SETTLEMENT_WINDOW
                                                                    then:
                                                                      properties:
                                                                        value:
                                                                          type: string
                                                                          pattern: '^P(?!$)(?:\d+Y)?(?:\d+M)?(?:\d+W)?(?:\d+D)?(?:T(?=\d)(?:\d+H)?(?:\d+M)?(?:\d+S)?)?$'
                                                                      required:
                                                                        - descriptor
                                                                        - value
                                                                  - if:
                                                                      properties:
                                                                        descriptor:
                                                                          properties:
                                                                            code:
                                                                              const: SETTLEMENT_BASIS
                                                                    then:
                                                                      properties:
                                                                        value:
                                                                          type: string
                                                                          enum:
                                                                            - INVOICE_RECEIPT
                                                                            - DELIVERY
                                                                      required:
                                                                        - descriptor
                                                                        - value
                                                                  - if:
                                                                      properties:
                                                                        descriptor:
                                                                          properties:
                                                                            code:
                                                                              const: MANDATORY_ARBITRATION
                                                                    then:
                                                                      properties:
                                                                        value:
                                                                          type: string
                                                                          pattern: ^(true|false)$
                                                                      required:
                                                                        - descriptor
                                                                        - value
                                                                  - if:
                                                                      properties:
                                                                        descriptor:
                                                                          properties:
                                                                            code:
                                                                              const: STATIC_TERMS
                                                                    then:
                                                                      properties:
                                                                        value:
                                                                          type: string
                                                                          format: uri
                                                                      required:
                                                                        - descriptor
                                                                        - value
                                                                  - if:
                                                                      properties:
                                                                        descriptor:
                                                                          properties:
                                                                            code:
                                                                              const: COURT_JURISDICTION
                                                                    then:
                                                                      properties:
                                                                        value:
                                                                          type: string
                                                                      required:
                                                                        - descriptor
                                                                        - value
                                                                  - if:
                                                                      properties:
                                                                        descriptor:
                                                                          properties:
                                                                            code:
                                                                              const: DELAY_INTEREST
                                                                    then:
                                                                      properties:
                                                                        value:
                                                                          type: string
                                                                          pattern: '^\d+(\.\d{1,2})?$'
                                                                      required:
                                                                        - descriptor
                                                                        - value
                                                                  - if:
                                                                      properties:
                                                                        descriptor:
                                                                          properties:
                                                                            code:
                                                                              const: SETTLEMENT_TYPE
                                                                    then:
                                                                      properties:
                                                                        value:
                                                                          type: string
                                                                          enum:
                                                                            - UPI
                                                                            - NEFT
                                                                            - RTGS
                                                                      required:
                                                                        - descriptor
                                                                        - value
                                                                  - if:
                                                                      properties:
                                                                        descriptor:
                                                                          properties:
                                                                            code:
                                                                              const: SETTLEMENT_AMOUNT
                                                                    then:
                                                                      properties:
                                                                        value:
                                                                          type: string
                                                                          pattern: '^\d+(\.\d{1,2})?$'
                                                                      required:
                                                                        - descriptor
                                                                        - value
                        - properties:
                            message:
                              properties:
                                catalog:
                                  properties:
                                    providers:
                                      items:
                                        properties:
                                          payments:
                                            items:
                                              properties:
                                                tags:
                                                  allOf:
                                                    - contains:
                                                        properties:
                                                          descriptor:
                                                            type: object
                                                            properties:
                                                              code:
                                                                const: BUYER_FINDER_FEES
                                                            required:
                                                              - code
                                                    - contains:
                                                        properties:
                                                          descriptor:
                                                            type: object
                                                            properties:
                                                              code:
                                                                const: SETTLEMENT_TERMS
                                                            required:
                                                              - code
            examples:
              Return a mobility catalog with multiple providers:
                value:
                  context:
                    action: on_search
                    bap_id: example-bap.in
                    bap_uri: 'https://api.example-bpp.in/path/to/url'
                    bpp_id: example-bpp.in
                    bpp_uri: 'https://api.example-bpp.in/path/to/url'
                    domain: 'nic2004:60221'
                    location:
                      city:
                        code: 'std:080'
                      country:
                        code: IND
                    message_id: 21e54d3c-9c3b-47c1-aa3b-b0e7b20818ee
                    timestamp: '2023-03-23T04:43:02Z'
                    transaction_id: 870782be-6757-43f1-945c-8eeaf9536259
                    version: 1.1.0
                  message:
                    catalog:
                      descriptor:
                        images:
                          - 'https://example-bpp.com/images/logos/oms.ico'
                        name: Open Mobility Solutions
                      providers:
                        - descriptor:
                            images:
                              - 'https://example-bpp.com/images/logos/acme.ico'
                            name: Acme Cabs
                          fulfillments:
                            - id: fb5c84d4-1b59-4b9d-96b5-9d79107432c5
                              stops:
                                - location:
                                    gps: '12.9099828, 77.6118226'
                                  type: start
                                - location:
                                    gps: '12.9351856, 77.6245996'
                                  type: end
                              vehicle:
                                category: TAXI
                          id: '1'
                          items:
                            - descriptor:
                                name: Economy
                              fulfillment_ids:
                                - '1'
                              id: '1'
                              payment_ids:
                                - '1'
                              price:
                                currency: INR
                                value: '175'
                            - descriptor:
                                name: Premium
                              fulfillment_ids:
                                - '1'
                              id: '2'
                              payment_ids:
                                - '1'
                              price:
                                currency: INR
                                value: '250'
                            - descriptor:
                                name: Luxury
                              fulfillment_ids:
                                - '1'
                              id: '3'
                              payment_ids:
                                - '1'
                              price:
                                currency: INR
                                value: '500'
                          payments:
                            - collected_by: BPP
                              id: '1'
                              type: ON-FULFILLMENT
                        - descriptor:
                            images:
                              - 'https://example-bpp.com/images/logos/betataxis.ico'
                            name: Beta Taxis
                          fulfillments:
                            - id: 1
                              stops:
                                - location:
                                    gps: '12.9099828, 77.6118226'
                                  type: start
                                - location:
                                    gps: '12.9351856, 77.62459969999999'
                                  type: end
                              vehicle:
                                category: TAXI
                            - id: 1
                              stops:
                                - location:
                                    gps: '12.9099828, 77.6118226'
                                  type: start
                                - location:
                                    gps: '12.9351856, 77.62459969999999'
                                  type: end
                              vehicle:
                                category: TEMPO-TRAVELLER
                          id: '2'
                          items:
                            - descriptor:
                                name: Beta Prime
                                short_desc: 'Affordable sedans, at affordable costs'
                              fulfillment_ids:
                                - fb5c84d4-1b59-4b9d-96b5-9d79107432c5
                              id: '1'
                              payment_ids:
                                - '1'
                              price:
                                currency: INR
                                value: '200'
                            - descriptor:
                                name: Beta Max
                                short_desc: Spacious vans for large groups
                              fulfillment_ids:
                                - fb5c84d4-1b59-4b9d-96b5-9d79107432c5
                              id: '2'
                              payment_ids:
                                - '1'
                              price:
                                currency: INR
                                value: '1500'
                          payments:
                            - collected_by: BPP
                              id: '1'
                              type: ON-FULFILLMENT
              Return a mobility catalog with no provider:
                value:
                  context:
                    location:
                      action: on_search
                      bap_id: example-bap.com
                      bap_uri: 'https://api.example-bap.com/pilot/bap/cab/v1'
                      bpp_id: example-bpp.com
                      bpp_uri: 'https://api.example-bpp.com/dobpp/beckn/7f7896dd-787e-4a0b-8675-e9e6fe93bb8f'
                      city:
                        code: 'std:080'
                      country:
                        code: IND
                      domain: 'nic2004:60221'
                      message_id: 21e54d3c-9c3b-47c1-aa3b-b0e7b20818ee
                      timestamp: '2023-03-23T04:43:02Z'
                      transaction_id: 870782be-6757-43f1-945c-8eeaf9536259
                      version: 1.1.0
                  message:
                    catalog:
                      descriptor:
                        name: InstaAuto
                      providers:
                        - fulfillments:
                            - id: fb5c84d4-1b59-4b9d-96b5-9d79107432c5
                              stops:
                                - location:
                                    address: '98 A, 6th Main Rd, Uttarahalli Hobli, Ramanjaneyanagar'
                                    area_code: 560061
                                    city:
                                      name: Bengaluru
                                    country:
                                      name: India
                                    district: Ramanjaneyanagar
                                    gps: '12.910458, 77.543089'
                                    state:
                                      name: Karnataka
                                  type: start
                                - location:
                                    address: 'Basavanagudi, Chikkanna Garden, Rangadore Memorial Hospital'
                                    area_code: 560061
                                    city:
                                      name: Bengaluru
                                    country:
                                      name: India
                                    district: Chikkanna Garden
                                    gps: '12.9535139,  77.5710434'
                                    state:
                                      name: Karnataka
                                  type: end
                              vehicle:
                                category: AUTO_RICKSHAW
                          id: 1
                          items:
                            - descriptor:
                                code: RIDE
                                name: Auto Ride
                              fulfillment_ids:
                                - fb5c84d4-1b59-4b9d-96b5-9d79107432c5
                              id: 5777a0bf-9a08-49aa-a97d-1e5561a9622e
                              payment_ids:
                                - '1'
                              price:
                                currency: INR
                                maximum_value: '156'
                                minimum_value: '176'
                                value: 156 - 176 INR
                          locations:
                            - gps: '12.9164682,77.6089985'
                              id: '1'
                            - gps: '12.91671,77.6092983'
                              id: '2'
                            - gps: '12.9165733,77.6152167'
                              id: '3'
                            - gps: '12.9068578,77.6044567'
                              id: '4'
                          payments:
                            - collected_by: BPP
                              id: '1'
                              type: ON-FULFILLMENT
              Return a public transit catalog of fare products:
                value:
                  context:
                    action: on_search
                    bap_id: 'https://example-bap.com'
                    bap_uri: 'https://mock_bap.com/beckn/'
                    bpp_id: 'https://transit-solutions.com'
                    bpp_uri: 'https://api.transit-solutions.com/beckn/'
                    domain: 'nic2008:49213'
                    location:
                      city:
                        code: 'std:080'
                      country:
                        code: IND
                    message_id: fde8b8b6-c2e5-49f7-b254-720843d528bd
                    timestamp: '2021-03-23T10:00:40.065Z'
                    transaction_id: 6f339232-2bc3-44d2-915c-30d2b053ce1d
                    version: 1.1.0
                  message:
                    catalog:
                      descriptor:
                        images:
                          - 'https://transitsolutions.in/logos/logo.ico'
                        name: Transit Solutions
                      providers:
                        - descriptor:
                            images:
                              - 'https://delhimetrorail.com/logos/logo.ico'
                            name: Delhi Metro Rail Limited
                          fulfillments:
                            - id: 1
                              stops:
                                - location:
                                    descriptor:
                                      name: Dwarka Sector 10 - Blue Line
                                    gps: '28.5811261,77.0548206'
                                  type: start
                                - descriptor:
                                    name: Patel Chowk - Yellow Line
                                  gps: '28.6230972,77.2099917'
                                  location: null
                                  type: end
                              tags:
                                - descriptor:
                                    name: Other Information
                                  list:
                                    - descriptor:
                                        name: Transfers
                                      display: true
                                      value: '1'
                                    - descriptor:
                                        name: Duration
                                      display: true
                                      value: 60 min
                              vehicle:
                                category: METRO
                            - id: '2'
                              stops:
                                - location:
                                    descriptor:
                                      name: Dwarka Sector 10 - Blue Line
                                    gps: '28.5811261,77.0548206'
                                  type: start
                                - location:
                                    descriptor:
                                      name: Shivaji Stadium -  Airport Express Line
                                    gps: '28.6288785,77.2085895'
                                  type: end
                              tags:
                                - descriptor:
                                    name: Other Information
                                  list:
                                    - descriptor:
                                        name: Transfers
                                      display: true
                                      value: '1'
                                    - descriptor:
                                        name: Duration
                                      display: true
                                      value: 45 min
                              vehicle:
                                category: METRO
                            - id: '3'
                              stops:
                                - location:
                                    descriptor:
                                      name: Dwarka Sector 21
                                    gps: '9.05,12.06'
                                  time:
                                    timestamp: '2021-10-15T00:32:19.000Z'
                                  type: start
                                - location:
                                    descriptor:
                                      name: Shivaji Stadium
                                    gps: '9.07,12.07'
                                  time:
                                    timestamp: '2021-10-15T00:43:21.000Z'
                                  type: end
                              tags:
                                - descriptor:
                                    name: Other Information
                                  list:
                                    - descriptor:
                                        name: Transfers
                                      display: true
                                      value: '1'
                                    - descriptor:
                                        name: Duration
                                      display: true
                                      value: 30 min
                              vehicle:
                                category: METRO
                          id: '1'
                          items:
                            - descriptor:
                                images:
                                  - 'https://delhimetrorail.com/icons/sjt.ico'
                                name: Single Journey Ticket
                              fulfillment_ids:
                                - '1'
                              id: '1'
                              price:
                                currency: '35'
                                value: INR
                            - descriptor:
                                images:
                                  - 'https://delhimetrorail.com/icons/sjt.ico'
                                name: Single Journey Ticket
                              fulfillment_ids:
                                - '2'
                              id: '2'
                              price:
                                currency: '65'
                                value: INR
                            - descriptor:
                                images:
                                  - 'https://delhimetrorail.com/icons/sjt.ico'
                                name: Single Journey Ticket
                              fulfillment_ids:
                                - '3'
                              id: '3'
                              price:
                                currency: '55'
                                value: INR
                            - descriptor:
                                images:
                                  - 'https://delhimetrorail.com/icons/rjt.ico'
                                name: Return Journey Ticket
                              fulfillment_ids:
                                - '1'
                              id: '4'
                              price:
                                currency: '60'
                                value: INR
                            - descriptor:
                                images:
                                  - 'https://delhimetrorail.com/icons/rjt.ico'
                                name: Return Journey Ticket
                              fulfillment_ids:
                                - '2'
                              id: '5'
                              price:
                                currency: '90'
                                value: INR
                            - descriptor:
                                images:
                                  - 'https://delhimetrorail.com/icons/rjt.ico'
                                name: Return Journey Ticket
                              fulfillment_ids:
                                - '3'
                              id: '6'
                              price:
                                currency: '100'
                                value: INR
                            - descriptor:
                                images:
                                  - 'https://delhimetrorail.com/icons/mp.ico'
                                name: Monthly Pass
                              id: '7'
                              price:
                                currency: INR
                                value: '250'
                          tags:
                            - descriptor:
                                name: Other Information
                              list:
                                - descriptor:
                                    name: Timetable
                                  display: true
                                  value: 'https://delhimetrorail.com/timetable.html'
                                - descriptor:
                                    name: GTFS Schedule
                                  display: true
                                  value: 'https://delhimetrorail.com/gtfs'
              Return a single provider mobility catalog:
                value:
                  context:
                    action: on_search
                    bap_id: example-bap.in
                    bap_uri: 'https://api.example-bpp.in/path/to/url'
                    bpp_id: example-bpp.in
                    bpp_uri: 'https://api.example-bpp.in/path/to/url'
                    domain: 'nic2004:60221'
                    location:
                      city:
                        code: 'std:080'
                      country:
                        code: IND
                    message_id: 21e54d3c-9c3b-47c1-aa3b-b0e7b20818ee
                    timestamp: '2023-03-23T04:43:02Z'
                    transaction_id: 870782be-6757-43f1-945c-8eeaf9536259
                    version: 1.1.0
                  message:
                    catalog:
                      descriptor:
                        name: Acme Taxis
                      providers:
                        - descriptor:
                            name: Acme Taxis
                          fulfillments:
                            - id: fb5c84d4-1b59-4b9d-96b5-9d79107432c5
                              stops:
                                - location:
                                    address: '98 A, 6th Main Rd, Uttarahalli Hobli, Ramanjaneyanagar'
                                    area_code: 560061
                                    city:
                                      name: Bengaluru
                                    country:
                                      name: India
                                    district: Ramanjaneyanagar
                                    gps: '12.910458, 77.543089'
                                    state:
                                      name: Karnataka
                                  type: start
                                - location:
                                    address: 'Basavanagudi, Chikkanna Garden, Rangadore Memorial Hospital'
                                    area_code: 560061
                                    city:
                                      name: Bengaluru
                                    country:
                                      name: India
                                    district: Chikkanna Garden
                                    gps: '12.9535139,  77.5710434'
                                    state:
                                      name: Karnataka
                                  type: end
                              vehicle:
                                category: TAXI
                          id: '1'
                          items:
                            - descriptor:
                                code: RIDE
                                name: Economy
                              fulfillment_ids:
                                - fb5c84d4-1b59-4b9d-96b5-9d79107432c5
                              id: 5777a0bf-9a08-49aa-a97d-1e5561a9622e
                              payment_ids:
                                - '1'
                              price:
                                currency: INR
                                value: '175'
                              tags:
                                - descriptor:
                                    name: Daytime Charges
                                  list:
                                    - descriptor:
                                        name: Min Fare upto 2 km
                                      display: true
                                      value: ₹ 30 upto 2 km
                                    - descriptor:
                                        name: Rate above Min. Fare
                                      display: true
                                      value: ₹15 / km
                                    - descriptor:
                                        name: Driver Pickup Charges
                                      display: true
                                      value: ₹ 10
                                    - descriptor:
                                        name: Nominal Fare
                                        short_desc: 'Driver may quote extra to cover for traffic, chance of return trip, etc.'
                                      display: true
                                      value: ₹ 10
                                    - descriptor:
                                        name: Waiting Charges
                                        short_desc: 'Driver may quote extra to cover for traffic, chance of return trip, etc.'
                                      display: true
                                      value: ₹ 0 / min
                          locations:
                            - gps: '12.9164682,77.6089985'
                              id: '1'
                            - gps: '12.91671,77.6092983'
                              id: '2'
                            - gps: '12.9165733,77.6152167'
                              id: '3'
                            - gps: '12.9068578,77.6044567'
                              id: '4'
                          payments:
                            - collected_by: BPP
                              id: '1'
                              type: ON-FULFILLMENT
              Return a single provider mobility catalog (with some optional tags):
                value:
                  context:
                    action: on_search
                    bap_id: example-bap.com
                    bap_uri: 'https://api.example-bap.com/pilot/bap/cab/v1'
                    bpp_id: example-bpp.com
                    bpp_uri: 'https://api.example-bpp.com/dobpp/beckn/7f7896dd-787e-4a0b-8675-e9e6fe93bb8f'
                    domain: 'nic2004:60221'
                    location:
                      city:
                        code: 'std:080'
                      country:
                        code: IND
                    message_id: 21e54d3c-9c3b-47c1-aa3b-b0e7b20818ee
                    timestamp: '2023-03-23T04:43:02Z'
                    transaction_id: 870782be-6757-43f1-945c-8eeaf9536259
                    version: 1.1.0
                  message:
                    catalog:
                      descriptor:
                        name: InstaAuto
                      providers:
                        - fulfillments:
                            - id: fb5c84d4-1b59-4b9d-96b5-9d79107432c5
                              stops:
                                - location:
                                    address: '98 A, 6th Main Rd, Uttarahalli Hobli, Ramanjaneyanagar'
                                    area_code: 560061
                                    city:
                                      name: Bengaluru
                                    country:
                                      name: India
                                    district: Ramanjaneyanagar
                                    gps: '12.910458, 77.543089'
                                    state:
                                      name: Karnataka
                                  type: start
                                - location:
                                    address: 'Basavanagudi, Chikkanna Garden, Rangadore Memorial Hospital'
                                    area_code: 560061
                                    city:
                                      name: Bengaluru
                                    country:
                                      name: India
                                    district: Chikkanna Garden
                                    gps: '12.9535139,  77.5710434'
                                    state:
                                      name: Karnataka
                                  type: end
                              vehicle:
                                category: AUTO_RICKSHAW
                          items:
                            - descriptor:
                                code: RIDE
                                name: Auto Ride
                              fulfillment_ids:
                                - fb5c84d4-1b59-4b9d-96b5-9d79107432c5
                              id: 5777a0bf-9a08-49aa-a97d-1e5561a9622e
                              payment_ids:
                                - '1'
                              price:
                                currency: INR
                                maximum_value: '156'
                                minimum_value: '176'
                                value: 156 - 176 INR
                              tags:
                                - descriptor:
                                    name: Daytime Charges
                                  list:
                                    - descriptor:
                                        name: Min Fare upto 2 km
                                      display: true
                                      value: ₹ 30 upto 2 km
                                    - descriptor:
                                        name: Rate above Min. Fare
                                      display: true
                                      value: ₹15 / km
                                    - descriptor:
                                        name: Driver Pickup Charges
                                      display: true
                                      value: ₹ 10
                                    - descriptor:
                                        name: Nominal Fare
                                        short_desc: 'Driver may quote extra to cover for traffic, chance of return trip, etc.'
                                      display: true
                                      value: ₹ 10
                                    - descriptor:
                                        name: Waiting Charges
                                        short_desc: 'Driver may quote extra to cover for traffic, chance of return trip, etc.'
                                      display: true
                                      value: ₹ 0 / min
                                - descriptor:
                                    name: Night Charges
                                  list:
                                    - descriptor:
                                        name: Night Charges
                                      display: true
                                      value: 1.5x of daytime charges applicable at night from 10 PM to 5 AM
                                    - descriptor:
                                        name: Night Shift Start
                                      display: true
                                      value: '22:00:00'
                                    - descriptor:
                                        name: Night Shift End
                                      display: true
                                      value: '05:00:00'
                                - descriptor:
                                    name: General Information
                                  list:
                                    - descriptor:
                                        name: Distance to nearest driver
                                      display: true
                                      value: 661 m
                                    - descriptor:
                                        name: Wait time upto
                                      display: true
                                      value: 3 min
                          locations:
                            - gps: '12.9164682,77.6089985'
                              id: '1'
                            - gps: '12.91671,77.6092983'
                              id: '2'
                            - gps: '12.9165733,77.6152167'
                              id: '3'
                            - gps: '12.9068578,77.6044567'
                              id: '4'
                          payments:
                            - collected_by: BPP
                              id: '1'
                              type: ON-FULFILLMENT
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
                  message:
                    properties:
                      ack:
                        $ref: '#/components/schemas/Ack'
                    required:
                      - ack
                    type: object
                required:
                  - context
                type: object
          description: Acknowledgement of message received
      tags:
        - Beckn App Platform (BAP)
        - Beckn Gateway (BG)
  /on_select:
    post:
      description: Send draft order object with quoted price for selected items
      operationId: on_select
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - type: object
                  properties:
                    context:
                      allOf:
                        - $ref: '#/components/schemas/Context'
                    error:
                      $ref: '#/components/schemas/Error'
                    message:
                      properties:
                        order:
                          allOf:
                            - $ref: '#/components/schemas/Order'
                      required:
                        - order
                      type: object
                  required:
                    - context
                    - message
                - allOf:
                    - $ref: '#/paths/~1init/post/requestBody/content/application~1json/schema/allOf/1/allOf/0'
                    - properties:
                        context:
                          properties:
                            action:
                              type: string
                              enum:
                                - on_select
                    - $ref: '#/paths/~1on_init/post/requestBody/content/application~1json/schema/allOf/1/allOf/2'
                    - $ref: '#/paths/~1confirm/post/requestBody/content/application~1json/schema/allOf/1/allOf/4'
                    - $ref: '#/paths/~1on_init/post/requestBody/content/application~1json/schema/allOf/1/allOf/4'
                    - $ref: '#/paths/~1on_init/post/requestBody/content/application~1json/schema/allOf/1/allOf/5'
                    - allOf:
                        - properties:
                            message:
                              properties:
                                order:
                                  properties:
                                    fulfillments:
                                      type: array
                                      minItems: 1
                                      items:
                                        required:
                                          - id
                                  required:
                                    - fulfillments
                        - properties:
                            message:
                              properties:
                                order:
                                  properties:
                                    fulfillments:
                                      type: array
                                      minItems: 1
                                      items:
                                        type: object
                                        properties:
                                          state:
                                            type: object
                                            properties:
                                              descriptor:
                                                type: object
                                                properties:
                                                  code:
                                                    type: string
                                                    enum:
                                                      - RIDE_ASSIGNED
                                                      - RIDE_ENROUTE_PICKUP
                                                      - RIDE_ARRIVED_PICKUP
                                                      - RIDE_STARTED
                                                      - RIDE_ENDED
                                                      - RIDE_CANCELLED
                                                required:
                                                  - code
                        - properties:
                            message:
                              properties:
                                order:
                                  properties:
                                    fulfillments:
                                      type: array
                                      minItems: 1
                                      items:
                                        properties:
                                          stops:
                                            items:
                                              properties:
                                                authorization:
                                                  type: object
                                                  properties:
                                                    type:
                                                      type: string
                                                      enum:
                                                        - OTP
                                                        - QR
                                                    token:
                                                      type: string
                                                      pattern: ^-?\d+(\.\d+)?$
                                                  required:
                                                    - type
                                                    - token
                        - properties:
                            message:
                              properties:
                                order:
                                  properties:
                                    fulfillments:
                                      items:
                                        properties:
                                          stops:
                                            allOf:
                                              - contains:
                                                  type: object
                                                  properties:
                                                    location:
                                                      type: object
                                                      properties:
                                                        gps:
                                                          type: string
                                                      required:
                                                        - gps
                                                    type:
                                                      const: START
                                                  required:
                                                    - location
                                                    - type
                                              - contains:
                                                  type: object
                                                  properties:
                                                    location:
                                                      type: object
                                                      properties:
                                                        gps:
                                                          type: string
                                                      required:
                                                        - gps
                                                    type:
                                                      const: END
                                                  required:
                                                    - location
                                                    - type
                                        required:
                                          - stops
                        - properties:
                            message:
                              properties:
                                order:
                                  properties:
                                    fulfillments:
                                      type: array
                                      minItems: 1
                                      items:
                                        type: object
                                        properties:
                                          vehicle:
                                            properties:
                                              category:
                                                type: string
                                                enum:
                                                  - AUTO_RICKSHAW
                                                  - CAB
                                            required:
                                              - category
                                        required:
                                          - vehicle
                    - $ref: '#/paths/~1on_init/post/requestBody/content/application~1json/schema/allOf/1/allOf/7'
                    - properties:
                        message:
                          properties:
                            order:
                              properties:
                                fulfillments:
                                  type: array
                                  items:
                                    allOf:
                                      - not:
                                          required:
                                            - agent
                    - $ref: '#/paths/~1on_init/post/requestBody/content/application~1json/schema/allOf/1/allOf/8'
            examples:
              Return a quote offered by a public transit service provider:
                value:
                  context:
                    action: on_select
                    bap_id: 'https://example-bap.com'
                    bap_uri: 'https://mock_bap.com/beckn/'
                    bpp_id: 'https://transit-solutions.com'
                    bpp_uri: 'https://api.transit-solutions.com/beckn/'
                    domain: 'nic2008:49213'
                    location:
                      city:
                        code: 'std:080'
                      country:
                        code: IND
                    message_id: fde8b8b6-c2e5-49f7-b254-720843d528bd
                    timestamp: '2021-03-23T10:00:40.065Z'
                    transaction_id: 6f339232-2bc3-44d2-915c-30d2b053ce1d
                    version: 1.1.0
                  message:
                    order:
                      fulfillments:
                        - id: '3'
                          stops:
                            - location:
                                descriptor:
                                  name: Dwarka Sector 21
                                gps: '9.05,12.06'
                              time:
                                timestamp: '2021-10-15T00:32:19.000Z'
                              type: start
                            - location:
                                descriptor:
                                  name: Shivaji Stadium
                                gps: '9.07,12.07'
                              time:
                                timestamp: '2021-10-15T00:43:21.000Z'
                              type: end
                          tags:
                            - descriptor:
                                name: Other Information
                              list:
                                - descriptor:
                                    name: Transfers
                                  display: true
                                  value: '1'
                                - descriptor:
                                    name: Duration
                                  display: true
                                  value: 30 min
                          vehicle:
                            category: METRO
                      id: '123413'
                      items:
                        - descriptor:
                            images:
                              - 'https://delhimetrorail.com/icons/sjt.ico'
                            name: Single Journey Ticket
                          fulfillment_ids:
                            - '3'
                          id: '3'
                          price:
                            currency: '55'
                            value: INR
                          tags:
                            - descriptor: null
                              list:
                                - descriptor:
                                    name: Validity
                                  display: true
                                  value: 24 hours from the time of purchase
                              name: Other Information
                      provider:
                        descriptor:
                          images:
                            - 'https://delhimetrorail.com/logos/logo.ico'
                          name: Delhi Metro Rail Limited
                        id: '1'
                      quote:
                        breakup:
                          - price:
                              currency: INR
                              value: '55'
                            title: Single Journey Ticket X 1
                          - price:
                              currency: INR
                              value: '2.75'
                            title: CGST @ 5%
                          - price:
                              currency: INR
                              value: '2.75'
                            title: SGST @ 5%
                        price:
                          currency: INR
                          value: '60.5'
              Return a quote offered by a ride hailing service provider:
                value:
                  context:
                    action: on_select
                    bap_id: example-bap.com
                    bap_uri: 'https://api.example-bap.com/pilot/bap/cab/v1'
                    bpp_id: example-bpp.com
                    bpp_uri: 'https://api.example-bpp.com/dobpp/beckn/7f7896dd-787e-4a0b-8675-e9e6fe93bb8f'
                    domain: 'nic2004:60221'
                    location:
                      city:
                        code: 'std:080'
                      country:
                        code: IND
                    message_id: 8926b747-0362-4fcc-b795-0994a6287700
                    timestamp: '2023-03-23T04:48:53Z'
                    transaction_id: 870782be-6757-43f1-945c-8eeaf9536259
                    version: 1.1.0
                  message:
                    order:
                      fulfillments:
                        - id: fulf_5cf064d5-4c0a-42d3-b73d-5f19a6f7468e
                          stops:
                            - location:
                                address: '98 A, 6th Main Rd, Uttarahalli Hobli, Ramanjaneyanagar'
                                area_code: 560061
                                city:
                                  name: Bengaluru
                                country:
                                  name: India
                                district: Ramanjaneyanagar
                                gps: '12.910458, 77.543089'
                                state:
                                  name: Karnataka
                              type: start
                            - location:
                                address: 'Basavanagudi, Chikkanna Garden, Rangadore Memorial Hospital'
                                area_code: 560061
                                city:
                                  name: Bengaluru
                                country:
                                  name: India
                                district: Chikkanna Garden
                                gps: '12.9535139,  77.5710434'
                                state:
                                  name: Karnataka
                              type: end
                          vehicle:
                            category: AUTO_RICKSHAW
                      items:
                        - descriptor:
                            code: RIDE
                            name: Auto Ride
                          fulfillment_ids:
                            - fb5c84d4-1b59-4b9d-96b5-9d79107432c5
                          id: 5777a0bf-9a08-49aa-a97d-1e5561a9622e
                          payment_ids:
                            - '1'
                          tags:
                            - descriptor:
                                name: Daytime Charges
                              list:
                                - descriptor:
                                    name: Min Fare upto 2 km
                                  display: true
                                  value: ₹ 30 upto 2 km
                                - descriptor:
                                    name: Rate above Min. Fare
                                  display: true
                                  value: ₹15 / km
                                - descriptor:
                                    name: Driver Pickup Charges
                                  display: true
                                  value: ₹ 10
                                - descriptor:
                                    name: Nominal Fare
                                    short_desc: 'Driver may quote extra to cover for traffic, chance of return trip, etc.'
                                  display: true
                                  value: ₹ 10
                                - descriptor:
                                    name: Waiting Charges
                                    short_desc: 'Driver may quote extra to cover for traffic, chance of return trip, etc.'
                                  display: true
                                  value: ₹ 0 / min
                            - descriptor:
                                name: Night Charges
                              list:
                                - descriptor:
                                    name: Night Charges
                                  display: true
                                  value: 1.5x of daytime charges applicable at night from 10 PM to 5 AM
                                - descriptor:
                                    name: Night Shift Start
                                  display: true
                                  value: '22:00:00'
                                - descriptor:
                                    name: Night Shift End
                                  display: true
                                  value: '05:00:00'
                            - descriptor:
                                name: General Information
                              list:
                                - descriptor:
                                    name: Distance to nearest driver
                                  display: true
                                  value: 661 m
                                - descriptor:
                                    name: Wait time upto
                                  display: true
                                  value: 3 min
                      provider:
                        descriptor:
                          name: Acme Taxis
                        id: '1'
                      quote:
                        breakup:
                          - price:
                              currency: INR
                              value: '30'
                            title: Base Fare
                          - price:
                              currency: INR
                              value: '56'
                            title: Per km fare
                        price:
                          currency: INR
                          value: '76'
                        ttl: P200S
        description: TODO
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
                  message:
                    properties:
                      ack:
                        $ref: '#/components/schemas/Ack'
                    required:
                      - ack
                    type: object
                required:
                  - message
                type: object
          description: Acknowledgement of message received
      tags:
        - Beckn App Platform (BAP)
  /on_init:
    post:
      description: Send order object with payment details updated
      operationId: on_init
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - properties:
                    context:
                      allOf:
                        - $ref: '#/components/schemas/Context'
                    error:
                      $ref: '#/components/schemas/Error'
                    message:
                      properties:
                        order:
                          allOf:
                            - $ref: '#/components/schemas/Order'
                      required:
                        - order
                      type: object
                  required:
                    - context
                  type: object
                - allOf:
                    - $ref: '#/paths/~1init/post/requestBody/content/application~1json/schema/allOf/1/allOf/0'
                    - properties:
                        context:
                          properties:
                            action:
                              type: string
                              enum:
                                - on_init
                    - properties:
                        message:
                          properties:
                            order:
                              properties:
                                provider:
                                  type: object
                                  properties:
                                    id:
                                      type: string
                                  required:
                                    - id
                              required:
                                - provider
                    - $ref: '#/paths/~1confirm/post/requestBody/content/application~1json/schema/allOf/1/allOf/4'
                    - properties:
                        message:
                          properties:
                            order:
                              properties:
                                items:
                                  items:
                                    properties:
                                      tags:
                                        allOf:
                                          - contains:
                                              properties:
                                                descriptor:
                                                  type: object
                                                  properties:
                                                    code:
                                                      const: FARE_POLICY
                                                  required:
                                                    - code
                                          - contains:
                                              properties:
                                                descriptor:
                                                  type: object
                                                  properties:
                                                    code:
                                                      const: INFO
                                                  required:
                                                    - code
                    - properties:
                        message:
                          properties:
                            order:
                              properties:
                                items:
                                  type: array
                                  minItems: 1
                                  items:
                                    type: object
                                    properties:
                                      fulfillment_ids:
                                        minItems: 1
                                      location_ids:
                                        minItems: 1
                                    required:
                                      - fulfillment_ids
                                      - location_ids
                    - $ref: '#/paths/~1init/post/requestBody/content/application~1json/schema/allOf/1/allOf/3'
                    - properties:
                        message:
                          properties:
                            order:
                              properties:
                                fulfillments:
                                  type: array
                                  minItems: 1
                                  items:
                                    type: object
                                    properties:
                                      type:
                                        type: string
                                        enum:
                                          - DELIVERY
                                    required:
                                      - type
                    - allOf:
                        - properties:
                            message:
                              properties:
                                order:
                                  properties:
                                    quote:
                                      type: object
                                      properties:
                                        price:
                                          type: object
                                          properties:
                                            currency:
                                              type: string
                                            value:
                                              type: string
                                              pattern: '^\d+(\.\d{1,2})?$'
                                          required:
                                            - currency
                                            - value
                                        breakup:
                                          type: array
                                          items:
                                            type: object
                                            properties:
                                              price:
                                                type: object
                                                properties:
                                                  currency:
                                                    type: string
                                                  value:
                                                    type: string
                                                    pattern: '^\d+(\.\d{1,2})?$'
                                                required:
                                                  - currency
                                                  - value
                                              title:
                                                type: string
                                                enum:
                                                  - BASE_FARE
                                                  - DISTANCE_FARE
                                                  - TAX
                                                  - DISCOUNT
                                                  - WAITING_CHARG
                                                  - CANCELLATION_CHARGES
                                            required:
                                              - price
                                              - title
                                      required:
                                        - price
                                        - breakup
                                  required:
                                    - quote
                        - properties:
                            message:
                              properties:
                                order:
                                  properties:
                                    quote:
                                      properties:
                                        breakup:
                                          allOf:
                                            - contains:
                                                type: object
                                                properties:
                                                  title:
                                                    const: BASE_FARE
                                                  price:
                                                    type: object
                                                    properties:
                                                      value:
                                                        type: string
                                                    required:
                                                      - value
                                                required:
                                                  - title
                                                  - price
                                            - contains:
                                                type: object
                                                properties:
                                                  title:
                                                    const: DISTANCE_FARE
                                                  price:
                                                    type: object
                                                    properties:
                                                      value:
                                                        type: string
                                                    required:
                                                      - value
                                                required:
                                                  - title
                                                  - price
                    - $ref: '#/paths/~1confirm/post/requestBody/content/application~1json/schema/allOf/1/allOf/5'
                    - properties:
                        message:
                          properties:
                            order:
                              properties:
                                cancellation_terms:
                                  items:
                                    properties:
                                      fulfillment_state:
                                        properties:
                                          descriptor:
                                            properties:
                                              code:
                                                type: string
                                                enum:
                                                  - RIDE_ASSIGNED
                                                  - RIDE_ENROUTE_PICKUP
                                                  - RIDE_ARRIVED_PICKUP
                                                  - RIDE_STARTED
                                            required:
                                              - code
                                      cancellation_fee:
                                        oneOf:
                                          - properties:
                                              percentage:
                                                type: string
                                                pattern: '^(100(\.0{1,2})?|(\d{1,2})(\.\d{1,2})?)$'
                                            required:
                                              - percentage
                                          - properties:
                                              amount:
                                                properties:
                                                  value:
                                                    type: string
                                                    pattern: '^[+-]?(\d+(\.\d*)?|\.\d+)$'
                                                required:
                                                  - currency
                                                  - value
                                            required:
                                              - amount
                                    required:
                                      - fulfillment_state
                                      - cancellation_fee
                              required:
                                - cancellation_terms
                    - properties:
                        message:
                          type: object
                      required:
                        - message
            examples:
              Return draft order for transit ticket with T+1 settlment via bank transfer:
                value:
                  context:
                    action: on_init
                    bap_id: 'https://example-bap.com'
                    bap_uri: 'https://api.example-bap.com/beckn/'
                    bpp_id: 'https://transit-solutions.com'
                    bpp_uri: 'https://api.transit-solutions.com/beckn/'
                    domain: 'nic2008:49213'
                    location:
                      city:
                        code: 'std:080'
                      country:
                        code: IND
                    message_id: fde8b8b6-c2e5-49f7-b254-720843d528bd
                    timestamp: '2021-03-23T10:00:40.065Z'
                    transaction_id: 6f339232-2bc3-44d2-915c-30d2b053ce1d
                    version: 1.1.0
                  message:
                    order:
                      billing:
                        email: john.doe@example.com
                        name: John Doe
                      cancellation_terms:
                        - external_ref:
                            url: 'https://dmrc.com/fare_products/sjt/cancellation_terms.html'
                      fulfillments:
                        - id: '3'
                          stops:
                            - instructions:
                                name: 'Show this ticket at the QR code scanner at the entry gate. If the QR code scanner is not present, show this at the ticket counter to get your token'
                              location:
                                descriptor:
                                  name: Dwarka Sector 21
                                gps: '9.05,12.06'
                              time:
                                timestamp: '2021-10-15T00:32:19.000Z'
                              type: start
                            - location:
                                descriptor:
                                  name: Shivaji Stadium
                                gps: '9.07,12.07'
                              time:
                                timestamp: '2021-10-15T00:43:21.000Z'
                              type: end
                          tags:
                            - descriptor:
                                name: Other Information
                              list:
                                - descriptor:
                                    name: Transfers
                                  display: true
                                  value: '0'
                                - descriptor:
                                    name: Duration
                                  display: true
                                  value: 30 min
                          vehicle:
                            category: METRO
                      items:
                        - descriptor:
                            images:
                              - 'https://delhimetrorail.com/icons/sjt.ico'
                            name: Single Journey Ticket
                          fulfillment_ids:
                            - '3'
                          id: '3'
                          price:
                            currency: '55'
                            value: INR
                          tags:
                            - descriptor:
                                name: Other Information
                              list:
                                - descriptor:
                                    name: Validity
                                  display: true
                                  value: 24 hours from the time of purchase
                      payment:
                        params:
                          amount: '60.5'
                          bank_account_number: '32756678999'
                          bank_code: SBIN0000575
                          currency: INR
                          transaction_id: '24566345563'
                        status: NOT-PAID
                        time:
                          range:
                            end: '2021-03-24T10:00:40.065Z'
                            start: '2021-03-23T10:00:40.065Z'
                        type: POST-FULFILLMENT
                      provider:
                        descriptor:
                          images:
                            - 'https://delhimetrorail.com/logos/logo.ico'
                          name: Delhi Metro Rail Limited
                        id: '1'
                      quote:
                        breakup:
                          - price:
                              currency: INR
                              value: '55'
                            title: Single Journey Ticket X 1
                          - price:
                              currency: INR
                              value: '2.75'
                            title: CGST @ 5%
                          - price:
                              currency: INR
                              value: '2.75'
                            title: SGST @ 5%
                        price:
                          currency: '60.5'
                          value: INR
              Return draft order for transit ticket with settlement via payment link:
                value:
                  context:
                    action: on_init
                    bap_id: 'https://example-bap.com'
                    bap_uri: 'https://api.example-bap.com/beckn/'
                    bpp_id: 'https://transit-solutions.com'
                    bpp_uri: 'https://api.transit-solutions.com/beckn/'
                    domain: 'nic2008:49213'
                    location:
                      city:
                        code: 'std:080'
                      country:
                        code: IND
                    message_id: fde8b8b6-c2e5-49f7-b254-720843d528bd
                    timestamp: '2021-03-23T10:00:40.065Z'
                    transaction_id: 6f339232-2bc3-44d2-915c-30d2b053ce1d
                    version: 1.1.0
                  message:
                    order:
                      billing:
                        email: john.doe@example.com
                        name: John Doe
                      cancellation_terms:
                        - external_ref:
                            url: 'https://dmrc.com/fare_products/sjt/cancellation_terms.html'
                      fulfillments:
                        - id: '3'
                          stops:
                            - instructions:
                                name: 'Show this ticket at the QR code scanner at the entry gate. If the QR code scanner is not present, show this at the ticket counter to get your token'
                              location:
                                descriptor:
                                  name: Dwarka Sector 21
                                gps: '9.05,12.06'
                              time:
                                timestamp: '2021-10-15T00:32:19.000Z'
                              type: start
                            - location:
                                descriptor:
                                  name: Shivaji Stadium
                                gps: '9.07,12.07'
                              time:
                                timestamp: '2021-10-15T00:43:21.000Z'
                              type: end
                          tags:
                            - descriptor:
                                name: Other Information
                              list:
                                - descriptor:
                                    name: Transfers
                                  display: true
                                  value: '0'
                                - descriptor:
                                    name: Duration
                                  display: true
                                  value: 30 min
                          vehicle:
                            category: METRO
                      items:
                        - descriptor:
                            images:
                              - 'https://delhimetrorail.com/icons/sjt.ico'
                            name: Single Journey Ticket
                          fulfillment_ids:
                            - '3'
                          id: '3'
                          price:
                            currency: '55'
                            value: INR
                          tags:
                            - descriptor:
                                name: Other Information
                              list:
                                - descriptor:
                                    name: Validity
                                  display: true
                                  value: 24 hours from the time of purchase
                      payments:
                        - tl_method: GET
                          type: ON-ORDER
                          uri: 'https://pay.razorpay.com?amt=60.5&cur=INR&ref=24566345563'
                      provider:
                        descriptor:
                          images:
                            - 'https://delhimetrorail.com/logos/logo.ico'
                          name: Delhi Metro Rail Limited
                        id: '1'
                      quote:
                        breakup:
                          - price:
                              currency: INR
                              value: '55'
                            title: Single Journey Ticket X 1
                          - price:
                              currency: INR
                              value: '2.75'
                            title: CGST @ 5%
                          - price:
                              currency: INR
                              value: '2.75'
                            title: SGST @ 5%
                        price:
                          currency: '60.5'
                          value: INR
              Return draft ride hailing order with payment after ride completion:
                value:
                  context:
                    action: on_init
                    bap_id: example-bap.com
                    bap_uri: 'https://api.example-bap.com/pilot/bap/cab/v1'
                    bpp_id: example-bpp.com
                    bpp_uri: 'https://api.example-bpp.com/dobpp/beckn/7f7896dd-787e-4a0b-8675-e9e6fe93bb8f'
                    domain: 'nic2004:60221'
                    location:
                      city:
                        code: 'std:080'
                      country:
                        code: IND
                    message_id: 8926b747-0362-4fcc-b795-0994a6287700
                    timestamp: '2023-03-23T04:48:53Z'
                    transaction_id: b580c989-f84d-4abe-af28-2c818aafce3b
                    version: 1.1.0
                  message:
                    order:
                      fulfillments:
                        - customer:
                            contact:
                              phone: +91-9897867564
                            person:
                              language:
                                code: en
                                name: English
                              name: John Doe
                          id: fulf_5cf064d5-4c0a-42d3-b73d-5f19a6f7468e
                          stops:
                            - location:
                                address: '98 A, 6th Main Rd, Uttarahalli Hobli, Ramanjaneyanagar'
                                area_code: 560061
                                city:
                                  name: Bengaluru
                                country:
                                  name: India
                                district: Ramanjaneyanagar
                                gps: '12.910458, 77.543089'
                                state:
                                  name: Karnataka
                              type: start
                            - location:
                                address: 'Basavanagudi, Chikkanna Garden, Rangadore Memorial Hospital'
                                area_code: 560061
                                city:
                                  name: Bengaluru
                                country:
                                  name: India
                                district: Chikkanna Garden
                                gps: '12.9535139,  77.5710434'
                                state:
                                  name: Karnataka
                              type: end
                          vehicle:
                            category: AUTO_RICKSHAW
                      items:
                        - descriptor:
                            code: RIDE
                            name: Auto Ride
                          fulfillment_ids:
                            - fb5c84d4-1b59-4b9d-96b5-9d79107432c5
                          id: 5777a0bf-9a08-49aa-a97d-1e5561a9622e
                          payment_ids:
                            - '1'
                          tags:
                            - descriptor:
                                name: Daytime Charges
                              list:
                                - descriptor:
                                    name: Min Fare upto 2 km
                                  display: true
                                  value: ₹ 30 upto 2 km
                                - descriptor:
                                    name: Rate above Min. Fare
                                  display: true
                                  value: ₹15 / km
                                - descriptor:
                                    name: Driver Pickup Charges
                                  display: true
                                  value: ₹ 10
                                - descriptor:
                                    name: Nominal Fare
                                    short_desc: 'Driver may quote extra to cover for traffic, chance of return trip, etc.'
                                  display: true
                                  value: ₹ 10
                                - descriptor:
                                    name: Waiting Charges
                                    short_desc: 'Driver may quote extra to cover for traffic, chance of return trip, etc.'
                                  display: true
                                  value: ₹ 0 / min
                            - descriptor:
                                name: Night Charges
                              list:
                                - descriptor:
                                    name: Night Charges
                                  display: true
                                  value: 1.5x of daytime charges applicable at night from 10 PM to 5 AM
                                - descriptor:
                                    name: Night Shift Start
                                  display: true
                                  value: '22:00:00'
                                - descriptor:
                                    name: Night Shift End
                                  display: true
                                  value: '05:00:00'
                            - descriptor:
                                name: General Information
                              list:
                                - descriptor:
                                    name: Distance to nearest driver
                                  display: true
                                  value: 661 m
                                - descriptor:
                                    name: Wait time upto
                                  display: true
                                  value: 3 min
                      payments:
                        - id: 7f7896dd-787e-4a0b-8675-e9e6fe93bb8f
                          params:
                            amount: '81'
                            currency: INR
                          status: NOT-PAID
                          type: ON-FULFILLMENT
                      provider:
                        descriptor:
                          name: Acme Taxis
                        id: '1'
                      quote:
                        breakup:
                          - price:
                              currency: INR
                              value: '30'
                            title: Base Fare
                          - price:
                              currency: INR
                              value: '56'
                            title: Per km fare
                          - price:
                              currency: INR
                              value: '2.5'
                            title: CGST @ 5%
                          - price:
                              currency: INR
                              value: '2.5'
                            title: SGST @ 5%
                        price:
                          currency: INR
                          value: '81'
        description: TODO
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
                  message:
                    properties:
                      ack:
                        $ref: '#/components/schemas/Ack'
                    required:
                      - ack
                    type: object
                required:
                  - message
                type: object
          description: Acknowledgement of message received
      tags:
        - Beckn App Platform (BAP)
  /on_confirm:
    post:
      description: Send active order object
      operationId: on_confirm
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - type: object
                  properties:
                    context:
                      allOf:
                        - $ref: '#/components/schemas/Context'
                    error:
                      $ref: '#/components/schemas/Error'
                    message:
                      properties:
                        order:
                          $ref: '#/components/schemas/Order'
                      required:
                        - order
                      type: object
                  required:
                    - context
                    - message
                - allOf:
                    - $ref: '#/paths/~1init/post/requestBody/content/application~1json/schema/allOf/1/allOf/0'
                    - properties:
                        context:
                          properties:
                            action:
                              type: string
                              enum:
                                - on_confirm
                    - $ref: '#/paths/~1on_init/post/requestBody/content/application~1json/schema/allOf/1/allOf/2'
                    - $ref: '#/paths/~1confirm/post/requestBody/content/application~1json/schema/allOf/1/allOf/4'
                    - $ref: '#/paths/~1on_init/post/requestBody/content/application~1json/schema/allOf/1/allOf/4'
                    - $ref: '#/paths/~1on_init/post/requestBody/content/application~1json/schema/allOf/1/allOf/5'
                    - $ref: '#/paths/~1on_status/post/requestBody/content/application~1json/schema/allOf/1/allOf/6'
                    - $ref: '#/paths/~1on_init/post/requestBody/content/application~1json/schema/allOf/1/allOf/7'
                    - $ref: '#/paths/~1on_init/post/requestBody/content/application~1json/schema/allOf/1/allOf/8'
                    - $ref: '#/paths/~1confirm/post/requestBody/content/application~1json/schema/allOf/1/allOf/5'
                    - properties:
                        message:
                          properties:
                            order:
                              properties:
                                status:
                                  type: string
                                  enum:
                                    - COMPLETE
                                    - ACTIVE
                              required:
                                - status
                    - $ref: '#/paths/~1on_init/post/requestBody/content/application~1json/schema/allOf/1/allOf/10'
                    - properties:
                        message:
                          properties:
                            order:
                              properties:
                                status:
                                  type: string
                                  enum:
                                    - COMPLETE
                                    - ACTIVE
                                    - CANCELLED
                                    - SOFT_CANCEL
                              required:
                                - status
                    - $ref: '#/paths/~1on_status/post/requestBody/content/application~1json/schema/allOf/1/allOf/11'
                    - $ref: '#/paths/~1on_status/post/requestBody/content/application~1json/schema/allOf/1/allOf/13'
                    - $ref: '#/paths/~1on_status/post/requestBody/content/application~1json/schema/allOf/1/allOf/12'
                    - $ref: '#/paths/~1on_status/post/requestBody/content/application~1json/schema/allOf/1/allOf/14'
            examples:
              Return confirmed order with latest fulfillment details:
                value:
                  context:
                    action: on_confirm
                    bap_id: example-bap.com
                    bap_uri: 'https://api.example-bap.com/pilot/bap/cab/v1'
                    bpp_id: example-bpp.com
                    bpp_uri: 'https://api.example-bpp.com/dobpp/beckn/7f7896dd-787e-4a0b-8675-e9e6fe93bb8f'
                    domain: 'nic2004:60221'
                    location:
                      city:
                        code: 'std:080'
                      country:
                        code: IND
                    message_id: 8926b747-0362-4fcc-b795-0994a6287700
                    timestamp: '2023-03-23T04:48:53Z'
                    transaction_id: b580c989-f84d-4abe-af28-2c818aafce3b
                    version: 1.1.0
                  message:
                    order:
                      fulfillments:
                        - agent:
                            contact:
                              phone: +91-98978675645
                            person:
                              name: RAGHAVENDRA J
                            rating: '5'
                          customer:
                            contact:
                              phone: +91-9897867564
                            person:
                              language:
                                code: en
                                name: English
                              name: John Doe
                          id: fulf_5cf064d5-4c0a-42d3-b73d-5f19a6f7468e
                          state:
                            descriptor:
                              code: DRIVER_EN_ROUTE
                              name: Driver is on the way
                          stops:
                            - authorization:
                                token: '234234'
                                type: OTP
                              location:
                                address: '98 A, 6th Main Rd, Uttarahalli Hobli, Ramanjaneyanagar'
                                area_code: 560061
                                city:
                                  name: Bengaluru
                                country:
                                  name: India
                                district: Ramanjaneyanagar
                                gps: '12.910458, 77.543089'
                                state:
                                  name: Karnataka
                              type: start
                            - location:
                                address: 'Basavanagudi, Chikkanna Garden, Rangadore Memorial Hospital'
                                area_code: 560061
                                city:
                                  name: Bengaluru
                                country:
                                  name: India
                                district: Chikkanna Garden
                                gps: '12.9535139,  77.5710434'
                                state:
                                  name: Karnataka
                              type: end
                          vehicle:
                            category: AUTO_RICKSHAW
                            registration: KA01JG1231
                      id: 7751bd26-3fdc-47ca-9b64-e998dc5abe68
                      items:
                        - descriptor:
                            code: RIDE
                            name: Auto Ride
                          fulfillment_ids:
                            - fb5c84d4-1b59-4b9d-96b5-9d79107432c5
                          id: 5777a0bf-9a08-49aa-a97d-1e5561a9622e
                          payment_ids:
                            - '1'
                          tags:
                            - descriptor:
                                name: Daytime Charges
                              list:
                                - descriptor:
                                    name: Min Fare upto 2 km
                                  display: true
                                  value: ₹ 30 upto 2 km
                                - descriptor:
                                    name: Rate above Min. Fare
                                  display: true
                                  value: ₹15 / km
                                - descriptor:
                                    name: Driver Pickup Charges
                                  display: true
                                  value: ₹ 10
                                - descriptor:
                                    name: Nominal Fare
                                    short_desc: 'Driver may quote extra to cover for traffic, chance of return trip, etc.'
                                  display: true
                                  value: ₹ 10
                                - descriptor:
                                    name: Waiting Charges
                                    short_desc: 'Driver may quote extra to cover for traffic, chance of return trip, etc.'
                                  display: true
                                  value: ₹ 0 / min
                            - descriptor:
                                name: Night Charges
                              list:
                                - descriptor:
                                    name: Night Charges
                                  display: true
                                  value: 1.5x of daytime charges applicable at night from 10 PM to 5 AM
                                - descriptor:
                                    name: Night Shift Start
                                  display: true
                                  value: '22:00:00'
                                - descriptor:
                                    name: Night Shift End
                                  display: true
                                  value: '05:00:00'
                            - descriptor:
                                name: General Information
                              list:
                                - descriptor:
                                    name: Distance to nearest driver
                                  display: true
                                  value: 661 m
                                - descriptor:
                                    name: Wait time upto
                                  display: true
                                  value: 3 min
                      payments:
                        - id: 7f7896dd-787e-4a0b-8675-e9e6fe93bb8f
                          params:
                            amount: '81'
                            currency: INR
                          status: NOT-PAID
                          type: ON-FULFILLMENT
                      provider:
                        descriptor:
                          name: Acme Tais
                        id: '1'
                      quote:
                        breakup:
                          - price:
                              currency: INR
                              value: '30'
                            title: Base Fare
                          - price:
                              currency: INR
                              value: '56'
                            title: Per km fare
                          - price:
                              currency: INR
                              value: '2.5'
                            title: CGST @ 5%
                          - price:
                              currency: INR
                              value: '2.5'
                            title: SGST @ 5%
                        price:
                          currency: INR
                          value: '81'
              Return confirmed ticket order with T+1 pending settlement:
                value:
                  context:
                    action: on_confirm
                    bap_id: 'https://example-bap.com'
                    bap_uri: 'https://api.example-bap.com/beckn/'
                    bpp_id: 'https://transit-solutions.com'
                    bpp_uri: 'https://api.transit-solutions.com/beckn/'
                    domain: 'nic2008:49213'
                    location:
                      city:
                        code: 'std:080'
                      country:
                        code: IND
                    message_id: fde8b8b6-c2e5-49f7-b254-720843d528bd
                    timestamp: '2021-03-23T10:00:40.065Z'
                    transaction_id: 6f339232-2bc3-44d2-915c-30d2b053ce1d
                    version: 1.1.0
                  message:
                    order:
                      billing:
                        email: john.doe@example.com
                        name: John Doe
                      cancellation_terms:
                        - external_ref:
                            url: 'https://dmrc.com/fare_products/sjt/cancellation_terms.html'
                      fulfillments:
                        - id: '3'
                          state:
                            descriptor:
                              name: Ticket issued
                          stops:
                            - instructions:
                                name: 'Show this ticket at the QR code scanner at the entry gate. If the QR code scanner is not present, show this at the ticket counter to get your token'
                              location:
                                descriptor:
                                  name: Dwarka Sector 21
                                gps: '9.05,12.06'
                              time:
                                timestamp: '2021-10-15T00:32:19.000Z'
                              type: start
                            - location:
                                descriptor:
                                  name: Shivaji Stadium
                                gps: '9.07,12.07'
                              time:
                                timestamp: '2021-10-15T00:43:21.000Z'
                              type: end
                          tags:
                            - descriptor:
                                name: Other Information
                              list:
                                - descriptor:
                                    name: Transfers
                                  display: true
                                  value: '0'
                                - descriptor:
                                    name: Duration
                                  display: true
                                  value: 30 min
                          vehicle:
                            category: METRO
                      id: '123413'
                      items:
                        - descriptor:
                            images:
                              - 'https://delhimetrorail.com/icons/sjt.ico'
                            name: Single Journey Ticket
                          fulfillment_ids:
                            - '3'
                          id: '3'
                          price:
                            currency: '55'
                            value: INR
                          tags:
                            - descriptor:
                                name: Other Information
                              list:
                                - descriptor:
                                    name: Validity
                                  display: true
                                  value: 24 hours from the time of purchase
                      payments:
                        - params:
                            amount: '60.5'
                            bank_account_number: '32756678999'
                            bank_code: SBIN0000575
                            currency: INR
                            transaction_id: '24566345563'
                          status: NOT-PAID
                          time:
                            range:
                              end: '2021-03-24T10:00:40.065Z'
                              start: '2021-03-23T10:00:40.065Z'
                          type: POST-FULFILLMENT
                      provider:
                        descriptor:
                          images:
                            - 'https://delhimetrorail.com/logos/logo.ico'
                          name: Delhi Metro Rail Limited
                        id: '1'
                      quote:
                        breakup:
                          - price:
                              currency: INR
                              value: '55'
                            title: Single Journey Ticket X 1
                          - price:
                              currency: INR
                              value: '2.75'
                            title: CGST @ 5%
                          - price:
                              currency: INR
                              value: '2.75'
                            title: SGST @ 5%
                        price:
                          currency: '60.5'
                          value: INR
              Return confirmed ticket order with payment confirmation:
                value:
                  context:
                    action: on_confirm
                    bap_id: 'https://example-bap.com'
                    bap_uri: 'https://api.example-bap.com/beckn/'
                    bpp_id: 'https://transit-solutions.com'
                    bpp_uri: 'https://api.transit-solutions.com/beckn/'
                    domain: 'nic2008:49213'
                    location:
                      city:
                        code: 'std:080'
                      country:
                        code: IND
                    message_id: fde8b8b6-c2e5-49f7-b254-720843d528bd
                    timestamp: '2021-03-23T10:00:40.065Z'
                    transaction_id: 6f339232-2bc3-44d2-915c-30d2b053ce1d
                    version: 1.1.0
                  message:
                    order:
                      billing:
                        email: john.doe@example.com
                        name: John Doe
                      cancellation_terms:
                        - external_ref:
                            url: 'https://dmrc.com/fare_products/sjt/cancellation_terms.html'
                      fulfillments:
                        - id: '3'
                          stops:
                            - instructions:
                                name: 'Show this ticket at the QR code scanner at the entry gate. If the QR code scanner is not present, show this at the ticket counter to get your token'
                              location:
                                descriptor:
                                  name: Dwarka Sector 21
                                gps: '9.05,12.06'
                              time:
                                timestamp: '2021-10-15T00:32:19.000Z'
                              type: start
                            - location:
                                descriptor:
                                  name: Shivaji Stadium
                                gps: '9.07,12.07'
                              time:
                                timestamp: '2021-10-15T00:43:21.000Z'
                              type: end
                          tags:
                            - descriptor:
                                name: Other Information
                              list:
                                - descriptor:
                                    name: Transfers
                                  display: true
                                  value: '0'
                                - descriptor:
                                    name: Duration
                                  display: true
                                  value: 30 min
                          vehicle:
                            category: METRO
                      id: '123413'
                      items:
                        - descriptor:
                            images:
                              - 'https://delhimetrorail.com/icons/sjt.ico'
                            name: Single Journey Ticket
                          fulfillment_ids:
                            - '3'
                          id: '3'
                          price:
                            currency: '55'
                            value: INR
                          tags:
                            - descriptor:
                                name: Other Information
                              list:
                                - descriptor:
                                    name: Validity
                                  display: true
                                  value: 24 hours from the time of purchase
                      payments:
                        - params:
                            amount: '60.5'
                            currency: INR
                            transaction_id: '24566345563'
                          status: PAID
                          type: ON-ORDER
                      provider:
                        descriptor:
                          images:
                            - 'https://delhimetrorail.com/logos/logo.ico'
                          name: Delhi Metro Rail Limited
                        id: '1'
                      quote:
                        breakup:
                          - price:
                              currency: INR
                              value: '55'
                            title: Single Journey Ticket X 1
                          - price:
                              currency: INR
                              value: '2.75'
                            title: CGST @ 5%
                          - price:
                              currency: INR
                              value: '2.75'
                            title: SGST @ 5%
                        price:
                          currency: '60.5'
                          value: INR
        description: TODO
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
                  message:
                    properties:
                      ack:
                        $ref: '#/components/schemas/Ack'
                    required:
                      - ack
                    type: object
                required:
                  - message
                type: object
          description: Acknowledgement of message received
      tags:
        - Beckn App Platform (BAP)
  /on_status:
    post:
      description: Fetch the status of a Service
      operationId: on_status
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - properties:
                    context:
                      allOf:
                        - $ref: '#/components/schemas/Context'
                    error:
                      $ref: '#/components/schemas/Error'
                    message:
                      properties:
                        order:
                          $ref: '#/components/schemas/Order'
                      required:
                        - order
                      type: object
                  required:
                    - context
                  type: object
                - allOf:
                    - $ref: '#/paths/~1init/post/requestBody/content/application~1json/schema/allOf/1/allOf/0'
                    - properties:
                        context:
                          properties:
                            action:
                              type: string
                              enum:
                                - on_status
                    - $ref: '#/paths/~1on_init/post/requestBody/content/application~1json/schema/allOf/1/allOf/2'
                    - $ref: '#/paths/~1confirm/post/requestBody/content/application~1json/schema/allOf/1/allOf/4'
                    - $ref: '#/paths/~1on_init/post/requestBody/content/application~1json/schema/allOf/1/allOf/4'
                    - $ref: '#/paths/~1on_init/post/requestBody/content/application~1json/schema/allOf/1/allOf/5'
                    - allOf:
                        - $ref: '#/paths/~1confirm/post/requestBody/content/application~1json/schema/allOf/1/allOf/3'
                        - properties:
                            message:
                              properties:
                                order:
                                  properties:
                                    fulfillments:
                                      type: array
                                      items:
                                        allOf:
                                          - properties:
                                              agent:
                                                properties:
                                                  contact:
                                                    properties:
                                                      phone:
                                                        type: string
                                                        pattern: '^\+?[1-9]\d{1,14}$'
                                                    required:
                                                      - phone
                                                  person:
                                                    properties:
                                                      name:
                                                        type: string
                                                    required:
                                                      - name
                                                required:
                                                  - contact
                                                  - person
                                            required:
                                              - agent
                    - $ref: '#/paths/~1on_init/post/requestBody/content/application~1json/schema/allOf/1/allOf/7'
                    - $ref: '#/paths/~1on_init/post/requestBody/content/application~1json/schema/allOf/1/allOf/8'
                    - $ref: '#/paths/~1confirm/post/requestBody/content/application~1json/schema/allOf/1/allOf/5'
                    - $ref: '#/paths/~1on_init/post/requestBody/content/application~1json/schema/allOf/1/allOf/10'
                    - properties:
                        message:
                          properties:
                            order:
                              properties:
                                payments:
                                  type: array
                                  items:
                                    properties:
                                      type:
                                        type: string
                                      params:
                                        type: object
                                        properties:
                                          transaction_id:
                                            type: string
                                    required:
                                      - type
                                    allOf:
                                      - if:
                                          properties:
                                            type:
                                              const: PRE-ORDER
                                        then:
                                          properties:
                                            params:
                                              required:
                                                - transaction_id
                    - properties:
                        message:
                          properties:
                            order:
                              properties:
                                fulfillments:
                                  type: array
                                  items:
                                    properties:
                                      vehicle:
                                        type: object
                                        properties:
                                          registration:
                                            type: string
                                        required:
                                          - registration
                                          - make
                                          - model
                                    required:
                                      - vehicle
                    - properties:
                        message:
                          properties:
                            order:
                              properties:
                                fulfillments:
                                  items:
                                    required:
                                      - state
                    - properties:
                        message:
                          properties:
                            order:
                              required:
                                - id
            examples:
              Return order with latest fulfillment status - Driver en-route to pickup:
                value:
                  context:
                    action: on_status
                    bap_id: example-bap.com
                    bap_uri: 'https://api.example-bap.com/pilot/bap/cab/v1'
                    bpp_id: example-bpp.com
                    bpp_uri: 'https://api.example-bpp.com/dobpp/beckn/7f7896dd-787e-4a0b-8675-e9e6fe93bb8f'
                    domain: 'nic2004:60221'
                    location:
                      city:
                        code: 'std:080'
                      country:
                        code: IND
                    message_id: 8926b747-0362-4fcc-b795-0994a6287700
                    timestamp: '2023-03-23T04:48:53Z'
                    transaction_id: b580c989-f84d-4abe-af28-2c818aafce3b
                    version: 1.1.0
                  message:
                    order:
                      fulfillments:
                        - agent:
                            contact:
                              phone: +91-98978675645
                            person:
                              name: RAGHAVENDRA J
                            rating: '5'
                          customer:
                            contact:
                              phone: +91-9897867564
                            person:
                              language:
                                code: en
                                name: English
                              name: John Doe
                          id: fulf_5cf064d5-4c0a-42d3-b73d-5f19a6f7468e
                          state:
                            descriptor:
                              code: DRIVER_EN_ROUTE_TO_PICKUP
                              name: Driver is en-route to your location
                          stops:
                            - authorization:
                                token: '234234'
                                type: OTP
                              location:
                                address: '98 A, 6th Main Rd, Uttarahalli Hobli, Ramanjaneyanagar'
                                area_code: 560061
                                city:
                                  name: Bengaluru
                                country:
                                  name: India
                                district: Ramanjaneyanagar
                                gps: '12.910458, 77.543089'
                                state:
                                  name: Karnataka
                              type: start
                            - location:
                                address: 'Basavanagudi, Chikkanna Garden, Rangadore Memorial Hospital'
                                area_code: 560061
                                city:
                                  name: Bengaluru
                                country:
                                  name: India
                                district: Chikkanna Garden
                                gps: '12.9535139,  77.5710434'
                                state:
                                  name: Karnataka
                              type: end
                          vehicle:
                            category: AUTO_RICKSHAW
                            registration: KA01JG1231
                      id: 7751bd26-3fdc-47ca-9b64-e998dc5abe68
                      items:
                        - descriptor:
                            code: RIDE
                            name: Auto Ride
                          fulfillment_ids:
                            - fb5c84d4-1b59-4b9d-96b5-9d79107432c5
                          id: 5777a0bf-9a08-49aa-a97d-1e5561a9622e
                          payment_ids:
                            - '1'
                          tags:
                            - descriptor:
                                name: Daytime Charges
                              list:
                                - descriptor:
                                    name: Min Fare upto 2 km
                                  display: true
                                  value: ₹ 30 upto 2 km
                                - descriptor:
                                    name: Rate above Min. Fare
                                  display: true
                                  value: ₹15 / km
                                - descriptor:
                                    name: Driver Pickup Charges
                                  display: true
                                  value: ₹ 10
                                - descriptor:
                                    name: Nominal Fare
                                    short_desc: 'Driver may quote extra to cover for traffic, chance of return trip, etc.'
                                  display: true
                                  value: ₹ 10
                                - descriptor:
                                    name: Waiting Charges
                                    short_desc: 'Driver may quote extra to cover for traffic, chance of return trip, etc.'
                                  display: true
                                  value: ₹ 0 / min
                            - descriptor:
                                name: Night Charges
                              list:
                                - descriptor:
                                    name: Night Charges
                                  display: true
                                  value: 1.5x of daytime charges applicable at night from 10 PM to 5 AM
                                - descriptor:
                                    name: Night Shift Start
                                  display: true
                                  value: '22:00:00'
                                - descriptor:
                                    name: Night Shift End
                                  display: true
                                  value: '05:00:00'
                            - descriptor:
                                name: General Information
                              list:
                                - descriptor:
                                    name: Distance to nearest driver
                                  display: true
                                  value: 661 m
                                - descriptor:
                                    name: Wait time upto
                                  display: true
                                  value: 3 min
                      payments:
                        - id: 7f7896dd-787e-4a0b-8675-e9e6fe93bb8f
                          params:
                            amount: '81'
                            currency: INR
                          status: NOT-PAID
                          type: ON-FULFILLMENT
                      provider:
                        descriptor:
                          name: Acme Taxis
                        id: '1'
                      quote:
                        breakup:
                          - price:
                              currency: INR
                              value: '30'
                            title: Base Fare
                          - price:
                              currency: INR
                              value: '56'
                            title: Per km fare
                          - price:
                              currency: INR
                              value: '2.5'
                            title: CGST @ 5%
                          - price:
                              currency: INR
                              value: '2.5'
                            title: SGST @ 5%
                        price:
                          currency: INR
                          value: '81'
              Return order with latest status - Ride Ended:
                value:
                  context:
                    action: on_status
                    bap_id: example-bap.com
                    bap_uri: 'https://api.example-bap.com/pilot/bap/cab/v1'
                    bpp_id: example-bpp.com
                    bpp_uri: 'https://api.example-bpp.com/dobpp/beckn/7f7896dd-787e-4a0b-8675-e9e6fe93bb8f'
                    domain: 'nic2004:60221'
                    location:
                      city:
                        code: 'std:080'
                      country:
                        code: IND
                    message_id: 8926b747-0362-4fcc-b795-0994a6287700
                    timestamp: '2023-03-23T04:48:53Z'
                    transaction_id: b580c989-f84d-4abe-af28-2c818aafce3b
                    version: 1.1.0
                  message:
                    order:
                      fulfillments:
                        - agent:
                            contact:
                              phone: +91-98978675645
                            person:
                              name: RAGHAVENDRA J
                            rating: '5'
                          customer:
                            contact:
                              phone: +91-9897867564
                            person:
                              language:
                                code: en
                                name: English
                              name: John Doe
                          id: fulf_5cf064d5-4c0a-42d3-b73d-5f19a6f7468e
                          state:
                            descriptor:
                              code: RIDE_ENDED
                              name: Your ride has ended
                          stops:
                            - authorization:
                                token: '234234'
                                type: OTP
                              location:
                                address: '98 A, 6th Main Rd, Uttarahalli Hobli, Ramanjaneyanagar'
                                area_code: 560061
                                city:
                                  name: Bengaluru
                                country:
                                  name: India
                                district: Ramanjaneyanagar
                                gps: '12.910458, 77.543089'
                                state:
                                  name: Karnataka
                              type: start
                            - location:
                                address: 'Basavanagudi, Chikkanna Garden, Rangadore Memorial Hospital'
                                area_code: 560061
                                city:
                                  name: Bengaluru
                                country:
                                  name: India
                                district: Chikkanna Garden
                                gps: '12.9535139,  77.5710434'
                                state:
                                  name: Karnataka
                              type: end
                          vehicle:
                            category: AUTO_RICKSHAW
                            registration: KA01JG1231
                      id: 7751bd26-3fdc-47ca-9b64-e998dc5abe68
                      items:
                        - descriptor:
                            code: RIDE
                            name: Auto Ride
                          fulfillment_ids:
                            - fb5c84d4-1b59-4b9d-96b5-9d79107432c5
                          id: 5777a0bf-9a08-49aa-a97d-1e5561a9622e
                          payment_ids:
                            - '1'
                          tags:
                            - descriptor:
                                name: Daytime Charges
                              list:
                                - descriptor:
                                    name: Min Fare upto 2 km
                                  display: true
                                  value: ₹ 30 upto 2 km
                                - descriptor:
                                    name: Rate above Min. Fare
                                  display: true
                                  value: ₹15 / km
                                - descriptor:
                                    name: Driver Pickup Charges
                                  display: true
                                  value: ₹ 10
                                - descriptor:
                                    name: Nominal Fare
                                    short_desc: 'Driver may quote extra to cover for traffic, chance of return trip, etc.'
                                  display: true
                                  value: ₹ 10
                                - descriptor:
                                    name: Waiting Charges
                                    short_desc: 'Driver may quote extra to cover for traffic, chance of return trip, etc.'
                                  display: true
                                  value: ₹ 0 / min
                            - descriptor:
                                name: Night Charges
                              list:
                                - descriptor:
                                    name: Night Charges
                                  display: true
                                  value: 1.5x of daytime charges applicable at night from 10 PM to 5 AM
                                - descriptor:
                                    name: Night Shift Start
                                  display: true
                                  value: '22:00:00'
                                - descriptor:
                                    name: Night Shift End
                                  display: true
                                  value: '05:00:00'
                            - descriptor:
                                name: General Information
                              list:
                                - descriptor:
                                    name: Distance to nearest driver
                                  display: true
                                  value: 661 m
                                - descriptor:
                                    name: Wait time upto
                                  display: true
                                  value: 3 min
                      payments:
                        - id: 7f7896dd-787e-4a0b-8675-e9e6fe93bb8f
                          params:
                            amount: '81'
                            currency: INR
                          status: NOT-PAID
                          type: ON-FULFILLMENT
                      provider:
                        descriptor:
                          name: Acme Taxis
                        id: '1'
                      quote:
                        breakup:
                          - price:
                              currency: INR
                              value: '30'
                            title: Base Fare
                          - price:
                              currency: INR
                              value: '56'
                            title: Per km fare
                          - price:
                              currency: INR
                              value: '2.5'
                            title: CGST @ 5%
                          - price:
                              currency: INR
                              value: '2.5'
                            title: SGST @ 5%
                        price:
                          currency: INR
                          value: '81'
              Return order with latest status - Ride started:
                value:
                  context:
                    action: on_status
                    bap_id: example-bap.com
                    bap_uri: 'https://api.example-bap.com/pilot/bap/cab/v1'
                    bpp_id: example-bpp.com
                    bpp_uri: 'https://api.example-bpp.com/dobpp/beckn/7f7896dd-787e-4a0b-8675-e9e6fe93bb8f'
                    domain: 'nic2004:60221'
                    location:
                      city:
                        code: 'std:080'
                      country:
                        code: IND
                    message_id: 8926b747-0362-4fcc-b795-0994a6287700
                    timestamp: '2023-03-23T04:48:53Z'
                    transaction_id: b580c989-f84d-4abe-af28-2c818aafce3b
                    version: 1.1.0
                  message:
                    order:
                      fulfillments:
                        - agent:
                            contact:
                              phone: +91-98978675645
                            person:
                              name: RAGHAVENDRA J
                            rating: '5'
                          customer:
                            contact:
                              phone: +91-9897867564
                            person:
                              language:
                                code: en
                                name: English
                              name: John Doe
                          id: fulf_5cf064d5-4c0a-42d3-b73d-5f19a6f7468e
                          state:
                            descriptor:
                              code: RIDE_STARTED
                              name: Your ride has started
                          stops:
                            - authorization:
                                token: '234234'
                                type: OTP
                              location:
                                address: '98 A, 6th Main Rd, Uttarahalli Hobli, Ramanjaneyanagar'
                                area_code: 560061
                                city:
                                  name: Bengaluru
                                country:
                                  name: India
                                district: Ramanjaneyanagar
                                gps: '12.910458, 77.543089'
                                state:
                                  name: Karnataka
                              type: start
                            - location:
                                address: 'Basavanagudi, Chikkanna Garden, Rangadore Memorial Hospital'
                                area_code: 560061
                                city:
                                  name: Bengaluru
                                country:
                                  name: India
                                district: Chikkanna Garden
                                gps: '12.9535139,  77.5710434'
                                state:
                                  name: Karnataka
                              type: end
                          vehicle:
                            category: AUTO_RICKSHAW
                            registration: KA01JG1231
                      id: 7751bd26-3fdc-47ca-9b64-e998dc5abe68
                      items:
                        - descriptor:
                            code: RIDE
                            name: Auto Ride
                          fulfillment_ids:
                            - fb5c84d4-1b59-4b9d-96b5-9d79107432c5
                          id: 5777a0bf-9a08-49aa-a97d-1e5561a9622e
                          payment_ids:
                            - '1'
                          tags:
                            - descriptor:
                                name: Daytime Charges
                              list:
                                - descriptor:
                                    name: Min Fare upto 2 km
                                  display: true
                                  value: ₹ 30 upto 2 km
                                - descriptor:
                                    name: Rate above Min. Fare
                                  display: true
                                  value: ₹15 / km
                                - descriptor:
                                    name: Driver Pickup Charges
                                  display: true
                                  value: ₹ 10
                                - descriptor:
                                    name: Nominal Fare
                                    short_desc: 'Driver may quote extra to cover for traffic, chance of return trip, etc.'
                                  display: true
                                  value: ₹ 10
                                - descriptor:
                                    name: Waiting Charges
                                    short_desc: 'Driver may quote extra to cover for traffic, chance of return trip, etc.'
                                  display: true
                                  value: ₹ 0 / min
                            - descriptor:
                                name: Night Charges
                              list:
                                - descriptor:
                                    name: Night Charges
                                  display: true
                                  value: 1.5x of daytime charges applicable at night from 10 PM to 5 AM
                                - descriptor:
                                    name: Night Shift Start
                                  display: true
                                  value: '22:00:00'
                                - descriptor:
                                    name: Night Shift End
                                  display: true
                                  value: '05:00:00'
                            - descriptor:
                                name: General Information
                              list:
                                - descriptor:
                                    name: Distance to nearest driver
                                  display: true
                                  value: 661 m
                                - descriptor:
                                    name: Wait time upto
                                  display: true
                                  value: 3 min
                      payments:
                        - id: 7f7896dd-787e-4a0b-8675-e9e6fe93bb8f
                          params:
                            amount: '81'
                            currency: INR
                          status: NOT-PAID
                          type: ON-FULFILLMENT
                      provider:
                        descriptor:
                          name: Acme Taxis
                        id: '1'
                      quote:
                        breakup:
                          - price:
                              currency: INR
                              value: '30'
                            title: Base Fare
                          - price:
                              currency: INR
                              value: '56'
                            title: Per km fare
                          - price:
                              currency: INR
                              value: '2.5'
                            title: CGST @ 5%
                          - price:
                              currency: INR
                              value: '2.5'
                            title: SGST @ 5%
                        price:
                          currency: INR
                          value: '81'
              Return order with status - Driver at pickup:
                value:
                  context:
                    action: on_status
                    bap_id: example-bap.com
                    bap_uri: 'https://api.example-bap.com/pilot/bap/cab/v1'
                    bpp_id: example-bpp.com
                    bpp_uri: 'https://api.example-bpp.com/dobpp/beckn/7f7896dd-787e-4a0b-8675-e9e6fe93bb8f'
                    domain: 'nic2004:60221'
                    location:
                      city:
                        code: 'std:080'
                      country:
                        code: IND
                    message_id: 8926b747-0362-4fcc-b795-0994a6287700
                    timestamp: '2023-03-23T04:48:53Z'
                    transaction_id: b580c989-f84d-4abe-af28-2c818aafce3b
                    version: 1.1.0
                  message:
                    order:
                      fulfillments:
                        - agent:
                            contact:
                              phone: +91-98978675645
                            person:
                              name: RAGHAVENDRA J
                            rating: '5'
                          customer:
                            contact:
                              phone: +91-9897867564
                            person:
                              language:
                                code: en
                                name: English
                              name: John Doe
                          id: fulf_5cf064d5-4c0a-42d3-b73d-5f19a6f7468e
                          state:
                            descriptor:
                              code: DRIVER_AT_PICKUP
                              name: Driver Arrived at Pickup Location
                          stops:
                            - authorization:
                                token: '234234'
                                type: OTP
                              location:
                                address: '98 A, 6th Main Rd, Uttarahalli Hobli, Ramanjaneyanagar'
                                area_code: 560061
                                city:
                                  name: Bengaluru
                                country:
                                  name: India
                                district: Ramanjaneyanagar
                                gps: '12.910458, 77.543089'
                                state:
                                  name: Karnataka
                              type: start
                            - location:
                                address: 'Basavanagudi, Chikkanna Garden, Rangadore Memorial Hospital'
                                area_code: 560061
                                city:
                                  name: Bengaluru
                                country:
                                  name: India
                                district: Chikkanna Garden
                                gps: '12.9535139,  77.5710434'
                                state:
                                  name: Karnataka
                              type: end
                          vehicle:
                            category: AUTO_RICKSHAW
                            registration: KA01JG1231
                      id: 7751bd26-3fdc-47ca-9b64-e998dc5abe68
                      items:
                        - descriptor:
                            code: RIDE
                            name: Auto Ride
                          fulfillment_ids:
                            - fb5c84d4-1b59-4b9d-96b5-9d79107432c5
                          id: 5777a0bf-9a08-49aa-a97d-1e5561a9622e
                          payment_ids:
                            - '1'
                          tags:
                            - descriptor:
                                name: Daytime Charges
                              list:
                                - descriptor:
                                    name: Min Fare upto 2 km
                                  display: true
                                  value: ₹ 30 upto 2 km
                                - descriptor:
                                    name: Rate above Min. Fare
                                  display: true
                                  value: ₹15 / km
                                - descriptor:
                                    name: Driver Pickup Charges
                                  display: true
                                  value: ₹ 10
                                - descriptor:
                                    name: Nominal Fare
                                    short_desc: 'Driver may quote extra to cover for traffic, chance of return trip, etc.'
                                  display: true
                                  value: ₹ 10
                                - descriptor:
                                    name: Waiting Charges
                                    short_desc: 'Driver may quote extra to cover for traffic, chance of return trip, etc.'
                                  display: true
                                  value: ₹ 0 / min
                            - descriptor:
                                name: Night Charges
                              list:
                                - descriptor:
                                    name: Night Charges
                                  display: true
                                  value: 1.5x of daytime charges applicable at night from 10 PM to 5 AM
                                - descriptor:
                                    name: Night Shift Start
                                  display: true
                                  value: '22:00:00'
                                - descriptor:
                                    name: Night Shift End
                                  display: true
                                  value: '05:00:00'
                            - descriptor:
                                name: General Information
                              list:
                                - descriptor:
                                    name: Distance to nearest driver
                                  display: true
                                  value: 661 m
                                - descriptor:
                                    name: Wait time upto
                                  display: true
                                  value: 3 min
                      payments:
                        - id: 7f7896dd-787e-4a0b-8675-e9e6fe93bb8f
                          params:
                            amount: '81'
                            currency: INR
                          status: PAID
                          type: ON-FULFILLMENT
                      provider:
                        descriptor:
                          name: Acme Taxis
                        id: '1'
                      quote:
                        breakup:
                          - price:
                              currency: INR
                              value: '30'
                            title: Base Fare
                          - price:
                              currency: INR
                              value: '56'
                            title: Per km fare
                          - price:
                              currency: INR
                              value: '2.5'
                            title: CGST @ 5%
                          - price:
                              currency: INR
                              value: '2.5'
                            title: SGST @ 5%
                        price:
                          currency: INR
                          value: '81'
              Return transit ticket order with status - Entered Paid Area:
                value:
                  context:
                    action: on_status
                    bap_id: 'https://example-bap.com'
                    bap_uri: 'https://mock_bap.com/beckn/'
                    bpp_id: 'https://kmrl-bpp.com'
                    bpp_uri: 'https://kmrl-bpp.com/beckn/'
                    domain: 'nic2004:60221'
                    location:
                      city:
                        code: 'std:080'
                      country:
                        code: IND
                    message_id: fde8b8b6-c2e5-49f7-b254-720843d528bd
                    timestamp: '2021-03-23T10:00:40.065Z'
                    transaction_id: 6f339232-2bc3-44d2-915c-30d2b053ce1d
                    version: 1.1.0
                  message:
                    order:
                      billing:
                        email: john.doe@example.com
                        name: John Doe
                      fulfillments:
                        - id: '3'
                          state:
                            descriptor:
                              name: Entered paid area
                          stops:
                            - location:
                                descriptor:
                                  name: Dwarka Sector 21
                                gps: '9.05,12.06'
                              time:
                                timestamp: '2021-10-15T00:32:19.000Z'
                              type: start
                            - location:
                                descriptor:
                                  name: Shivaji Stadium
                                gps: '9.07,12.07'
                              time:
                                timestamp: '2021-10-15T00:43:21.000Z'
                              type: end
                          tags:
                            - descriptor:
                                name: Other Information
                              list:
                                - descriptor:
                                    name: Transfers
                                  display: true
                                  value: '0'
                                - descriptor:
                                    name: Duration
                                  display: true
                                  value: 30 min
                          vehicle:
                            category: METRO
                      id: '123413'
                      items:
                        - descriptor:
                            images:
                              - 'https://delhimetrorail.com/icons/sjt.ico'
                            name: Single Journey Ticket
                          fulfillment_ids:
                            - '3'
                          id: '3'
                          price:
                            currency: '55'
                            value: INR
                      payments:
                        - params:
                            amount: '60.5'
                            currency: INR
                            transaction_id: '24566345563'
                          status: PAID
                          time:
                            range:
                              end: '2021-03-24T10:00:40.065Z'
                              start: '2021-03-23T10:00:40.065Z'
                          url: 'https://pay.razorpay.com?amt=60.5&cur=INR&ref=24566345563'
                      provider:
                        descriptor:
                          images:
                            - 'https://delhimetrorail.com/logos/logo.ico'
                          name: Delhi Metro Rail Limited
                        id: '1'
                      quote:
                        breakup:
                          - price:
                              currency: INR
                              value: '55'
                            title: Single Journey Ticket X 1
                          - price:
                              currency: INR
                              value: '2.75'
                            title: CGST @ 5%
                          - price:
                              currency: INR
                              value: '2.75'
                            title: SGST @ 5%
                        price:
                          currency: '60.5'
                          value: INR
              Return transit ticket order with status - Exited paid area:
                value:
                  context:
                    action: on_status
                    bap_id: 'https://example-bap.com'
                    bap_uri: 'https://mock_bap.com/beckn/'
                    bpp_id: 'https://kmrl-bpp.com'
                    bpp_uri: 'https://kmrl-bpp.com/beckn/'
                    domain: 'nic2004:60221'
                    location:
                      city:
                        code: 'std:080'
                      country:
                        code: IND
                    message_id: fde8b8b6-c2e5-49f7-b254-720843d528bd
                    timestamp: '2021-03-23T10:00:40.065Z'
                    transaction_id: 6f339232-2bc3-44d2-915c-30d2b053ce1d
                    version: 1.1.0
                  message:
                    order:
                      billing:
                        email: john.doe@example.com
                        name: John Doe
                      fulfillments:
                        - id: '3'
                          state:
                            descriptor:
                              name: Exited paid area
                          stops:
                            - location:
                                descriptor:
                                  name: Dwarka Sector 21
                                gps: '9.05,12.06'
                              time:
                                timestamp: '2021-10-15T00:32:19.000Z'
                              type: start
                            - location:
                                descriptor:
                                  name: Shivaji Stadium
                                gps: '9.07,12.07'
                              time:
                                timestamp: '2021-10-15T00:43:21.000Z'
                              type: end
                          tags:
                            - descriptor:
                                name: Other Information
                              list:
                                - descriptor:
                                    name: Transfers
                                  display: true
                                  value: '0'
                                - descriptor:
                                    name: Duration
                                  display: true
                                  value: 30 min
                          vehicle:
                            category: METRO
                      id: '123413'
                      items:
                        - descriptor:
                            images:
                              - 'https://delhimetrorail.com/icons/sjt.ico'
                            name: Single Journey Ticket
                          fulfillment_ids:
                            - '3'
                          id: '3'
                          price:
                            currency: '55'
                            value: INR
                      payments:
                        - params:
                            amount: '60.5'
                            currency: INR
                            transaction_id: '24566345563'
                          status: PAID
                          url: 'https://pay.razorpay.com?amt=60.5&cur=INR&ref=24566345563'
                      provider:
                        descriptor:
                          images:
                            - 'https://delhimetrorail.com/logos/logo.ico'
                          name: Delhi Metro Rail Limited
                        id: '1'
                      quote:
                        breakup:
                          - price:
                              currency: INR
                              value: '55'
                            title: Single Journey Ticket X 1
                          - price:
                              currency: INR
                              value: '2.75'
                            title: CGST @ 5%
                          - price:
                              currency: INR
                              value: '2.75'
                            title: SGST @ 5%
                        price:
                          currency: '60.5'
                          value: INR
              Return transit ticket order with status - Ticket Issued:
                value:
                  context:
                    action: on_status
                    bap_id: 'https://example-bap.com'
                    bap_uri: 'https://mock_bap.com/beckn/'
                    bpp_id: 'https://kmrl-bpp.com'
                    bpp_uri: 'https://kmrl-bpp.com/beckn/'
                    domain: 'nic2004:60221'
                    location:
                      city:
                        code: 'std:080'
                      country:
                        code: IND
                    message_id: fde8b8b6-c2e5-49f7-b254-720843d528bd
                    timestamp: '2021-03-23T10:00:40.065Z'
                    transaction_id: 6f339232-2bc3-44d2-915c-30d2b053ce1d
                    version: 1.1.0
                  message:
                    order:
                      billing:
                        email: john.doe@example.com
                        name: John Doe
                      fulfillments:
                        - id: '3'
                          state:
                            descriptor:
                              name: Ticket Issued
                          stops:
                            - location:
                                descriptor:
                                  name: Dwarka Sector 21
                                gps: '9.05,12.06'
                              time:
                                timestamp: '2021-10-15T00:32:19.000Z'
                              type: start
                            - location:
                                descriptor:
                                  name: Shivaji Stadium
                                gps: '9.07,12.07'
                              time:
                                timestamp: '2021-10-15T00:43:21.000Z'
                              type: end
                          tags:
                            - descriptor:
                                name: Other Information
                              list:
                                - descriptor:
                                    name: Transfers
                                  display: true
                                  value: '0'
                                - descriptor:
                                    name: Duration
                                  display: true
                                  value: 30 min
                          vehicle:
                            category: METRO
                      id: '123413'
                      items:
                        - descriptor:
                            images:
                              - 'https://delhimetrorail.com/icons/sjt.ico'
                            name: Single Journey Ticket
                          fulfillment_ids:
                            - '3'
                          id: '3'
                          price:
                            currency: '55'
                            value: INR
                      payments:
                        - params:
                            amount: '60.5'
                            currency: INR
                            transaction_id: '24566345563'
                          status: PAID
                          time:
                            range:
                              end: '2021-03-24T10:00:40.065Z'
                              start: '2021-03-23T10:00:40.065Z'
                          url: 'https://pay.razorpay.com?amt=60.5&cur=INR&ref=24566345563'
                      provider:
                        descriptor:
                          images:
                            - 'https://delhimetrorail.com/logos/logo.ico'
                          name: Delhi Metro Rail Limited
                        id: '1'
                      quote:
                        breakup:
                          - price:
                              currency: INR
                              value: '55'
                            title: Single Journey Ticket X 1
                          - price:
                              currency: INR
                              value: '2.75'
                            title: CGST @ 5%
                          - price:
                              currency: INR
                              value: '2.75'
                            title: SGST @ 5%
                        price:
                          currency: '60.5'
                          value: INR
        description: TODO
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
                  message:
                    properties:
                      ack:
                        $ref: '#/components/schemas/Ack'
                    required:
                      - ack
                    type: object
                required:
                  - message
                type: object
          description: Acknowledgement of message received
      tags:
        - Beckn App Platform (BAP)
  /on_update:
    post:
      description: Returns updated service with updated runtime object
      operationId: on_update
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - properties:
                    context:
                      allOf:
                        - $ref: '#/components/schemas/Context'
                        - properties:
                            action:
                              enum:
                                - on_update
                    error:
                      $ref: '#/components/schemas/Error'
                    message:
                      properties:
                        order:
                          allOf:
                            - $ref: '#/components/schemas/Order'
                      required:
                        - order
                      type: object
                  required:
                    - context
                  type: object
                - allOf:
                    - $ref: '#/paths/~1init/post/requestBody/content/application~1json/schema/allOf/1/allOf/0'
                    - properties:
                        context:
                          properties:
                            action:
                              type: string
                              enum:
                                - on_update
                    - $ref: '#/paths/~1on_init/post/requestBody/content/application~1json/schema/allOf/1/allOf/2'
                    - $ref: '#/paths/~1confirm/post/requestBody/content/application~1json/schema/allOf/1/allOf/4'
                    - $ref: '#/paths/~1on_init/post/requestBody/content/application~1json/schema/allOf/1/allOf/4'
                    - $ref: '#/paths/~1on_init/post/requestBody/content/application~1json/schema/allOf/1/allOf/5'
                    - $ref: '#/paths/~1on_status/post/requestBody/content/application~1json/schema/allOf/1/allOf/6'
                    - $ref: '#/paths/~1on_init/post/requestBody/content/application~1json/schema/allOf/1/allOf/7'
                    - $ref: '#/paths/~1on_init/post/requestBody/content/application~1json/schema/allOf/1/allOf/8'
                    - $ref: '#/paths/~1confirm/post/requestBody/content/application~1json/schema/allOf/1/allOf/5'
                    - $ref: '#/paths/~1on_init/post/requestBody/content/application~1json/schema/allOf/1/allOf/10'
                    - $ref: '#/paths/~1on_status/post/requestBody/content/application~1json/schema/allOf/1/allOf/11'
                    - $ref: '#/paths/~1on_status/post/requestBody/content/application~1json/schema/allOf/1/allOf/12'
                    - $ref: '#/paths/~1on_status/post/requestBody/content/application~1json/schema/allOf/1/allOf/13'
                    - $ref: '#/paths/~1on_status/post/requestBody/content/application~1json/schema/allOf/1/allOf/14'
            examples:
              Return updated order with payment transaction status:
                value:
                  context:
                    action: on_update
                    bap_id: example-bap.com
                    bap_uri: 'https://api.example-bap.com/pilot/bap/cab/v1'
                    bpp_id: example-bpp.com
                    bpp_uri: 'https://api.example-bpp.com/dobpp/beckn/7f7896dd-787e-4a0b-8675-e9e6fe93bb8f'
                    domain: 'nic2004:60221'
                    location:
                      city:
                        code: 'std:080'
                      country:
                        code: IND
                    message_id: 8926b747-0362-4fcc-b795-0994a6287700
                    timestamp: '2023-03-23T04:48:53Z'
                    transaction_id: b580c989-f84d-4abe-af28-2c818aafce3b
                    version: 1.1.0
                  message:
                    order:
                      fulfillments:
                        - agent:
                            contact:
                              phone: +91-98978675645
                            person:
                              name: RAGHAVENDRA J
                            rating: '5'
                          customer:
                            contact:
                              phone: +91-9897867564
                            person:
                              language:
                                code: en
                                name: English
                              name: John Doe
                          id: fulf_5cf064d5-4c0a-42d3-b73d-5f19a6f7468e
                          state:
                            descriptor:
                              code: PAYMENT_COLLECTED
                              name: Payment received
                          stops:
                            - authorization:
                                token: '234234'
                                type: OTP
                              location:
                                address: '98 A, 6th Main Rd, Uttarahalli Hobli, Ramanjaneyanagar'
                                area_code: 560061
                                city:
                                  name: Bengaluru
                                country:
                                  name: India
                                district: Ramanjaneyanagar
                                gps: '12.910458, 77.543089'
                                state:
                                  name: Karnataka
                              type: start
                            - location:
                                address: 'Basavanagudi, Chikkanna Garden, Rangadore Memorial Hospital'
                                area_code: 560061
                                city:
                                  name: Bengaluru
                                country:
                                  name: India
                                district: Chikkanna Garden
                                gps: '12.9535139,  77.5710434'
                                state:
                                  name: Karnataka
                              type: end
                          vehicle:
                            category: AUTO_RICKSHAW
                            registration: KA01JG1231
                      id: ABC1234
                      items:
                        - descriptor:
                            code: RIDE
                            name: Auto Ride
                          fulfillment_ids:
                            - fb5c84d4-1b59-4b9d-96b5-9d79107432c5
                          id: 5777a0bf-9a08-49aa-a97d-1e5561a9622e
                          payment_ids:
                            - '1'
                          tags:
                            - descriptor:
                                name: Daytime Charges
                              list:
                                - descriptor:
                                    name: Min Fare upto 2 km
                                  display: true
                                  value: ₹ 30 upto 2 km
                                - descriptor:
                                    name: Rate above Min. Fare
                                  display: true
                                  value: ₹15 / km
                                - descriptor:
                                    name: Driver Pickup Charges
                                  display: true
                                  value: ₹ 10
                                - descriptor:
                                    name: Nominal Fare
                                    short_desc: 'Driver may quote extra to cover for traffic, chance of return trip, etc.'
                                  display: true
                                  value: ₹ 10
                                - descriptor:
                                    name: Waiting Charges
                                    short_desc: 'Driver may quote extra to cover for traffic, chance of return trip, etc.'
                                  display: true
                                  value: ₹ 0 / min
                            - descriptor:
                                name: Night Charges
                              list:
                                - descriptor:
                                    name: Night Charges
                                  display: true
                                  value: 1.5x of daytime charges applicable at night from 10 PM to 5 AM
                                - descriptor:
                                    name: Night Shift Start
                                  display: true
                                  value: '22:00:00'
                                - descriptor:
                                    name: Night Shift End
                                  display: true
                                  value: '05:00:00'
                            - descriptor:
                                name: General Information
                              list:
                                - descriptor:
                                    name: Distance to nearest driver
                                  display: true
                                  value: 661 m
                                - descriptor:
                                    name: Wait time upto
                                  display: true
                                  value: 3 min
                      payments:
                        - id: 7f7896dd-787e-4a0b-8675-e9e6fe93bb8f
                          params:
                            amount: '81'
                            currency: INR
                          status: PAID
                          type: ON-FULFILLMENT
                      provider:
                        descriptor:
                          name: Acme Taxis
                        id: '1'
                      quote:
                        breakup:
                          - price:
                              currency: INR
                              value: '30'
                            title: Base Fare
                          - price:
                              currency: INR
                              value: '56'
                            title: Per km fare
                          - price:
                              currency: INR
                              value: '2.5'
                            title: CGST @ 5%
                          - price:
                              currency: INR
                              value: '2.5'
                            title: SGST @ 5%
                        price:
                          currency: INR
                          value: '81'
              Return updated order with recomputed charges:
                value:
                  context:
                    action: on_update
                    bap_id: example-bap.com
                    bap_uri: 'https://api.example-bap.com/pilot/bap/cab/v1'
                    bpp_id: example-bpp.com
                    bpp_uri: 'https://api.example-bpp.com/dobpp/beckn/7f7896dd-787e-4a0b-8675-e9e6fe93bb8f'
                    domain: 'nic2004:60221'
                    location:
                      city:
                        code: 'std:080'
                      country:
                        code: IND
                    message_id: 8926b747-0362-4fcc-b795-0994a6287700
                    timestamp: '2023-03-23T04:48:53Z'
                    transaction_id: b580c989-f84d-4abe-af28-2c818aafce3b
                    version: 1.1.0
                  message:
                    order:
                      fulfillments:
                        - agent:
                            contact:
                              phone: +91-98978675645
                            person:
                              name: RAGHAVENDRA J
                            rating: '5'
                          customer:
                            contact:
                              phone: +91-9897867564
                            person:
                              language:
                                code: en
                                name: English
                              name: John Doe
                          id: fulf_5cf064d5-4c0a-42d3-b73d-5f19a6f7468e
                          state:
                            descriptor:
                              code: RIDE_ENDED
                              name: Your ride has ended
                          stops:
                            - authorization:
                                token: '234234'
                                type: OTP
                              location:
                                address: '98 A, 6th Main Rd, Uttarahalli Hobli, Ramanjaneyanagar'
                                area_code: 560061
                                city:
                                  name: Bengaluru
                                country:
                                  name: India
                                district: Ramanjaneyanagar
                                gps: '12.910458, 77.543089'
                                state:
                                  name: Karnataka
                              type: start
                            - location:
                                address: 'Basavanagudi, Chikkanna Garden, Rangadore Memorial Hospital'
                                area_code: 560061
                                city:
                                  name: Bengaluru
                                country:
                                  name: India
                                district: Chikkanna Garden
                                gps: '12.9535139,  77.5710434'
                                state:
                                  name: Karnataka
                              type: end
                          vehicle:
                            category: AUTO_RICKSHAW
                            registration: KA01JG1231
                      id: ABC1234
                      items:
                        - descriptor:
                            code: RIDE
                            name: Auto Ride
                          fulfillment_ids:
                            - fb5c84d4-1b59-4b9d-96b5-9d79107432c5
                          id: 5777a0bf-9a08-49aa-a97d-1e5561a9622e
                          payment_ids:
                            - '1'
                          tags:
                            - descriptor:
                                name: Daytime Charges
                              list:
                                - descriptor:
                                    name: Min Fare upto 2 km
                                  display: true
                                  value: ₹ 30 upto 2 km
                                - descriptor:
                                    name: Rate above Min. Fare
                                  display: true
                                  value: ₹15 / km
                                - descriptor:
                                    name: Driver Pickup Charges
                                  display: true
                                  value: ₹ 10
                                - descriptor:
                                    name: Nominal Fare
                                    short_desc: 'Driver may quote extra to cover for traffic, chance of return trip, etc.'
                                  display: true
                                  value: ₹ 10
                                - descriptor:
                                    name: Waiting Charges
                                    short_desc: 'Driver may quote extra to cover for traffic, chance of return trip, etc.'
                                  display: true
                                  value: ₹ 0 / min
                            - descriptor:
                                name: Night Charges
                              list:
                                - descriptor:
                                    name: Night Charges
                                  display: true
                                  value: 1.5x of daytime charges applicable at night from 10 PM to 5 AM
                                - descriptor:
                                    name: Night Shift Start
                                  display: true
                                  value: '22:00:00'
                                - descriptor:
                                    name: Night Shift End
                                  display: true
                                  value: '05:00:00'
                            - descriptor:
                                name: General Information
                              list:
                                - descriptor:
                                    name: Distance to nearest driver
                                  display: true
                                  value: 661 m
                                - descriptor:
                                    name: Wait time upto
                                  display: true
                                  value: 3 min
                      payments:
                        - id: 7f7896dd-787e-4a0b-8675-e9e6fe93bb8f
                          params:
                            amount: '75'
                            currency: INR
                          status: NOT-PAID
                          type: ON-FULFILLMENT
                      provider:
                        descriptor:
                          name: Acme Taxis
                        id: '1'
                      quote:
                        breakup:
                          - price:
                              currency: INR
                              value: '30'
                            title: Base Fare
                          - price:
                              currency: INR
                              value: '40'
                            title: Per km fare
                          - price:
                              currency: INR
                              value: '2.5'
                            title: CGST @ 5%
                          - price:
                              currency: INR
                              value: '2.5'
                            title: SGST @ 5%
                        price:
                          currency: INR
                          value: '75'
        description: TODO
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
                  message:
                    properties:
                      ack:
                        $ref: '#/components/schemas/Ack'
                    required:
                      - ack
                    type: object
                required:
                  - message
                type: object
          description: Acknowledgement of message received
      tags:
        - Beckn App Platform (BAP)
  /on_rating:
    post:
      description: Provide feedback on a service
      operationId: on_rating
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - properties:
                    context:
                      allOf:
                        - $ref: '#/components/schemas/Context'
                        - properties:
                            action:
                              enum:
                                - on_rating
                    error:
                      $ref: '#/components/schemas/Error'
                    message:
                      properties:
                        feedback_form:
                          allOf:
                            - $ref: '#/components/schemas/XInput'
                          description: A feedback form to allow the user to provide additional information on the rating provided
                      type: object
                  required:
                    - context
                    - message
                  type: object
                - allOf:
                    - $ref: '#/paths/~1init/post/requestBody/content/application~1json/schema/allOf/1/allOf/0'
                    - properties:
                        context:
                          properties:
                            action:
                              type: string
                              enum:
                                - on_rating
                    - properties:
                        message:
                          properties:
                            feedback_form:
                              type: object
                              properties:
                                required:
                                  type: boolean
                                form:
                                  type: object
                              required:
                                - required
                              allOf:
                                - if:
                                    properties:
                                      required:
                                        const: true
                                  then:
                                    required:
                                      - form
            examples:
              Return acknowledgement of rating and feedback:
                value:
                  context:
                    action: on_rating
                    bap_id: api.beckn.juspay.in/pilot/bap/cab/v1
                    bap_uri: 'https://api.example-bap.com/pilot/bap/cab/v1'
                    bpp_id: api.beckn.juspay.in/dobpp/beckn/7f7896dd-787e-4a0b-8675-e9e6fe93bb8f
                    bpp_uri: 'https://api.example-bpp.com/dobpp/beckn/7f7896dd-787e-4a0b-8675-e9e6fe93bb8f'
                    domain: 'nic2004:60221'
                    location:
                      city:
                        code: 'std:080'
                      country:
                        code: IND
                    message_id: 2a17e268-1dc4-4d1a-98a2-17554a50c7d2
                    timestamp: '2023-03-23T05:41:15Z'
                    version: 1.1.0
                  message:
                    feedback_form:
                      form:
                        mime_type: text/html
                        url: 'https://www.example.com/feedbackform'
                      required: true
        description: TODO
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
                  message:
                    properties:
                      ack:
                        $ref: '#/components/schemas/Ack'
                    required:
                      - ack
                    type: object
                required:
                  - message
                type: object
          description: Acknowledgement of message received
      tags:
        - Beckn App Platform (BAP)
  /on_support:
    post:
      description: Contact Support
      operationId: on_support
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - properties:
                    context:
                      allOf:
                        - $ref: '#/components/schemas/Context'
                        - properties:
                            action:
                              enum:
                                - on_support
                    error:
                      $ref: '#/components/schemas/Error'
                    message:
                      properties:
                        support:
                          $ref: '#/components/schemas/Support'
                      type: object
                  required:
                    - context
                  type: object
                - allOf:
                    - $ref: '#/paths/~1init/post/requestBody/content/application~1json/schema/allOf/1/allOf/0'
                    - properties:
                        context:
                          properties:
                            action:
                              type: string
                              enum:
                                - on_support
                    - properties:
                        message:
                          properties:
                            support:
                              type: object
                              properties:
                                email:
                                  type: string
                                  format: email
                                phone:
                                  type: string
                                url:
                                  type: string
                                  format: uri
                              anyOf:
                                - required:
                                    - email
                                - required:
                                    - phone
                                - required:
                                    - url
            examples:
              Return support information related to an order:
                value:
                  context:
                    action: on_support
                    bap_id: example-bap.com
                    bap_uri: 'https://api.example-bap.com/pilot/bap/cab/v1'
                    bpp_id: example-bpp.com
                    bpp_uri: 'https://api.example-bpp.com/dobpp/beckn/7f7896dd-787e-4a0b-8675-e9e6fe93bb8f'
                    domain: 'nic2004:60221'
                    location:
                      city:
                        code: 'std:080'
                      country:
                        code: IND
                    message_id: ec3dea8c-c64c-4f06-b2a0-ec1f9584d7ba
                    timestamp: '2023-03-23T05:41:09Z'
                    version: 1.1.0
                  message:
                    support:
                      callback_phone: '+916756453421'
                      email: support@example-bpp.com
                      phone: '+918068870525'
                      ref_id: 1386183jkgsgfjsf
                      url: 'https://support.example-bpp.com/gethelp'
        description: TODO
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
                  message:
                    properties:
                      ack:
                        $ref: '#/components/schemas/Ack'
                    required:
                      - ack
                    type: object
                required:
                  - message
                type: object
          description: Acknowledgement of message received
      tags:
        - Beckn App Platform (BAP)
  /on_track:
    post:
      description: Send tracking details of an active order
      operationId: on_track
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - properties:
                    context:
                      allOf:
                        - $ref: '#/components/schemas/Context'
                        - properties:
                            action:
                              enum:
                                - on_track
                    error:
                      $ref: '#/components/schemas/Error'
                    message:
                      properties:
                        tracking:
                          $ref: '#/components/schemas/Tracking'
                      required:
                        - tracking
                      type: object
                  required:
                    - context
                  type: object
                - allOf:
                    - $ref: '#/paths/~1init/post/requestBody/content/application~1json/schema/allOf/1/allOf/0'
                    - properties:
                        context:
                          properties:
                            action:
                              type: string
                              enum:
                                - on_track
                    - properties:
                        message:
                          properties:
                            tracking:
                              type: object
                              properties:
                                status:
                                  type: string
                                url:
                                  type: string
                                location:
                                  type: object
                                  properties:
                                    latitude:
                                      type: number
                                    longitude:
                                      type: number
                              required:
                                - status
                              oneOf:
                                - required:
                                    - url
                                - required:
                                    - location
            examples:
              Return tracking information for an order:
                value:
                  context:
                    action: on_track
                    bap_id: example-bap.com
                    bap_uri: 'https://api.example-bap.com/pilot/bap/cab/v1'
                    bpp_id: example-bpp.com
                    bpp_uri: 'https://api.example-bpp.com/dobpp/beckn/7f7896dd-787e-4a0b-8675-e9e6fe93bb8f'
                    domain: 'nic2004:60221'
                    location:
                      city:
                        code: 'std:080'
                      country:
                        code: IND
                    message_id: ec3dea8c-c64c-4f06-b2a0-ec1f9584d7ba
                    timestamp: '2023-03-23T05:41:09Z'
                    version: 1.1.0
                  message:
                    tracking:
                      status: active
                      url: 'https://api.beckn.juspay.in/dobpp/ui/driver/location/abc9f0aa-bbfd-4e91-b378-41feee12f05f'
        description: TODO
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
                  message:
                    properties:
                      ack:
                        $ref: '#/components/schemas/Ack'
                    required:
                      - ack
                    type: object
                required:
                  - message
                type: object
          description: Acknowledgement of message received
      tags:
        - Beckn App Platform (BAP)
  /on_cancel:
    post:
      description: Send cancellation request_id with reasons list in case of cancellation request. Else send cancelled order object
      operationId: on_cancel
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - properties:
                    context:
                      allOf:
                        - $ref: '#/components/schemas/Context'
                        - properties:
                            action:
                              enum:
                                - on_cancel
                    error:
                      $ref: '#/components/schemas/Error'
                    message:
                      properties:
                        order:
                          allOf:
                            - $ref: '#/components/schemas/Order'
                      required:
                        - order
                      type: object
                  required:
                    - context
                  type: object
                - allOf:
                    - $ref: '#/paths/~1init/post/requestBody/content/application~1json/schema/allOf/1/allOf/0'
                    - properties:
                        context:
                          properties:
                            action:
                              type: string
                              enum:
                                - on_cancel
                    - $ref: '#/paths/~1on_init/post/requestBody/content/application~1json/schema/allOf/1/allOf/2'
                    - $ref: '#/paths/~1confirm/post/requestBody/content/application~1json/schema/allOf/1/allOf/4'
                    - $ref: '#/paths/~1on_init/post/requestBody/content/application~1json/schema/allOf/1/allOf/4'
                    - $ref: '#/paths/~1on_init/post/requestBody/content/application~1json/schema/allOf/1/allOf/5'
                    - $ref: '#/paths/~1on_status/post/requestBody/content/application~1json/schema/allOf/1/allOf/6'
                    - $ref: '#/paths/~1on_init/post/requestBody/content/application~1json/schema/allOf/1/allOf/7'
                    - $ref: '#/paths/~1on_init/post/requestBody/content/application~1json/schema/allOf/1/allOf/8'
                    - $ref: '#/paths/~1confirm/post/requestBody/content/application~1json/schema/allOf/1/allOf/5'
                    - $ref: '#/paths/~1on_init/post/requestBody/content/application~1json/schema/allOf/1/allOf/10'
                    - $ref: '#/paths/~1on_status/post/requestBody/content/application~1json/schema/allOf/1/allOf/11'
                    - $ref: '#/paths/~1on_status/post/requestBody/content/application~1json/schema/allOf/1/allOf/12'
                    - $ref: '#/paths/~1on_status/post/requestBody/content/application~1json/schema/allOf/1/allOf/13'
                    - $ref: '#/paths/~1on_status/post/requestBody/content/application~1json/schema/allOf/1/allOf/14'
                    - properties:
                        message:
                          properties:
                            order:
                              properties:
                                status:
                                  type: string
                                  enum:
                                    - CANCELLED
                                    - SOFT_CANCEL
                              required:
                                - status
                    - properties:
                        message:
                          properties:
                            order:
                              properties:
                                cancellation_terms:
                                  items:
                                    required:
                                      - reason_required
                              required:
                                - cancellation_terms
            examples:
              Return cancelled ticket order with cancellation charges:
                value:
                  context:
                    action: on_cancel
                    bap_id: 'https://example-bap.com'
                    bap_uri: 'https://api.example-bap.com/beckn/'
                    bpp_id: 'https://transit-solutions.com'
                    bpp_uri: 'https://api.transit-solutions.com/beckn/'
                    domain: 'nic2008:49213'
                    location:
                      city:
                        code: 'std:080'
                      country:
                        code: IND
                    message_id: fde8b8b6-c2e5-49f7-b254-720843d528bd
                    timestamp: '2021-03-23T10:00:40.065Z'
                    transaction_id: 6f339232-2bc3-44d2-915c-30d2b053ce1d
                    version: 1.1.0
                  message:
                    order:
                      billing:
                        email: john.doe@example.com
                        name: John Doe
                      cancellation_terms:
                        - external_ref:
                            url: 'https://dmrc.com/fare_products/sjt/cancellation_terms.html'
                      fulfillments:
                        - id: '3'
                          state:
                            descriptor:
                              name: Ticket Cancelled
                          stops:
                            - instructions:
                                name: 'Show this ticket at the QR code scanner at the entry gate. If the QR code scanner is not present, show this at the ticket counter to get your token'
                              location:
                                descriptor:
                                  name: Dwarka Sector 21
                                gps: '9.05,12.06'
                              time:
                                timestamp: '2021-10-15T00:32:19.000Z'
                              type: start
                            - location:
                                descriptor:
                                  name: Shivaji Stadium
                                gps: '9.07,12.07'
                              time:
                                timestamp: '2021-10-15T00:43:21.000Z'
                              type: end
                          tags:
                            - descriptor:
                                name: Other Information
                              list:
                                - descriptor:
                                    name: Transfers
                                  display: true
                                  value: '0'
                                - descriptor:
                                    name: Duration
                                  display: true
                                  value: 30 min
                          vehicle:
                            category: METRO
                      id: '123413'
                      items:
                        - descriptor:
                            images:
                              - 'https://delhimetrorail.com/icons/sjt.ico'
                            name: Single Journey Ticket
                          fulfillment_ids:
                            - '3'
                          id: '3'
                          price:
                            currency: '55'
                            value: INR
                          tags:
                            - descriptor:
                                name: Other Information
                              list:
                                - descriptor:
                                    name: Validity
                                  display: true
                                  value: 24 hours from the time of purchase
                      payments:
                        - params:
                            amount: '10'
                            bank_account_number: '32756678999'
                            bank_code: SBIN0000575
                            currency: INR
                          status: NOT-PAID
                          time:
                            range:
                              end: '2021-03-24T10:00:40.065Z'
                              start: '2021-03-23T10:00:40.065Z'
                          type: POST-FULFILLMENT
                      provider:
                        descriptor:
                          images:
                            - 'https://delhimetrorail.com/logos/logo.ico'
                          name: Delhi Metro Rail Limited
                        id: '1'
                      quote:
                        breakup:
                          - price:
                              currency: INR
                              value: '55'
                            title: Single Journey Ticket X 1
                          - price:
                              currency: INR
                              value: '2.75'
                            title: CGST @ 5%
                          - price:
                              currency: INR
                              value: '2.75'
                            title: SGST @ 5%
                        price:
                          currency: '60.5'
                          value: INR
              Return order cancelled by rider with cancellation charges:
                value:
                  context:
                    action: on_cancel
                    bap_id: example-bap.com
                    bap_uri: 'https://api.example-bap.com/pilot/bap/cab/v1'
                    bpp_id: example-bpp.com
                    bpp_uri: 'https://api.example-bpp.com/dobpp/beckn/7f7896dd-787e-4a0b-8675-e9e6fe93bb8f'
                    domain: 'nic2004:60221'
                    location:
                      city:
                        code: 'std:080'
                      country:
                        code: IND
                    message_id: 8926b747-0362-4fcc-b795-0994a6287700
                    timestamp: '2023-03-23T04:48:53Z'
                    transaction_id: b580c989-f84d-4abe-af28-2c818aafce3b
                    version: 1.1.0
                  message:
                    order:
                      fulfillments:
                        - agent:
                            contact:
                              phone: +91-98978675645
                            person:
                              name: RAGHAVENDRA J
                            rating: '5'
                          customer:
                            contact:
                              phone: +91-9897867564
                            person:
                              language:
                                code: en
                                name: English
                              name: John Doe
                          id: fulf_5cf064d5-4c0a-42d3-b73d-5f19a6f7468e
                          state:
                            descriptor:
                              code: RIDE_CANCELLED
                              name: Oops! The driver had to cancel
                          stops:
                            - authorization:
                                token: '234234'
                                type: OTP
                              location:
                                address: '98 A, 6th Main Rd, Uttarahalli Hobli, Ramanjaneyanagar'
                                area_code: 560061
                                city:
                                  name: Bengaluru
                                country:
                                  name: India
                                district: Ramanjaneyanagar
                                gps: '12.910458, 77.543089'
                                state:
                                  name: Karnataka
                              type: start
                            - location:
                                address: 'Basavanagudi, Chikkanna Garden, Rangadore Memorial Hospital'
                                area_code: 560061
                                city:
                                  name: Bengaluru
                                country:
                                  name: India
                                district: Chikkanna Garden
                                gps: '12.9535139,  77.5710434'
                                state:
                                  name: Karnataka
                              type: end
                          vehicle:
                            category: AUTO_RICKSHAW
                            registration: KA01JG1231
                      id: 7751bd26-3fdc-47ca-9b64-e998dc5abe68
                      items:
                        - descriptor:
                            code: RIDE
                            name: Auto Ride
                          fulfillment_ids:
                            - fb5c84d4-1b59-4b9d-96b5-9d79107432c5
                          id: 5777a0bf-9a08-49aa-a97d-1e5561a9622e
                          payment_ids:
                            - '1'
                          tags:
                            - descriptor:
                                name: Daytime Charges
                              list:
                                - descriptor:
                                    name: Min Fare upto 2 km
                                  display: true
                                  value: ₹ 30 upto 2 km
                                - descriptor:
                                    name: Rate above Min. Fare
                                  display: true
                                  value: ₹15 / km
                                - descriptor:
                                    name: Driver Pickup Charges
                                  display: true
                                  value: ₹ 10
                                - descriptor:
                                    name: Nominal Fare
                                    short_desc: 'Driver may quote extra to cover for traffic, chance of return trip, etc.'
                                  display: true
                                  value: ₹ 10
                                - descriptor:
                                    name: Waiting Charges
                                    short_desc: 'Driver may quote extra to cover for traffic, chance of return trip, etc.'
                                  display: true
                                  value: ₹ 0 / min
                            - descriptor:
                                name: Night Charges
                              list:
                                - descriptor:
                                    name: Night Charges
                                  display: true
                                  value: 1.5x of daytime charges applicable at night from 10 PM to 5 AM
                                - descriptor:
                                    name: Night Shift Start
                                  display: true
                                  value: '22:00:00'
                                - descriptor:
                                    name: Night Shift End
                                  display: true
                                  value: '05:00:00'
                            - descriptor:
                                name: General Information
                              list:
                                - descriptor:
                                    name: Distance to nearest driver
                                  display: true
                                  value: 661 m
                                - descriptor:
                                    name: Wait time upto
                                  display: true
                                  value: 3 min
                      payments:
                        - id: 7f7896dd-787e-4a0b-8675-e9e6fe93bb8f
                          params:
                            amount: '30'
                            bank_account_number: '32754478993'
                            bank_code: SBIN0000575
                            currency: INR
                          status: NOT-PAID
                          time:
                            duration: P1D
                          type: POST-FULFILLMENT
                      provider:
                        descriptor:
                          name: Acme Taxis
                        id: '1'
                      quote:
                        breakup:
                          - price:
                              currency: INR
                              value: '30'
                            title: Cancellation charges
                        price:
                          currency: INR
                          value: '30'
              Return order cancelled by the driver:
                value:
                  context:
                    action: on_cancel
                    bap_id: example-bap.com
                    bap_uri: 'https://api.example-bap.com/pilot/bap/cab/v1'
                    bpp_id: example-bpp.com
                    bpp_uri: 'https://api.example-bpp.com/dobpp/beckn/7f7896dd-787e-4a0b-8675-e9e6fe93bb8f'
                    domain: 'nic2004:60221'
                    location:
                      city:
                        code: 'std:080'
                      country:
                        code: IND
                    message_id: 8926b747-0362-4fcc-b795-0994a6287700
                    timestamp: '2023-03-23T04:48:53Z'
                    transaction_id: b580c989-f84d-4abe-af28-2c818aafce3b
                    version: 1.1.0
                  message:
                    order:
                      fulfillments:
                        - agent:
                            contact:
                              phone: +91-98978675645
                            person:
                              name: RAGHAVENDRA J
                            rating: '5'
                          customer:
                            contact:
                              phone: +91-9897867564
                            person:
                              language:
                                code: en
                                name: English
                              name: John Doe
                          id: fulf_5cf064d5-4c0a-42d3-b73d-5f19a6f7468e
                          state:
                            descriptor:
                              code: RIDE_CANCELLED
                              name: Oops! The driver had to cancel
                          stops:
                            - authorization:
                                token: '234234'
                                type: OTP
                              location:
                                address: '98 A, 6th Main Rd, Uttarahalli Hobli, Ramanjaneyanagar'
                                area_code: 560061
                                city:
                                  name: Bengaluru
                                country:
                                  name: India
                                district: Ramanjaneyanagar
                                gps: '12.910458, 77.543089'
                                state:
                                  name: Karnataka
                              type: start
                            - location:
                                address: 'Basavanagudi, Chikkanna Garden, Rangadore Memorial Hospital'
                                area_code: 560061
                                city:
                                  name: Bengaluru
                                country:
                                  name: India
                                district: Chikkanna Garden
                                gps: '12.9535139,  77.5710434'
                                state:
                                  name: Karnataka
                              type: end
                          vehicle:
                            category: AUTO_RICKSHAW
                            registration: KA01JG1231
                      id: 7751bd26-3fdc-47ca-9b64-e998dc5abe68
                      items:
                        - descriptor:
                            code: RIDE
                            name: Auto Ride
                          fulfillment_ids:
                            - fb5c84d4-1b59-4b9d-96b5-9d79107432c5
                          id: 5777a0bf-9a08-49aa-a97d-1e5561a9622e
                          payment_ids:
                            - '1'
                          tags:
                            - descriptor:
                                name: Daytime Charges
                              list:
                                - descriptor:
                                    name: Min Fare upto 2 km
                                  display: true
                                  value: ₹ 30 upto 2 km
                                - descriptor:
                                    name: Rate above Min. Fare
                                  display: true
                                  value: ₹15 / km
                                - descriptor:
                                    name: Driver Pickup Charges
                                  display: true
                                  value: ₹ 10
                                - descriptor:
                                    name: Nominal Fare
                                    short_desc: 'Driver may quote extra to cover for traffic, chance of return trip, etc.'
                                  display: true
                                  value: ₹ 10
                                - descriptor:
                                    name: Waiting Charges
                                    short_desc: 'Driver may quote extra to cover for traffic, chance of return trip, etc.'
                                  display: true
                                  value: ₹ 0 / min
                            - descriptor:
                                name: Night Charges
                              list:
                                - descriptor:
                                    name: Night Charges
                                  display: true
                                  value: 1.5x of daytime charges applicable at night from 10 PM to 5 AM
                                - descriptor:
                                    name: Night Shift Start
                                  display: true
                                  value: '22:00:00'
                                - descriptor:
                                    name: Night Shift End
                                  display: true
                                  value: '05:00:00'
                            - descriptor:
                                name: General Information
                              list:
                                - descriptor:
                                    name: Distance to nearest driver
                                  display: true
                                  value: 661 m
                                - descriptor:
                                    name: Wait time upto
                                  display: true
                                  value: 3 min
                      payments:
                        - id: 7f7896dd-787e-4a0b-8675-e9e6fe93bb8f
                          params:
                            amount: '0'
                            currency: INR
                          status: NOT-PAID
                          type: POST-FULFILLMENT
                      provider:
                        descriptor:
                          name: Acme Taxis
                        id: '1'
                      quote:
                        price:
                          currency: INR
                          value: '0'
        description: TODO
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
                  message:
                    properties:
                      ack:
                        $ref: '#/components/schemas/Ack'
                    required:
                      - ack
                    type: object
                required:
                  - message
                type: object
          description: Acknowledgement of message received
      tags:
        - Beckn App Platform (BAP)
components:
  securitySchemes:
    SubscriberAuth:
      description: 'Signature of message body using BAP or BPP subscriber''s signing public key. <br/><br/>Format:<br/><br/><code>Authorization : Signature keyId="{subscriber_id}|{unique_key_id}|{algorithm}",algorithm="ed25519",created="1606970629",expires="1607030629",headers="(created) (expires) digest",signature="Base64(BLAKE-512(signing string))"</code>'
      in: header
      name: Authorization
      type: apiKey
  schemas:
    Ack:
      additionalProperties: false
      description: 'Describes the acknowledgement sent in response to an API call. If the implementation uses HTTP/S, then Ack must be returned in the same session. Every API call to a BPP must be responded to with an Ack whether the BPP intends to respond with a callback or not. This has one property called `status` that indicates the status of the Acknowledgement.'
      properties:
        status:
          description: 'The status of the acknowledgement. If the request passes the validation criteria of the BPP, then this is set to ACK. If a BPP responds with status = `ACK` to a request, it is required to respond with a callback. If the request fails the validation criteria, then this is set to NACK. Additionally, if a BPP does not intend to respond with a callback even after the request meets the validation criteria, it should set this value to `NACK`.'
          enum:
            - ACK
            - NACK
          type: string
        tags:
          description: A list of tags containing any additional information sent along with the Acknowledgement.
          items:
            $ref: '#/components/schemas/TagGroup'
          type: array
      type: object
    AddOn:
      additionalProperties: false
      description: Describes an add-on
      properties:
        descriptor:
          $ref: '#/components/schemas/Descriptor'
        id:
          description: 'ID of the add-on. This follows the syntax {item.id}/add-on/{add-on unique id} for item specific add-on OR '
          type: string
        price:
          $ref: '#/components/schemas/Price'
      type: object
    Address:
      description: Describes a postal address.
      type: string
    Agent:
      additionalProperties: false
      description: 'Describes the direct performer, driver or executor that fulfills an order. It is usually a person. But in some rare cases, it could be a non-living entity like a drone, or a bot. Some examples of agents are Doctor in the healthcare sector, a driver in the mobility sector, or a delivery person in the logistics sector. This object can be set at any stage of the order lifecycle. This can be set at the discovery stage when the BPP wants to provide details on the agent fulfilling the order, like in healthcare, where the doctor''s name appears during search. This object can also used to search for a particular person that the customer wants fulfilling an order. Sometimes, this object gets instantiated after the order is confirmed, like in the case of on-demand taxis, where the driver is assigned after the user confirms the ride.'
      properties:
        contact:
          $ref: '#/components/schemas/Contact'
        organization:
          $ref: '#/components/schemas/Organization'
        person:
          $ref: '#/components/schemas/Person'
        rating:
          $ref: '#/components/schemas/Rating/properties/value'
      type: object
    Authorization:
      additionalProperties: false
      description: Describes an authorization mechanism
      properties:
        status:
          description: Status of the token
          type: string
        token:
          description: Token used for authorization
          type: string
        type:
          description: Type of authorization mechanism used
          type: string
        valid_from:
          description: Timestamp in RFC3339 format from which token is valid
          format: date-time
          type: string
        valid_to:
          description: Timestamp in RFC3339 format until which token is valid
          format: date-time
          type: string
      type: object
    Billing:
      additionalProperties: false
      description: 'Describes the billing details of an entity.<br>This has properties like name,organization,address,email,phone,time,tax_number, created_at,updated_at'
      properties:
        address:
          allOf:
            - $ref: '#/components/schemas/Address'
          description: The address of the billable entity
        city:
          allOf:
            - $ref: '#/components/schemas/City'
          description: The city where the billable entity resides.
        email:
          description: Email address where the bill is sent to
          format: email
          type: string
        name:
          description: Name of the billable entity
          type: string
        organization:
          allOf:
            - $ref: '#/components/schemas/Organization'
          description: Details of the organization being billed.
        phone:
          description: Phone number of the billable entity
          type: string
        state:
          allOf:
            - $ref: '#/components/schemas/State'
          description: The state where the billable entity resides. This is important for state-level tax calculation
        tax_id:
          description: ID of the billable entity as recognized by the taxation authority
          type: string
        time:
          allOf:
            - $ref: '#/components/schemas/Time'
          description: Details regarding the billing period
      type: object
    Cancellation:
      additionalProperties: false
      description: Describes a cancellation event
      properties:
        additional_description:
          allOf:
            - $ref: '#/components/schemas/Descriptor'
          description: Any additional information regarding the nature of cancellation
        cancelled_by:
          type: string
        reason:
          allOf:
            - $ref: '#/components/schemas/Option'
          description: The reason for cancellation
        time:
          description: Date-time when the order was cancelled by the buyer
          format: date-time
          type: string
      type: object
    CancellationTerm:
      additionalProperties: false
      description: Describes the cancellation terms of an item or an order. This can be referenced at an item or order level. Item-level cancellation terms can override the terms at the order level.
      properties:
        cancel_by:
          allOf:
            - $ref: '#/components/schemas/Time'
          description: Information related to the time of cancellation.
        cancellation_fee:
          $ref: '#/components/schemas/Fee'
        external_ref:
          $ref: '#/components/schemas/MediaFile'
        fulfillment_state:
          allOf:
            - $ref: '#/components/schemas/FulfillmentState'
          description: The state of fulfillment during which this term is applicable.
        reason_required:
          description: Indicates whether a reason is required to cancel the order
          type: boolean
        xinput:
          $ref: '#/components/schemas/XInput'
      required:
        - cancellation_fee
      type: object
    Catalog:
      additionalProperties: false
      description: 'Describes the products or services offered by a BPP. This is typically sent as the response to a search intent from a BAP. The payment terms, offers and terms of fulfillment supported by the BPP can also be included here. The BPP can show hierarchical nature of products/services in its catalog using the parent_category_id in categories. The BPP can also send a ttl (time to live) in the context which is the duration for which a BAP can cache the catalog and use the cached catalog.  <br>This has properties like bbp/descriptor,bbp/categories,bbp/fulfillments,bbp/payments,bbp/offers,bbp/providers and exp<br>This is used in the following situations.<br><ul><li>This is typically used in the discovery stage when the BPP sends the details of the products and services it offers as response to a search intent from the BAP. </li></ul>'
      properties:
        descriptor:
          $ref: '#/components/schemas/Descriptor'
        exp:
          description: Timestamp after which catalog will expire
          format: date-time
          type: string
        fulfillments:
          description: Fulfillment modes offered at the BPP level. This is used when a BPP itself offers fulfillments on behalf of the providers it has onboarded.
          items:
            $ref: '#/components/schemas/Fulfillment'
          type: array
        offers:
          description: Offers at the BPP-level. This is common across all providers onboarded by the BPP.
          items:
            $ref: '#/components/schemas/Offer'
          type: array
        payments:
          description: Payment terms offered by the BPP for all transactions. This can be overriden at the provider level.
          items:
            $ref: '#/components/schemas/Payment'
          type: array
        providers:
          items:
            $ref: '#/components/schemas/Provider'
          type: array
        ttl:
          description: Duration in seconds after which this catalog will expire
          type: string
      type: object
    Category:
      additionalProperties: false
      description: A label under which a collection of items can be grouped.
      properties:
        descriptor:
          $ref: '#/components/schemas/Descriptor'
        id:
          description: ID of the category
          type: string
        parent_category_id:
          $ref: '#/components/schemas/Category/properties/id'
        tags:
          items:
            $ref: '#/components/schemas/TagGroup'
          type: array
        time:
          $ref: '#/components/schemas/Time'
        ttl:
          description: Time to live for an instance of this schema
      type: object
    Circle:
      additionalProperties: false
      description: Describes a circular region of a specified radius centered at a specified GPS coordinate.
      properties:
        gps:
          $ref: '#/components/schemas/Gps'
        radius:
          $ref: '#/components/schemas/Scalar'
      type: object
    City:
      additionalProperties: false
      description: Describes a city
      properties:
        code:
          description: City code
          type: string
        name:
          description: Name of the city
          type: string
      type: object
    Contact:
      additionalProperties: false
      properties:
        email:
          type: string
        jcard:
          description: A Jcard object as per draft-ietf-jcardcal-jcard-03 specification
          type: object
        phone:
          type: string
      type: object
    Context:
      additionalProperties: false
      description: 'Every API call in beckn protocol has a context. It provides a high-level overview to the receiver about the nature of the intended transaction. Typically, it is the BAP that sets the transaction context based on the consumer''s location and action on their UI. But sometimes, during unsolicited callbacks, the BPP also sets the transaction context but it is usually the same as the context of a previous full-cycle, request-callback interaction between the BAP and the BPP. The context object contains four types of fields. <ol><li>Demographic information about the transaction using fields like `domain`, `country`, and `region`.</li><li>Addressing details like the sending and receiving platform''s ID and API URL.</li><li>Interoperability information like the protocol version that implemented by the sender and,</li><li>Transaction details like the method being called at the receiver''s endpoint, the transaction_id that represents an end-to-end user session at the BAP, a message ID to pair requests with callbacks, a timestamp to capture sending times, a ttl to specifiy the validity of the request, and a key to encrypt information if necessary.</li></ol> This object must be passed in every interaction between a BAP and a BPP. In HTTP/S implementations, it is not necessary to send the context during the synchronous response. However, in asynchronous protocols, the context must be sent during all interactions,'
      properties:
        action:
          description: The Beckn protocol method being called by the sender and executed at the receiver.
          type: string
        bap_id:
          allOf:
            - description: 'A globally unique identifier of the platform, Typically it is the fully qualified domain name (FQDN) of the platform.'
              type: string
          description: Subscriber ID of the BAP
        bap_uri:
          allOf:
            - description: The callback URL of the Subscriber. This should necessarily contain the same domain name as set in `subscriber_id``.
              format: uri
              type: string
          description: Subscriber URL of the BAP for accepting callbacks from BPPs.
        bpp_id:
          allOf:
            - $ref: '#/components/schemas/Context/properties/bap_id/allOf/0'
          description: Subscriber ID of the BPP
        bpp_uri:
          allOf:
            - $ref: '#/components/schemas/Context/properties/bap_uri/allOf/0'
          description: Subscriber URL of the BPP for accepting calls from BAPs.
        domain:
          allOf:
            - $ref: '#/components/schemas/Domain/properties/code'
          description: Domain code that is relevant to this transaction context
        key:
          description: The encryption public key of the sender
          type: string
        location:
          allOf:
            - $ref: '#/components/schemas/Location'
          description: The location where the transaction is intended to be fulfilled.
          required:
            - country
            - city
        message_id:
          description: 'This is a unique value which persists during a request / callback cycle. Since beckn protocol APIs are asynchronous, BAPs need a common value to match an incoming callback from a BPP to an earlier call. This value can also be used to ignore duplicate messages coming from the BPP. It is recommended to generate a fresh message_id for every new interaction. When sending unsolicited callbacks, BPPs must generate a new message_id.'
          format: uuid
          type: string
        timestamp:
          description: Time of request generation in RFC3339 format
          format: date-time
          type: string
        transaction_id:
          description: 'This is a unique value which persists across all API calls from `search` through `confirm`. This is done to indicate an active user session across multiple requests. The BPPs can use this value to push personalized recommendations, and dynamic offerings related to an ongoing transaction despite being unaware of the user active on the BAP.'
          format: uuid
          type: string
        ttl:
          description: The duration in ISO8601 format after timestamp for which this message holds valid
          type: string
        version:
          description: Version of transaction protocol being used by the sender.
          type: string
      type: object
    Country:
      additionalProperties: false
      description: Describes a country.
      properties:
        code:
          description: Country code as per ISO 3166-1 and ISO 3166-2 format
          type: string
        name:
          description: Name of the country
          type: string
      type: object
    Credential:
      additionalProperties: false
      description: Describes a credential of an entity - Person or Organization
      properties:
        id:
          type: string
        type:
          default: VerifiableCredential
          type: string
        url:
          description: URL of the credential
          format: uri
          type: string
      type: object
    Customer:
      additionalProperties: false
      description: Describes a customer buying/availing a product or a service
      properties:
        contact:
          $ref: '#/components/schemas/Contact'
        person:
          $ref: '#/components/schemas/Person'
      type: object
    DecimalValue:
      description: Describes a decimal value
      pattern: '^[+-]?([0-9]*[.])?[0-9]+'
      type: string
    Descriptor:
      additionalProperties: false
      description: Physical description of something.
      properties:
        additional_desc:
          properties:
            content_type:
              enum:
                - text/plain
                - text/html
                - application/json
              type: string
            url:
              type: string
          type: object
        code:
          type: string
        images:
          items:
            $ref: '#/components/schemas/Image'
          type: array
        long_desc:
          type: string
        media:
          items:
            $ref: '#/components/schemas/MediaFile'
          type: array
        name:
          type: string
        short_desc:
          type: string
      type: object
    Domain:
      additionalProperties: false
      description: 'Described the industry sector or sub-sector. The network policy should contain codes for all the industry sectors supported by the network. Domains can be created in varying levels of granularity. The granularity of a domain can be decided by the participants of the network. Too broad domains will result in irrelevant search broadcast calls to BPPs that don''t have services supporting the domain. Too narrow domains will result in a large number of registry entries for each BPP. It is recommended that network facilitators actively collaborate with various working groups and network participants to carefully choose domain codes keeping in mind relevance, performance, and opportunity cost. It is recommended that networks choose broad domains like mobility, logistics, healthcare etc, and progressively granularize them as and when the number of network participants for each domain grows large.'
      properties:
        additional_info:
          allOf:
            - $ref: '#/components/schemas/MediaFile'
          description: A url that contains addtional information about that domain.
        code:
          description: 'Standard code representing the domain. The standard is usually published as part of the network policy. Furthermore, the network facilitator should also provide a mechanism to provide the supported domains of a network.'
          type: string
        name:
          description: Name of the domain
          type: string
      type: object
    Duration:
      description: Describes duration as per ISO8601 format
      type: string
    Error:
      additionalProperties: false
      description: 'Describes an error object that is returned by a BAP, BPP or BG as a response or callback to an action by another network participant. This object is sent when any request received by a network participant is unacceptable. This object can be sent either during Ack or with the callback.'
      properties:
        code:
          description: 'Standard error code. For full list of error codes, refer to docs/protocol-drafts/BECKN-005-ERROR-CODES-DRAFT-01.md of this repo"'
          type: string
        message:
          description: Human readable message describing the error. Used mainly for logging. Not recommended to be shown to the user.
          type: string
        paths:
          description: Path to json schema generating the error. Used only during json schema validation errors
          type: string
      type: object
    Fee:
      additionalProperties: false
      description: A fee applied on a particular entity
      properties:
        amount:
          allOf:
            - $ref: '#/components/schemas/Price'
          description: A fixed value
        percentage:
          allOf:
            - $ref: '#/components/schemas/DecimalValue'
          description: Percentage of a value
      type: object
    Form:
      additionalProperties: false
      description: Describes a form
      properties:
        data:
          additionalProperties:
            type: string
          description: The form submission data
          type: object
        mime_type:
          description: This field indicates the nature and format of the form received by querying the url. MIME types are defined and standardized in IETF's RFC 6838.
          enum:
            - text/html
            - application/xml
          type: string
        submission_id:
          format: uuid
          type: string
        url:
          description: 'The URL from where the form can be fetched. The content fetched from the url must be processed as per the mime_type specified in this object. Once fetched, the rendering platform can choosed to render the form as-is as an embeddable element; or process it further to blend with the theme of the application. In case the interface is non-visual, the the render can process the form data and reproduce it as per the standard specified in the form.'
          format: uri
          type: string
      type: object
    Fulfillment:
      additionalProperties: false
      description: Describes how a an order will be rendered/fulfilled to the end-customer
      properties:
        agent:
          allOf:
            - $ref: '#/components/schemas/Agent'
          description: The agent that is currently handling the fulfillment of the order
        contact:
          $ref: '#/components/schemas/Contact'
        customer:
          allOf:
            - $ref: '#/components/schemas/Customer'
          description: The person that will ultimately receive the order
        id:
          description: Unique reference ID to the fulfillment of an order
          type: string
        path:
          description: The physical path taken by the agent that can be rendered on a map. The allowed format of this property can be set by the network.
          type: string
        rateable:
          description: Whether the fulfillment can be rated or not
          type: boolean
        rating:
          allOf:
            - $ref: '#/components/schemas/Rating/properties/value'
          description: The rating value of the fulfullment service.
        state:
          allOf:
            - $ref: '#/components/schemas/FulfillmentState'
          description: The current state of fulfillment. The BPP must set this value whenever the state of the order fulfillment changes and fire an unsolicited `on_status` call.
        stops:
          description: The list of logical stops encountered during the fulfillment of an order.
          items:
            $ref: '#/components/schemas/Stop'
          type: array
        tags:
          items:
            $ref: '#/components/schemas/TagGroup'
          type: array
        tracking:
          default: false
          description: Indicates whether the fulfillment allows tracking
          type: boolean
        type:
          description: 'A code that describes the mode of fulfillment. This is typically set when there are multiple ways an order can be fulfilled. For example, a retail order can be fulfilled either via store pickup or a home delivery. Similarly, a medical consultation can be provided either in-person or via tele-consultation. The network policy must publish standard fulfillment type codes for the different modes of fulfillment.'
          type: string
        vehicle:
          $ref: '#/components/schemas/Vehicle'
      type: object
    FulfillmentState:
      additionalProperties: false
      description: Describes the state of fulfillment
      properties:
        descriptor:
          $ref: '#/components/schemas/Descriptor'
        updated_at:
          format: date-time
          type: string
        updated_by:
          description: ID of entity which changed the state
          type: string
      type: object
    Gps:
      description: Describes a gps coordinate
      pattern: '^[-+]?([1-8]?\d(\.\d{6,})?|90(\.0{6,})?),\s*[-+]?(180(\.0{6,})?|((1[0-7]\d)|([1-9]?\d))(\.\d{6,})?)$'
      type: string
    Image:
      additionalProperties: false
      description: Describes an image
      properties:
        height:
          description: Height of the image in pixels
          type: string
        size_type:
          description: The size of the image. The network policy can define the default dimensions of each type
          enum:
            - xs
            - sm
            - md
            - lg
            - xl
            - custom
          type: string
        url:
          description: URL to the image. This can be a data url or an remote url
          format: uri
          type: string
        width:
          description: Width of the image in pixels
          type: string
      required:
        - url
      type: object
    Intent:
      additionalProperties: false
      description: 'The intent to buy or avail a product or a service. The BAP can declare the intent of the consumer containing <ul><li>What they want (A product, service, offer)</li><li>Who they want (A seller, service provider, agent etc)</li><li>Where they want it and where they want it from</li><li>When they want it (start and end time of fulfillment</li><li>How they want to pay for it</li></ul><br>This has properties like descriptor,provider,fulfillment,payment,category,offer,item,tags<br>This is typically used by the BAP to send the purpose of the user''s search to the BPP. This will be used by the BPP to find products or services it offers that may match the user''s intent.<br>For example, in Mobility, the mobility consumer declares a mobility intent. In this case, the mobility consumer declares information that describes various aspects of their journey like,<ul><li>Where would they like to begin their journey (intent.fulfillment.start.location)</li><li>Where would they like to end their journey (intent.fulfillment.end.location)</li><li>When would they like to begin their journey (intent.fulfillment.start.time)</li><li>When would they like to end their journey (intent.fulfillment.end.time)</li><li>Who is the transport service provider they would like to avail services from (intent.provider)</li><li>Who is traveling (This is not recommended in public networks) (intent.fulfillment.customer)</li><li>What kind of fare product would they like to purchase (intent.item)</li><li>What add-on services would they like to avail</li><li>What offers would they like to apply on their booking (intent.offer)</li><li>What category of services would they like to avail (intent.category)</li><li>What additional luggage are they carrying</li><li>How would they like to pay for their journey (intent.payment)</li></ul><br>For example, in health domain, a consumer declares the intent for a lab booking the describes various aspects of their booking like,<ul><li>Where would they like to get their scan/test done (intent.fulfillment.start.location)</li><li>When would they like to get their scan/test done (intent.fulfillment.start.time)</li><li>When would they like to get the results of their test/scan (intent.fulfillment.end.time)</li><li>Who is the service provider they would like to avail services from (intent.provider)</li><li>Who is getting the test/scan (intent.fulfillment.customer)</li><li>What kind of test/scan would they like to purchase (intent.item)</li><li>What category of services would they like to avail (intent.category)</li><li>How would they like to pay for their journey (intent.payment)</li></ul>'
      properties:
        category:
          allOf:
            - $ref: '#/components/schemas/Category'
          description: Details on the item category
        descriptor:
          allOf:
            - $ref: '#/components/schemas/Descriptor'
          description: 'A raw description of the search intent. Free text search strings, raw audio, etc can be sent in this object.'
        fulfillment:
          allOf:
            - $ref: '#/components/schemas/Fulfillment'
          description: Details on how the customer wants their order fulfilled
        item:
          allOf:
            - $ref: '#/components/schemas/Item'
          description: Details of the item that the consumer wants to order
        offer:
          allOf:
            - $ref: '#/components/schemas/Offer'
          description: details on the offer the customer wants to avail
        payment:
          allOf:
            - $ref: '#/components/schemas/Payment'
          description: Details on how the customer wants to pay for the order
        provider:
          allOf:
            - $ref: '#/components/schemas/Provider'
          description: The provider from which the customer wants to place to the order from
        tags:
          items:
            $ref: '#/components/schemas/TagGroup'
          type: array
      type: object
    Item:
      additionalProperties: false
      description: 'Describes a product or a service offered to the end consumer by the provider. In the mobility sector, it can represent a fare product like one way journey. In the logistics sector, it can represent the delivery service offering. In the retail domain it can represent a product like a grocery item.'
      properties:
        add_ons:
          items:
            $ref: '#/components/schemas/AddOn'
          type: array
        cancellation_terms:
          description: Cancellation terms of this item
          items:
            $ref: '#/components/schemas/CancellationTerm'
          type: array
        category_ids:
          description: Categories this item can be listed under
          items:
            allOf:
              - $ref: '#/components/schemas/Category/properties/id'
          type: array
        creator:
          allOf:
            - $ref: '#/components/schemas/Organization'
          description: The creator of this item
        descriptor:
          allOf:
            - $ref: '#/components/schemas/Descriptor'
          description: Physical description of the item
        fulfillment_ids:
          description: Modes through which this item can be fulfilled
          items:
            allOf:
              - $ref: '#/components/schemas/Fulfillment/properties/id'
          type: array
        id:
          description: ID of the item.
          type: string
        location_ids:
          description: Provider Locations this item is available in
          items:
            allOf:
              - $ref: '#/components/schemas/Location/properties/id'
          type: array
        matched:
          description: Whether this item is an exact match of the request
          type: boolean
        parent_item_id:
          allOf:
            - $ref: '#/components/schemas/Item/properties/id'
          description: 'ID of the item, this item is a variant of'
        parent_item_quantity:
          allOf:
            - $ref: '#/components/schemas/ItemQuantity'
          description: The number of units of the parent item this item is a multiple of
        payment_ids:
          description: Payment modalities through which this item can be ordered
          items:
            allOf:
              - $ref: '#/components/schemas/Payment/properties/id'
          type: array
        price:
          allOf:
            - $ref: '#/components/schemas/Price'
          description: 'The price of this item, if it has intrinsic value'
        quantity:
          allOf:
            - $ref: '#/components/schemas/ItemQuantity'
          description: The selling quantity of the item
        rateable:
          description: Whether this item can be rated
          type: boolean
        rating:
          allOf:
            - $ref: '#/components/schemas/Rating/properties/value'
          description: The rating of the item
        recommended:
          description: Whether this item is a recommended item to a response
          type: boolean
        refund_terms:
          description: Refund terms of this item
          items:
            description: Refund term of an item or an order
            properties:
              fulfillment_state:
                allOf:
                  - $ref: '#/components/schemas/State'
                description: The state of fulfillment during which this term is applicable.
              refund_amount:
                $ref: '#/components/schemas/Price'
              refund_eligible:
                description: Indicates if cancellation will result in a refund
                type: boolean
              refund_within:
                allOf:
                  - $ref: '#/components/schemas/Time'
                description: Time within which refund will be processed after successful cancellation.
            type: object
          type: array
        related:
          description: Whether this item is a related item to the exactly matched item
          type: boolean
        replacement_terms:
          description: Terms that are applicable be met when this item is replaced
          items:
            $ref: '#/components/schemas/ReplacementTerm'
          type: array
        return_terms:
          description: Terms that are applicable when this item is returned
          items:
            $ref: '#/components/schemas/ReturnTerm'
          type: array
        tags:
          items:
            $ref: '#/components/schemas/TagGroup'
          type: array
        time:
          allOf:
            - $ref: '#/components/schemas/Time'
          description: Temporal attributes of this item. This property is used when the item exists on the catalog only for a limited period of time.
        ttl:
          description: Time to live in seconds for an instance of this schema
          type: string
        xinput:
          allOf:
            - $ref: '#/components/schemas/XInput'
          description: Additional input required from the customer to purchase / avail this item
      type: object
    ItemQuantity:
      additionalProperties: false
      description: Describes the count or amount of an item
      properties:
        allocated:
          description: This represents the exact quantity allocated for purchase of the item.
          properties:
            count:
              minimum: 0
              type: integer
            measure:
              $ref: '#/components/schemas/Scalar'
          type: object
        available:
          description: This represents the exact quantity available for purchase of the item. The buyer can only purchase multiples of this
          properties:
            count:
              minimum: 0
              type: integer
            measure:
              $ref: '#/components/schemas/Scalar'
          type: object
        maximum:
          description: This represents the maximum quantity allowed for purchase of the item
          properties:
            count:
              minimum: 1
              type: integer
            measure:
              $ref: '#/components/schemas/Scalar'
          type: object
        minimum:
          description: This represents the minimum quantity allowed for purchase of the item
          properties:
            count:
              minimum: 0
              type: integer
            measure:
              $ref: '#/components/schemas/Scalar'
          type: object
        selected:
          description: This represents the quantity selected for purchase of the item
          properties:
            count:
              minimum: 0
              type: integer
            measure:
              $ref: '#/components/schemas/Scalar'
          type: object
        unitized:
          description: This represents the quantity available in a single unit of the item
          properties:
            count:
              maximum: 1
              minimum: 1
              type: integer
            measure:
              $ref: '#/components/schemas/Scalar'
          type: object
      type: object
    Location:
      additionalProperties: false
      description: The physical location of something
      properties:
        3dspace:
          description: The three dimensional region describing this location
          type: string
        address:
          allOf:
            - $ref: '#/components/schemas/Address'
          description: The address of this location.
        area_code:
          type: string
        circle:
          $ref: '#/components/schemas/Circle'
        city:
          allOf:
            - $ref: '#/components/schemas/City'
          description: 'The city this location is, or is located within'
        country:
          allOf:
            - $ref: '#/components/schemas/Country'
          description: 'The country this location is, or is located within'
        descriptor:
          $ref: '#/components/schemas/Descriptor'
        district:
          description: 'The state this location is, or is located within'
          type: string
        gps:
          allOf:
            - $ref: '#/components/schemas/Gps'
          description: The GPS co-ordinates of this location.
        id:
          type: string
        map_url:
          description: The url to the map of the location. This can be a globally recognized map url or the one specified by the network policy.
          format: uri
          type: string
        polygon:
          description: The boundary polygon of this location
          type: string
        rating:
          allOf:
            - $ref: '#/components/schemas/Rating/properties/value'
          description: The rating of this location
        state:
          allOf:
            - $ref: '#/components/schemas/State'
          description: 'The state this location is, or is located within'
      type: object
    MediaFile:
      additionalProperties: false
      description: This object contains a url to a media file.
      properties:
        dsa:
          description: The signing algorithm used by the sender
          type: string
        mimetype:
          description: 'indicates the nature and format of the document, file, or assortment of bytes. MIME types are defined and standardized in IETF''s RFC 6838'
          type: string
        signature:
          description: The digital signature of the file signed by the sender
          type: string
        url:
          description: The URL of the file
          format: uri
          type: string
      type: object
    Offer:
      additionalProperties: false
      description: An offer associated with a catalog. This is typically used to promote a particular product and enable more purchases.
      properties:
        category_ids:
          items:
            $ref: '#/components/schemas/Category/properties/id'
          type: array
        descriptor:
          $ref: '#/components/schemas/Descriptor'
        id:
          type: string
        item_ids:
          items:
            $ref: '#/components/schemas/Item/properties/id'
          type: array
        location_ids:
          items:
            $ref: '#/components/schemas/Location/properties/id'
          type: array
        tags:
          items:
            $ref: '#/components/schemas/TagGroup'
          type: array
        time:
          $ref: '#/components/schemas/Time'
      type: object
    Option:
      additionalProperties: false
      description: Describes a selectable option
      properties:
        descriptor:
          $ref: '#/components/schemas/Descriptor'
        id:
          type: string
      type: object
    Order:
      additionalProperties: false
      description: Describes a legal purchase order. It contains the complete details of the legal contract created between the buyer and the seller.
      properties:
        add_ons:
          description: The add-ons purchased / availed in this order
          items:
            $ref: '#/components/schemas/AddOn'
          type: array
        billing:
          allOf:
            - $ref: '#/components/schemas/Billing'
          description: The billing details of this order
        cancellation:
          allOf:
            - $ref: '#/components/schemas/Cancellation'
          description: The cancellation details of this order
        cancellation_terms:
          description: Cancellation terms of this item
          items:
            $ref: '#/components/schemas/CancellationTerm'
          type: array
        created_at:
          description: The date-time of creation of this order
          format: date-time
          type: string
        fulfillments:
          description: The fulfillments involved in completing this order
          items:
            $ref: '#/components/schemas/Fulfillment'
          type: array
        id:
          description: Human-readable ID of the order. This is generated at the BPP layer. The BPP can either generate order id within its system or forward the order ID created at the provider level.
          type: string
        items:
          description: The items purchased / availed in this order
          items:
            $ref: '#/components/schemas/Item'
          type: array
        offers:
          description: The offers applied in this order
          items:
            $ref: '#/components/schemas/Offer'
          type: array
        payments:
          description: The terms of settlement for this order
          items:
            $ref: '#/components/schemas/Payment'
          type: array
        provider:
          allOf:
            - $ref: '#/components/schemas/Provider'
          description: Details of the provider whose catalog items have been selected.
        quote:
          allOf:
            - $ref: '#/components/schemas/Quotation'
          description: The mutually agreed upon quotation for this order.
        ref_order_ids:
          description: A list of order IDs to link this order to previous orders.
          items:
            description: ID of a previous order
            type: string
          type: array
        refund_terms:
          description: Refund terms of this item
          items:
            $ref: '#/components/schemas/Item/properties/refund_terms/items'
          type: array
        replacement_terms:
          description: Replacement terms of this item
          items:
            $ref: '#/components/schemas/ReplacementTerm'
          type: array
        return_terms:
          description: Return terms of this item
          items:
            $ref: '#/components/schemas/ReturnTerm'
          type: array
        status:
          description: Status of the order. Allowed values can be defined by the network policy
          type: string
        tags:
          items:
            $ref: '#/components/schemas/TagGroup'
          type: array
        type:
          default: DEFAULT
          description: 'This is used to indicate the type of order being created to BPPs. Sometimes orders can be linked to previous orders, like a replacement order in a retail domain. A follow-up consultation in healthcare domain. A single order part of a subscription order. The list of order types can be standardized at the network level.'
          enum:
            - DRAFT
            - DEFAULT
          type: string
        updated_at:
          description: The date-time of updated of this order
          format: date-time
          type: string
        xinput:
          allOf:
            - $ref: '#/components/schemas/XInput'
          description: Additional input required from the customer to confirm this order
      type: object
    Organization:
      additionalProperties: false
      description: An organization. Usually a recognized business entity.
      properties:
        address:
          allOf:
            - $ref: '#/components/schemas/Address'
          description: The postal address of the organization
        city:
          allOf:
            - $ref: '#/components/schemas/City'
          description: The city where the the organization's address is registered
        contact:
          $ref: '#/components/schemas/Contact'
        descriptor:
          $ref: '#/components/schemas/Descriptor'
        state:
          allOf:
            - $ref: '#/components/schemas/State'
          description: The state where the organization's address is registered
      type: object
    Payment:
      additionalProperties: false
      description: 'Describes the terms of settlement between the BAP and the BPP for a single transaction. When instantiated, this object contains <ol><li>the amount that has to be settled,</li><li>The payment destination destination details</li><li>When the settlement should happen, and</li><li>A transaction reference ID</li></ol>. During a transaction, the BPP reserves the right to decide the terms of payment. However, the BAP can send its terms to the BPP first. If the BPP does not agree to those terms, it must overwrite the terms and return them to the BAP. If overridden, the BAP must either agree to the terms sent by the BPP in order to preserve the provider''s autonomy, or abort the transaction. In case of such disagreements, the BAP and the BPP can perform offline negotiations on the payment terms. Once an agreement is reached, the BAP and BPP can resume transactions.'
      properties:
        collected_by:
          description: 'This field indicates who is the collector of payment. The BAP can set this value to ''bap'' if it wants to collect the payment first and  settle it to the BPP. If the BPP agrees to those terms, the BPP should not send the payment url. Alternatively, the BPP can set this field with the value ''bpp'' if it wants the payment to be made directly.'
          type: string
        id:
          description: ID of the payment term that can be referred at an item or an order level in a catalog
          type: string
        params:
          properties:
            amount:
              type: string
            bank_account_number:
              type: string
            bank_code:
              type: string
            currency:
              type: string
            source_bank_account_number:
              type: string
            source_bank_code:
              type: string
            source_virtual_payment_address:
              type: string
            transaction_id:
              description: The reference transaction ID associated with a payment activity
              type: string
            virtual_payment_address:
              type: string
          type: object
        status:
          type: string
        tags:
          items:
            $ref: '#/components/schemas/TagGroup'
          type: array
        time:
          $ref: '#/components/schemas/Time'
        type:
          type: string
        url:
          description: 'A payment url to be called by the BAP. If empty, then the payment is to be done offline. The details of payment should be present in the params object. If tl_method = http/get, then the payment details will be sent as url params. Two url param values, ```$transaction_id``` and ```$amount``` are mandatory.'
          format: uri
          type: string
      type: object
    Person:
      additionalProperties: false
      description: Describes a person as any individual
      properties:
        age:
          allOf:
            - $ref: '#/components/schemas/Duration'
          description: Age of the person
        creds:
          items:
            $ref: '#/components/schemas/Credential'
          type: array
        dob:
          description: Date of birth of the person
          format: date
          type: string
        gender:
          description: 'Gender of something, typically a Person, but possibly also fictional characters, animals, etc. While Male and Female may be used, text strings are also acceptable for people who do not identify as a binary gender.Allowed values for this field can be published in the network policy'
          type: string
        id:
          description: Describes the identity of the person
          type: string
        image:
          $ref: '#/components/schemas/Image'
        languages:
          items:
            description: Describes a language known to the person.
            properties:
              code:
                type: string
              name:
                type: string
            type: object
          type: array
        name:
          description: the name of the person
          type: string
        skills:
          items:
            description: Describes a skill of the person.
            properties:
              code:
                type: string
              name:
                type: string
            type: object
          type: array
        tags:
          items:
            $ref: '#/components/schemas/TagGroup'
          type: array
        url:
          description: Profile url of the person
          format: uri
          type: string
      type: object
    Price:
      additionalProperties: false
      description: Describes the price of an item. Allows for domain extension.
      properties:
        computed_value:
          $ref: '#/components/schemas/DecimalValue'
        currency:
          type: string
        estimated_value:
          $ref: '#/components/schemas/DecimalValue'
        listed_value:
          $ref: '#/components/schemas/DecimalValue'
        maximum_value:
          $ref: '#/components/schemas/DecimalValue'
        minimum_value:
          $ref: '#/components/schemas/DecimalValue'
        offered_value:
          $ref: '#/components/schemas/DecimalValue'
        value:
          $ref: '#/components/schemas/DecimalValue'
      type: object
    Provider:
      additionalProperties: false
      description: Describes the catalog of a business.
      properties:
        categories:
          items:
            $ref: '#/components/schemas/Category'
          type: array
        category_id:
          description: Category Id of the provider at the BPP-level catalog
          type: string
        descriptor:
          $ref: '#/components/schemas/Descriptor'
        exp:
          description: Time after which catalog has to be refreshed
          format: date-time
          type: string
        fulfillments:
          items:
            $ref: '#/components/schemas/Fulfillment'
          type: array
        id:
          description: Id of the provider
          type: string
        items:
          items:
            $ref: '#/components/schemas/Item'
          type: array
        locations:
          items:
            $ref: '#/components/schemas/Location'
          type: array
        offers:
          items:
            $ref: '#/components/schemas/Offer'
          type: array
        payments:
          items:
            $ref: '#/components/schemas/Payment'
          type: array
        rateable:
          description: Whether this provider can be rated or not
          type: boolean
        rating:
          $ref: '#/components/schemas/Rating/properties/value'
        tags:
          items:
            $ref: '#/components/schemas/TagGroup'
          type: array
        time:
          $ref: '#/components/schemas/Time'
        ttl:
          description: 'The time-to-live in seconds, for this object. This can be overriden at deeper levels. A value of -1 indicates that this object is not cacheable.'
          minimum: -1
          type: integer
      type: object
    Quotation:
      additionalProperties: false
      description: 'Describes a quote. It is the estimated price of products or services from the BPP.<br>This has properties like price, breakup, ttl'
      properties:
        breakup:
          description: the breakup of the total quoted price
          items:
            properties:
              item:
                $ref: '#/components/schemas/Item'
              price:
                $ref: '#/components/schemas/Price'
              title:
                type: string
            type: object
          type: array
        id:
          description: ID of the quote.
          format: uuid
          type: string
        price:
          allOf:
            - $ref: '#/components/schemas/Price'
          description: The total quoted price
        ttl:
          $ref: '#/components/schemas/Duration'
      type: object
    Rating:
      additionalProperties: false
      description: Describes the rating of an entity
      properties:
        id:
          description: Id of the object being rated
          type: string
        rating_category:
          description: Category of the entity being rated
          type: string
        value:
          description: 'Rating value given to the object. This can be a single value or can also contain an inequality operator like gt, gte, lt, lte. This can also contain an inequality expression containing logical operators like && and ||.'
          type: string
      type: object
    Region:
      additionalProperties: false
      description: Describes an arbitrary region of space. The network policy should contain a published list of supported regions by the network.
      properties:
        boundary:
          description: 'A string representing the boundary of the region. One-dimensional regions are represented by polylines. Two-dimensional regions are represented by polygons, and three-dimensional regions can represented by polyhedra.'
          type: string
        code:
          description: A standard code representing the region. This should be interpreted in the same way by all network participants.
          type: string
        dimensions:
          description: 'The number of dimensions that are used to describe any point inside that region. The most common dimensionality of a region is 2, that represents an area on a map. There are regions on the map that can be approximated to one-dimensional regions like roads, railway lines, or shipping lines. 3 dimensional regions are rarer, but are gaining popularity as flying drones are being adopted for various fulfillment services.'
          enum:
            - '1'
            - '2'
            - '3'
          type: string
        map_url:
          description: The url to the map of the region. This can be a globally recognized map or the one specified by the network policy.
          type: string
        name:
          description: Name of the region as specified on the map where that region exists.
          type: string
        type:
          description: 'The type of region. This is used to specify the granularity of the region represented by this object. Various examples of two-dimensional region types are city, country, state, district, and so on. The network policy should contain a list of all possible region types supported by the network.'
          type: string
      type: object
    ReplacementTerm:
      additionalProperties: false
      description: The replacement policy of an item or an order
      properties:
        external_ref:
          $ref: '#/components/schemas/MediaFile'
        fulfillment_state:
          allOf:
            - $ref: '#/components/schemas/State'
          description: The state of fulfillment during which this term is applicable.
        replace_within:
          allOf:
            - $ref: '#/components/schemas/Time'
          description: 'Applicable only for buyer managed returns where the buyer has to replace the item before a certain date-time, failing which they will not be eligible for replacement'
      type: object
    ReturnTerm:
      additionalProperties: false
      description: Describes the return policy of an item or an order
      properties:
        fulfillment_managed_by:
          description: The entity that will perform the return
          type: string
        fulfillment_state:
          allOf:
            - $ref: '#/components/schemas/State'
          description: The state of fulfillment during which this term IETF''s applicable.
        return_eligible:
          description: Indicates whether the item is eligible for return
          type: boolean
        return_location:
          allOf:
            - $ref: '#/components/schemas/Location'
          description: The location where the item or order must / will be returned to
        return_time:
          allOf:
            - $ref: '#/components/schemas/Time'
          description: 'Applicable only for buyer managed returns where the buyer has to return the item to the origin before a certain date-time, failing which they will not be eligible for refund.'
      type: object
    Scalar:
      additionalProperties: false
      description: Describes a scalar
      properties:
        computed_value:
          $ref: '#/components/schemas/DecimalValue'
        estimated_value:
          $ref: '#/components/schemas/DecimalValue'
        range:
          properties:
            max:
              $ref: '#/components/schemas/DecimalValue'
            min:
              $ref: '#/components/schemas/DecimalValue'
          type: object
        type:
          enum:
            - CONSTANT
            - VARIABLE
          type: string
        unit:
          type: string
        value:
          $ref: '#/components/schemas/DecimalValue'
      type: object
    Schedule:
      additionalProperties: false
      description: Describes a schedule
      properties:
        frequency:
          $ref: '#/components/schemas/Duration'
        holidays:
          items:
            format: date-time
            type: string
          type: array
        times:
          items:
            format: date-time
            type: string
          type: array
      type: object
    State:
      additionalProperties: false
      description: A bounded geopolitical region of governance inside a country.
      properties:
        code:
          description: State code as per country or international standards
          type: string
        name:
          description: Name of the state
          type: string
      type: object
    Stop:
      additionalProperties: false
      description: A logical point in space and time during the fulfillment of an order.
      properties:
        authorization:
          $ref: '#/components/schemas/Authorization'
        contact:
          allOf:
            - $ref: '#/components/schemas/Contact'
          description: Contact details of the stop
        id:
          type: string
        instructions:
          allOf:
            - $ref: '#/components/schemas/Descriptor'
          description: Instructions that need to be followed at the stop
        location:
          allOf:
            - $ref: '#/components/schemas/Location'
          description: Location of the stop
        parent_stop_id:
          type: string
        person:
          allOf:
            - $ref: '#/components/schemas/Person'
          description: The details of the person present at the stop
        time:
          allOf:
            - $ref: '#/components/schemas/Time'
          description: Timings applicable at the stop.
        type:
          description: The type of stop. Allowed values of this property can be defined by the network policy.
          enum:
            - START
            - END
          type: string
      type: object
    Support:
      additionalProperties: false
      description: Details of customer support
      properties:
        callback_phone:
          pattern: '^\+?[1-9]\d{1,14}$'
          type: string
        email:
          format: email
          type: string
        phone:
          pattern: '^\+?[1-9]\d{1,14}$'
          type: string
        ref_id:
          type: string
        url:
          format: uri
          type: string
      type: object
    Tag:
      additionalProperties: false
      description: 'Describes a tag. This is used to contain extended metadata. This object can be added as a property to any schema to describe extended attributes. For BAPs, tags can be sent during search to optimize and filter search results. BPPs can use tags to index their catalog to allow better search functionality. Tags are sent by the BPP as part of the catalog response in the `on_search` callback. Tags are also meant for display purposes. Upon receiving a tag, BAPs are meant to render them as name-value pairs. This is particularly useful when rendering tabular information about a product or service.'
      properties:
        descriptor:
          allOf:
            - $ref: '#/components/schemas/Descriptor'
          description: 'Description of the Tag, can be used to store detailed information.'
        display:
          description: 'This value indicates if the tag is intended for display purposes. If set to `true`, then this tag must be displayed. If it is set to `false`, it should not be displayed. This value can override the group display value.'
          type: boolean
        value:
          description: The value of the tag. This set by the BPP and rendered as-is by the BAP.
          type: string
      type: object
    TagGroup:
      additionalProperties: false
      description: 'A collection of tag objects with group level attributes. For detailed documentation on the Tags and Tag Groups schema go to https://github.com/beckn/protocol-specifications/discussions/316'
      properties:
        descriptor:
          allOf:
            - $ref: '#/components/schemas/Descriptor'
          description: 'Description of the TagGroup, can be used to store detailed information.'
        display:
          default: true
          description: 'Indicates the display properties of the tag group. If display is set to false, then the group will not be displayed. If it is set to true, it should be displayed. However, group-level display properties can be overriden by individual tag-level display property. As this schema is purely for catalog display purposes, it is not recommended to send this value during search.'
          type: boolean
        list:
          description: 'An array of Tag objects listed under this group. This property can be set by BAPs during search to narrow the `search` and achieve more relevant results. When received during `on_search`, BAPs must render this list under the heading described by the `name` property of this schema.'
          items:
            $ref: '#/components/schemas/Tag'
          type: array
      type: object
    Time:
      additionalProperties: false
      description: Describes time in its various forms. It can be a single point in time; duration; or a structured timetable of operations
      properties:
        days:
          description: comma separated values representing days of the week
          type: string
        duration:
          $ref: '#/components/schemas/Duration'
        label:
          type: string
        range:
          properties:
            end:
              format: date-time
              type: string
            start:
              format: date-time
              type: string
          type: object
        schedule:
          $ref: '#/components/schemas/Schedule'
        timestamp:
          format: date-time
          type: string
      type: object
    Tracking:
      additionalProperties: false
      description: Contains tracking information that can be used by the BAP to track the fulfillment of an order in real-time. which is useful for knowing the location of time sensitive deliveries.
      properties:
        id:
          description: A unique tracking reference number
          type: string
        location:
          allOf:
            - $ref: '#/components/schemas/Location'
          description: 'In case there is no real-time tracking endpoint available, this field will contain the latest location of the entity being tracked. The BPP will update this value everytime the BAP calls the track API.'
        status:
          description: 'This value indicates if the tracking is currently active or not. If this value is `active`, then the BAP can begin tracking the order. If this value is `inactive`, the tracking URL is considered to be expired and the BAP should stop tracking the order.'
          enum:
            - ACTIVE
            - INACTIVE
          type: string
        url:
          description: 'A URL to the tracking endpoint. This can be a link to a tracking webpage, a webhook URL created by the BAP where BPP can push the tracking data, or a GET url creaed by the BPP which the BAP can poll to get the tracking data. It can also be a websocket URL where the BPP can push real-time tracking data.'
          format: uri
          type: string
      type: object
    Vehicle:
      additionalProperties: false
      description: 'Describes a vehicle is a device that is designed or used to transport people or cargo over land, water, air, or through space.<br>This has properties like category, capacity, make, model, size,variant,color,energy_type,registration'
      properties:
        capacity:
          type: integer
        cargo_volumne:
          type: string
        category:
          type: string
        code:
          type: string
        color:
          type: string
        emission_standard:
          type: string
        energy_type:
          type: string
        make:
          type: string
        model:
          type: string
        registration:
          type: string
        size:
          type: string
        variant:
          type: string
        wheelchair_access:
          type: string
        wheels_count:
          type: string
      type: object
    XInput:
      additionalProperties: false
      description: 'Contains any additional or extended inputs required to confirm an order. This is typically a Form Input. Sometimes, selection of catalog elements is not enough for the BPP to confirm an order. For example, to confirm a flight ticket, the airline requires details of the passengers along with information on baggage, identity, in addition to the class of ticket. Similarly, a logistics company may require details on the nature of shipment in order to confirm the shipping. A recruiting firm may require additional details on the applicant in order to confirm a job application. For all such purposes, the BPP can choose to send this object attached to any object in the catalog that is required to be sent while placing the order. This object can typically be sent at an item level or at the order level. The item level XInput will override the Order level XInput as it indicates a special requirement of information for that particular item. Hence the BAP must render a separate form for the Item and another form at the Order level before confirmation.'
      properties:
        form:
          $ref: '#/components/schemas/Form'
        required:
          description: Indicates whether the form data is mandatorily required by the BPP to confirm the order.
          type: boolean
      type: object