Actions17
- Customer Actions
- Dictionary Actions
- Document Actions
- Product Actions
- Print Actions
Document → Create Invoice
AI-generatedSummary
Create a sales, purchase, or margin invoice in Comarch Optima ERP by sending the invoice data as JSON to the Optima REST API.
Inputs
- Document Type — Select the type of invoice to create: Sale (Sales Invoice), Purchase (Purchase Invoice), or Margin (Margin Invoice).
- Margin Procedure — Specify the margin procedure applicable only when the Document Type is Margin; leave empty for other document types.
- Document Data (required) — Provide the invoice document details as a JSON object, including payer information and items. For corrections, include OriginalDocumentId and PrzyczynaKorekty properties as needed.
Output shape
a single JSON object representing the response from the Optima API after creating the invoice
The node sends a POST request to the endpoint corresponding to the document type and operation, returning the API's JSON response containing details about the created invoice document.
Examples
Example 1: Create a sales invoice with payer and product details
Set Document Type to 'Sale', optionally set Margin Procedure empty, and provide a JSON Object under Document Data with payer acronym and line items including product code, quantity, and price.