How beckn/schemas works
Purpose and boundaries
This is the Beckn Protocol Tier 2 core-schema repository: a versioned, domain-agnostic library of JSON-LD/RDF terms and structural schema definitions. It is not an executable service or web application. Tier 1 protocol transport/envelopes live externally; Tier 3 domain packs extend these core types.
Entry points: README.md, schema/README.md, and the root semantic artifacts schema/context.jsonld and schema/vocab.jsonld.
Schema-package model
Each concept is independently versioned under schema/{SchemaName}/vX.Y/. A package generally contains:
• attributes.yaml: structural attributes/schema source;
• context.jsonld: JSON-LD term mappings;
• vocab.jsonld: RDF class/property vocabulary;
• optional schema.json, profile.json, renderer.json, or examples.
Examples: schema/Catalog/v2.2/attributes.yaml, schema/Item/v2.1/schema.json, schema/GroceryItem/v2.0/profile.json.
Semantic contract layer
The root context and vocabulary provide the shared beckn namespace and aggregate semantic surface used by implementations and downstream domain extensions. Per-schema artifacts isolate each type’s semantic definition while allowing independent releases.
Key boundary: ordinary JSON consumers can use payloads structurally, while JSON-LD/RDF consumers resolve terms into globally unique identifiers and graph relationships. Paths: schema/context.jsonld, schema/vocab.jsonld, schema/Address/v2.0/context.jsonld.
Transaction lifecycle schema families
The repository models Beckn interaction stages as data/action types rather than runtime handlers:
• discovery and catalog exchange: schema/DiscoverAction/v2.0/attributes.yaml, schema/Catalog/v2.2/attributes.yaml, schema/Offer/v2.1/attributes.yaml;
• selection, initialization, and commitment: schema/SelectAction/v2.0/attributes.yaml, schema/InitAction/v2.0/attributes.yaml, schema/Contract/v2.0/attributes.yaml;
• confirmation, updates, cancellation, and status callbacks: schema/ConfirmAction/v2.0/attributes.yaml, schema/UpdateAction/v2.0/attributes.yaml, schema/OnStatusAction/v2.0/attributes.yaml.
Tier 1 API messages are expected to reference these payload definitions; this repository does not define request routing or transport behavior.
Core commerce and fulfillment graph
Catalogs connect providers, items, offers, pricing, contracts/orders, and fulfillment. These types form the reusable graph that verticals specialize:
• supply: schema/Provider/v2.1/attributes.yaml, schema/Item/v2.1/attributes.yaml, schema/Offer/v2.1/attributes.yaml;
• commercial terms: schema/PriceSpecification/v2.2/attributes.yaml, schema/PaymentTerms/v2.0/attributes.yaml, schema/Invoice/v2.2/attributes.yaml;
• delivery/tracking: schema/Fulfillment/v2.1/attributes.yaml, schema/Tracking/v2.1/attributes.yaml, schema/TrackAction/v2.1/attributes.yaml.
Cross-domain and sector extensions
Common identity, location, time, descriptor, policy, and error types are shared dependencies across all transaction graphs: schema/Organization/v2.0/attributes.yaml, schema/Location/v2.0/attributes.yaml, schema/TimePeriod/v2.1/attributes.yaml.
The repository also contains richer mobility, logistics, hiring, education, and retail-oriented schemas. Some v2.1 packages include rendering/profile metadata, indicating a more presentation- or profile-driven extension surface: schema/ServiceOffer/v2.1/profile.json, schema/HiringJobOffer/v2.1/renderer.json, schema/HomeAndKitchenItem/v2.0/examples/home-kitchen-item.json.
Authoring, versioning, and automation
Documentation defines the normative structure, JSON-LD vocabulary practices, and schema lifecycle: docs/2_Schema_Structure.md, docs/3_JSON_LD_Context_and_Vocabulary.md, docs/4_Versioning_and_Deprecation.md. Governance controls change acceptance: CONTRIBUTING.md, GOVERNANCE.md.
Python utilities generate or audit aggregate context/vocabulary consistency and schema parity; they are repository-maintenance tooling, not production runtime infrastructure: tools/generate-context-jsonld.py, tools/generate-vocab-jsonld.py, tools/schema_parity_audit.py.
Main entry points: README.md Versioned schema packages · v2.0/attributes.yaml Contract & invoice · context.jsonld Aggregate JSON-LD context · v2.2/attributes.yaml Catalog
Components 20
Semantic foundation
- Repository entry points
README.md - Aggregate JSON-LD context · Maps shared terms to the Beckn namespace.
schema/context.jsonld - Aggregate RDF vocabulary · Defines the shared class and property surface.
schema/vocab.jsonld - Versioned schema packages · Each concept has independently released structural and semantic artifacts.
schema/README.md
Transaction schemas
Data definitions for Beckn interaction stages.
- Discovery & catalog
schema/DiscoverAction/v2.0/attributes.yaml - Selection & commitment
schema/SelectAction/v2.0/attributes.yaml - Confirmation & status
schema/ConfirmAction/v2.0/attributes.yaml
Commerce & fulfillment
- Catalog
schema/Catalog/v2.2/attributes.yaml - Provider, item & offer
schema/Provider/v2.1/attributes.yaml - Price & payment terms
schema/PriceSpecification/v2.2/attributes.yaml - Contract & invoice
schema/Contract/v2.0/attributes.yaml - Fulfillment & tracking
schema/Fulfillment/v2.1/attributes.yaml
Shared & sector extensions
- Identity, location & time · Cross-domain dependencies for transaction and commerce graphs.
schema/Organization/v2.0/attributes.yaml - Per-schema JSON-LD context · Isolates semantic terms for an individual schema release.
schema/Address/v2.0/context.jsonld - Sector profiles & renderers · Profiles, renderers, and examples support specialized vertical schemas.
schema/ServiceOffer/v2.1/profile.json
Authoring & maintenance
- Schema lifecycle docs · Normative structure, JSON-LD, versioning, and deprecation guidance.
docs/2_Schema_Structure.md - Contribution governance
CONTRIBUTING.md - Context generator
tools/generate-context-jsonld.py - Vocabulary generator
tools/generate-vocab-jsonld.py - Schema parity audit
tools/schema_parity_audit.py
Connections 21
- Repository entry points → Versioned schema packages: introduces
- Schema lifecycle docs → Versioned schema packages: defines
- Contribution governance → Schema lifecycle docs: governs changes to
- Versioned schema packages → Per-schema JSON-LD context: contains
- Per-schema JSON-LD context → Aggregate JSON-LD context: aggregates into
- Versioned schema packages → Aggregate RDF vocabulary: contributes terms to
- Context generator → Aggregate JSON-LD context: generates or audits
- Vocabulary generator → Aggregate RDF vocabulary: generates or audits
- Schema parity audit → Versioned schema packages: checks parity
- Discovery & catalog → Catalog: exchanges
- Catalog → Provider, item & offer: lists
- Selection & commitment → Provider, item & offer: selects
- Selection & commitment → Contract & invoice: initiates
- Confirmation & status → Contract & invoice: confirms or updates
- Contract & invoice → Price & payment terms: uses
- Contract & invoice → Fulfillment & tracking: requires
- Confirmation & status → Fulfillment & tracking: reports status for
- Identity, location & time → Catalog: supports
- Identity, location & time → Contract & invoice: supports
- Sector profiles & renderers → Versioned schema packages: extends
- Aggregate JSON-LD context → Aggregate RDF vocabulary: resolves terms against