schema-aggregator

RetailCommitment Schema Pack v2.1

Overview

RetailCommitment is a Beckn v2.1 schema pack that declares per-commitment line-item details for retail contracts. This is a NEW schema introduced in v2.1 that did not exist in v2.0.

In v2, per-commitment fields (resourceId, lineId, offerId, quantity, price, specialInstructions) were awkwardly scattered across domain-specific items like FoodAndBeverageItem. In v2.1, they are consolidated into a dedicated, domain-agnostic CommitmentAttributes schema that can attach to any Commitment entity.

The schema enables providers and buyers to specify:

Attachment Points

This schema attaches to the following Beckn v2.0 core entities via the commitmentAttributes container:

Schema Structure

Design Rationale

Consolidation from v2 Domain-Specific Models

Problem in v2: Commitment line-item attributes were embedded in domain-specific resource types:

This made it difficult to:

Solution in v2.1: Extract these fields into a dedicated, domain-agnostic CommitmentAttributes schema that:

Field Semantics

lineId: Unique identifier within the parent contract. Examples:

resourceId: Reference to the Resource (catalog item) being committed. Enables:

offerId: Reference to the specific Offer under which the commitment was made. Enables:

quantity: Separate unitCode and unitQuantity provide precision:

price: References core PriceSpecification:

specialInstructions: Per-item buyer notes:

Non-Goals

This schema does not:

Upstream Candidates

Future enhancement opportunities for v2.2+:

  1. Tax Breakdown: taxDetails: {taxType: enum, taxRate: number, taxAmount: number}
  2. Discount Application: discounts: array of {discountId, discountType, amount, appliedAt}
  3. Substitution Rules: substitutionAllowed: boolean, preferredSubstitutes: array<resourceId>
  4. Allergen Warnings: allergens: array, allergenWarningRequired: boolean
  5. Packaging Preferences: packagingType: enum, packagingSeparation: boolean
  6. Warranty/Guarantee: warrantyId: string, warrantyTerms: {duration, coverage}
  7. Serial/Batch Tracking: serialNumber: string, batchId: string, mfgDate: date
  8. Expiry/Shelf-Life: expiryDate: date-time, shelfLife: duration
  9. Compliance Flags: customsDeclarable: boolean, hsCode: string
  10. Return/Exchange: returnable: boolean, returnWindow: duration