What is an invoice?
An invoice is a commercial document issued by a seller to a buyer that records a transaction between two parties. In Nocotax, invoices are the primary way to document:- Sales to customers (revenue)
- Purchases from suppliers (costs)
- Commission arrangements between platforms and merchants
Invoice flows
Nocotax supports three invoice flows that determine the direction and purpose of the invoice:Sales flow
The sales flow (flow=sales) represents invoices your platform issues to customers for goods or services you’ve sold. This is your outbound invoicing.
- SaaS subscription invoices
- E-commerce order invoices
- Service booking confirmations
- Product sales
- Increases your accounts receivable (AR)
- Represents revenue for your business
- You are the supplier, customer is the buyer
- You charge tax (if applicable)
Purchases flow
The purchases flow (flow=purchases) represents invoices for goods or services you’ve purchased from suppliers. This is your inbound invoicing.
- Recording supplier invoices
- Self-billing for marketplace payouts
- Documenting costs and expenses
- Tracking amounts owed to suppliers
- Increases your accounts payable (AP)
- Represents costs for your business
- Supplier is the issuer, you are the customer
- You may be able to claim input tax
Default vs explicit organization IDs
When creating invoices, you can choose to specify organization IDs explicitly or let Nocotax use default values based on your account configuration.Default IDs (recommended)
If you omitsupplier_id or customer_id, Nocotax will use default values based on the flow:
Invoice structure
Every invoice contains the following key components:Header information
Basic invoice details:- Flow: Direction of the invoice (sales/purchases)
- Supplier: Organization providing goods/services
- Customer: Organization receiving goods/services
- document_number: Sequential invoice number (assigned when finalized)
- document_date: Invoice issue date (set when finalized)
- Currency: Three-letter ISO currency code
Line items
Individual products or services on the invoice:- title: What’s being sold. Appears on the document
- quantity: How many units (decimal, defaults to 1)
- unit_extratax_amount: Price per unit excluding tax, as a decimal string in the currency’s main unit (e.g.
"99.2842") - extratax_amount: Total line amount excluding tax, as an integer in the currency’s smallest unit (quantity × unit_extratax_amount, rounded)
- unit_tax_included_amount: Price per unit including tax, as a decimal string in the currency’s main unit
- tax_included_amount: Total line amount including tax, as an integer in the currency’s smallest unit
- taxes: A breakdown of taxes at the line item level.
Tax breakdown
Detailed tax information per line and invoice:- tax_id: Tax identifier
- percentage: Tax rate applied
- jurisdiction: Where the tax applies
- exemption: Exemption reason if applicable
Totals
Calculated amounts:- total_extratax_amount: Sum of all line items before tax
- total_tax_amount: Total tax across all line items
- total_tax_included_amount: Final amount including tax
Payment information
- payment_terms: Payment terms configuration (type and days)
- due_date: When payment is expected
- payment_status:
open,dueorpaid(a partially paid invoice staysopenordue; checkamount_remaining) - amount_due: How much is still unpaid
- amount_overpaid: If a payment is recorded, the amount that exceeds the amount_remaining at the time it is recorded
- amount_paid: How much is recorded as paid
- amount_remaining: How much is still unpaid
Multi-currency support
Nocotax supports invoices in multiple currencies. Each invoice must specify its currency:- Currency is required when creating an invoice
- All amounts on an invoice must be in the same currency
- Currency cannot be changed after invoice creation
Invoice numbering
Invoice numbers are assigned automatically when you finalize an invoice. Nocotax ensures:- Sequential numbering: Each invoice gets the next available number
- Unique numbers: No duplicates within your account
- Per-flow numbering: Sales and purchases can have separate sequences
- Format customization: Configure your numbering format in settings
Draft invoices don’t have document numbers. Numbers are assigned only when you finalize the invoice via the
document_number field.Amounts: totals vs unit prices
Nocotax uses two different conventions. Mixing them up is the most common integration mistake, so read this section carefully.
Smallest units by currency:
Unit prices keep their full precision because they are multiplied by
quantity; the resulting line total is then rounded to the smallest currency unit.
Working with line items
Invoices support up to 10 line items per invoice at creation:Line item attributes
Each line item includes:title(required): Text description of the item, displayed on the documentquantity(optional): Number of units, defaults to1product.tax_code(optional): Tax category for automatic tax calculation- One amount (at least one is required;
unit_extratax_amountandunit_tax_included_amountcannot be combined, norextratax_amountandtax_included_amount):unit_extratax_amount: unit price excluding tax, decimal string in the main unit ("99.2842")unit_tax_included_amount: unit price including tax, decimal string in the main unitextratax_amount: line total excluding tax, integer in the smallest unit (9900)tax_included_amount: line total including tax, integer in the smallest unit
order_reference,period,taxes(optional): see the API reference
extratax_amount: quantity × unit_extratax_amount, rounded to the smallest unitunit_tax_included_amount: Unit price including taxtax_included_amount: Total line amount including tax
Tax information
When automatic tax calculation is enabled, invoices include detailed tax breakdown:Common patterns
Pattern 1: Simple sales invoice
Pattern 2: Recording a supplier invoice
Next steps
Invoice Lifecycle
Learn about invoice statuses and state transitions
Managing Taxes
Configure tax calculations on invoices
Payments
Track and reconcile invoice payments
API Reference
Explore the complete invoices API
