{
  "$id": "https://schema.nfh.global/Contract/v2.0",
  "x-iri": "https://schema.nfh.global/Contract/v2.0",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "description": "This is a JSON-LD compliant, linked-data schema that specifies a generic multi-party, digitally signed Contract between a set of participants. based on the vocabulary defined in the @context. By default, it is the most generic form of contract i.e beckn:Contract. However, based on the mapping being used in @context, it could take values like retail:Order, mobility:Reservation, healthcare:Appointment, and so on, which will be defined as sub-classes of beckn:Contract. Alternate description A digitally agreed commitment between two or more participants governing the exchange of economic or non-economic value.  Contract is the canonical contract object in the generalized Beckn v2.1 protocol. It replaces the commerce-specific Order construct as the canonical transaction object at the API layer.  A Contract binds:  - Commitments (what is agreed)  - Consideration (value promised)  - Performance (how execution occurs)  - Settlements (how consideration is discharged)  The model is domain-neutral and supports commerce, hiring, energy markets, carbon exchanges, data access, mobility, subscriptions, and other use cases.",
  "title": "Contract",
  "properties": {
    "id": {
      "description": "A UUID string generated at the BPP endpoint at any stage before the confirmation of the order i.e before `/on_confirm` callback. This value is intended typically for indexing or filtering. While the chances of a UUID collision are rare, it is recommended to use a combination of `bppId`, `providerId` and `id` to allow for global uniqueness.",
      "type": "string",
      "format": "uuid"
    },
    "descriptor": {
      "$ref": "https://schema.nfh.global/Descriptor/v2.0/schema.json"
    },
    "commitments": {
      "type": "array",
      "description": "Structured commitments governed by this contract.",
      "minItems": 1,
      "items": {
        "$ref": "https://schema.nfh.global/Commitment/v2.0/schema.json"
      }
    },
    "consideration": {
      "type": "array",
      "description": "Value agreed to be exchanged under this contract.",
      "items": {
        "$ref": "https://schema.nfh.global/Consideration/v2.0/schema.json"
      }
    },
    "participants": {
      "description": "The participants involved in the contract. Contracts are not always between two individuals.  Several entities may play a specific role in the creation, fulfillment, and post-fulfillment of the contract.",
      "type": "array",
      "items": {
        "$ref": "https://schema.nfh.global/Participant/v2.0/schema.json"
      }
    },
    "performance": {
      "type": "array",
      "description": "Execution units of the contract.  Performance is the generalized fulfillment abstraction. Each Performance instance represents a structured execution plan or delivery mechanism, including:   - Physical delivery  - Service provisioning  - API access  - Subscription activation  - Carbon credit transfer  - Capacity allocation  - Workforce onboarding  Tracking and Support interactions may be linked to individual Performance units.",
      "items": {
        "$ref": "https://schema.nfh.global/Performance/v2.0/schema.json"
      }
    },
    "settlements": {
      "type": "array",
      "description": "Records representing discharge of agreed consideration.",
      "items": {
        "$ref": "https://schema.nfh.global/Settlement/v2.0/schema.json"
      }
    },
    "status": {
      "description": "The current state of the contract expressed as a Descriptor whose code MUST be one of the standard contract state values.",
      "allOf": [
        {
          "$ref": "https://schema.nfh.global/Descriptor/v2.0/schema.json"
        },
        {
          "type": "object",
          "properties": {
            "code": {
              "enum": [
                "DRAFT",
                "ACTIVE",
                "CANCELLED",
                "COMPLETE"
              ]
            }
          }
        }
      ]
    },
    "contractAttributes": {
      "description": "Domain-specific extension attributes for this contract.",
      "allOf": [
        {
          "$ref": "https://schema.nfh.global/Attributes/v2.0/schema.json"
        },
        {},
        {
          "properties": {}
        }
      ]
    }
  },
  "additionalProperties": false,
  "required": [
    "commitments"
  ]
}
