apicreateproposalfromcatalog JSON request body agent create
POST /api/createproposalfromcatalog creates a proposal from catalog product ids or SKUs. Line prices, VAT, and names come from the catalog unless you override price.
This is the simple quoting path for agents. It does not accept inline product objects, groups, or child trees. Use /api/createproposal for full editor JSON, or /api/createproposalfromtemplate to clone existing lines.
Optional template_id copies proposal settings and custom fields from that proposal. It does not copy template line items; items is the source of lines.
Top-level JSON fields
keyAPI key. You may send Authorization: Bearer or X-Api-Key instead.
nameProposal name. Also accepted as proposal.name.
itemsCatalog lines. Each item needs product_ref, sku, or numeric id, plus optional ammount (alias amount, default 1). Optional price and discount override catalog values.
contactExisting contact id or a contact object accepted by /api/createcontact.
template_idProposal whose settings and extra fields are copied after create. Line items are not copied.
Minimal request
{
"key": "YOUR_API_KEY",
"name": "Quote for Example UAB",
"contact": {
"name": "Example UAB",
"email": "john@example.com"
},
"items": [
{ "sku": "TERRAX-40", "ammount": 2 },
{ "product_ref": 15, "ammount": 1 }
]
}
Response
{
"status": "ok",
"data": {
"proposal": { "id": 456, "name": "Quote for Example UAB" },
"entries": [],
"url": "https://example.com/offer/generated-url"
}
}
Error responses
Unknown products return field-level errors and a stable code. The proposal is not created if any item fails.
{
"status": "error",
"data": "unknown product",
"code": "unknown_product",
"errors": [
{ "field": "items.0.product_ref", "code": "unknown_product", "message": "Product not found: MISSING-SKU" }
]
}
name_required,items_required,unknown_product,template_not_found- Auth:
api disabled,no key,wrong key(HTTP 403)