{
  "name": "create_shipping_label",
  "slug": "shipping-label",
  "description": {
    "th": "เตรียมใบปะหน้าพัสดุหนึ่งใบ ชื่อ เบอร์ ที่อยู่ผู้รับและผู้ส่ง พร้อมรายการสินค้า ได้ลิงก์เปิดหน้าเว็บที่กรอกข้อมูลไว้แล้วให้ผู้ใช้ตรวจและดาวน์โหลด PDF",
    "en": "Prepares one shipping label: receiver and sender name, phone and address, plus an optional item list. Returns a link to a prefilled page where the user checks it and downloads the PDF."
  },
  "inputSchema": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "receiver": {
        "description": "The receiver (name and rawAddress required).",
        "type": "object",
        "properties": {
          "name": {
            "description": "Name.",
            "type": "string",
            "maxLength": 80
          },
          "phone": {
            "description": "Phone.",
            "type": "string",
            "maxLength": 30
          },
          "rawAddress": {
            "description": "Full address as one text, with postcode; the page splits it.",
            "type": "string",
            "maxLength": 240
          }
        },
        "required": [
          "name",
          "rawAddress"
        ],
        "additionalProperties": false
      },
      "sender": {
        "description": "The sender; any field may be empty.",
        "type": "object",
        "properties": {
          "name": {
            "description": "Name.",
            "type": "string",
            "maxLength": 80
          },
          "phone": {
            "description": "Phone.",
            "type": "string",
            "maxLength": 30
          },
          "rawAddress": {
            "description": "Full address as one text, with postcode; the page splits it.",
            "type": "string",
            "maxLength": 240
          }
        },
        "required": [],
        "additionalProperties": false
      },
      "lines": {
        "description": "Items in the parcel, at most 50; printed as one items text (\"name x2 unit; ...\") of at most 600 characters.",
        "type": "array",
        "maxItems": 50,
        "items": {
          "type": "object",
          "properties": {
            "description": {
              "description": "Item.",
              "type": "string",
              "maxLength": 200
            },
            "qty": {
              "description": "Quantity, a number or short text.",
              "anyOf": [
                {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 999999999
                },
                {
                  "type": "string",
                  "maxLength": 40
                }
              ]
            },
            "unit": {
              "description": "Unit, e.g. ชิ้น.",
              "type": "string",
              "maxLength": 40
            }
          },
          "required": [
            "description"
          ],
          "additionalProperties": false
        }
      }
    },
    "required": [
      "receiver"
    ],
    "additionalProperties": false
  }
}
