Raw schema
{
"type": "object",
"properties": {
"params": {
"$ref": "#/$defs/CreateOrderInput"
}
},
"required": [
"params"
],
"$defs": {
"CartItem": {
"additionalProperties": false,
"description": "One cart line — EITHER a catalogue product OR a quoted custom cake.\n\nCatalogue line: {\"product_id\": \"...\", \"quantity\": 1, \"icing_text\": \"...\"}\nCustom cake line: {\"custom_cake_request_id\": \"...\", \"phone\": \"+9477...\"}\nThe custom cake line is turned into the staff-quoted cake server-side\n(name, picture, price); quantity is always 1 and no price is ever sent.",
"properties": {
"product_id": {
"anyOf": [
{
"maxLength": 80,
"minLength": 3,
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Kapruka product ID (e.g. 'cakeXX000000'). Catalogue line.",
"title": "Product Id"
},
"quantity": {
"anyOf": [
{
"maximum": 99,
"minimum": 1,
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"description": "Quantity (1–99, default 1). Catalogue lines only.",
"title": "Quantity"
},
"icing_text": {
"anyOf": [
{
"maxLength": 120,
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Cake icing text. Silently ignored for non-cake products. Catalogue lines only.",
"title": "Icing Text"
},
"custom_cake_request_id": {
"anyOf": [
{
"maxLength": 80,
"minLength": 6,
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "request_id of a custom cake that kapruka_custom_cake_status reports as 'quoted'. Orders the staff-quoted cake (quantity 1). Requires `phone`.",
"title": "Custom Cake Request Id"
},
"phone": {
"anyOf": [
{
"maxLength": 30,
"minLength": 7,
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The customer.phone the custom cake request was made with (custom cake lines only).",
"title": "Phone"
}
},
"title": "CartItem",
"type": "object"
},
"CreateOrderInput": {
"additionalProperties": false,
"properties": {
"cart": {
"description": "1–30 items.",
"items": {
"$ref": "#/$defs/CartItem"
},
"maxItems": 30,
"minItems": 1,
"title": "Cart",
"type": "array"
},
"recipient": {
"$ref": "#/$defs/Recipient"
},
"delivery": {
"$ref": "#/$defs/Delivery"
},
"sender": {
"$ref": "#/$defs/Sender"
},
"gift_message": {
"anyOf": [
{
"maxLength": 300,
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Optional gift card message.",
"title": "Gift Message"
},
"currency": {
"default": "LKR",
"description": "Pricing currency. Supported: LKR, USD, GBP, AUD, CAD, EUR.",
"title": "Currency",
"type": "string"
},
"response_format": {
"default": "markdown",
"description": "'markdown' (default) or 'json'.",
"title": "Response Format",
"type": "string"
}
},
"required": [
"cart",
"recipient",
"delivery",
"sender"
],
"title": "CreateOrderInput",
"type": "object"
},
"Delivery": {
"additionalProperties": false,
"properties": {
"address": {
"description": "Street address.",
"maxLength": 250,
"minLength": 3,
"title": "Address",
"type": "string"
},
"city": {
"description": "Must be a Kapruka delivery city (canonical name from kapruka_list_delivery_cities) that EVERY cart item can reach. The order ships as one shipment, so food / hotel cake / liquor items restrict the whole cart to their city set — verify with kapruka_check_delivery(city, product_id) first; otherwise the order is rejected with city_not_deliverable_for_item.",
"maxLength": 100,
"minLength": 2,
"title": "City",
"type": "string"
},
"location_type": {
"default": "house",
"description": "One of: house, apartment, office, other.",
"title": "Location Type",
"type": "string"
},
"date": {
"description": "Delivery date in YYYY-MM-DD (Asia/Colombo). Must be today or future.",
"title": "Date",
"type": "string"
},
"instructions": {
"anyOf": [
{
"maxLength": 250,
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Free-form delivery instructions.",
"title": "Instructions"
}
},
"required": [
"address",
"city",
"date"
],
"title": "Delivery",
"type": "object"
},
"Recipient": {
"additionalProperties": false,
"properties": {
"name": {
"description": "Recipient name shown on the order.",
"maxLength": 80,
"minLength": 1,
"title": "Name",
"type": "string"
},
"phone": {
"description": "Recipient phone — E.164 (+9477…) or local SL (077…) format.",
"maxLength": 30,
"minLength": 7,
"title": "Phone",
"type": "string"
}
},
"required": [
"name",
"phone"
],
"title": "Recipient",
"type": "object"
},
"Sender": {
"additionalProperties": false,
"properties": {
"name": {
"description": "Sender name on the gift card.",
"maxLength": 80,
"minLength": 1,
"title": "Name",
"type": "string"
},
"anonymous": {
"default": false,
"description": "If true, gift card shows 'Anonymous' instead of the sender name.",
"title": "Anonymous",
"type": "boolean"
}
},
"required": [
"name"
],
"title": "Sender",
"type": "object"
}
},
"title": "kapruka_create_orderArguments"
}