{
"oneOf": [
{
"type": "object",
"properties": {
"endpoint": { "const": "get_order" },
"method": { "const": "GET" },
"path": { "const": "/orders/{order_id}" },
"path_params": {
"type": "object",
"properties": {
"order_id": { "type": "string", "pattern": "^ORD-[0-9]{4,10}$" }
},
"required": ["order_id"],
"additionalProperties": false
}
},
"required": ["endpoint", "method", "path", "path_params"],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"endpoint": { "const": "create_refund" },
"method": { "const": "POST" },
"path": { "const": "/refunds" },
"body": {
"type": "object",
"properties": {
"order_id": { "type": "string", "pattern": "^ORD-[0-9]{4,10}$" },
"amount": { "type": "number", "minimum": 0.01 },
"reason": {
"type": "string",
"enum": ["duplicate", "fraud", "requested_by_customer", "other"]
}
},
"required": ["order_id", "amount", "reason"],
"additionalProperties": false
}
},
"required": ["endpoint", "method", "path", "body"],
"additionalProperties": false
}
]
}