openapi: 3.1.1 info: title: Context version: 2.1.0 description: Schema definition for Context in the Beckn Protocol v2.0.1 license: name: CC-BY-NC-SA 4.0 International contact: name: Beckn Labs url: https://beckn.io components: schemas: Context: x-iri: https://schema.beckn.io/Context/v2.1 description: 'The message envelope header that accompanies every Beckn API call, carrying network addressing, protocol version, action identification, transaction correlation identifiers, timing constraints, and optional cryptographic metadata required to route, authenticate, and correlate messages across the asynchronous Beckn communication pattern. Context appears in every request and callback across all phases of the value-exchange lifecycle. The CN assigns bapId, bapUri, transactionId, messageId, and timestamp when originating a request; the PN assigns bppId and bppUri when it is the receiving actor. Fabric services such as the CS (Cataloging Service) and DS (Discovery Service) validate the version, action, and signature fields as part of request authentication. Relationship: Composes the RequestDigest schema via the requestDigest property, which carries the BLAKE2b-512 hash of the originating request body for non-repudiation of the asynchronous callback leg.' type: object title: Context properties: action: description: The Beckn protocol method name being invoked by the sender, which the receiving actor MUST use to route and execute the corresponding operation. The value MUST match the action value defined in the path schema for the endpoint being called. type: string version: type: string description: The Beckn protocol version in use for this transaction, assigned by the CN when constructing the request. MUST be the const value 2.0.0 for all requests conforming to this specification. const: 2.0.0 bapId: description: Verified namespace identifier of the CN on dedi.global. Receiving actors MUST resolve the CN's address and key material by first resolving the subnet registry URL from context.networkId, then calling the subnet registry's lookup endpoint with context.bapId and context.networkId. The subscriber_url field in the response is the CN's network address; the key material is used for signature verification. type: string senderId: description: The identity of the message sender — by default the sender node's identity on dedi.global, whose default format is `namespace_id/registry_id/record_id`. Additional identity formats are defined in the Identity and Addressing RFC (Identity_and_Addressing.md). Decentralized identifiers (DIDs) are also supported, and are typically used by ecosystems anchored outside dedi.global. type: string senderUrl: description: The network address (base URL) of the message sender, corresponding to senderId, to which responses or callbacks for this message are delivered. type: string format: uri bapUri: description: The callback base URL of the CN to which the PN or Fabric service MUST deliver asynchronous callbacks. This MUST match the subscriber_url returned by the subnet registry lookup for context.bapId and context.networkId. type: string format: uri bppId: description: Verified namespace identifier of the PN on dedi.global. Calling actors MUST resolve the PN's address and key material by first resolving the subnet registry URL from context.networkId, then calling the subnet registry's lookup endpoint with context.bppId and context.networkId. The subscriber_url field in the response is the PN's network address; the key material is used for signature verification. type: string bppUri: description: The request base URL of the PN to which the CN MUST send request API calls. This MUST match the subscriber_url returned by the subnet registry lookup for context.bppId and context.networkId. type: string format: uri receiverId: description: The identity of the message receiver — by default the receiver node's identity on dedi.global, whose default format is `namespace_id/registry_id/record_id`. Additional identity formats are defined in the Identity and Addressing RFC (Identity_and_Addressing.md). Decentralized identifiers (DIDs) are also supported, and are typically used by ecosystems anchored outside dedi.global. type: string receiverUrl: description: The network address (base URL) of the message receiver, corresponding to receiverId, to which this message is delivered. type: string format: uri transactionId: description: A UUID assigned by the CN that persists across all API calls within a single transaction session from discover through confirm. The PN MAY use this value to correlate related requests, push personalized recommendations, and maintain dynamic offerings across the multi-step negotiation cycle without requiring knowledge of the specific consumer identity on the CN. type: string format: uuid messageId: description: A UUID that persists across a single request and its corresponding callback, assigned by the CN for request messages and generated fresh by the PN for unsolicited callbacks. The CN MUST use this value to correlate incoming callbacks with the originating request and MAY use it to detect and discard duplicate messages from the PN. A new messageId MUST be generated for every new interaction. type: string format: uuid networkId: description: The unique identifier of the Beckn subnet within which this transaction is occurring. Actors use this value to resolve the subnet's registry URL before performing identity and address lookups. The RECOMMENDED format is namespace_id followed by a slash followed by registry_id, for example acmenet.org/charge-net. type: string timestamp: description: The date and time at which this message was generated by the sender, expressed in RFC 3339 date-time format. The receiving actor MAY use this value together with ttl to assess whether the message has expired before processing. type: string format: date-time key: description: The encryption public key of the sender, provided when the sender intends for the receiver to use it for encrypting response payloads or establishing a secure channel. Assignment is by the CN or PN depending on message direction. type: string try: description: 'A boolean flag set by the CN to activate the two-phase preview pattern: when true, the PN MUST compute and return the outcome of the requested action without persisting any state change; when false (the default), the PN MUST execute and commit the action. Applicable to the `update` and `cancel` actions only. For all other actions, sending actors MUST NOT set this flag; receiving actors MUST ignore it if present.' type: boolean ttl: description: The duration, expressed in ISO 8601 duration format, after the timestamp value during which this message remains valid. The receiving actor SHOULD reject messages whose timestamp plus ttl has elapsed before processing. type: string schemaContext: description: Array of JSON-LD context urls representing the schemas relevant to the request in which this context object is transported. type: array items: type: string format: uri requestDigest: $ref: https://schema.beckn.io/RequestDigest/v2.0/attributes.yaml#/components/schemas/RequestDigest