add new schema folder

This commit is contained in:
AshwiniK-protean
2025-02-27 15:07:30 +05:30
parent 113aadbb0a
commit 26c97c5774
65 changed files with 389 additions and 571 deletions

View File

@@ -0,0 +1,43 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://ondc.org/trv10/2.0.0/cancel",
"type": "object",
"allOf": [
{
"$ref": "../core/v1.1.0/cancel.json#"
},
{
"$ref": "https://beckn.org/schema/cancel#"
},
{
"$ref": "./init.json#/allOf/2"
},
{
"properties": {
"message": {
"type": "object",
"properties": {
"order_id": {
"type": "string"
},
"descriptor": {
"type": "object",
"properties": {
"code": {
"type": "string",
"enum": ["SOFT_CANCEL", "CONFIRM_CANCEL"]
}
},
"required": ["code"]
},
"cancellation_reason_id": {
"type": "string",
"pattern": "^[0-9]+$"
}
},
"required": ["order_id", "descriptor", "cancellation_reason_id"]
}
}
}
]
}

View File

@@ -0,0 +1,466 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://ondc.org/trv10/2.0.0/confirm",
"type": "object",
"allOf": [
{
"$ref": "../core/v1.1.0/confirm.json#"
},
{
"$ref": "https://beckn.org/schema/confirm#"
},
{
"$ref": "./init.json#/allOf/2"
},
{
"$ref": "./init.json#/allOf/3"
},
{
"allOf": [
{
"$ref": "./on_select.json#/allOf/8/allOf/0"
},
{
"properties": {
"message": {
"properties": {
"order": {
"properties": {
"fulfillments": {
"type": "array",
"items": {
"allOf": [
{
"properties": {
"customer": {
"properties": {
"contact": {
"properties": {
"phone": {
"type": "string",
"pattern": "^\\+?[1-9]\\d{1,14}$"
}
},
"required": [
"phone"
]
},
"person": {
"properties": {
"name": {
"type": "string"
}
},
"required": [
"name"
]
}
},
"required": [
"contact",
"person"
]
}
},
"required": [
"customer"
]
}
]
}
}
}
}
}
}
}
}
]
},
{
"allOf": [
{
"$ref": "./init.json#/allOf/6"
},
{
"properties": {
"message": {
"properties": {
"order": {
"properties": {
"payments": {
"type": "array",
"items": {
"type": "object",
"properties": {
"params": {
"type": "object",
"properties": {
"amount": {
"type": "string",
"pattern": "^\\d+(\\.\\d{1,2})?$"
}
}
},
"type": {
"type": "string",
"enum": [
"PRE-ORDER",
"ON-FULFILLMENT",
"POST-FULFILLMENT"
]
},
"status": {
"type": "string",
"enum": [
"PAID",
"NOT-PAID"
]
},
"collected_by": {
"type": "string",
"enum": [
"BAP",
"BPP"
]
},
"tags": {
"type": "array",
"minItems": 2,
"maxItems": 2,
"uniqueItems": true,
"items": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": {
"code": {
"type": "string",
"enum": [
"SETTLEMENT_TERMS",
"BUYER_FINDER_FEES"
]
}
},
"allOf": [
{
"if": {
"properties": {
"descriptor": {
"properties": {
"code": {
"const": "SETTLEMENT_TERMS"
}
}
}
}
},
"then": {
"properties": {
"list": {
"allOf": [
{
"contains": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": {
"code": {
"const": "STATIC_TERMS"
}
}
},
"value": {
"type": "string",
"format": "uri"
}
}
}
},
{
"contains": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": {
"code": {
"const": "SETTLEMENT_BASIS"
}
}
},
"value": {
"type": "string",
"enum": [
"DELIVERY"
]
}
}
}
},
{
"contains": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": {
"code": {
"const": "SETTLEMENT_WINDOW"
}
}
},
"value": {
"type": "string"
}
}
}
},
{
"contains": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": {
"code": {
"const": "DELAY_INTEREST"
}
}
},
"value": {
"type": "string",
"pattern": "^\\d+(\\.\\d{1,2})?$"
}
}
}
},
{
"contains": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": {
"code": {
"const": "SETTLEMENT_TYPE"
}
}
},
"value": {
"type": "string",
"enum": [
"upi",
"neft",
"rtgs",
"UPI",
"NEFT",
"RTGS"
]
}
}
}
},
{
"contains": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": {
"code": {
"const": "SETTLEMENT_AMOUNT"
}
}
},
"value": {
"type": "string",
"pattern": "^\\d+(\\.\\d{1,2})?$"
}
}
}
},
{
"contains": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": {
"code": {
"const": "MANDATORY_ARBITRATION"
}
}
},
"value": {
"type": "string",
"enum": [
"true",
"false"
]
}
}
}
},
{
"contains": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": {
"code": {
"const": "COURT_JURISDICTION"
}
}
},
"value": {
"type": "string"
}
}
}
}
]
}
}
}
},
{
"if": {
"properties": {
"descriptor": {
"properties": {
"code": {
"const": "BUYER_FINDER_FEES"
}
}
}
}
},
"then": {
"properties": {
"list": {
"type": "array",
"items": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": {
"code": {
"enum": [
"BUYER_FINDER_FEES_PERCENTAGE"
]
}
}
},
"value": {
"type": "string",
"pattern": "^-?\\d+(\\.\\d+)?$"
}
}
}
}
}
}
}
]
}
},
"required": [
"descriptor"
]
}
}
},
"required": [
"type",
"status",
"collected_by",
"tags"
]
}
}
}
}
}
}
}
}
]
},
{
"properties": {
"message": {
"properties": {
"order": {
"properties": {
"payments": {
"type": "array",
"items": {
"properties": {
"type": {
"type": "string"
},
"params": {
"type": "object",
"properties": {
"transaction_id": {
"type": "string"
}
}
}
},
"required": [
"type"
],
"allOf": [
{
"if": {
"properties": {
"type": {
"const": "PRE-ORDER"
}
}
},
"then": {
"properties": {
"params": {
"required": [
"transaction_id"
]
}
}
}
}
]
}
}
},
"required": [
"payments"
]
}
}
}
}
},
{
"properties": {
"message": {
"properties": {
"order": {
"not": {
"required": [
"id"
]
}
}
}
}
}
}
]
}

View File

@@ -0,0 +1,397 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://ondc.org/trv10/2.0.0/init",
"type": "object",
"allOf": [
{ "$ref": "../core/v1.1.0/init.json#" },
{ "$ref": "https://beckn.org/schema/init#" },
{
"allOf": [
{ "$ref": "./search.json#/properties/context/allOf/0" },
{ "required": ["bpp_id", "bpp_uri"] }
]
},
{
"properties": {
"message": {
"properties": {
"order": {
"type": "object",
"properties": {
"provider": {
"type": "object",
"properties": {
"id": { "type": "string" }
},
"required": ["id"]
},
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": { "type": "string" }
},
"required": ["id"]
}
}
},
"required": ["provider", "items"]
}
}
}
}
},
{ "$ref": "./confirm.json#/allOf/4" },
{ "$ref": "./on_select.json#/allOf/10" },
{
"properties": {
"message": {
"properties": {
"order": {
"required": ["fulfillments"]
}
}
}
}
},
{
"properties": {
"message": {
"type": "object",
"properties": {
"order": {
"type": "object",
"properties": {
"payments": {
"type": "array",
"items": {
"type": "object",
"properties": {
"params": {
"type": "object",
"properties": {
"amount": {
"type": "string",
"pattern": "^\\d+(\\.\\d{1,2})?$"
}
}
},
"type": {
"type": "string",
"enum": ["PRE-ORDER", "ON-FULFILLMENT", "POST-FULFILLMENT"]
},
"status": {
"type": "string",
"enum": ["PAID", "NOT-PAID"]
},
"collected_by": {
"type": "string",
"enum": ["BAP", "BPP"]
},
"tags": {
"type": "array",
"minItems": 2,
"maxItems": 2,
"uniqueItems": true,
"items": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": {
"code": {
"type": "string",
"enum": ["SETTLEMENT_TERMS", "BUYER_FINDER_FEES"]
}
}
}
},
"required": ["descriptor"]
}
}
},
"required": ["type", "status", "collected_by", "tags"],
"allOf": [
{
"if": {
"allOf": [
{ "properties": { "collected_by": { "const": "BAP" } } },
{ "properties": { "type": { "const": "PRE-ORDER" } } }
]
},
"then": {
"properties": {
"tags": {
"items": {
"if": {
"properties": {
"descriptor": {
"properties": { "code": { "const": "SETTLEMENT_TERMS" } }
}
}
},
"then": {
"properties": {
"list": {
"allOf": [
{
"contains": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": { "code": { "const": "STATIC_TERMS" } }
},
"value": {
"type": "string",
"format": "uri"
}
}
}
},
{
"contains": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": { "code": { "const": "SETTLEMENT_BASIS" } }
},
"value": {
"type": "string",
"enum": ["DELIVERY"]
}
}
}
},
{
"contains": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": { "code": { "const": "SETTLEMENT_WINDOW" } }
},
"value": {
"type": "string"
}
}
}
},
{
"contains": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": { "code": { "const": "DELAY_INTEREST" } }
},
"value": {
"type": "string",
"pattern": "^\\d+(\\.\\d{1,2})?$"
}
}
}
}
]
}
}
}
}
}
}
}
},
{
"if": {
"allOf": [
{ "properties": { "collected_by": { "const": "BPP" } } },
{ "properties": { "type": { "const": "PRE-ORDER" } } }
]
},
"then": {
"properties": {
"tags": {
"items": {
"if": {
"properties": {
"descriptor": {
"properties": { "code": { "const": "SETTLEMENT_TERMS" } }
}
}
},
"then": {
"properties": {
"list": {
"allOf": [
{
"contains": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": { "code": { "const": "STATIC_TERMS" } }
},
"value": {
"type": "string",
"format": "uri"
}
}
}
},
{
"contains": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": { "code": { "const": "SETTLEMENT_BASIS" } }
},
"value": {
"type": "string",
"enum": ["DELIVERY"]
}
}
}
},
{
"contains": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": { "code": { "const": "SETTLEMENT_WINDOW" } }
},
"value": {
"type": "string"
}
}
}
}
]
}
}
}
}
}
}
}
},
{
"if": {
"allOf": [
{ "properties": { "collected_by": { "const": "BPP" } } },
{ "properties": { "type": { "const": "ON-FULFILLMENT" } } }
]
},
"then": {
"properties": {
"tags": {
"items": {
"if": {
"properties": {
"descriptor": {
"properties": { "code": { "const": "SETTLEMENT_TERMS" } }
}
}
},
"then": {
"properties": {
"list": {
"allOf": [
{
"contains": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": { "code": { "const": "STATIC_TERMS" } }
},
"value": {
"type": "string",
"format": "uri"
}
}
}
},
{
"contains": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": { "code": { "const": "SETTLEMENT_BASIS" } }
},
"value": {
"type": "string",
"enum": ["DELIVERY"]
}
}
}
},
{
"contains": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": { "code": { "const": "SETTLEMENT_WINDOW" } }
},
"value": {
"type": "string"
}
}
}
},
{
"contains": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": { "code": { "const": "DELAY_INTEREST" } }
},
"value": {
"type": "string",
"pattern": "^\\d+(\\.\\d{1,2})?$"
}
}
}
}
]
}
}
}
}
}
}
}
}
]
}
}
}
}
}
}
}
},
{
"properties": {
"message": {
"properties": {
"order": {
"properties": {
"billing": {
"required": ["name"]
}
},
"required": ["billing"]
}
}
}
}
}
]
}

View File

@@ -0,0 +1,16 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://ondc.org/trv10/2.0.0/on_cancel",
"type": "object",
"allOf": [
{
"$ref": "../core/v1.1.0/confirm.json#"
},
{
"$ref": "https://beckn.org/schema/confirm#"
},
{
"$ref": "./init.json#/allOf/2"
}
]
}

View File

@@ -0,0 +1,16 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://ondc.org/trv10/2.0.0/on_confirm",
"type": "object",
"allOf": [
{
"$ref": "../core/v1.1.0/confirm.json#"
},
{
"$ref": "https://beckn.org/schema/confirm#"
},
{
"$ref": "./init.json#/allOf/2"
}
]
}

View File

@@ -0,0 +1,320 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://ondc.org/trv10/2.0.0/on_init",
"type": "object",
"allOf": [
{
"$ref": "../core/v1.1.0/on_init.json#"
},
{
"$ref": "https://beckn.org/schema/on_init#"
},
{
"$ref": "./init.json#/allOf/2"
},
{
"properties": {
"message": {
"properties": {
"order": {
"properties": {
"provider": {
"type": "object",
"properties": {
"id": {
"type": "string"
}
},
"required": ["id"]
}
},
"required": ["provider"]
}
}
}
}
},
{
"$ref": "./on_select.json#/allOf/5"
},
{
"$ref": "./on_select.json#/allOf/6"
},
{
"properties": {
"message": {
"properties": {
"order": {
"properties": {
"items": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"properties": {
"fulfillment_ids": {
"minItems": 1
},
"location_ids": {
"minItems": 1
}
},
"required": ["fulfillment_ids", "location_ids"]
}
}
}
}
}
}
}
},
{
"$ref": "./confirm.json#/allOf/5/allOf/1"
},
{
"properties": {
"message": {
"properties": {
"order": {
"properties": {
"fulfillments": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": ["DELIVERY"]
}
},
"required": ["type"]
}
}
}
}
}
}
}
},
{
"allOf": [
{
"properties": {
"message": {
"properties": {
"order": {
"properties": {
"quote": {
"type": "object",
"properties": {
"price": {
"type": "object",
"properties": {
"currency": {
"type": "string"
},
"value": {
"type": "string",
"pattern": "^\\d+(\\.\\d{1,2})?$"
}
},
"required": ["currency", "value"]
},
"breakup": {
"type": "array",
"items": {
"type": "object",
"properties": {
"price": {
"type": "object",
"properties": {
"currency": {
"type": "string"
},
"value": {
"type": "string",
"pattern": "^\\d+(\\.\\d{1,2})?$"
}
},
"required": ["currency", "value"]
},
"title": {
"type": "string",
"enum": [
"BASE_FARE",
"DISTANCE_FARE",
"TAX",
"DISCOUNT",
"WAITING_CHARGE"
]
}
},
"required": ["price", "title"]
}
}
},
"required": ["price", "breakup"]
}
},
"required": ["quote"]
}
}
}
}
},
{
"properties": {
"message": {
"properties": {
"order": {
"properties": {
"quote": {
"properties": {
"breakup": {
"allOf": [
{
"contains": {
"type": "object",
"properties": {
"title": {
"const": "BASE_FARE"
},
"price": {
"type": "object",
"properties": {
"value": {
"type": "string"
}
},
"required": ["value"]
}
},
"required": ["title", "price"]
}
},
{
"contains": {
"type": "object",
"properties": {
"title": {
"const": "DISTANCE_FARE"
},
"price": {
"type": "object",
"properties": {
"value": {
"type": "string"
}
},
"required": ["value"]
}
},
"required": ["title", "price"]
}
}
]
}
}
}
}
}
}
}
}
}
]
},
{
"$ref": "./confirm.json#/allOf/7"
},
{
"allOf": [
{
"properties": {
"message": {
"properties": {
"order": {
"properties": {
"cancellation_terms": {
"type": "array",
"items": {
"type": "object",
"properties": {
"fulfillment_state": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": {
"code": {
"type": "string",
"enum": [
"RIDE_ASSIGNED",
"RIDE_ENROUTE_PICKUP",
"RIDE_ARRIVED_PICKUP",
"RIDE_STARTED"
]
}
},
"required": ["code"]
}
},
"required": ["descriptor"]
},
"cancellation_fee": {
"oneOf": [
{
"type": "object",
"properties": {
"percentage": {
"type": "string",
"pattern": "^(100(\\.0{1,2})?|([0-9]{1,2})(\\.\\d{1,2})?)$"
}
},
"required": ["percentage"]
},
{
"type": "object",
"properties": {
"amount": {
"type": "object",
"properties": {
"value": {
"type": "string",
"pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)$"
},
"currency": {
"type": "string"
}
},
"required": ["currency", "value"]
}
},
"required": ["amount"]
}
]
}
},
"required": ["fulfillment_state", "cancellation_fee"]
}
}
},
"required": ["cancellation_terms"]
}
}
}
}
},
{
"properties": {
"message": {
"type": "object"
}
},
"required": ["message"]
}
]
}
]
}

View File

@@ -0,0 +1,16 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://ondc.org/trv10/2.0.0/on_rating",
"type": "object",
"allOf": [
{
"$ref": "../core/v1.1.0/confirm.json#"
},
{
"$ref": "https://beckn.org/schema/confirm#"
},
{
"$ref": "./init.json#/allOf/2"
}
]
}

View File

@@ -0,0 +1,648 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://ondc.org/trv10/2.0.0/on_search",
"type": "object",
"allOf": [
{
"$ref": "../core/v1.1.0/on_search.json#"
},
{
"$ref": "https://beckn.org/schema/on_search#"
},
{
"$ref": "./init.json#/allOf/2"
},
{
"properties": {
"message": {
"type": "object",
"properties": {
"catalog": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"images": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"required": [
"name"
]
},
"providers": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"descriptor": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"images": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"required": [
"name"
]
},
"fulfillments": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"properties": {
"vehicle": {
"type": "object",
"properties": {
"category": {
"type": "string",
"enum": [
"AUTO_RICKSHAW",
"CAB"
]
}
},
"required": [
"category"
]
},
"type": {
"type": "string",
"enum": [
"DELIVERY"
]
}
},
"required": [
"id",
"vehicle",
"type"
]
}
},
"items": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"code": {
"type": "string",
"enum": [
"RIDE"
]
}
},
"required": [
"code"
]
},
"price": {
"type": "object",
"properties": {
"value": {
"type": "string",
"pattern": "^-?\\d+(\\.\\d+)?$"
}
},
"required": [
"value",
"currency"
]
},
"fulfillment_ids": {
"type": "array",
"minItems": 1
},
"payment_ids": {
"type": "array",
"minItems": 1
}
},
"required": [
"id",
"descriptor",
"price",
"fulfillment_ids"
]
}
}
},
"required": [
"id",
"descriptor",
"items",
"fulfillments"
]
}
}
},
"required": [
"providers"
]
}
},
"required": [
"catalog"
]
}
}
},
{
"properties": {
"message": {
"properties": {
"order": {
"properties": {
"payments": {
"type": "array",
"items": {
"type": "object",
"properties": {
"collected_by": {
"type": "string",
"enum": [
"BAP",
"BPP"
]
},
"tags": {
"type": "array",
"minItems": 2,
"maxItems": 2,
"uniqueItems": true,
"items": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": {
"code": {
"type": "string",
"enum": [
"SETTLEMENT_TERMS",
"BUYER_FINDER_FEES"
]
}
}
}
},
"required": [
"descriptor"
]
}
}
},
"required": [
"collected_by",
"tags"
],
"allOf": [
{
"if": {
"allOf": [
{
"properties": {
"collected_by": {
"const": "BAP"
}
}
}
]
},
"then": {
"properties": {
"tags": {
"items": {
"if": {
"properties": {
"descriptor": {
"properties": {
"code": {
"const": "SETTLEMENT_TERMS"
}
}
}
}
},
"then": {
"properties": {
"list": {
"allOf": [
{
"contains": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": {
"code": {
"const": "STATIC_TERMS"
}
}
},
"value": {
"type": "string",
"format": "uri"
}
}
}
},
{
"contains": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": {
"code": {
"const": "SETTLEMENT_TYPE"
}
}
},
"value": {
"type": "string",
"enum": [
"upi",
"neft",
"rtgs",
"UPI",
"NEFT",
"RTGS"
]
}
}
}
},
{
"contains": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": {
"code": {
"const": "DELAY_INTEREST"
}
}
},
"value": {
"type": "string",
"pattern": "^\\d+(\\.\\d{1,2})?$"
}
}
}
},
{
"contains": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": {
"code": {
"const": "MANDATORY_ARBITRATION"
}
}
},
"value": {
"type": "string",
"enum": [
"true",
"false"
]
}
}
}
},
{
"contains": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": {
"code": {
"const": "COURT_JURISDICTION"
}
}
},
"value": {
"type": "string"
}
}
}
}
]
}
}
}
}
}
}
}
},
{
"if": {
"allOf": [
{
"properties": {
"collected_by": {
"const": "BPP"
}
}
}
]
},
"then": {
"properties": {
"tags": {
"items": {
"if": {
"properties": {
"descriptor": {
"properties": {
"code": {
"const": "SETTLEMENT_TERMS"
}
}
}
}
},
"then": {
"properties": {
"list": {
"allOf": [
{
"contains": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": {
"code": {
"const": "STATIC_TERMS"
}
}
},
"value": {
"type": "string",
"format": "uri"
}
}
}
},
{
"contains": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": {
"code": {
"const": "SETTLEMENT_TYPE"
}
}
},
"value": {
"type": "string",
"enum": [
"upi",
"neft",
"rtgs",
"UPI",
"NEFT",
"RTGS"
]
}
}
}
},
{
"contains": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": {
"code": {
"const": "DELAY_INTEREST"
}
}
},
"value": {
"type": "string",
"pattern": "^\\d+(\\.\\d{1,2})?$"
}
}
}
},
{
"contains": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": {
"code": {
"const": "MANDATORY_ARBITRATION"
}
}
},
"value": {
"type": "string",
"enum": [
"true",
"false"
]
}
}
}
},
{
"contains": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": {
"code": {
"const": "COURT_JURISDICTION"
}
}
},
"value": {
"type": "string"
}
}
}
},
{
"contains": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": {
"code": {
"const": "SETTLEMENT_BASIS"
}
}
},
"value": {
"type": "string",
"enum": [
"DELIVERY"
]
}
}
}
},
{
"contains": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": {
"code": {
"const": "SETTLEMENT_WINDOW"
}
}
},
"value": {
"type": "string"
}
}
}
}
]
}
}
}
}
}
}
}
}
]
}
}
},
"required": [
"payments"
]
}
}
}
}
},
{
"properties": {
"message": {
"properties": {
"catalog": {
"properties": {
"providers": {
"items": {
"properties": {
"fulfillments": {
"items": {
"properties": {
"stops": {
"allOf": [
{
"contains": {
"type": "object",
"properties": {
"location": {
"type": "object",
"properties": {
"gps": {
"type": "string"
}
},
"required": [
"gps"
]
},
"type": {
"const": "START"
}
},
"required": [
"location",
"type"
]
}
},
{
"contains": {
"type": "object",
"properties": {
"location": {
"type": "object",
"properties": {
"gps": {
"type": "string"
}
},
"required": [
"gps"
]
},
"type": {
"const": "END"
}
},
"required": [
"location",
"type"
]
}
}
]
}
},
"required": [
"stops"
]
}
}
}
}
}
}
}
}
}
}
}
]
}

View File

@@ -0,0 +1,827 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://ondc.org/trv10/2.0.0/on_select",
"type": "object",
"allOf": [
{
"$ref": "../core/v1.1.0/on_select.json#"
},
{
"$ref": "https://beckn.org/schema/on_select#"
},
{
"$ref": "./init.json#/allOf/2"
},
{
"$ref": "#/paths/~1on_init/post/requestBody/content/application~1json/schema/allOf/1/allOf/2"
},
{
"$ref": "#/paths/~1on_init/post/requestBody/content/application~1json/schema/allOf/1/allOf/4"
},
{
"properties": {
"message": {
"type": "object",
"properties": {
"order": {
"type": "object",
"properties": {
"items": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"properties": {
"id": { "type": "string" },
"descriptor": {
"type": "object",
"properties": {
"name": { "type": "string" },
"code": { "type": "string", "enum": ["RIDE"] }
},
"required": ["code"]
},
"price": {
"type": "object",
"properties": { "value": { "type": "string" } },
"required": ["value"]
},
"fulfillment_ids": { "minItems": 1 },
"location_ids": { "minItems": 1 }
},
"required": ["id", "price", "descriptor"]
}
}
},
"required": ["items"]
}
}
}
}
},
{
"allOf": [
{
"properties": {
"message": {
"properties": {
"order": {
"properties": {
"items": {
"items": {
"properties": {
"tags": {
"items": {
"if": {
"properties": {
"descriptor": {
"properties": {
"code": { "const": "FARE_POLICY" }
}
}
}
},
"then": {
"properties": {
"list": {
"type": "array",
"items": {
"type": "object",
"properties": {
"descriptor": {
"properties": {
"code": {
"type": "string",
"enum": [
"MIN_FARE",
"MIN_FARE_DISTANCE_KM",
"PER_KM_CHARGE",
"PICKUP_CHARGE",
"WAITING_CHARGE_PER_MIN",
"NIGHT_CHARGE_MULTIPLIER",
"NIGHT_SHIFT_START_TIME",
"NIGHT_SHIFT_END_TIME",
"EXTERNAL_REF"
]
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
},
{
"properties": {
"message": {
"properties": {
"order": {
"properties": {
"items": {
"items": {
"properties": {
"tags": {
"items": {
"if": {
"properties": {
"descriptor": {
"properties": {
"code": { "const": "FARE_POLICY" }
}
}
}
},
"then": {
"properties": {
"list": {
"allOf": [
{
"contains": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": {
"code": { "const": "MIN_FARE" }
},
"required": ["code"]
},
"value": {
"type": "string",
"pattern": "^[0-9]+(\\.[0-9]+)?$"
}
},
"required": ["descriptor", "value"]
}
},
{
"contains": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": {
"code": { "const": "MIN_FARE_DISTANCE_KM" }
},
"required": ["code"]
},
"value": {
"type": "string",
"pattern": "^[0-9]+(\\.[0-9]+)?$"
}
},
"required": ["descriptor", "value"]
}
},
{
"contains": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": {
"code": { "const": "PER_KM_CHARGE" }
},
"required": ["code"]
},
"value": {
"type": "string",
"pattern": "^[0-9]+(\\.[0-9]+)?$"
}
},
"required": ["descriptor", "value"]
}
},
{
"contains": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": {
"code": { "const": "PICKUP_CHARGE" }
},
"required": ["code"]
},
"value": {
"type": "string",
"pattern": "^[0-9]+(\\.[0-9]+)?$"
}
},
"required": ["descriptor", "value"]
}
},
{
"contains": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": {
"code": { "const": "WAITING_CHARGE_PER_MIN" }
},
"required": ["code"]
},
"value": {
"type": "string",
"pattern": "^[0-9]+(\\.[0-9]+)?$"
}
},
"required": ["descriptor", "value"]
}
},
{
"contains": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": {
"code": { "const": "NIGHT_CHARGE_MULTIPLIER" }
},
"required": ["code"]
},
"value": {
"type": "string",
"pattern": "^[0-9]+(\\.[0-9]+)?$"
}
},
"required": ["descriptor", "value"]
}
},
{
"contains": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": {
"code": { "const": "NIGHT_SHIFT_START_TIME" }
},
"required": ["code"]
},
"value": {
"type": "string",
"pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$"
}
},
"required": ["descriptor", "value"]
}
}
]
}
}
}
}
}
}
}
}
}
}
}
}
}
},
{
"properties": {
"message": {
"properties": {
"order": {
"properties": {
"items": {
"items": {
"properties": {
"tags": {
"items": {
"if": {
"properties": {
"descriptor": {
"properties": {
"code": { "const": "FARE_POLICY" }
}
}
}
},
"then": {
"properties": {
"list": {
"type": "array",
"items": {
"allOf": [
{
"if": {
"properties": {
"descriptor": {
"properties": {
"code": {
"enum": [
"MIN_FARE",
"MIN_FARE_DISTANCE_KM",
"PER_KM_CHARGE",
"PICKUP_CHARGE",
"WAITING_CHARGE_PER_MIN",
"NIGHT_CHARGE_MULTIPLIER"
]
}
}
}
}
},
"then": {
"properties": {
"value": {
"type": "string",
"pattern": "^-?\\d+(\\.\\d+)?$"
}
},
"required": ["descriptor", "value"]
}
},
{
"if": {
"properties": {
"descriptor": {
"properties": {
"code": {
"enum": [
"NIGHT_SHIFT_START_TIME",
"NIGHT_SHIFT_END_TIME"
]
}
}
}
}
},
"then": {
"properties": {
"value": {
"type": "string",
"pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$"
}
},
"required": ["descriptor", "value"]
}
},
{
"if": {
"properties": {
"descriptor": {
"properties": {
"code": { "const": "EXTERNAL_REF" }
}
}
}
},
"then": {
"properties": {
"value": {
"type": "string",
"pattern": "^https?://[^\\s/$.?#].[^\\s]*$"
}
},
"required": ["descriptor", "value"]
}
}
]
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
]
},
{
"allOf": [
{
"properties": {
"message": {
"properties": {
"order": {
"properties": {
"items": {
"items": {
"properties": {
"tags": {
"items": {
"if": {
"properties": {
"descriptor": {
"properties": {
"code": { "const": "INFO" }
}
}
}
},
"then": {
"properties": {
"list": {
"type": "array",
"items": {
"type": "object",
"properties": {
"descriptor": {
"properties": {
"code": {
"type": "string",
"enum": [
"DISTANCE_TO_NEAREST_DRIVER_METER",
"ETA_TO_NEAREST_DRIVER_MIN"
]
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
},
{
"properties": {
"message": {
"properties": {
"order": {
"properties": {
"items": {
"items": {
"properties": {
"tags": {
"items": {
"if": {
"properties": {
"descriptor": {
"properties": {
"code": { "const": "INFO" }
}
}
}
},
"then": {
"properties": {
"list": {
"allOf": [
{
"contains": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": {
"code": { "const": "ETA_TO_NEAREST_DRIVER_MIN" }
},
"required": ["code"]
},
"value": {
"type": "string",
"pattern": "^\\d+(\\.\\d+)?$"
}
},
"required": ["descriptor", "value"]
}
},
{
"contains": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": {
"code": { "const": "DISTANCE_TO_NEAREST_DRIVER_METER" }
},
"required": ["code"]
},
"value": {
"type": "string",
"pattern": "^\\d+(\\.\\d+)?$"
}
},
"required": ["descriptor", "value"]
}
}
]
}
}
}
}
}
}
}
}
}
}
}
}
}
},
{
"properties": {
"message": {
"properties": {
"order": {
"properties": {
"items": {
"type": "array",
"items": {
"properties": {
"tags": {
"items": {
"if": {
"properties": {
"descriptor": {
"properties": {
"code": { "const": "INFO" }
}
}
}
},
"then": {
"properties": {
"list": {
"type": "array",
"items": {
"allOf": [
{
"if": {
"properties": {
"descriptor": {
"properties": {
"code": {
"enum": [
"DISTANCE_TO_NEAREST_DRIVER_METER",
"ETA_TO_NEAREST_DRIVER_MIN"
]
}
}
}
}
},
"then": {
"properties": {
"value": {
"type": "string",
"pattern": "^-?\\d+(\\.\\d+)?$"
}
},
"required": ["descriptor", "value"]
}
}
]
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
]
},
{
"allOf": [
{
"properties": {
"message": {
"properties": {
"order": {
"properties": {
"fulfillments": {
"type": "array",
"minItems": 1,
"items": {
"required": ["id"]
}
}
},
"required": ["fulfillments"]
}
}
}
}
},
{
"properties": {
"message": {
"properties": {
"order": {
"properties": {
"fulfillments": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"properties": {
"state": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": {
"code": {
"type": "string",
"enum": [
"RIDE_ASSIGNED",
"RIDE_ENROUTE_PICKUP",
"RIDE_ARRIVED_PICKUP",
"RIDE_STARTED",
"RIDE_ENDED",
"RIDE_CANCELLED"
]
}
},
"required": ["code"]
}
}
}
}
}
}
}
}
}
}
}
},
{
"properties": {
"message": {
"properties": {
"order": {
"properties": {
"fulfillments": {
"type": "array",
"minItems": 1,
"items": {
"properties": {
"stops": {
"items": {
"properties": {
"authorization": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": ["OTP"]
},
"token": {
"type": "string",
"pattern": "^-?\\d+(\\.\\d+)?$"
}
},
"required": ["type", "token"]
}
}
}
}
}
}
}
}
}
}
}
}
},
{
"properties": {
"message": {
"properties": {
"order": {
"properties": {
"fulfillments": {
"items": {
"properties": {
"stops": {
"type": "array",
"minItems": 2,
"items": {
"type": "object",
"properties": {
"location": {
"type": "object",
"properties": {
"gps": { "type": "string" }
},
"required": ["gps"]
},
"type": {
"enum": ["START", "END"]
}
},
"required": ["location", "type"]
}
}
},
"required": ["stops"]
}
}
}
}
}
}
}
},
{
"properties": {
"message": {
"properties": {
"order": {
"properties": {
"fulfillments": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"properties": {
"vehicle": {
"properties": {
"category": {
"type": "string",
"enum": ["AUTO_RICKSHAW", "CAB"]
}
},
"required": ["category"]
}
},
"required": ["vehicle"]
}
}
},
"required": ["fulfillments"]
}
}
}
}
}
]
},
{
"$ref": "#/paths/~1on_init/post/requestBody/content/application~1json/schema/allOf/1/allOf/6"
},
{
"properties": {
"message": {
"properties": {
"order": {
"properties": {
"fulfillments": {
"type": "array",
"items": {
"allOf": [
{
"not": {
"required": ["agent"]
}
}
]
}
}
}
}
}
}
}
},
{
"$ref": "#/paths/~1on_init/post/requestBody/content/application~1json/schema/allOf/1/allOf/7"
}
]
}

View File

@@ -0,0 +1,16 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://ondc.org/trv10/2.0.0/on_status",
"type": "object",
"allOf": [
{
"$ref": "../core/v1.1.0/confirm.json#"
},
{
"$ref": "https://beckn.org/schema/confirm#"
},
{
"$ref": "./init.json#/allOf/2"
}
]
}

View File

@@ -0,0 +1,16 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://ondc.org/trv10/2.0.0/on_support",
"type": "object",
"allOf": [
{
"$ref": "../core/v1.1.0/confirm.json#"
},
{
"$ref": "https://beckn.org/schema/confirm#"
},
{
"$ref": "./init.json#/allOf/2"
}
]
}

View File

@@ -0,0 +1,16 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://ondc.org/trv10/2.0.0/on_track",
"type": "object",
"allOf": [
{
"$ref": "../core/v1.1.0/confirm.json#"
},
{
"$ref": "https://beckn.org/schema/confirm#"
},
{
"$ref": "./init.json#/allOf/2"
}
]
}

View File

@@ -0,0 +1,16 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://ondc.org/trv10/2.0.0/on_update",
"type": "object",
"allOf": [
{
"$ref": "../core/v1.1.0/confirm.json#"
},
{
"$ref": "https://beckn.org/schema/confirm#"
},
{
"$ref": "./init.json#/allOf/2"
}
]
}

View File

@@ -0,0 +1,16 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://ondc.org/trv10/2.0.0/rating",
"type": "object",
"allOf": [
{
"$ref": "../core/v1.1.0/rating.json#"
},
{
"$ref": "https://beckn.org/schema/rating#"
},
{
"$ref": "./init.json#/allOf/2"
}
]
}

View File

@@ -0,0 +1,149 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://ondc.org/trv10/2.0.0/search",
"allOf": [
{ "$ref": "../core/v1.1.0/search.json#" },
{ "$ref": "https://beckn.org/schema/search#" }
],
"type": "object",
"properties": {
"context": {
"type": "object",
"allOf": [
{
"properties": {
"action": {
"type": "string"
},
"location": {
"type": "object",
"properties": {
"city": {
"type": "object",
"properties": {
"code": { "type": "string" }
},
"required": ["code"]
},
"country": {
"type": "object",
"properties": {
"code": {
"type": "string",
"enum": ["IND"]
}
},
"required": ["code"]
}
},
"required": ["city", "country"]
},
"bap_id": {
"type": "string",
"pattern": "^(?!https?://).*$"
},
"bpp_id": {
"type": "string",
"pattern": "^(?!https?://).*$"
},
"ttl": {
"type": "string",
"format": "duration"
},
"timestamp": {
"type": "string",
"format": "date-time"
}
},
"required": [
"location",
"domain",
"action",
"message_id",
"transaction_id",
"timestamp",
"bap_id",
"bap_uri",
"ttl"
]
}
]
},
"message": {
"type": "object",
"properties": {
"intent": {
"allOf": [
{
"type": "object",
"properties": {
"payment": {
"type": "object",
"properties": {
"collected_by": {
"type": "string",
"enum": ["BPP", "BAP"]
},
"tags": {
"type": "array",
"minItems": 2,
"maxItems": 2,
"uniqueItems": true,
"items": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": {
"code": {
"type": "string",
"enum": ["SETTLEMENT_TERMS", "BUYER_FINDER_FEES"]
}
}
}
},
"required": ["descriptor"]
}
}
},
"required": ["collected_by"]
},
"fulfillment": {
"type": "object",
"properties": {
"stops": {
"type": "array",
"items": {
"type": "object",
"properties": {
"location": {
"type": "object",
"properties": {
"gps": { "type": "string" }
},
"required": ["gps"]
},
"type": {
"type": "string",
"enum": ["START", "END"]
}
},
"required": ["location", "type"]
},
"minItems": 2
}
},
"required": ["stops"]
}
},
"required": ["payment", "fulfillment"]
}
]
}
},
"required": ["intent"]
}
},
"required": ["context", "message"]
}

View File

@@ -0,0 +1,11 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://ondc.org/trv10/2.0.0/select",
"type": "object",
"allOf": [
{ "$ref": "../core/v1.1.0/select.json#" },
{ "$ref": "https://beckn.org/schema/select#" },
{ "$ref": "./init.json#/$defs/init_schema_1" },
{ "$ref": "../paths/init.json#/$defs/init_schema_2" }
]
}

View File

@@ -0,0 +1,29 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://ondc.org/trv10/2.0.0/status",
"type": "object",
"allOf": [
{
"$ref": "../core/v1.1.0/status.json#"
},
{
"$ref": "https://beckn.org/schema/status#"
},
{
"$ref": "./init.json#/allOf/2"
},
{
"properties": {
"message": {
"type": "object",
"properties": {
"order_id": {
"type": "string"
}
},
"required": ["order_id"]
}
}
}
]
}

View File

@@ -0,0 +1,16 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://ondc.org/trv10/2.0.0/support",
"type": "object",
"allOf": [
{
"$ref": "../core/v1.1.0/support.json#"
},
{
"$ref": "https://beckn.org/schema/support#"
},
{
"$ref": "./init.json#/allOf/2"
}
]
}

View File

@@ -0,0 +1,16 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://ondc.org/trv10/2.0.0/track",
"type": "object",
"allOf": [
{
"$ref": "../core/v1.1.0/track.json#"
},
{
"$ref": "https://beckn.org/schema/track#"
},
{
"$ref": "./init.json#/allOf/2"
}
]
}

View File

@@ -0,0 +1,38 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://ondc.org/trv10/2.0.0/update",
"type": "object",
"allOf": [
{
"$ref": "../core/v1.1.0/update.json#"
},
{
"$ref": "https://beckn.org/schema/update#"
},
{
"$ref": "./init.json#/allOf/2"
},
{
"properties": {
"message": {
"type": "object",
"properties": {
"order": {
"type": "object",
"properties": {
"id": {
"type": "string"
}
},
"required": ["id"]
},
"update_target": {
"type": "string",
"pattern": "^[^,]+(,[^,]+)*$"
}
}
}
}
}
]
}