Documents.Add
Create a business document for a customer, such as invoice, receipt, receipt-tax-invoice, credit invoice, proposal, purchase order, or delivery document. Customer identity alone is not enough: for a normal invoice also send final_amount and items (or products). The response returns the created document id and PDF link when a PDF is generated.
Required Choice
Send at least one complete option from the list below.
| Option | Accepted Fields | Explanation |
|---|---|---|
| 1 | customer_id or email or mobile or phone | One of these values is required to create the record. |
Permissions
- User must be logged in with a valid bearer token.
- User must be allowed to create documents for the selected customer and invoice company.
- When invoice_setting_id is sent, it must belong to the same account. If omitted, the account default invoice company is used.
Action
- Creates a row in the Documents table and generates the business document/PDF when the selected type supports it.
- If customer_id is omitted, the system can create or reuse a customer from email or phone before creating the document.
- Links related documents when related_document_id or document_to_pay is sent, including paid/canceled status updates when the type requires it.
- For product items, stock and related product counters may be updated.
- For appointment_group or appointment_type items, customer appointment package rows can be created.
- Date inputs should be sent in UTC using Y-m-d H:i:s, for example 2026-07-24 09:30:00.
Push Service
- Document creation itself does not have a dedicated public socket event in this route metadata.
- If the document send action emails or WhatsApps a customer, message/socket behavior follows the send channel settings.
Automation
- When save_as_draft is not 1, this method runs automation event document_type_{document_type}.
- Examples: invoice runs document_type_invoice, receipt runs document_type_receipt, purchase_orders runs document_type_purchase_orders.
- Automation receives customer data plus document_type, document_link, doc_insert_id, final_amount, items, and paid_status.
Special Instructions
- Required Choice below only covers customer identity (customer_id or email/mobile/phone). That is not a complete Documents.Add payload.
- For a normal invoice (default document_type), also send final_amount and items[], or send products[] instead of items. Sending only customer fields returns an error.
- Use document_type to choose the sub-document rules in Document Types below. If omitted, invoice is used.
- Payment methods are only for receipt-like documents: receipt, receipt_partly_paid, receipt_tax_invoice, gi_ir, organization_receipt. Do not send payment_method for invoice / proforma / credit / proposal / purchase_orders / delivery_invoice.
- Two payment styles: (1) Single method: send payment_method plus that method fields, and call_multi_receipt_fun=1 for receipt-like types. (2) Mixed payments: send call_multi_receipt_fun=1 and multiple_receipt_detail as a JSON array; each block needs payment_method and pay_amount. Sum of pay_amount must equal final_amount.
- See Payment Methods below for required fields per payment_method (cash, cc, check, transference, masav, others, bit, payby_credit, paybridge_tranzila, stripe_iframe, nedarim_payment).
- Empty items are allowed only for special/simple payment flows or when linking related_document_id / document_to_pay.
- Each items[] line should include item_name, item_qty, item_price, item_total. Also send iteeeem_id (product id, or 0 for free-text), item_discount_type (percentage or price), and item_discount (default 0). Missing iteeeem_id can fail product sold inserts.
- Optional per line: item_storageid = warehouse id from Storage.List (storage.id). Important for delivery / stock movement documents.
- Optional add_order2-compatible shortcut: send products[] (and optional order JSON) instead of items. The App layer converts products into items, looks up or creates catalog products by sku, and calculates totals when final_amount is omitted. If both items and products are sent, items wins.
- Message "Please fill required fields" (no "...") means credit-card payment fields are missing when payment_method=cc. It does not mean customer_id is missing.
- create_recept_automatic is always forced to 1 by the App layer for Documents.Add so PDF generation runs. Callers do not need to send it.
- Use save_as_draft=1 when the UI should save without issuing the final document number.
- For credit or payment documents, send related_document_id or document_to_pay when the new document must be linked to an existing document.
- To use a custom PDF design, create and activate the PDF template in settings first. Then send pdf_template_id, or leave it empty to use the active default template for this document type.
Required Parameters
No body parameters are required for this function.
Optional Parameters
| Name | Type | Sample | What it gives |
|---|---|---|---|
customer_idpost | int | 123 | Existing customer id. If omitted, send email or phone/mobile so the system can create or reuse a customer. |
namepost | string | John Demo | Customer name printed on the document and used when creating a customer. |
emailpost | [email protected] | Customer email. Required when creating a customer if no phone/mobile is sent. Also used for send_email. | |
mobilepost | string | 0500000000 | Customer mobile. Required when creating a customer if no email is sent. Also used for WhatsApp sends. |
phonepost | string | 0500000000 | Alias/additional phone field for customer and billing details. |
addresspost | string | 1 Demo Street | Customer billing address printed on the document. |
citypost | int|string | 7 | Customer city id or city text, depending on account settings. |
corporationpost | string | 123456789 | Customer tax/company id. May be required by invoice company settings or Invoice Israel approval. |
company_namepost | string | Demo Ltd | Customer company name printed on the document. |
document_typepost | string | invoice | Document type. Supported: invoice, credit_invoice, proforma_invoice, receipt, receipt_partly_paid, receipt_tax_invoice, gi_ir, order_proposals, purchase_orders, delivery_invoice, organization_receipt. |
invoice_setting_idpost | int | 5 | Invoice company/settings id from InvoiceSettings.List. If omitted, the default invoice company is used. |
pdf_template_idpost | int | 12 | Optional custom PDF template id. If empty, the active default custom template is used when one exists for the user/company/document type. |
pdf_template_strictpost | int | 1 | 1 means fail with an error if the selected template is invalid or cannot render. If omitted or 0, the system can fall back to the standard PDF design. |
document_langpost | string | he | Document language, for example he or en. |
final_amountpost | number | 100.00 | Final amount of the document. Practically required for a normal invoice (together with items or products). For receipt/payment documents this must match payment total. |
totalpost | number | 85.47 | Subtotal before tax when the UI calculates it separately. Usually final_amount is enough. |
taxpost | number | 17 | Tax percentage. If tax_from_invoice=1, the invoice company tax can override this. |
include_taxpost | int | 1 | 1 means prices include tax. 0 means the engine can adjust item totals for tax. |
currencypost | string | ILS | Alias for coin. Currency/sign used on the document. |
discount_typepost | string | percentage | Document discount type: percentage or price. |
discountpost | number | 0 | Document-level discount value. |
itemspost | json|array | [{"item_name":"Demo item","item_qty":1,"item_price":100,"item_total":100,"iteeeem_id":0,"item_discount_type":"percentage","item_discount":0}] | Line item loop. Practically required for a normal invoice (or send products instead). Required per line: item_name, item_qty, item_price, item_total. Also send iteeeem_id (catalog product id, or 0 for free-text), item_discount_type (percentage/price), and item_discount. Optional item_storageid = warehouse id from Storage.List. Aliases for product id: item_id, product_id. See Loop: items[] under the selected document type. |
productspost | json|array | [{"sku":"abc01","name":"ABC","price":100,"qty":1,"discount":0,"discount_type":"percentage","item_vat_include":0,"notes":""}] | Optional add_order2-compatible product list. Used only when items is empty. Each product needs qty. sku is required except for organization_receipt. App looks up or creates the catalog product by sku, builds items[], and calculates totals when final_amount is omitted. |
orderpost | json|object | {"note":"Thank you","coin":"ils","discount":0,"tax":17} | Optional add_order2-compatible order object. Used to fill note/coin/discount/tax when those top-level fields are not already sent. |
all_items_totalpost | number | 100 | Optional pre-tax/base total helper used with products conversion or simple receipt flows when items are empty. |
check_payment_methodpost | int | 0 | Internal/safe flag. App sets this to 0 automatically for non-receipt documents when payment_method was not sent, so no documents_payments row is created. |
notepost | text | Thank you | Document note/body text. Quotes are allowed. |
note_headerpost | text | Invoice terms | Header note printed above the document body when template supports it. |
save_as_draftpost | int | 1 | 1 saves as draft/internal document where supported. Drafts do not run document automation. |
related_document_idpost | int|csv|array | 900 | Existing document id(s) to link, pay, credit, convert, or copy from depending on document_type. |
related_document_typepost | string | order_proposals | Optional relation context when linking to another document or external order source. |
document_to_paypost | int|csv|array | 900,901 | Invoice/order document ids that this receipt/payment document should mark as paid or partially paid. |
payment_methodpost | string | cash | For receipt-like documents: cash, cc, check, transference, others, masav, bit, payby_credit, paybridge_tranzila, stripe_iframe/strip_payment, nedarim_payment, or account-supported method. Do not send this for a normal invoice/proposal/order. With call_multi_receipt_fun=1 the App/API builds multiple_receipt_detail from these fields (or send multiple_receipt_detail JSON directly). |
payment_datepost | datetime | 2026-07-24 09:30:00 | UTC payment date in Y-m-d H:i:s. Defaults to current server time when omitted. Send UTC date/time as Y-m-d H:i:s, for example 2026-07-20 10:00:00. The SDK converts user local Date/local datetime input to UTC before posting. |
payment_date_documentpost | datetime | 2026-07-24 09:30:00 | Date stored for the document payment block when different from payment_date. Send UTC date/time as Y-m-d H:i:s, for example 2026-07-20 10:00:00. The SDK converts user local Date/local datetime input to UTC before posting. |
number_of_paymentspost | int | 1 | Number of payments/installments. |
c_type_paypost | string | regular | Payment schedule type: regular, installments, standing_order, or multiple_paytype for multi-payment receipt flow. |
call_multi_receipt_funpost | int | 1 | 1 enables receipt payment-block flow for receipt, receipt_tax_invoice, gi_ir, organization_receipt, or receipt_partly_paid. Send this with payment_method (single) or with multiple_receipt_detail (one or more blocks). |
multiple_receipt_detailpost | json|array | [{"payment_method":"cash","pay_amount":100,"payment_date":"2026-07-24 09:30:00"}] | Payment block loop for receipt-like docs. Each block needs payment_method and pay_amount. Total pay_amount must equal final_amount. Method-specific keys go inside each block (see Payment Methods). Prefer this for mixed payments. |
card_namepost | string | John Demo | Required for payment_method=cc when charging a new card (not saved card). |
card_nopost | string | 4580000000000000 | Required for payment_method=cc when no subscription_id/card_id is used. Full card or reader value. |
month_yearpost | string | 12-2028 | Required for payment_method=cc new card. Expiration as MM-YYYY or MM/YYYY. |
cvcpost | string | 123 | Required for payment_method=cc new card. cvv is also accepted. |
subscription_idpost | string | 55 | Saved card/subscription id for payment_method=cc without sending full card details. Maps to card_id in the payment block. |
card_idpost | string | 55 | Saved card id / processor card reference for payment_method=cc. |
other_payment_optionpost | string | PayPal | Required label/text when payment_method=others. |
check_numberpost | string|array | 1001 | For payment_method=check. One value or array of check numbers. Pair with check_sumamount. |
check_sumamountpost | number|array | 100 | For payment_method=check. Amount per check row. Non-empty rows are kept; sum should match pay_amount. |
check_datepost | date|array | 2026-07-24 | For payment_method=check. Check date per row. Send date filters and date values as UTC Y-m-d H:i:s when the route accepts date/time; date-only table columns store the Y-m-d date part. |
check_bank_detailspost | string|array | 11 | For payment_method=check. bank_details.id from Banks.List (same as dashboard check dropdown). Alias check_bank may be used by clients for the same id. Do not send a free-text bank name. |
check_acc_numberpost | string|array | 123456 | For payment_method=check. Account number per row. |
check_branch_nopost | string|array | 12 | For payment_method=check. Branch number per row. |
check_tzpost | string|array | 123456789 | For payment_method=check. ID/TZ per row. |
check_addresspost | string|array | 1 Demo St | For payment_method=check. Address per row. |
check_emailpost | email|array | [email protected] | For payment_method=check. Email per row. |
check_team_memberpost | string|array | 14 | For payment_method=check. Optional team member id per row. |
monthly_payment_for_checkpost | int | 0 | For payment_method=check. 1 marks monthly/standing check handling where supported. |
check_trans_vistapost | string | REF-001 | For payment_method=transference. Transfer reference / confirmation text. |
check_acc_number_transpost | string | 123456 | For payment_method=transference. Source account number. |
check_branch_no_transpost | string | 12 | For payment_method=transference. Source branch number. |
check_bank_namepost | string | Bank Hapoalim | For payment_method=transference. Bank name (also accept check_bank). |
check_bankpost | string | 12 | For payment_method=transference. Bank id/code stored as check_bank_id. |
deposite_to_bankpost | string | Company account | For payment_method=transference. Deposit-to account label. |
check_date_transpost | date | 2026-07-24 | For payment_method=transference. Transfer date. Send date filters and date values as UTC Y-m-d H:i:s when the route accepts date/time; date-only table columns store the Y-m-d date part. |
masav_idpost | int | 0 | For payment_method=masav. Existing masav_payment id to update; 0 creates new. |
acc_nopost | string | 123456 | Required for payment_method=masav. Customer bank account number. |
branch_nopost | string | 12 | Required for payment_method=masav. Bank branch number. |
bankpost | string | 10 | Required for payment_method=masav (הוראת קבע / standing order — not cc). Send Banks.List id (dashboard masav bank dropdown value). Banks.List also returns code (Israel clearing number) for labels; prefer id to match dashboard. |
acc_namepost | string | John Demo | Required for payment_method=masav. Account holder name. |
tzpost | string | 123456789 | Required for payment_method=masav. National ID / TZ. |
no_of_paymentpost | int | 1 | For payment_method=masav. Number of masav charges. |
bi_monthlypost | int | 0 | For payment_method=masav. 1 enables bi-monthly schedule. |
bit_payment_idpost | string | bit-123 | Required for payment_method=bit. Bit payment reference id. |
payby_credit_invoice_numberpost | string | 900 | Required for payment_method=payby_credit. Related credit/invoice number used for the payment. |
number_of_payments_paybridgepost | int | 1 | For payment_method=paybridge_tranzila. Installment count (defaults to number_of_payments). |
c_type_pay_paybridgepost | string | regular | For payment_method=paybridge_tranzila. regular or installments. |
c_type_pay_nedarimpost | string | regular | For payment_method=nedarim_payment. Schedule type; regular forces number_of_payments=1. |
number_of_payments_nedarimpost | int | 1 | For payment_method=nedarim_payment. Installment count. |
payment_date_nedarimpost | datetime | 2026-07-24 09:30:00 | For payment_method=nedarim_payment. Payment date when not regular. Send UTC date/time as Y-m-d H:i:s, for example 2026-07-20 10:00:00. The SDK converts user local Date/local datetime input to UTC before posting. |
unlimited_nedarimpost | int | 0 | For payment_method=nedarim_payment. Unlimited standing order flag. |
cc_paytype_nedarimpost | string | nedarim_payment | For payment_method=nedarim_payment. Pay type label stored on the block. |
inner_block_notepost | string | Paid at counter | Optional note on the payment block (stored as note; for nedarim also used as import_type). |
payment_amountpost | number | 100 | Single-block pay amount when not using multiple_receipt_detail. Defaults to final_amount. |
order_take_installment_typepost | int | 1 | For cc/nedarim installments. How installments are taken on the order/receipt flow. |
payment_detail_idpost | int | 12 | Payment gateway/settings id. Defaults to invoice company/default payment settings. |
payment_project_idpost | int | 8 | Payment project/accounting project id. |
create_recept_automaticpost | int | 1 | Always forced to 1 by the App layer for Documents.Add. Enables PDF generation and receipt auto-create where supported. Callers do not need to send this field. Legacy spelling is kept for PHP compatibility. |
create_receipt_sepratepost | int | 1 | For installments, create separate receipt documents when supported. Legacy spelling is kept for compatibility. |
document_paidpost | int | 1 | Initial paid status override where supported. |
document_receipt_idpost | int | 456 | Receipt document id to link when creating related documents. |
type_of_deliverypost | string | delivery | For delivery_invoice: delivery or return. Return can reverse stock/linked amounts. |
date_createdpost | datetime | 2026-07-24 09:30:00 | UTC document creation date in Y-m-d H:i:s. Account permissions may control backdating. Send UTC date/time as Y-m-d H:i:s, for example 2026-07-20 10:00:00. The SDK converts user local Date/local datetime input to UTC before posting. |
due_datepost | datetime | 2026-08-24 09:30:00 | UTC due date for order/payment terms where supported. Send UTC date/time as Y-m-d H:i:s, for example 2026-07-20 10:00:00. The SDK converts user local Date/local datetime input to UTC before posting. |
last_pay_datepost | datetime | 2026-08-24 09:30:00 | UTC last payment date for order/payment terms where supported. Send UTC date/time as Y-m-d H:i:s, for example 2026-07-20 10:00:00. The SDK converts user local Date/local datetime input to UTC before posting. |
proposal_titlepost | string | Website project | Proposal title for order_proposals templates. |
order_all_fieldspost | json|array | {"terms":"Net 30"} | Extra order/proposal fields shown by account document settings. |
extra_detailpost | json|array | {"source":"api"} | Extra document metadata saved with the document. |
arrCustomFieldpost | json|array | {"field_key":"value"} | Custom document/item fields from User.Basic field settings. |
send_emailpost | int | 1 | Alias for send_by_mail. Sends the generated document by email when settings allow it and it is not a draft. |
send_whatsapppost | int | 1 | Alias for send_by_wp. Sends the generated document by WhatsApp when settings allow it and it is not a draft. |
auto_send_purchase_order_to_signpost | int | 1 | For purchase_orders only: sends a signing/payment link when supported and not a draft. |
approve_invoice_israel_datapost | int | 1 | Used only when Invoice Israel requires confirmation to continue without customer corporation id. |
Document Types
invoice
Tax invoice / standard invoice for a customer. Do not send payment_method.
Required
- customer_id or email/mobile/phone
- document_type=invoice (or omit; default)
- final_amount
- items[] or products[]
- invoice_setting_id if no default company exists
Optional
- related_document_id to create invoice from receipt/proposal/order
- tax/include_tax/discount fields
- save_as_draft=1
- send_email/send_whatsapp
- date_created/due_date/last_pay_date
- corporation may be required by company settings or Invoice Israel
- pdf_template_id
Loop: items[]
- Required per useful line: item_name, item_qty, item_price, item_total
- Recommended defaults when not linking a catalog product: iteeeem_id=0, item_discount_type=percentage, item_discount=0
- Optional per line: iteeeem_id product id, item_discount_type, item_discount, item_notes, item_storageid (warehouse id from Storage.List), item_SKU, item_type
- For appointment packages: item_type=appointment_group, iteeeem_id=group id, item_qty=number of appointments
- For appointment services: item_type=appointment_type, iteeeem_id=appointment type id, item_qty=number of appointments
Sample Payload
{
"customer_id": "123",
"document_type": "invoice",
"final_amount": "100.00",
"items": [
{
"item_name": "Demo item",
"item_qty": 1,
"item_price": 100,
"item_total": 100,
"iteeeem_id": 0,
"item_discount_type": "percentage",
"item_discount": 0
}
]
}proforma_invoice
Proforma invoice / preliminary invoice before final tax invoice. Do not send payment_method.
Required
- customer_id or email/mobile/phone
- document_type=proforma_invoice
- final_amount
- items[] or products[]
Optional
- tax/include_tax/discount fields
- save_as_draft=1
- send_email/send_whatsapp
- date_created/due_date/last_pay_date
- note/note_header
Loop: items[]
- Required per useful line: item_name, item_qty, item_price, item_total
- Optional product/storage/custom fields are the same as invoice.
Sample Payload
{
"customer_id": "123",
"document_type": "proforma_invoice",
"final_amount": "100.00",
"items": [
{
"item_name": "Planning",
"item_qty": 1,
"item_price": 100,
"item_total": 100,
"iteeeem_id": 0,
"item_discount_type": "percentage",
"item_discount": 0
}
]
}credit_invoice
Credit invoice that credits/cancels an invoice or receipt-tax-invoice amount. Do not send payment_method.
Required
- customer_id
- document_type=credit_invoice
- final_amount
- items[] normally
- related_document_id is normally required so the credited document is linked
Optional
- tax/include_tax
- note
- date_created
- save_as_draft=1
- corporation may be required by Invoice Israel
Loop: items[]
- Required per useful line: item_name, item_qty, item_price, item_total
- Use values that match the amount being credited.
Sample Payload
{
"customer_id": "123",
"document_type": "credit_invoice",
"related_document_id": "900",
"final_amount": "25.00",
"items": [
{
"item_name": "Refund",
"item_qty": 1,
"item_price": 25,
"item_total": 25,
"iteeeem_id": 0,
"item_discount_type": "percentage",
"item_discount": 0
}
]
}receipt
Receipt for money received. Payment is required.
Required
- customer_id (or email/mobile/phone to create/reuse customer)
- document_type=receipt
- final_amount
- call_multi_receipt_fun=1
- Either payment_method (+ method fields) OR multiple_receipt_detail[]
- Sum of all pay_amount values must equal final_amount
Optional
- document_to_pay or related_document_id to mark invoices/orders paid
- payment_date
- number_of_payments
- c_type_pay
- send_email/send_whatsapp
- create_receipt_seprate for installments
- items[] if receipt should show lines
- invoice_setting_id
Loop: items[]
- Items can be empty for a simple receipt, or include item_name/item_qty/item_price/item_total when receipt should show lines.
Loop: multiple_receipt_detail[]
- Every block requires: payment_method, pay_amount
- Optional on every block: note (or inner_block_note), payment_date, payment_date_document
- cash: no extra fields
- cc: new card needs card_no, card_name, month_year, cvc; OR send subscription_id/card_id for saved card; optional c_type_pay, number_of_payments, unlimited, order_take_installment_type
- check: one or more check rows with check_number + check_sumamount (required per kept row); optional check_date, check_bank_details, check_acc_number, check_branch_no, check_tz, check_address, check_email, check_team_member, monthly_payment_for_check
- transference: optional check_trans_vista, check_acc_number_trans, check_branch_no_trans, check_bank_name/check_bank, deposite_to_bank, check_date_trans
- masav: acc_no, branch_no, bank, acc_name, tz; optional masav_id, no_of_payment, unlimited, bi_monthly, cust_id_hide
- others: other_payment_option required
- bit: bit_payment_id required
- payby_credit: payby_credit_invoice_number required
- paybridge_tranzila: optional number_of_payments_paybridge, c_type_pay_paybridge
- stripe_iframe / strip_payment: no extra card fields on this layer (processor handles charge)
- nedarim_payment: optional c_type_pay_nedarim, number_of_payments_nedarim, payment_date_nedarim, unlimited_nedarim, last4degits/card_no
- See Payment Methods section for full field lists and sample blocks
Sample Payload
{
"customer_id": "123",
"document_type": "receipt",
"final_amount": "100.00",
"call_multi_receipt_fun": "1",
"payment_method": "cash",
"payment_date": "2026-07-24 09:30:00"
}receipt_partly_paid
Partial receipt against one or more related documents. Payment is required.
Required
- customer_id
- document_type=receipt_partly_paid
- related_document_id
- final_amount
- call_multi_receipt_fun=1
- payment_method or multiple_receipt_detail[]
- pay total cannot exceed remaining amount on related document
Optional
- document_to_pay
- payment_date
- number_of_payments
- send_email/send_whatsapp
Loop: multiple_receipt_detail[]
- Same payment_method rules as receipt. See Payment Methods section.
Sample Payload
{
"customer_id": "123",
"document_type": "receipt_partly_paid",
"related_document_id": "900",
"final_amount": "40.00",
"call_multi_receipt_fun": "1",
"payment_method": "cash"
}receipt_tax_invoice
Receipt tax invoice: invoice lines + payment in one document.
Required
- customer_id
- document_type=receipt_tax_invoice
- final_amount
- items[] for invoice lines
- call_multi_receipt_fun=1
- payment_method or multiple_receipt_detail[]
- sum of pay_amount = final_amount
Optional
- related_document_id/document_to_pay
- tax/include_tax
- payment_date
- send_email/send_whatsapp
- corporation may be required by company settings or Invoice Israel
Loop: items[]
- Required per useful line: item_name, item_qty, item_price, item_total
- Optional product/storage/custom fields are the same as invoice.
Loop: multiple_receipt_detail[]
- Same payment_method rules as receipt. See Payment Methods section.
Sample Payload
{
"customer_id": "123",
"document_type": "receipt_tax_invoice",
"final_amount": "100.00",
"call_multi_receipt_fun": "1",
"payment_method": "cash",
"items": [
{
"item_name": "Demo item",
"item_qty": 1,
"item_price": 100,
"item_total": 100,
"iteeeem_id": 0,
"item_discount_type": "percentage",
"item_discount": 0
}
]
}gi_ir
Goods receipt / invoice receipt style payment document. Payment is required.
Required
- customer_id
- document_type=gi_ir
- final_amount
- call_multi_receipt_fun=1
- payment_method or multiple_receipt_detail[]
Optional
- related_document_id/document_to_pay
- payment_date
- items[]
- send_email/send_whatsapp
Loop: multiple_receipt_detail[]
- Same payment_method rules as receipt. See Payment Methods section.
Sample Payload
{
"customer_id": "123",
"document_type": "gi_ir",
"final_amount": "100.00",
"call_multi_receipt_fun": "1",
"payment_method": "cash"
}organization_receipt
Donation/organization receipt. Payment is required.
Required
- customer_id
- document_type=organization_receipt
- final_amount
- call_multi_receipt_fun=1
- payment_method or multiple_receipt_detail[]
Optional
- cus_products_id for organization product/donation link
- payment_date
- send_email/send_whatsapp
- note
Loop: multiple_receipt_detail[]
- Same payment_method rules as receipt. For cc on organization_receipt the block may force cc_paytype=add_new_card. See Payment Methods section.
Sample Payload
{
"customer_id": "123",
"document_type": "organization_receipt",
"final_amount": "180.00",
"call_multi_receipt_fun": "1",
"payment_method": "cash"
}purchase_orders
Purchase/order document. Do not send payment_method.
Required
- customer_id or email/mobile/phone
- document_type=purchase_orders
- final_amount
- items[] or products[]
Optional
- related_document_id to create from proposal/invoice
- auto_send_purchase_order_to_sign=1
- order_all_fields
- save_as_draft=1
- send_email/send_whatsapp
- date_created/due_date/last_pay_date
Loop: items[]
- Required per useful line: item_name, item_qty, item_price, item_total
- Optional product/storage fields can affect stock/order tracking.
- appointment_group and appointment_type item_type values can create customer appointment packages.
Sample Payload
{
"customer_id": "123",
"document_type": "purchase_orders",
"final_amount": "300.00",
"items": [
{
"item_name": "Package",
"item_qty": 3,
"item_price": 100,
"item_total": 300,
"iteeeem_id": 0,
"item_discount_type": "percentage",
"item_discount": 0
}
]
}order_proposals
Proposal/quote document before the customer approves an order. Do not send payment_method.
Required
- customer_id or email/mobile/phone
- document_type=order_proposals
- final_amount
- items[] or products[]
Optional
- proposal_title
- approve_sign_img
- order_all_fields
- save_as_draft=1
- send_email/send_whatsapp
- note/note_header
Loop: items[]
- Required per useful line: item_name, item_qty, item_price, item_total
- Optional product/storage/custom fields are the same as invoice/order documents.
Sample Payload
{
"customer_id": "123",
"document_type": "order_proposals",
"proposal_title": "Website project",
"final_amount": "1200.00",
"items": [
{
"item_name": "Project setup",
"item_qty": 1,
"item_price": 1200,
"item_total": 1200,
"iteeeem_id": 0,
"item_discount_type": "percentage",
"item_discount": 0
}
]
}delivery_invoice
Delivery document or return delivery document. Do not send payment_method.
Required
- customer_id
- document_type=delivery_invoice
- final_amount
- items[] normally
- type_of_delivery=delivery or return when stock movement matters
Optional
- related_document_id to link to purchase order/order
- date_created
- save_as_draft=1
- note
- send_email/send_whatsapp
Loop: items[]
- Required per useful line: item_name, item_qty, item_price, item_total
- Optional item_storageid (from Storage.List) and iteeeem_id are important for stock movement.
- Use type_of_delivery=return to reverse/return delivered stock where supported.
Sample Payload
{
"customer_id": "123",
"document_type": "delivery_invoice",
"type_of_delivery": "delivery",
"related_document_id": "900",
"final_amount": "100.00",
"items": [
{
"iteeeem_id": "77",
"item_name": "Product",
"item_qty": 1,
"item_price": 100,
"item_total": 100,
"item_storageid": "3",
"item_discount_type": "percentage",
"item_discount": 0
}
]
}Payment Methods
Use these payment methods only on receipt-like document types (receipt, receipt_partly_paid, receipt_tax_invoice, gi_ir, organization_receipt) with call_multi_receipt_fun=1. You can send a single payment_method + top-level fields, or send multiple_receipt_detail[] blocks. Do not send payment_method on invoice/proforma/credit/proposal/purchase_orders/delivery_invoice.
cash
Cash payment. Simplest receipt payment method.
Used On Document Types
- receipt
- receipt_partly_paid
- receipt_tax_invoice
- gi_ir
- organization_receipt
Required
- payment_method=cash
- pay_amount (or payment_amount / defaults to final_amount for single block)
Optional
- payment_date
- note / inner_block_note
- payment_date_document
Notes
- No card/check/bank fields needed.
- For mixed payments put cash as one block inside multiple_receipt_detail[].
Sample Payload
{
"customer_id": "123",
"document_type": "receipt",
"final_amount": "100.00",
"call_multi_receipt_fun": "1",
"payment_method": "cash",
"payment_date": "2026-07-24 09:30:00"
}Sample multiple_receipt_detail[] Block
{
"payment_method": "cash",
"pay_amount": 100,
"payment_date": "2026-07-24 09:30:00",
"note": ""
}cc
Credit card charge (new card or saved card/subscription).
Used On Document Types
- receipt
- receipt_partly_paid
- receipt_tax_invoice
- gi_ir
- organization_receipt
Required
- payment_method=cc
- pay_amount
- Either subscription_id/card_id (saved card) OR new card fields: card_no, card_name, month_year, cvc
Optional
- c_type_pay=regular|installments|standing_order
- number_of_payments
- payment_date
- payment_d
- unlimited
- order_take_installment_type
- create_receipt_seprate for installments
- payment_detail_id
- test_card
Notes
- If c_type_pay=regular, number_of_payments is forced to 1 and payment_date/unlimited are cleared on the block.
- Missing new-card fields often returns message: Please fill required fields
- organization_receipt may force cc_paytype=add_new_card on the block.
Sample Payload
{
"customer_id": "123",
"document_type": "receipt",
"final_amount": "100.00",
"call_multi_receipt_fun": "1",
"payment_method": "cc",
"card_name": "John Demo",
"card_no": "4580000000000000",
"month_year": "12-2028",
"cvc": "123",
"c_type_pay": "regular"
}Sample multiple_receipt_detail[] Block
{
"payment_method": "cc",
"pay_amount": 100,
"card_name": "John Demo",
"card_no": "4580000000000000",
"month_year": "12-2028",
"cvc": "123",
"c_type_pay": "regular",
"number_of_payments": 1,
"card_id": ""
}check
Check payment with one or more check rows inside the payment block.
Used On Document Types
- receipt
- receipt_partly_paid
- receipt_tax_invoice
- gi_ir
- organization_receipt
Required
- payment_method=check
- pay_amount
- At least one check row with check_sumamount not empty
- check_number per kept row
Optional
- check_date
- check_address
- check_email
- check_tz
- check_acc_number
- check_branch_no
- check_team_member
- check_bank_details
- monthly_payment_for_check
- check_photo file(s)
Notes
- Check rows can be sent as parallel arrays (check_number[], check_sumamount[], ...) or nested inside multiple_receipt_detail[] as indexed row objects.
- Sum of check_sumamount rows should match the block pay_amount.
- check_bank_details must be Banks.List id (bank_details.id), same as the dashboard check bank dropdown — not a free-text bank name.
Sample Payload
{
"customer_id": "123",
"document_type": "receipt",
"final_amount": "100.00",
"call_multi_receipt_fun": "1",
"payment_method": "check",
"check_number": "1001",
"check_sumamount": "100",
"check_date": "2026-07-24",
"check_bank_details": "11",
"check_acc_number": "123456",
"check_branch_no": "12"
}Sample multiple_receipt_detail[] Block
{
"payment_method": "check",
"pay_amount": 100,
"monthly_payment_for_check": 0,
"0": {
"check_number": "1001",
"check_date": "2026-07-24",
"check_sumamount": "100",
"check_bank_details": "11",
"check_acc_number": "123456",
"check_branch_no": "12",
"check_tz": "",
"check_address": "",
"check_email": "",
"check_team_member": ""
}
}transference
Bank transfer / wire payment.
Used On Document Types
- receipt
- receipt_partly_paid
- receipt_tax_invoice
- gi_ir
- organization_receipt
Required
- payment_method=transference
- pay_amount
Optional
- check_trans_vista
- check_acc_number_trans
- check_branch_no_trans
- check_bank_name or check_bank
- deposite_to_bank
- check_date_trans
- check_photo_transfer file
Notes
- check_bank is stored as check_bank_id; check_bank_name maps to check_bank on the block.
Sample Payload
{
"customer_id": "123",
"document_type": "receipt",
"final_amount": "100.00",
"call_multi_receipt_fun": "1",
"payment_method": "transference",
"check_trans_vista": "REF-001",
"check_bank_name": "Bank Hapoalim",
"check_date_trans": "2026-07-24"
}Sample multiple_receipt_detail[] Block
{
"payment_method": "transference",
"pay_amount": 100,
"check_trans_vista": "REF-001",
"check_acc_number_trans": "123456",
"check_branch_no_trans": "12",
"check_bank": "Bank Hapoalim",
"deposite_to_bank": "Company account",
"check_bank_id": "12",
"check_date_trans": "2026-07-24"
}masav
Masav standing-order / bank debit payment.
Used On Document Types
- receipt
- receipt_partly_paid
- receipt_tax_invoice
- gi_ir
- organization_receipt
Required
- payment_method=masav
- pay_amount
- acc_no
- branch_no
- bank
- acc_name
- tz
Optional
- masav_id (update existing masav_payment)
- cust_id_hide
- no_of_payment
- unlimited
- bi_monthly
- one_day_month
- month_start
- asmachta
- payment_d
- note
Notes
- Account must have masav_setting configured (mosad_code/mosad_name).
- masav_id=0 or empty creates a new masav_payment row.
- Do not send standing order as payment_method=cc. Use payment_method=masav.
- bank = Banks.List id (dashboard masav dropdown). Use Banks.List code only for display labels.
Sample Payload
{
"customer_id": "123",
"document_type": "receipt",
"final_amount": "100.00",
"call_multi_receipt_fun": "1",
"payment_method": "masav",
"acc_name": "John Demo",
"acc_no": "123456",
"branch_no": "401",
"bank": "10",
"tz": "123456789",
"no_of_payment": "1"
}Sample multiple_receipt_detail[] Block
{
"payment_method": "masav",
"pay_amount": 100,
"masav_id": 0,
"acc_no": "123456",
"branch_no": "401",
"bank": "10",
"acc_name": "John Demo",
"tz": "123456789",
"no_of_payment": 1,
"unlimited": 0,
"bi_monthly": 0
}others
Other / custom payment option label.
Used On Document Types
- receipt
- receipt_partly_paid
- receipt_tax_invoice
- gi_ir
- organization_receipt
Required
- payment_method=others
- pay_amount
- other_payment_option
Optional
- payment_date
- note / inner_block_note
Notes
- other_payment_option is the free-text label shown on the receipt (for example PayPal, Gift card).
Sample Payload
{
"customer_id": "123",
"document_type": "receipt",
"final_amount": "100.00",
"call_multi_receipt_fun": "1",
"payment_method": "others",
"other_payment_option": "PayPal"
}Sample multiple_receipt_detail[] Block
{
"payment_method": "others",
"pay_amount": 100,
"other_payment_option": "PayPal"
}bit
Bit payment reference.
Used On Document Types
- receipt
- receipt_partly_paid
- receipt_tax_invoice
- gi_ir
- organization_receipt
Required
- payment_method=bit
- pay_amount
- bit_payment_id
Optional
- payment_date
- note
Notes
- bit_payment_id is the Bit transaction/reference id from the Bit flow.
Sample Payload
{
"customer_id": "123",
"document_type": "receipt",
"final_amount": "100.00",
"call_multi_receipt_fun": "1",
"payment_method": "bit",
"bit_payment_id": "bit-123"
}Sample multiple_receipt_detail[] Block
{
"payment_method": "bit",
"pay_amount": 100,
"bit_payment_id": "bit-123"
}payby_credit
Pay using customer credit / related credit invoice balance.
Used On Document Types
- receipt
- receipt_partly_paid
- receipt_tax_invoice
- gi_ir
- organization_receipt
Required
- payment_method=payby_credit
- pay_amount
- payby_credit_invoice_number
Optional
- payment_date
- note
Notes
- payby_credit_invoice_number points at the credit/document number used for this payment.
Sample Payload
{
"customer_id": "123",
"document_type": "receipt",
"final_amount": "50.00",
"call_multi_receipt_fun": "1",
"payment_method": "payby_credit",
"payby_credit_invoice_number": "900"
}Sample multiple_receipt_detail[] Block
{
"payment_method": "payby_credit",
"pay_amount": 50,
"payby_credit_invoice_number": "900"
}paybridge_tranzila
PayBridge / Tranzila hosted or linked payment method.
Used On Document Types
- receipt
- receipt_partly_paid
- receipt_tax_invoice
- gi_ir
- organization_receipt
Required
- payment_method=paybridge_tranzila
- pay_amount
Optional
- number_of_payments_paybridge (or number_of_payments)
- c_type_pay_paybridge (or c_type_pay)
- payment_detail_id / paybridge payment settings
Notes
- If c_type_pay_paybridge=regular, number_of_payments is forced to 1.
- Gateway settings usually come from payment_detail with default_paybridge.
Sample Payload
{
"customer_id": "123",
"document_type": "receipt",
"final_amount": "100.00",
"call_multi_receipt_fun": "1",
"payment_method": "paybridge_tranzila",
"c_type_pay_paybridge": "regular",
"number_of_payments_paybridge": "1"
}Sample multiple_receipt_detail[] Block
{
"payment_method": "paybridge_tranzila",
"pay_amount": 100,
"c_type_pay": "regular",
"number_of_payments": 1
}stripe_iframe
Stripe iframe / strip_payment. Alias strip_payment is normalized to stripe_iframe.
Used On Document Types
- receipt
- receipt_partly_paid
- receipt_tax_invoice
- gi_ir
- organization_receipt
Required
- payment_method=stripe_iframe (or strip_payment)
- pay_amount
Optional
- stripe_transction_id when the charge already happened outside this call
- payment_date
- note
Notes
- This layer does not require card_no/cvc; the Stripe flow supplies the charge reference.
- Sending strip_payment is accepted and stored as stripe_iframe.
Sample Payload
{
"customer_id": "123",
"document_type": "receipt",
"final_amount": "100.00",
"call_multi_receipt_fun": "1",
"payment_method": "stripe_iframe",
"stripe_transction_id": "pi_123"
}Sample multiple_receipt_detail[] Block
{
"payment_method": "stripe_iframe",
"pay_amount": 100
}nedarim_payment
Nedarim Plus payment method.
Used On Document Types
- receipt
- receipt_partly_paid
- receipt_tax_invoice
- gi_ir
- organization_receipt
Required
- payment_method=nedarim_payment
- pay_amount
Optional
- c_type_pay_nedarim
- number_of_payments_nedarim
- payment_date_nedarim
- payment_d_nedarim
- unlimited_nedarim
- cc_paytype_nedarim
- last4degits or card_no
- nedarim_payment_transaction_id
- inner_block_note (also stored as import_type)
- order_take_installment_type
- create_receipt_seprate
Notes
- If c_type_pay_nedarim=regular, number_of_payments becomes 1 and payment_date/unlimited are cleared.
- Installment flags behave like cc installments.
Sample Payload
{
"customer_id": "123",
"document_type": "receipt",
"final_amount": "100.00",
"call_multi_receipt_fun": "1",
"payment_method": "nedarim_payment",
"c_type_pay_nedarim": "regular",
"nedarim_payment_transaction_id": "nd-123"
}Sample multiple_receipt_detail[] Block
{
"payment_method": "nedarim_payment",
"pay_amount": 100,
"c_type_pay": "regular",
"number_of_payments": 1,
"card_no": "1234",
"import_type": "",
"test_card": 0
}mixed_multiple_receipt_detail
Mixed payments in one receipt using multiple_receipt_detail[].
Used On Document Types
- receipt
- receipt_partly_paid
- receipt_tax_invoice
- gi_ir
- organization_receipt
Required
- call_multi_receipt_fun=1
- multiple_receipt_detail JSON array
- each block: payment_method + pay_amount + method-specific required fields
- sum(pay_amount) == final_amount
Optional
- Omit top-level payment_method when the full loop is sent
- Per-block note/payment_date
Notes
- If multiple_receipt_detail is sent, the API uses it as-is and does not rebuild from a single payment_method.
- Mismatch of block totals returns: Total amount and sum of payment Block amount not match...!!
Sample Payload
{
"customer_id": "123",
"document_type": "receipt",
"final_amount": "150.00",
"call_multi_receipt_fun": "1",
"multiple_receipt_detail": [
{
"payment_method": "cash",
"pay_amount": 50,
"payment_date": "2026-07-24 09:30:00"
},
{
"payment_method": "others",
"pay_amount": 100,
"other_payment_option": "PayPal"
}
]
}PDF Templates
What PDF Templates Do
PDF templates let users design document PDFs with HTML/CSS and placeholders. If no custom template is selected or defaulted, the standard PDF design is used.
- Supported document types: order_proposals, purchase_orders, invoice, receipt, receipt_tax_invoice, credit_invoice, delivery_invoice, proforma_invoice, detail_orders, gi_ir, organization_receipt.
- Templates are user-owned, versioned, tested with mock data, and can be set as defaults per user, invoice company, and document type.
- Rendering supports modern browser CSS and RTL/LTR output.
How To Create A Template
- Open Settings > Document PDF Templates.
- Choose Add Template or edit an existing template.
- Select the document type the template is for.
- Select the template language. Automatic defaults are matched by document language first.
- Write the HTML and CSS using the placeholders and loops below.
- Test with mock data before activating.
- Save and activate a version.
- Optionally set it as the default for one or more document types for the user/company.
- When creating a document, send pdf_template_id to force this template, or omit it to use the active default template.
Create Document Options
- pdf_template_id empty: use the active default custom template if one exists.
- For automatic defaults, the system first tries the document language template, then the company/system default language template.
- No default custom template: use the standard PDF design.
- pdf_template_id valid: use that active template if it belongs to the account and the invoice setting matches.
- pdf_template_id invalid and pdf_template_strict=1: return an error.
- pdf_template_id invalid and pdf_template_strict is empty/0: fall back to the standard PDF design.
customer_id=123 document_type=invoice document_lang=he final_amount=100.00 pdf_template_id=12 pdf_template_strict=1
Template Language Defaults
- Each template has a language: he, en, ar, or th.
- A template can be default for multiple document types, but its default is still tied to its template language.
- If a Hebrew document has a Hebrew default template, that template is used.
- If a Hebrew document has no Hebrew template, Biz1 tries the company/system default language template.
- If no matching custom template exists, Biz1 keeps the standard PDF flow.
- Explicit pdf_template_id bypasses automatic language selection and uses the chosen template when ownership and invoice setting checks pass.
Required Template Parts
- Company name: {{company.company_name}}, {{company.name}}, or {{owner.company_name}}
- Company ID: {{company.company_tax_id}}, {{company.company_id}}, or {{owner.company_tax_number}}
- Company address: {{company.company_address}}, {{company.address}}, or {{owner.address}}
- Company phone: {{company.company_phone}}, {{company.phone}}, {{owner.phone}}, or {{owner.mobile}}
- Customer name: {{customer.name}}
- Document date: {{document.date_created}} or {{document.date}}
- Document ID: {{document.last_documents_id}} or {{document.id}}
- Document type label: {{document_type}}, {{document.type_label}}, or {{document.document_type}}
- Biz1 logo: {{crm_logo}}
- Biz1 credit text: {{crm_credit}}
<a href="https://biz1.co.il"><img src="{{crm_logo}}" width="48" /><span>{{crm_credit}}</span></a>Document Placeholders
{{document.id}}
{{document.last_documents_id}}
{{document.date_created}}
{{document.date}}
{{document.due_date}}
{{document.type}}
{{document_type}}
{{document.type_label}}
{{document.lang}}
{{document.direction}}
{{document.coin}}
{{document.total}}
{{document.tax}}
{{document.discount}}
{{document.final_amount}}
{{document.note}}
{{document.note_html}}
{{document.payment_link}}
{{document.invoice_israel_code}}Customer Placeholders
{{customer.name}}
{{customer.email}}
{{customer.mobile}}
{{customer.phone}}
{{customer.address}}
{{customer.company}}
{{customer.corporation}}
{{customer.cf_name}}Company And Owner Placeholders
{{company.company_name}}
{{company.company_tax_id}}
{{company.company_address}}
{{company.company_phone}}
{{company.email}}
{{logo}}
{{company.logo}}
{{company.company_letter}}
{{company.order_letter}}
{{company.receipt_letter}}
{{company.invoice_receipt_letter}}
{{company.purchase_order_letter}}
{{company.details_order_letter}}
{{owner.name}}
{{owner.email}}
{{owner.phone}}
{{owner.mobile}}
{{owner.website}}
{{owner.logo}}
{{owner.invoice_logo}}
{{owner.address}}
{{owner.company_name}}
{{owner.company_tax_number}}Payment Link
- Use payment placeholders when a payment or approval link exists.
- For order_proposals, the link appears when the proposal is not approved/signed yet.
- For invoice, detail_orders, and purchase_orders, the link appears when unpaid and payment button settings allow it.
- When there is no valid link, the placeholder is empty.
{{payment_link}}
{{document.payment_link}}
{{payment_title}}
{{payment_text}}
{{payment_link_label}}
{{#if payment_link}}
<section class="payment-cta">
<strong>{{payment_title}}</strong>
<span>{{payment_text}}</span>
<a href="{{payment_link}}">{{payment_link_label}}</a>
</section>
{{/if}}Repeated Header Footer And Pages
- Use {{header}} and {{footer}} for default repeated areas.
- Use {{#header}}...{{/header}} and {{#footer}}...{{/footer}} for custom repeated header/footer blocks.
- Use page tokens only inside header/footer.
- When header/footer is used, PDF margins are increased to make room.
{{#header}}
<div>{{company.company_name}} - {{document.last_documents_id}} <span style="float:right">{{page}} / {{pages}}</span></div>
{{/header}}
{{#footer}}
<div><a href="https://biz1.co.il">{{crm_credit}}</a> <span style="float:right">{{page}} / {{pages}}</span></div>
{{/footer}}
{{page}}
{{pages}}
{{total_pages}}RTL And Language
- Hebrew and other RTL documents render with dir=rtl and lang=he.
- English and Thai render LTR.
- Language-aware placeholders: {{crm_credit}}, {{payment_title}}, {{payment_text}}, {{payment_link_label}}.
.document-pdf-template-root[dir=rtl] { direction: rtl; text-align: right; }
.document-pdf-template-root[dir=ltr] { direction: ltr; text-align: left; }Safe Rich Text Notes
- Normal placeholders escape HTML, for example {{document.note}}.
- Prepared safe rich text uses triple braces.
{{{document.note_html}}}
{{{company.header_notes_order_proposal_html}}}
{{{company.order_letter_html}}}
{{{company.purchase_order_letter_html}}}
{{{company.details_order_letter_html}}}Header And Body Note Fields
{{company.header_notes_invoice}}
{{company.header_notes_order_proposal}}
{{company.header_notes_order_proposal_html}}
{{company.header_notes_receipt}}
{{company.header_notes_receipt_tax_invoice}}
{{company.header_notes_purchase_order}}
{{company.header_notes_details_order}}
{{company.header_notes_delivery}}
{{company.header_notes_proforma_invoice}}
{{company.header_notes_donation_receipt}}
{{company.company_letter}}
{{company.order_letter}}
{{company.order_letter_html}}
{{company.receipt_letter}}
{{company.invoice_receipt_letter}}
{{company.purchase_order_letter}}
{{company.purchase_order_letter_html}}
{{company.details_order_letter}}
{{company.details_order_letter_html}}
{{company.notes_for_delivery}}
{{company.notes_for_proforma_invoices}}
{{company.notes_for_donation_receipt}}Items Loop
{{#items}}
<tr>
<td>{{item.name}}</td>
<td>{{item.qty}}</td>
<td>{{format_money(item.price, document.coin)}}</td>
<td>{{format_money(item.qty * item.price, document.coin)}}</td>
</tr>
{{/items}}
{{item.name}}
{{item.qty}}
{{item.price}}
{{item.discount}}
{{item.description}}
{{item.notes}}
{{item.sku}}
{{item.discount_type}}
{{item.vat_include}}
{{item.line_total}}
{{item.options_text}}Product Category And Option Fields
- {{item.options_text}} contains saved category option/custom-field values for the line, formatted as text.
{{product.id}}
{{product.color}}
{{product.image}}
{{product.image_url}}
{{category.id}}
{{category.name}}
{{category.category}}
{{category.image}}
{{category.image_url}}Filters And Conditions
- Use items_by_category to loop only items from one category.
- Use where filters for simple item conditions.
- Supported operators: ==, !=, >, >=, <, <=.
- If blocks are single-level. Do not nest if blocks.
{{#items_by_category 123}}
<tr><td>{{item.name}}</td><td>{{category.id}}</td></tr>
{{/items_by_category}}
{{#items where category.id == 456}}
<tr><td>{{item.name}}</td><td>{{format_money(item.line_total, document.coin)}}</td></tr>
{{/items}}
{{#if item.discount > 0}}
<td>{{item.discount}}</td>
{{else}}
<td>-</td>
{{/if}}Math And Money Formatting
- Write math inside one placeholder. Do not write separate placeholders around operators.
{{item.qty * item.price}}
{{(item.qty * item.price) - item.discount}}
{{format_money(item.line_total, document.coin)}}
{{format_money(document.final_amount, document.coin)}}Custom Fields
{{customer.cf_name}}
{{product.cf_color}}
{{category.cf_floor_type}}
{{customer_cf("cf-name")}}
{{product_cf("color")}}
{{category_cf("floor-type")}}Images
- Images are restricted to trusted Biz1 file hosts and uploaded Biz1 paths.
<img src="{{crm_logo}}" width="48" />
<img src="{{product.image}}" width="80" />
<img src="{{category.image}}" width="80" />CSS Support
- Templates render with browser CSS, so grid, @page, and print-friendly CSS are supported.
- Avoid external CSS imports, JavaScript, remote fonts that may not load quickly, very large images, and fixed elements that overlap content.
@page { size: A4; margin: 10mm; }
.grid { display: grid; grid-template-columns: 1fr 120px; }
.line-card { break-inside: avoid; page-break-inside: avoid; }Blocked For Safety
- <script> tags are blocked.
- <iframe>, <object>, <embed>, and <form> are blocked.
- onclick, onload, and other JavaScript event attributes are blocked.
- javascript: URLs are blocked.
- PHP tags are blocked.
- Unknown external image hosts are blocked.
Invoice Israel And Signatures
- Invoice Israel fields are available as document/company placeholders.
- There is currently no template placeholder for digital signatures or approval signature images.
- Custom HTML PDFs do not currently pass through the legacy certificate-signing step.
{{document.invoice_israel_code}}
{{company.invoice_israel}}
{{company.force_tz}}
{{company.israel_default_data}}Troubleshooting
- Template not used: check ownership, document_type, active status, default configuration, or pdf_template_id.
- Missing fields error: include every required placeholder, especially {{crm_logo}} and {{crm_credit}}.
- Payment link empty: the document must be eligible for payment/approval and the payment button must be enabled.
- Header/footer not repeating: use header/footer tokens and keep page tokens only inside those blocks.
- Hebrew not RTL: send document_lang=he and use CSS for .document-pdf-template-root[dir=rtl].
Authentication
Send the bearer token returned by Login in the request header.
Authorization: Bearer YOUR TOKEN
Sample Request
{
"url": "\/app\/Documents.Add",
"method": "POST",
"headers": {
"Authorization": "Bearer YOUR TOKEN"
},
"body": {
"customer_id": "123",
"document_type": "invoice",
"final_amount": "250.00",
"pdf_template_id": "12",
"pdf_template_strict": "1",
"items": "[{\"item_name\":\"Demo item\",\"item_qty\":1,\"item_price\":100,\"item_total\":100,\"iteeeem_id\":0,\"item_discount_type\":\"percentage\",\"item_discount\":0},{\"item_name\":\"Second product\",\"item_qty\":2,\"item_price\":75,\"item_total\":150,\"iteeeem_id\":0,\"item_discount_type\":\"percentage\",\"item_discount\":0}]"
},
"url_user": "https:\/\/{user}.bull36.com\/app\/Documents.Add",
"url_domain": "https:\/\/{domain}\/app\/Documents.Add"
}Endpoint
POST /app/Documents.Add
POST https://{user}.bull36.com/app/Documents.Add
POST https://{domain}/app/Documents.AddSample Output
{
"success": 1,
"inserted_documents_id": "456",
"document_id": "456",
"pdf_url": "https:\/\/files.biz1.co.il\/biz1upload\/invoice_docs\/invoice-1001-123-24.07.2026-456.pdf",
"message": "Document created",
"automation_event": "document_type_invoice"
}Draft saved
{
"success": 1,
"inserted_documents_id": "456",
"pdf_url": "",
"message": "Success"
}Missing company settings
{
"success": 0,
"message": "Company id is required...!",
"full_response": []
}Customer only (missing amount/items)
{
"success": "0",
"error": "missing_document_fields",
"message": "Documents.Add needs final_amount and items (or products). customer_id \/ email \/ mobile \/ phone alone is not enough to create an invoice.",
"route": "Documents.Add"
}Missing payment fields (payment_method=cc)
{
"success": 0,
"message": "Please fill required fields"
}Payment blocks mismatch
{
"success": 0,
"message": "Total amount and sum of payment Block amount not match...!!"
}JavaScript Example
const token = 'YOUR TOKEN';
const body = new URLSearchParams({
customer_id: '123',
document_type: 'invoice',
final_amount: '250.00',
items: JSON.stringify([
{
item_name: 'Demo item',
item_qty: 1,
item_price: 100,
item_total: 100,
iteeeem_id: 0,
item_discount_type: 'percentage',
item_discount: 0
},
{
item_name: 'Second product',
item_qty: 2,
item_price: 75,
item_total: 150,
iteeeem_id: 0,
item_discount_type: 'percentage',
item_discount: 0
}
])
});
const res = await fetch('/app/Documents.Add', {
method: 'POST',
headers: { Authorization: `Bearer ${token}` },
body
});
const data = await res.json();
console.log(data.inserted_documents_id || data.document_id, data.pdf_url);Error Example
{
"success": 0,
"message": "Document creation failed"
}