openapi: 3.1.1
info:
  title: CancellationPolicy
  version: 2.0.0
  description: Schema for CancellationPolicy in Beckn Logistics domain.
  license:
    name: CC-BY-NC-SA 4.0 International
  contact:
    name: Beckn Labs
    url: https://beckn.io
components:
  schemas:
    LogisticsCancellationPolicy:
      x-iri: https://schema.nfh.global/LogisticsCancellationPolicy/v2.0
      type: object
      title: CancellationPolicy
      description: Defines terms under which a shipment booking can be cancelled.
      properties:
        id:
          type: string
          example: CP-EXPRESS-001
        cancellableUntil:
          type: string
          description: Cancellation allowed until this lifecycle stage
          enum:
          - BEFORE_PICKUP
          - BEFORE_DISPATCH
          - ANYTIME
          - NON_CANCELLABLE
          example: BEFORE_PICKUP
        cancellationFee:
          type: object
          properties:
            type:
              type: string
              enum:
              - FLAT
              - PERCENTAGE
              - NIL
              example: FLAT
            value:
              type: number
              example: 50
            currency:
              type: string
              example: INR
        refundPolicy:
          type: object
          properties:
            refundable:
              type: boolean
              example: true
            refundPercentage:
              type: number
              example: 100
            processingDays:
              type: integer
              example: 5
        conditions:
          type: array
          items:
            type: string
          example:
          - Full refund if cancelled before pickup
          - 50% refund if cancelled after pickup
        applicableServiceTypes:
          type: array
          items:
            type: string
          example:
          - EXPRESS
          - COURIER
