{
  "$id": "https://schema.nfh.global/Fulfillment/v2.0",
  "x-iri": "https://schema.nfh.global/Fulfillment/v2.0",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "Schema definition for Fulfillment in the Beckn Protocol",
  "title": "Fulfillment",
  "type": "object",
  "properties": {
    "@context": {
      "type": "string",
      "format": "uri",
      "example": "https://raw.githubusercontent.com/beckn/protocol-specifications-new/refs/heads/main/schema/core/v2/context.jsonld"
    },
    "@type": {
      "type": "string",
      "enum": [
        "beckn:Fulfillment"
      ],
      "x-jsonld": {
        "@id": "schema:Thing"
      }
    },
    "beckn:id": {
      "type": "string",
      "description": "Fulfillment identifier",
      "x-jsonld": {
        "@id": "schema:identifier"
      }
    },
    "beckn:fulfillmentStatus": {
      "type": "string",
      "description": "Fulfillment status code (e.g., OutForDelivery, ReadyForPickup, Confirmed)",
      "x-jsonld": {
        "@id": "beckn:fulfillmentStatus"
      }
    },
    "beckn:mode": {
      "type": "string",
      "enum": [
        "DELIVERY",
        "PICKUP",
        "RESERVATION",
        "DIGITAL"
      ],
      "description": "DELIVERY    → last-mile / parcel logistics PICKUP      → customer collects from a place RESERVATION → entitlement/booking is fulfilled (tickets, seats, appointments) DIGITAL     → digital good / license access ",
      "x-jsonld": {
        "@id": "beckn:mode"
      }
    },
    "trackingAction": {
      "$ref": "https://schema.nfh.global/TrackAction/v2.1/schema.json",
      "description": "Tracking entrypoint for this fulfillment, modeled as schema.org TrackAction. Use target.url for a clickable tracking URL; may also include deliveryMethod. ",
      "x-jsonld": {
        "@type": "schema:TrackAction"
      }
    },
    "beckn:deliveryAttributes": {
      "$ref": "https://schema.nfh.global/Attributes/v2.0/schema.json",
      "description": "Bundle of attributes for the chosen mode:  # DELIVERY: endpoints, slot windows, route & events → map to schema:ParcelDelivery / schema:DeliveryEvent # PICKUP: pickupPlace, counter codes, time windows → map to schema:Place + schema:openingHoursSpecification # RESERVATION: reservationStatus, reservedTicket → map to schema:Reservation # DIGITAL: contentUrl/license/expiry → map to schema:DataDownload/schema:MediaObject "
    }
  },
  "required": [
    "@context",
    "@type",
    "beckn:mode"
  ],
  "additionalProperties": false
}
