🚪 Closing Documents

Any document produced on the system will be set automatically as open, this will be more critical in case of managing stock and customer balance.

Closing a document can be used for a mark on receiving a payment (closing by producing a receipt) or for delivering the merchandise to the customer (closing by producing an invoice).

It is possible to pull an existing document to another document as the same type in order to add more items and change it from the original version.


Common Documents Closing Options

Order -> closing with Invoice or Invoice Receipt

Invoice-> closing with Receipt

Shipping Certificate -> closing with Invoice Receipt


Checking Open Documents

In order to check if a document is open through API, it is possible to use the method -

Customer.OpenDocuments

The response will return all open documents on the business, it is possible to sort the request by specific customer, document type, producing date etc.


Closing Options -


While Document/Receipt Creation

Closing an existing document while producing other document or receipt.


Methods -

Document.New, Receipt.New


Send in request parameters:

'closed_document_type'

The document type to be closed.


'closed_document_number'

The document number to be closed.


'document_is_receipt'

true - closing with a receipt

false - closing with a document (default value)


In case of closing a document with receipt the system will automatically add a comment to the receipt with the closed document details:


Request Example - Receipt.New general closing invoice with receipt
Request
{
  "api_token": "DECD03E5-E35C-41E8-84F7-FBA2FB483928",
  "receipt_type": 1,
  "customer_id": 0,
  "last_name": "test",
  "email_to": "[email protected]",
  "digital_signature": true,
  "closed_document_type": 1,
  "closed_document_number": 378,
  "payments": [
      {
          "payment_type": 2,
          "description": "test receipt",
          "amount_nis": 100
      }
  ]
}


Partial Closing by Item Line

Close partial amount (some of the items) of an existing document while producing another document.


Method-

Document.New


Send the request items list parameters to close (under the specific closing item):

'closed_document_type'

The document type to be closed.


'closed_document_num'

The document number to be closed.


'closed_document_line'

The line of the item to be closed.


Line number sent should be parallel to item position in the document to close (for example, third item will be line 3)


Request Example - Document.New partial closing Shipment certificate by line
Request
{
  "api_token": "DECD03E5-E35C-41E8-84F7-FBA2FB483928",
  "document_type": 2,
  "customer_id": 0,
  "last_name": "Doe",
  "first_name": "John",
  "price_include_vat": true,
  "currency_id": 1,
  "round_digits": 0,   
  "items": [
      {
          "item_id": 0,
          "quantity": 1,
          "price_nis": 15,
          "description": "Item Test1",
          "closed_document_type":4,
  	        "closed_document_num":23,
  	        "closed_document_line":3
      },
      {
          "item_id": 0,
          "quantity": 1,
          "price_nis": 10,
          "description": "Item Test2",
          "closed_document_type":4,
  	        "closed_document_num":23,
  	        "closed_document_line":4
      }
  ],
  "payments": [
      {
          "payment_type": 2,
          "description": "Cash",
          "amount_nis": 25
      }
  ]
}


After Document/Receipt Creation - Retroactive


Closing with a Document/Receipt (also for multiple documents)

Close the document with another document or receipt after it’s already produced.


Method -

Document.Close


Send in request parameters:

'document_type''

The document type to be closed.


'document_number'

The document number to be closed.


'closing_type'

The closing document type.


'closing_number'

The closing document number.


Request Example - Document.Close invoice with receipt
Request
{
  "api_token":"DECD03E5-E35C-41E8-84F7-FBA2FB483928",
  "document_type":1,
  "document_number":378,
  "closing_type":1,
  "closing_number":115,
  "amount_close":15,
  "document_is_receipt":true,
  "closing_date":"06-08-2025"
}

Manual Closing

Close a partial or full amount of a document manually without another document/receipt.


Method -

Document.Close

Send in request parameters:


'document_type''

The document type to be closed.


'document_number'

The document number to be closed.


'closing_type = 0'

The closing document type.

0 - manual closing.


'closing_number = 0'

The closing document number.

0 - manual closing.


'document_is_receipt = true'

true - send as a receipt for manual closing.


Request Example - Document.Close Invoice manual closing
Request
{
"api_token": "dfc0121e-10d4-4f6b-94e5-664fdaa253bd",
"document_type": 1,
"document_number": 508,
"closing_type": 0,
"closing_number": 0,
"closing_date": "05-08-2025",
"amount_close": 100,
"document_is_receipt": true,
}