Raw schema
{
"type": "object",
"properties": {
"required_date": {
"type": "string",
"description": "Delivery date, yyyy-mm-dd."
},
"currency": {
"type": "string",
"pattern": "^[A-Za-z]{3}$"
},
"location_id": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991,
"description": "Location id (must be accessible to the key user)."
},
"legal_entity_id": {
"description": "Required when the company uses legal entities.",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"budget_id": {
"description": "Budget line id.",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"note": {
"description": "Plain-text note (stored as HTML).",
"type": "string",
"maxLength": 4000
},
"custom_fields": {
"description": "Document custom field values (department, project, GL account...). Every required one must be given.",
"maxItems": 50,
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991,
"description": "The document custom field id."
},
"value": {
"type": "string",
"maxLength": 500,
"description": "Dropdown: the option id as text. Text: the text. Date: an ISO 8601 date."
},
"type": {
"anyOf": [
{
"type": "number",
"const": 1
},
{
"type": "number",
"const": 2
},
{
"type": "number",
"const": 3
}
],
"description": "1 dropdown, 2 text, 3 date."
}
},
"required": [
"id",
"value",
"type"
]
}
},
"items": {
"minItems": 1,
"maxItems": 500,
"type": "array",
"items": {
"type": "object",
"properties": {
"item_id": {
"description": "A catalog item id; its name, SKU and type then come from the catalog.",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"name": {
"description": "Item name (required without item_id).",
"type": "string",
"minLength": 1,
"maxLength": 500
},
"quantity": {
"type": "number",
"exclusiveMinimum": 0,
"maximum": 1000000000
},
"price": {
"type": "number",
"minimum": 0,
"maximum": 1000000000000,
"description": "Unit price in the document currency."
},
"type": {
"description": "0 non-inventory (default), 1 inventory, 2 service, 3 shipping, 4 tax.",
"type": "integer",
"minimum": 0,
"maximum": 4
},
"supplier_id": {
"description": "Supplier id for this line.",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"quantity",
"price"
]
}
}
},
"required": [
"required_date",
"currency",
"location_id",
"items"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}