Create an Invoice
When an Invoice is created in Fortnox based on a HubSpot Deal, following fields are mapped. Only a few Fortnox fields are populated to use Fortnox default handling of invoices.
| Field HubSpot | Direction | Field Fortnox |
|---|---|---|
| Deal: deal_currency_code | -> | Currency |
| Company: fortnox_id | -> | CustomerNumber |
| Contact: firstname lastname | -> | YourReference |
| Deal: hubspot_owner_id (firstname lastname) | -> | OurReference |
| Deal: agreement_start_date, agreement_end_date | -> | Remarks (appended before description, localized based on currency) |
| Deal: description | -> | Remarks (appended after agreement dates if they exist) |
| Line item: hs_sku | -> | ArticleNumber |
| Line item: name | -> | Description |
| Line item: quantity | -> | DeliveredQuantity |
| Line item: price | -> | Price |
| Line item: discount or hs_discount_percentage | -> | Discount |
| Line item: calculated (hs_total_discount or hs_discount_percentage) | -> | DiscountType ('AMOUNT' or 'PERCENT') |
| Line item: tax | -> | VAT |
| Company: billing_email | -> | EmailInformation.EmailAddressTo |
| Company: fortnox_cost_center | -> | CostCenter |
| Deal: order_number | -> | YourOrderNumber |
| Deal: fortnox_print_template | -> | PrintTemplate (only when set to delivery note) |
| Deal: fortnox_invoice_type | -> | InvoiceType (only when set to CASHINVOICE) |
| Deal: fortnox_payment_way | -> | PaymentWay (CASH, CARD, AUTOGIRO; default: omitted) |
| Deal: fortnox_way_of_delivery | -> | Before invoice: for PRINT / EMAIL / PRINTSERVICE, PUT customer DefaultDeliveryTypes.Invoice (+ EmailInvoice when EMAIL). After POST /3/invoices: GET …/print, …/email, …/eprint, or …/einvoice (before optional bookkeep). E-INVOICE only runs the send step. |
| Deal: amounts_include_vat | -> | VATIncluded (only when Yes: true; default: omitted) |
| Deal: fortnox_bookkeep_after_create | -> | After successful new invoice (and after optional send from fortnox_way_of_delivery): PUT …/bookkeep (optional; default: no booking) |
| Deal: fortnox_kreditfaktura + fortnox_credit_invoice_reference | -> | When kreditfaktura is JA: PUT …/credit on the debit document number in fortnox_credit_invoice_reference (no line-item POST for this path) |
Fortnox Way of Delivery (customer defaults + send)
The deal property Fortnox Way of Delivery (fortnox_way_of_delivery) does two things when set: (1) before POST /3/invoices, for PRINT, EMAIL, or PRINTSERVICE, it updates the linked Fortnox customer with DefaultDeliveryTypes.Invoice (and EmailInvoice from billing email when EMAIL). (2) after the invoice is created, it calls Fortnox send for this document, before optional bookkeep.
- PRINT → customer defaults, then
GET …/print - EMAIL → customer defaults +
EmailInformationon the invoice, thenGET …/email - PRINTSERVICE → customer defaults, then
GET …/eprint - E-INVOICE → only
GET …/einvoice(noDefaultDeliveryTypesupdate via this field) - Empty — create invoice only; no customer update or send call from this property.
E-invoice may require booking first in some Fortnox setups; see Release notes (April 21, 2026).
Bookkeep after create & kreditfaktura
Three optional deal fields control booking and credit invoices:
- Fortnox bookkeep after invoice create (
fortnox_bookkeep_after_create) — When Yes, after the app successfully creates a new Fortnox invoice from the deal (and after any optional send fromfortnox_way_of_delivery), it calls Fortnox to bookkeep that document. When No, behavior is unchanged (invoice created but not booked via this step). - Fortnox kreditfaktura (
fortnox_kreditfaktura, values NEJ / JA) — NEJ: create a normal invoice from deal line items. JA: create a credit invoice in Fortnox by crediting an existing debit invoice; deal line items are not used for this run. - Fortnox document to credit (invoice number) (
fortnox_credit_invoice_reference) — The Fortnox document number of the debit invoice to credit. Required when kreditfaktura is JA. After success, the new document number is stored in Invoice number in Fortnox (invoice_number_in_fortnox).
See Release notes (April 8, 2026) for API details and the bookkeep/credit fix.
Invoice from existing Fortnox order (optional)
When the nested app setting Invoice from existing Fortnox order when linked is enabled under HubSpot deal to Fortnox invoice, the app creates the Fortnox invoice from an existing Fortnox order (Fortnox Fakturera order) instead of building a standalone invoice from deal line items. That keeps warehouse picking on one document in Fortnox. This is off by default.
When it runs: when you create an invoice from a deal (CRM card, workflow, or create_invoice_in_fortnox),
the nested setting is on, and a Fortnox order number can be resolved for the deal. Optional send, bookkeep, and line-item sync-back run the same as after a normal invoice create.
Kreditfaktura is unchanged (credit path only). With the setting off, or when no order is linked, behaviour is unchanged (POST /3/invoices/ from deal line items).
Deal properties involved:
| HubSpot deal property | Role |
|---|---|
order_number_in_fortnox (Order number in Fortnox) |
Fortnox order document number to invoice. Read from the deal first; otherwise from associated HubSpot orders' order_number_in_fortnox. |
invoice_number_in_fortnox (Invoice number in Fortnox) |
Written after success with the new Fortnox invoice document number (standalone or from order). |
How the Fortnox order is resolved:
- Deal Order number in Fortnox if set.
- Otherwise, associated HubSpot Orders — their
order_number_in_fortnoxvalues. - Exactly one unique order number → Fortnox Fakturera order for that document. None found → fall back to standalone invoice. Multiple → error (set the order number on the deal).
- Invoice rows come from the Fortnox order, not re-built from deal line items. Fortnox links order and invoice (
OrderReference/InvoiceReference).
Typical flow:
- Enable HubSpot order to Fortnox order and create a Fortnox order from a HubSpot order — when the order has exactly one associated deal,
order_number_in_fortnoxis copied to that deal automatically. Or set Order number in Fortnox on the deal manually. - Enable this nested setting under HubSpot deal to Fortnox invoice.
- Create the invoice from the deal as usual.
Deal order_number_in_fortnox is created at HubSpot install and re-authentication (group Deal information).
See Release notes (June 30, 2026).
Sync Fortnox invoice row values to line items (optional)
When the nested app setting Sync Fortnox invoice row values to line items is enabled under HubSpot deal to Fortnox invoice, the app writes Fortnox-calculated row VAT and totals back to the deal's line items after a successful invoice create. This is off by default.
When it runs: after Fortnox accepts the invoice (and after any optional send from
fortnox_way_of_delivery and optional bookkeep), and before
Invoice number in Fortnox (invoice_number_in_fortnox) is set on the deal.
Applies to normal invoice create and to kreditfaktura (credit invoice) create.
Line item properties written (Fortnox → HubSpot):
| HubSpot line item property | Source |
|---|---|
fortnox_invoice_document_number |
Fortnox invoice document number |
fortnox_invoice_row_number |
1-based row index on the Fortnox invoice |
fortnox_invoice_row_vat_percent |
Fortnox row VAT |
fortnox_invoice_row_vat_amount |
Derived from Fortnox row totals (respects VATIncluded on the invoice) |
fortnox_invoice_row_total_incl_vat |
Derived line total including VAT from the Fortnox row |
Matching and safety:
- Rows are matched by index (first Fortnox row ↔ first line item, and so on).
- Each pair is verified against SKU, quantity, and line total before update. Credit rows compare absolute line totals; signed VAT amounts from Fortnox are preserved.
- Line items already linked to a different Fortnox invoice are skipped (re-invoicing guard). Credit sync allows rows linked to the debited invoice.
- Line item
priceandtaxare not changed — downstream exports (e.g. card integrations) can read the Fortnox properties as authoritative VAT. - Sync-back is best-effort: failures are logged and surfaced in the activity message; invoice create still succeeds.
- HubSpot batch updates are sent in chunks of up to 100 line items per request.
Custom properties are created on line items at install and HubSpot re-authentication (group Line item information).
Amounts Include VAT
The app includes a deal property "Amounts include VAT" (amounts_include_vat)
that controls whether HubSpot deal and line item amounts are treated as VAT-inclusive or VAT-exclusive when creating Fortnox invoices.
- Default (empty or No) – The app does not send
VATIncluded; Fortnox uses its default (amounts treated as VAT-exclusive, VAT added on top). This preserves the original behavior. - Yes – HubSpot amounts include VAT. The app sends
VATIncluded: trueso Fortnox does not add VAT on top. Use this when your HubSpot deal amounts already include VAT to avoid double VAT.
Set to Yes only when your HubSpot amounts are VAT-inclusive and you want Fortnox to treat them as such. See Release Notes (March 10, 2026) for more details.
Invoice vs Delivery Note (Print Template)
The app includes a deal property "Fortnox document type" (fortnox_print_template)
that controls whether Fortnox creates a regular invoice or a delivery note when you trigger
"Create invoice in Fortnox".
- Faktura (value:
st) – standard invoice. The app does not sendPrintTemplate; Fortnox uses its default (normally invoice). - Följesedel (value:
ps) – delivery note. The app sendsPrintTemplate = "ps"on the invoice. - If the field is empty or has any other value,
PrintTemplateis omitted and Fortnox applies its own default template.
This means you only explicitly override the template when you select Följesedel; otherwise the invoice follows your Fortnox default configuration.
Standard invoice vs Cash invoice (InvoiceType)
The app also includes a deal property "Fortnox invoice type" (fortnox_invoice_type)
that controls whether Fortnox creates a standard invoice or a cash invoice (kontantfaktura).
- Standard invoice (Fortnox default) (value:
INVOICE) – normal invoice type. The app does not sendInvoiceType; Fortnox uses its configured default. - Kontantfaktura (cash invoice) (value:
CASHINVOICE) – the app sendsInvoiceType = "CASHINVOICE"so Fortnox creates a cash invoice. - If the field is empty or has any other value,
InvoiceTypeis omitted and Fortnox applies its own default type.
Combined with the print template setting, this gives you fine-grained control per deal while still respecting Fortnox defaults when you do not explicitly override them.
Betalsätt (PaymentWay)
The optional deal field Fortnox betalsätt (PaymentWay) (fortnox_payment_way) maps to Fortnox PaymentWay when creating an invoice from a deal:
- Kontant, Kort, or Autogiro sends the matching Fortnox API code (
CASH,CARD,AUTOGIRO). Choose Kort for card payments (for example Diners). Default leavesPaymentWayunset.
⚠️ VAT Configuration Requirement
Important: The VAT percentage sent to Fortnox must match a VAT rate that is configured in your Fortnox account.
How it works:
- The tax property on line items contains the VAT percentage (e.g., "25" for 25%)
- This percentage is sent to Fortnox when creating invoice rows
- Fortnox matches this percentage to a configured VAT rate in your account
- If the percentage doesn't match a configured rate, Fortnox may reject the invoice or use a default rate
To configure VAT rates in Fortnox:
- Go to Settings → Accounting → Predefined Accounts
- Scroll to the VAT section
- Ensure all VAT percentages you use (e.g., 25%, 12%, 6%) are configured
- Common VAT account codes: 2611 (25%), 2621 (12%), 2631 (6%)
Invoice Email Feature
Automatic Email Configuration: When creating invoices in Fortnox from HubSpot deals, the app can automatically configure the invoice to be sent to a specific billing email address.
Syncing from Fortnox:
- The Fortnox Billing Email field (
billing_email) is synced from Fortnox customers to HubSpot companies during company sync - The app prioritizes the EmailInvoice field from Fortnox, falling back to the Email field if EmailInvoice is not available
- Email addresses are automatically trimmed of whitespace during sync
- If both email fields are empty or null in Fortnox, the billing_email field will not be set in HubSpot
Manual Configuration:
- You can also manually add a single billing email address to the Fortnox Billing Email field on the associated company in HubSpot
- When creating an invoice from a deal, the app validates the email format before adding it to the invoice
- If the email format is invalid, a warning is logged and the invoice is created without email information
- If no billing email is provided, the invoice is created without email information (normal behavior)
- The billing email is set directly on the invoice, not on the customer record in Fortnox
- Only one email address is supported per invoice
Note: The Fortnox Billing Email field is automatically created during app installation and can be found in the Company Information section. The app validates email format when creating invoices to ensure only valid addresses are sent to Fortnox.
Remarks Field Structure
Remarks Field Ordering: When creating invoices in Fortnox from HubSpot deals, the Remarks field is built in the following order:
- Agreement Dates (if provided, localized based on currency)
- Deal Description (if provided)
Agreement Dates Localization:
- Swedish (SEK currency): "Avtalsstartdatum {date} och slutdatum {date}" - Dates formatted as YYYY-MM-DD
- English (other currencies): "Agreement start date {date} and end date {date}" - Dates formatted as MM/DD/YYYY
- If only start date is provided, only that date is included
- If only end date is provided, only that date is included
- If both dates are provided, they appear together in one text string
Line Item Descriptions
Product Name Only: When creating invoices in Fortnox from HubSpot deals, the app uses only the line item name field for the description in Fortnox.
Behavior:
- If name exists → Uses name only
- If name is missing → No description field sent
Works for both: Existing products (with SKU) and custom line items (without SKU)