Skip to content

create document

posthttps://billing5.tranzila.com/api/documents_db/create_document

Payload Params

Element NameData TypeMandatoryNote (default value in bold)
terminal_nameStringYesTerminal for which a document is created
document_dateDateNoCurrent date. Format yyyy-mm-dd
document_typeStringNoIR
document_currency_codeStringNoILS
vat_percentDecimalNoTerminal setting or BOI to document date
actionIntegerNo1
client_companyStringNomy company
client_nameStringNoClient name or contact person
client_idStringNoNumeric
client_emailStringNoClient email address
client_address_line_1StringNoClient address line 1
client_address_line_2StringNoClient address line 2
client_cityStringNojerusalem
client_country_codeStringNoIL
client_zipStringNoNumeric
itemsArraySee notesArray of item documents, depending on document type
paymentsArraySee notesArray of payment documents, depending on document type
document_languageStringNoheb
response_languageStringNoeng
related_document_numberIntegerNo
relation_typeIntegerSee notesMandatory if related_document_number is sent or not empty
client_receipt_paid_forStringNooptional, the product or service name, use only when generating a receipt only (RE)
created_by_userStringNoReference to external username, user_id or any other identifying data (will not be shown on invoice)
created_by_systemStringNoReference to external system identifying data

Item Params

Element NameData TypeMandatoryNote (default value in bold)
codeStringNo
nameStringYes
typeStringNoI
units_numberDecimalNo1
unit_typeIntegerNo1
unit_priceDecimalYes
price_typeStringNoG
currency_codeStringNoILS
to_doc_currency_exchange_rateDecimalSee noteMandatory if currency code different from document currency

Payment Params

Element NameData TypeMandatoryNote (default value in bold)
payment_methodIntegerYes
payment_dateDateNoCurrent date. Format yyyy-mm-dd
cc_last_4_digitsStringNo
cc_credit_termIntegerNo
cc_installments_numberIntegerNo
cc_brandIntegerNo
bankStringNo
bank_branchStringNo
bank_accountStringNo
cheque_numberStringNo
paypal_accountStringNo
paypal_transaction_numberStringNo
other_descriptionStringNo
amountDecimalYes
currency_codeStringNoILS
to_doc_currency_exchange_rateDecimalSee notesMandatory if currency code different from document currency
txnindexIntegerNoAdd a transaction index to the document
canceldocStringNoIndicates if the credit document is for a cancelled transaction

JSON Example

JSON
{
  "terminal_name": "terminalname",
  "document_date": "2021-01-01",
  "document_type": "IR",
  "action": 1,
  "document_language": "heb",
  "document_currency_code": "ILS",
  "vat_percent": 17,
  "client_company": "Test Ltd",
  "client_id":"123456789",
  "client_name": "Test",
  "client_email": "test@test.com",
  "client_address_line_1": "test line 1",
  "client_address_line_2": "test line 2",
  "client_zip": "4545451",
  "client_city":"City",
  "client_country_code": "IL",
  "items": [
    {
      "type": "I",
      "code": "321",
      "name": "A",
      "price_type": "G",
      "unit_price": 70.25,
      "units_number": 1,
      "unit_type": 1,
      "currency_code": "ILS",
      "to_doc_currency_exchange_rate": 1
    },
    {
      "type": "I",
      "code": "111",
      "name": "B",
      "price_type": "G",
      "unit_price": 30,
      "units_number": 1,
      "unit_type": 2,
      "currency_code": "ILS",
      "to_doc_currency_exchange_rate": 1
    }
  ],
  "payments": [
    {
      "payment_method": 1,
      "payment_date": "2024-07-06",
      "cc_last_4_digits": 1533,
      "cc_credit_term": 1,
      "cc_brand": 1,
      "amount": 100.25,
      "currency_code": "ILS"
    }
  ]
}

Request

Headers

X-tranzila-api-app-keystring
Example:{{app_key}}
X-tranzila-api-request-timestring
Example:{{new_timestamp}}
X-tranzila-api-noncestring
Example:{{nonce}}
X-tranzila-api-access-tokenstring
Example:{{access_key}}
Content-Typestring
Example:application/json

Body

application/json
terminal_namestringrequired

Terminal for which a document is created

document_datestring<date>required
Match pattern:yyyy-mm-dd
Example:2024-01-20
document_typestringrequired
document_languagestringrequired

`eng` English, `heb` Hebrew

Example:heb
document_currency_codestringrequired

[Currency table detail](https://docs.tranzila.com/docs/invoices/erwyy1y8szn0h-params-table#currencies)

Example:ILS
actioninteger

`1` Debit, `3` Credit

Example:1
vat_percentinteger
Example:17
client_companystring
client_idstring

Numeric

client_emailstring

Client email address

client_namestring
client_address_line_1string
client_address_line_2string
client_zipstring

Numeric

client_citystring
client_country_codestring
client_receipt_paid_forstring
response_languagestring

`eng` English, `heb` Hebrew

Example:eng
paymentsarray[object]required

Array of payment documents, depending on document type. </br> Different payment methods require different fields, [as detailed here.](https://docs.tranzila.com/docs/invoices/erwyy1y8szn0h-params-table#payment-fields-requirement-by-payment-method)

itemsarray[object]required

Array of item documents, depending on document type

related_document_numberstring
txnindexinteger

This parameter allows you to add a transaction index to the document. It can be used to correlate the document with transactions in the Reports API.

Example:12345
canceldocstring

This parameter indicates whether the document is a credit document for a cancelled transaction. If set to `Y`, the created document's number will be reflected in the report response under the `txnfdnumber` parameter.

Match pattern:^[YN]$
Example:"Y"
created_by_systemstring

Reference to external system identifying data

relation_typeinteger

Mandatory if related_document_number is sent or not empty </br> [Guidelines for parameters](https://docs.tranzila.com/docs/invoices/erwyy1y8szn0h-params-table#document-relation-types)

Example:1
created_by_userstring

Reference to external username, user id or any other identifying data (will not be shown on invoice)

Responses

Document creation response (success or error)

Success Response

When an invoice PDF is successfully created:

  • status_code: 0 = Success
  • status_msg: "Success" or "הצלחה"
  • Document details including unique retrieval_key for PDF access

Error Response

When document creation fails:

  • status_code: <error_code> (see error codes section)
  • status_msg: <error_message>

All responses return HTTP 200 - check status_code field to determine success/failure.

Response body

response.json
JSON
1{
2  "status_code": 0,
3  "status_msg": "הצלחה",
4  "enquiry_key": "14451a5f",
5  "document": {
6    "id": "6995",
7    "number": "1000010",
8    "assignment_number": null,
9    "total_charge_amount": 11.9,
10    "currency": "ILS",
11    "created_at": "2025-04-06 14:12:09",
12    "retrieval_key": "ODIyMWM2NGYwZWU1NjAzMzI3NzU2NDMzZDMwZTE4YzU2NTViMDAxNTFiZGE3ZGRjMDU3MzkyYmEyMWQ0MjY1Y2ZjZjM3ZmM5ZTIzNTI3YTQ0YTBkOGI5MjdjYjE4YTg5OGU5NWIyMDFjZWY4NDc1NDk0YmMwYTg3ZmYyMzk5MjgxM0EzUENxNmovUm8xUUJsMk5rK1VnVGtDK0lJZkFEZVpNOXlqbWd3NXVIZU5SZXo4MFU5aEpqV1JMY29sVFFsTVI2NGxBUHFKU0MzbnVOTldPZWhKZz09"
13  }
14}
15
Was this page helpful?