openapi: 3.1.1
info:
  title: Fare
  version: 2.0.0
  description: Schema for Fare in Beckn Logistics domain.
  license:
    name: CC-BY-NC-SA 4.0 International
  contact:
    name: Beckn Labs
    url: https://beckn.io
components:
  schemas:
    ShippingFare:
      x-iri: https://schema.nfh.global/ShippingFare/v2.0
      type: object
      title: Fare
      description: Total cost charged for a logistics service including base freight, surcharges, taxes.
      required:
      - currency
      - totalAmount
      properties:
        currency:
          type: string
          example: INR
        baseFreight:
          type: number
          description: Base freight charge
          example: 450
        fuelSurcharge:
          type: number
          example: 45
        odaSurcharge:
          type: number
          description: Out of Delivery Area surcharge
          example: 0
        codCharge:
          type: number
          description: Cash on delivery charge
          example: 30
        insuranceCharge:
          type: number
          example: 25
        gst:
          type: number
          description: GST amount
          example: 81
        otherCharges:
          type: number
          example: 0
        discount:
          type: number
          example: 50
        totalAmount:
          type: number
          description: Final total payable
          example: 581
        breakup:
          type: array
          description: Detailed fare breakup line items
          items:
            $ref: https://schema.nfh.global/FareBreakup/v2.0/attributes.yaml#/components/schemas/FareBreakup
        estimatedFare:
          type: boolean
          description: Whether this is an estimate or confirmed fare
          example: false
        paymentMode:
          type: string
          enum:
          - PREPAID
          - COD
          - TO_PAY
          - CREDIT
          example: PREPAID
