Validate a payload
payload_validateValidate a protocol payload against the ONDC spec for the session's build. Runs JSON Schema and contextual rule checks, returning rule codes and JSONPaths for any failures.
Instructions
Check a protocol payload against the ONDC spec for this session's build, without sending it anywhere. Runs L0 (JSON Schema) and L1 (the spec's contextual rules); every failure comes back with a rule code and a JSONPath. Use it to inspect a body before committing to it, or to understand a refusal. Note that flow_proceed already gates what it sends, so this is not a required step in the loop. A valid verdict only covers the layers listed in checked.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | No | Action to validate as. Defaults to the payload's own context.action, which is almost always what you want. | |
| payload | Yes | The full protocol payload, exactly as it would go on the wire. | |
| session_id | Yes | Session whose build (domain + version) the payload is judged against. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | The action the payload was judged as. | |
| events | No | What has happened in this session since your last call — the participant's callbacks, steps sent automatically, refusals, form submissions. Attached to every session-scoped result and delivered exactly once, so read it here instead of polling. Absent when nothing happened. `more` above zero means call record_get_events for the rest. | |
| status | Yes | ||
| checked | Yes | Layers that actually produced a verdict. | |
| docs_url | No | The published rule list for this build, when upstream named one. | |
| findings | Yes | Every failure found, across every layer that ran. | |
| unchecked | Yes | Layers that did not. A `valid` status only covers what is in `checked`. |