apicreateproposal — complete JSON reference all fields field-by-field
POST /api/createproposal — maximal request schema, accepted values, defaults, and server overrides. For shorter examples, see apicreateproposal.html.
- The JSON below shows every field the API can accept. You normally send only the subset you need.
- Proposal fields may be sent inside
proposalor at the top level. When both exist,proposalwins for proposal fields;authorandownermay also be sent at top level. - Inline
product_refobjects use the same schema as apicreateproduct (withoutkey). - Inline
contactobjects use the same schema as apicreatecontact (withoutkey).
Full maximal JSON
Every supported key in one payload. Placeholder values illustrate types and typical shapes.
{
"key": "YOUR_API_KEY",
"proposal": {
"name": "Website project",
"type": 0,
"url": "custom-url-only-when-type-1",
"created": "2026-07-08",
"deadline": "2026-08-07",
"currency": "EUR",
"language": "lt",
"author": 3,
"owner": 3,
"edited": 3,
"status": 0,
"discount": 5,
"tax": 0,
"comment": "Internal comment shown in editor",
"usercomment": "Client-visible comment",
"confirmable": 1,
"accepted": 0,
"hide": 0,
"hidecus": 0,
"hidepronr": 0,
"deleted": 0,
"locked": 0,
"client": "Client Company",
"code": "300000001",
"person": "Jane Doe",
"project": "Project code",
"selling": "2026-07-15",
"arriving": "2026-07-20",
"done": "2026-09-01",
"soldby": 3,
"colors": "",
"people": 10,
"gramsperperson": 250,
"proprice": 0,
"margin": 0,
"marginper": 0,
"turnover": 0,
"total": 0,
"edit_amount": 0,
"showpriceperperson": 0,
"showgroup": 0,
"template": 0,
"listtype": 0,
"header": "",
"opacity": 0,
"archive": 0,
"shop": 0,
"started": "",
"form_id": 0,
"video": "",
"zoho": "",
"zohod": 0,
"scoro": 0,
"bitrix": "",
"bitrixlead": 0,
"bitrixdeal": 0,
"unicode": "auto-generated-if-omitted"
},
"name": "Alternative top-level name (ignored if proposal.name is set)",
"author": 3,
"owner": 3,
"contact": 123,
"contact_object_example": {
"id": 123,
"name": "Client Company",
"code": "300000001",
"phone": "+37060000000",
"email": "info@client.example",
"address": "Example street 1",
"person": "Jane Doe",
"manager": 3,
"lead": "",
"lead_data": "",
"zoho_id": "",
"vat": "LT123456789",
"website": "https://client.example",
"city": "Vilnius",
"meta": {
"payment_terms": "14 days",
"custom_field": "any value"
}
},
"settings": {
"advanceper": 30,
"showgroup": 1,
"thediscount": "5%",
"hidepronr": 0,
"textcolor": "#111827",
"offtags": 0,
"selectoff": 0,
"groupinstotal": 0,
"dicper": 0,
"perpos": 0,
"decprice": 0,
"fiveround": 0,
"hidecusrr": 0,
"proptitle": "",
"expandheadfoot": 0,
"movebuttons": 0,
"thepayon": 0,
"setcompany": 0,
"shop_image": "",
"shop_text": ""
},
"advanceper": 30,
"showgroup": 1,
"thediscount": "5%",
"groups": [
{
"name": "Main work",
"title": "Alternative group title key",
"product": "Alternative group title key",
"advance": 30,
"price": 30,
"entries": [
{
"product_ref": 15,
"product": "Line title override",
"link": 15,
"sku": "SKU-001",
"product_variation_id": 0,
"variation": "",
"ammount": 2,
"ammount2": 1,
"amount": 2,
"amount2": 1,
"unit": "vnt",
"unit2": "vnt",
"price": 100,
"prime": 80,
"discount": 0,
"discount_type": 0,
"pvm": 21,
"withpvm": 0,
"supplier": "Supplier A",
"marper": 0,
"deli": 0,
"price_per_unit": 0,
"comment": "Short description / HTML",
"notes": "Internal notes",
"image": "gallery-id-or-path",
"tags": "1,2,3",
"group": "Main work",
"attribute": "",
"grams": 0,
"accepted": 0,
"acceptable": 0,
"selectable": 0,
"required": 0,
"periodical": 0,
"pricetype": 0,
"amounttype": 0,
"edit_amount": 0,
"hide_amount": 0,
"addup": 0,
"amname": "",
"template": 0,
"counterpri": 0,
"preview": 0,
"translations": {
"en": { "product": "English line title", "comment": "English description" }
},
"feature_values": {
"12": [44, 45],
"15": "custom text"
},
"feature_custom_text": { "15": "custom text" },
"feature_custom_number": { "20": "5" },
"children": [
{
"product_ref": "INCLUDED-SKU-001",
"ammount": 1,
"selectable": 1,
"accepted": 1
}
]
},
{
"product": "Informational row",
"attribute": "text_sep",
"comment": "<p>HTML content</p>"
}
]
}
],
"entries": [
{
"product_ref": {
"name": "Inline created product",
"sku": "INLINE-001",
"category": "API products",
"price": {
"Supplier A": {
"1": [50, 75, 0, 5]
}
}
},
"ammount": 1
}
]
}
Note: send either entries or groups, not both as required lists. The example above shows both only for documentation. contact_object_example is not a real key — use contact with one of the supported formats below.
Top-level fields
keyAPI key. Removed before processing.
proposalContainer for proposal table fields. If omitted, proposal fields may be sent at top level instead.
contactExisting contact id, or a contact object (see Contact object). On success, client, code, and person are copied onto the proposal.
entriesFlat list of proposal lines. Each item is an entry object (see Entry fields).
groupsCreates grouped lines with a group_sep row per group. See Groups.
settingsPer-proposal settings stored in the settings table. See Settings object. Individual setting keys may also be sent at top level.
author, ownerMay be sent at top level even when using a proposal object. Merged into proposal payload when not already inside proposal.
Proposal fields
All columns mass-assignable on the proposals table. Send inside proposal or at top level.
| Field | Type | Default / notes |
|---|---|---|
name | string | Required. Proposal title. |
nr | int | Server-generated. Any submitted value is ignored. |
url | string | Only accepted when type = 1 (Global). Otherwise always generated server-side. |
type | int | Default 0. See proposal types. |
created | date string | Default today (Y-m-d). |
deadline | date string | Default created + ofexp days from app settings (usually 30). |
currency | string | Default from app setting currency (e.g. EUR). |
language | string | Default from app setting mainlang. |
author | int | User id. Default from API user resolution logic when omitted. |
owner | int | User id. Defaults to author. |
edited | int | User id. Defaults to author. |
status | int | Default 0 (Pending). See status values. |
discount | number | Proposal-level discount percent. Default 0. |
tax | number | Default 0. |
comment | string | Default empty string. |
usercomment | string | Client-facing comment field. |
confirmable | 0 | 1 | Whether client can confirm the offer. Default from app setting confirmable. |
accepted | 0 | 1 | Proposal acceptance flag. Default 0. |
hide | 0 | 1 | Hide proposal. Default 0. |
hidecus | 0 | 1 | Hide customer block. Default 0. |
hidepronr | 0 | 1 | Hide proposal number on frontend. |
deleted | 0 | 1 | Soft-delete flag. Default 0. |
locked | 0 | 1 | Lock proposal editing. |
client | string | Client company name. Set automatically when contact resolves. |
code | string | Client code / company code. Set from contact when resolved. |
person | string | Contact person name. Set from contact when resolved. |
project | string | Project reference. |
selling | date string | Selling date. |
arriving | date string | Arrival date. |
done | date string | Completion date. |
soldby | int | User id of salesperson. |
colors | string | Color configuration (app-specific). |
people | int | People count (catering module). |
gramsperperson | number | Grams per person (catering module). |
proprice | number | Per-person price. |
margin | number | Margin amount. |
marginper | number | Margin percent. |
turnover | number | Turnover value. |
total | number | Recalculated after entries are created. |
edit_amount | 0 | 1 | Allow amount editing on frontend. |
showpriceperperson | 0 | 1 | Show per-person price. |
showgroup | 0 | 1 | Show group prices. Stored as a proposal setting and copied onto the proposals.showgroup column so getproposals returns the saved value. |
template | int | Public offer layout (0, 1, 2). Default from company template setting when omitted. |
listtype | int | List display type. |
header | string | Custom header content. |
opacity | number | Header/footer opacity. |
archive | 0 | 1 | Archive flag. |
shop | 0 | 1 | Shop/global shop flag. |
started | string | Started timestamp/text. |
form_id | int | Linked form id. |
video | string | Video URL or embed. |
unicode | string | Random 32-char string if omitted. |
zoho | string | Zoho integration id. |
zohod | int | Zoho deal flag. |
scoro | int | Scoro integration id. |
bitrix | string | Bitrix id string. |
bitrixlead | int | Bitrix lead id. |
bitrixdeal | int | Bitrix deal id. |
Contact object
When contact is an object, it is created or updated via the same logic as POST /api/createcontact. See apicreatecontact.html for full details.
| Field | Type | Notes |
|---|---|---|
id | int | If provided and found, existing contact is used (no create). |
name | string | Required when creating/updating by object. |
code | string | Upsert key — matching code updates existing contact. |
phone, email, address, person | string | Core contact columns. |
manager | int | Manager user id. |
lead, lead_data | mixed | Lead tracking fields. |
zoho_id | string | Zoho contact id. |
vat, website, city | string | Legacy convenience keys saved to contact_meta. |
meta or metas | object | Custom meta fields. Keys → contact_meta.field, values → contact_meta.value. |
Settings object
Stored per proposal in the settings table. Keys may be sent inside settings or at top level.
| Key | Type | Description |
|---|---|---|
advanceper | number | Advance payment percent for groups / proposal. |
showgroup | 0 | 1 | Show group subtotals on the offer. Returned by getproposals as top-level showgroup and inside settings. |
thediscount | string | Discount label/text shown on offer (e.g. "5%"). Value "0" is stored as empty. |
hidepronr | 0 | 1 | Hide proposal number on frontend. |
textcolor | string | Text color (hex or CSS color). |
offtags | 0 | 1 | Offer tags display option. |
selectoff | 0 | 1 | Hide parent SELECT! / accept buttons on the public offer (1 = hide, editor: “Hide select button”). Default 0 shows them. Does not hide child selectable: 1 toggles. Distinct from entry selectable. |
groupinstotal | 0 | 1 | Include group rows in total calculation. |
dicper | number | Dictionary / display percent setting. |
perpos | number | Per-position setting. |
decprice | 0 | 1 | Decimal price display. |
fiveround | 0 | 1 | Round prices to nearest 5. |
hidecusrr | 0 | 1 | Hide customer on offer. |
proptitle | string | Custom proposal title override. |
expandheadfoot | 0 | 1 | Auto-expand header and footer in editor. |
movebuttons | 0 | 1 | Move action buttons on frontend. |
thepayon | 0 | 1 | Enable payment on offer. |
setcompany | 0 | 1 | Company display setting. |
shop_image | string | Shop/global offer image. |
shop_text | string | Shop/global offer text. |
Any other proposal setting key accepted by the app's settings helper may also be stored if sent inside settings. Array values are JSON-encoded before storage. Do not send tunc. tunc is a company setting (“Separate prices for included products”), not a proposal setting. The public offer and /accepting read it from company settings. A proposal-level tunc value is ignored and does not update group subtotals or the sticky/footer total. Group subtotals use showgroup. When company tunc is on and the parent has addup: 1, a bundle sumbox is shown next to included children. There is no showvat or showtax createproposal setting. The public offer hides the VAT row when the proposal tax rate and every commercial line are 0%.
Groups
Each group creates one group_sep entry, then creates the group's entries with the group name assigned.
| Field | Type | Notes |
|---|---|---|
name | string | Group title. Used for group_sep row and entry group value. |
title | string | Alias for name. |
product | string | Alias for name. |
advance | number | Advance percent stored on the group_sep row price field. |
price | number | Alias for advance on the separator row. |
entries | array | Entry objects belonging to this group. |
Entry fields
Each item in entries[] or groups[].entries[]. All entries table fillable columns are accepted.
Product linking
| Field | Type | Notes |
|---|---|---|
product_ref | int | string | object | Primary product reference. See Product references. |
product_object | object | Alias for inline product_ref object. |
product | string | int | object | Line title when string. When numeric or object, treated as product reference (like product_ref). |
link | int | Product id. Same as numeric product_ref. |
sku | string | Used as SKU lookup when no product_ref and no string product title. |
product_variation_id | int | Variation id for the line. |
variation | string | Variation label/text. |
Line content and pricing
| Field | Type | Default / notes |
|---|---|---|
product | string | Line title. Defaults to linked product name when product resolves. |
ammount | number | Primary quantity. Default 1. Alias: amount. |
ammount2 | number | Secondary quantity. Default 1. Alias: amount2. |
unit | string | Primary unit. Default vnt or product units. |
unit2 | string | Secondary unit. Default vnt or product units2. |
price | number | Sale/unit price. Default from product tier when linked. |
prime | number | Cost price. Default from product tier when linked. |
supplier | string | Supplier name for pricing tier. |
discount | number | Line discount. Default 0. |
discount_type | 0 | 1 | 0 = percent, 1 = fixed currency amount. |
pvm | number | VAT rate percent. Default from product or app mainpvm. |
withpvm | 0 | 1 | Price includes VAT. |
marper | number | Margin percent. Default 0. |
deli | number | Delivery cost component. Default 0. |
price_per_unit | number | Displayed price per unit override. |
grams | number | Weight in grams (catering). |
pricetype | 0 | 1 | 0 = percent-based calc, 1 = currency-based. |
amounttype | 0 | 1 | 0 = one amount column, 1 = two amount columns. |
periodical | 0 | 1 | Recurring / periodical line (e.g. monthly hosting). |
addup | 0 | 1 | Add-up row behavior. |
counterpri | number | Counter price field. |
Display, structure, and flags
| Field | Type | Notes |
|---|---|---|
attribute | string | Row type. Default "0" for product rows (empty is stored as "0"). See attribute values. |
group | string | Group name. Set automatically for lines inside groups[]. |
comment | string | Description / HTML. Defaults to product description when linked. |
notes | string | Internal notes (not shown to client). |
image | string | Image reference. Defaults to product gallery when linked. |
tags | string | Comma-separated tag ids. |
accepted | 0 | 1 | Row is selected/accepted (selection offers). |
acceptable | 0 | 1 | Row can be accepted by client. |
selectable | 0 | 1 | Child rows only. 1 = this included child has its own SELECT toggle on the public offer. 0 = not individually toggleable (mandatory included / packing). Does not hide the parent product's SELECT! button — use proposal selectoff: 1 for that. selectable: 0 on a top-level parent is stored but unused for parent SELECT!. |
required | 0 | 1 | Required included item. |
edit_amount | 0 | 1 | Allow client to edit quantity. |
hide_amount | 0–3 | 0 show, 1 hide both, 2 hide primary, 3 hide secondary. |
amname | string | Custom amount column label. |
template | int | Template line reference. |
preview | 0 | 1 | Preview-only row. |
translations | object | Per-language overrides, e.g. { "en": { "product": "...", "comment": "..." } }. |
children | array | Nested child entries. See Child entries. |
order, orderp, parent, and proposal are assigned automatically. Do not send them unless you have a specific reason.
Product references
product_ref (or numeric/object product, or link, or bare sku) resolves in this order:
- Integer id — existing product by
products.id - String SKU — existing product by
products.sku - Object with
id— lookup by id - Object with
sku— lookup by SKU - Object without match — inline create via
apicreateproductlogic
Inline product object
Full product schema: apicreateproduct.html. Common keys:
{
"name": "Created inline product",
"sku": "INLINE-001",
"category": "Services",
"price": {
"Supplier A": {
"1": [50, 75, 0, 5]
}
},
"description": "Short description",
"withpvm": 0,
"attributes": [],
"variations": []
}
Price tier array: [cost, sale_price, delivery, discount]. Tier keys are strings ("1", "10", etc.).
When a product resolves, these entry fields are auto-filled from the product if not explicitly sent: link, product (name), sku, unit, unit2, pvm, withpvm, grams, amounttype, hide_amount, comment, image, price, prime, supplier.
Feature values on entries
Save product feature selections on a line. Keys are product_features.id values.
feature_valuesGeneral feature values. Value may be a string, number, or array of option ids.
feature_custom_textCustom text features (type 2). Keys = feature id, value = text.
feature_custom_numberAmount/calculation features (type 3). Keys = feature id, value = number as string.
{
"product_ref": "SKU-001",
"feature_values": {
"12": [44, 45],
"15": "custom text"
},
"feature_custom_text": { "15": "custom text" },
"feature_custom_number": { "20": "5" }
}
Child entries
children[] creates nested lines linked to the parent through the parent / orderp system (included products, selectable add-ons, etc.).
- Child objects use the same fields as regular entries.
- Set
selectable: 1on children the client may toggle on/off. That child flag does not hide the parent's SELECT! button. - Set
accepted: 1to pre-select a selectable child. - Required / packing children use
selectable: 0(no child SELECT toggle). - Children may themselves contain
children[](recursive).
Enums and constants
Proposal type
| Value | Meaning |
|---|---|
0 | Normal proposal |
1 | Global proposal (custom url accepted) |
2 | Merch |
3 | Merch Global |
4 | Template (used by getproposals templates_only) |
Proposal status
| Value | Meaning |
|---|---|
0 | Pending |
1 | Ready |
2 | Sent |
3 | Negotiations/updating |
4 | Confirmed |
5 | Invoice sent |
6 | In process |
7 | Completed/follow-up |
8 | Rejected |
9 | Expired |
10 | Order sent |
Entry attribute
| Value | Meaning |
|---|---|
"" (empty) or omitted | Normalized to 0 (normal product / service line) |
0 | Normal product / service line |
group_sep | Group separator (created automatically for groups[]) |
text_sep | Informational text row (HTML in comment) |
header | Header block row |
footer | Footer block row |
Entry hide_amount
| Value | Meaning |
|---|---|
0 | Do not hide amount |
1 | Hide both amounts |
2 | Hide primary amount (price may be multiplied by hidden amount on display) |
3 | Hide secondary amount |
Aliases and server rules
amount→ammount,amount2→ammount2product_object→ same as inlineproduct_refobject- Group
title/product→ groupname - Group
price→ groupadvance nris always regenerated; submitted value ignoredurlis only honored fortype = 1; otherwise regenerated- Proposal totals (
total, margins, etc.) are recalculated after all entries are created - Transaction rolls back on validation errors (e.g. missing name, missing entries)
Responses
Success
{
"status": "ok",
"data": {
"proposal": {
"id": 123,
"name": "Website project",
"url": "abc123def456",
"nr": 1042,
"client": "Client Company",
"code": "300000001",
"total": 1500,
"...": "all proposal columns"
},
"entries": [
{
"id": 501,
"proposal": 123,
"product": "Design work",
"link": 15,
"ammount": 1,
"price": 500,
"...": "all entry columns",
"images": [],
"feature_values": []
}
],
"url": "https://your-domain/offer/abc123def456"
}
}
Errors
Response data | Cause |
|---|---|
api disabled | API access not enabled for tenant/plan |
no key | Missing key |
wrong key | Invalid API key |
name required | No name at top level or inside proposal |
entries required | Neither entries nor groups provided |
contact not found | contact id does not exist |
contact must be id or object | Invalid contact type |
name invalid | Inline contact object missing name |
bad proposal data | Proposal row failed to persist |
- apicreateproposal.html — shorter guide with practical examples
- apicreatecontact.html — full contact payload
- apicreateproduct.html — full inline product payload
- apicreateproposalfromtemplate.html — clone from template instead