Create an Invoice
The app can create a Fortnox invoice from a HubSpot Deal or from a native HubSpot Invoice record. Which path is active depends on Invoicing in HubSpot app settings (portal default and optional per-direction overrides). The field mapping and Fortnox options below apply to both paths; deal properties become invoice custom properties on the HubSpot Invoice object (fortnox_*, amounts_include_vat, etc.).
Create from HubSpot Invoice
Use this path when the portal HubSpot → Fortnox create object type is set to HubSpot Invoice.
- App setting: Enable HubSpot invoice to Fortnox invoice.
- App card: Add Fortnox invoice from invoice (preview) under Settings → Objects → Invoices → Preview — see Invoice app card.
- Workflow: Set Create Fortnox invoice from this HubSpot invoice (
create_fortnox_invoice_from_invoice_object) to Yes. - Requirements: One associated company with
fortnox_id, line items in a single currency, no recurring line items, SKUs must exist in Fortnox when used. - Success:
invoice_number_in_fortnoxon the HubSpot Invoice is set to the new Fortnox document number.
Deal-based create is disabled when this path is active (and vice versa). See Release notes (July 14, 2026).
Create from Deal
When an invoice is created in Fortnox from a HubSpot Deal, the 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 |
| Company: fortnox_invoice_template | -> | PrintTemplate / DefaultTemplates.Invoice (via Settings map) |
| Deal: order_number | -> | YourOrderNumber |
| Deal: fortnox_print_template | -> | PrintTemplate (only when set to delivery note; overrides company template) |
| Deal: fortnox_invoice_type | -> | InvoiceType (only when set to CASHINVOICE) |
| Deal: fortnox_payment_way | -> | PaymentWay (CASH, CARD, AUTOGIRO; default: omitted) |
| Deal / Invoice: fortnox_terms_of_payment | -> | TermsOfPayment (optional Betalningsvillkor code, e.g. 30, Z) |
| 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) |
| Deal / HubSpot Invoice: fortnox_accrual_period | -> | After successful new invoice create, before optional send/bookkeep: POST /3/invoiceaccruals when period is 1, 2, 3, 6, or 12 months. Uses portal Periodiseringskonto (default 2990). Skipped when Ingen or for kreditfaktura. Set the period before creating the Fortnox invoice. |
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 accrual / periodisering (optional)
Set Fortnox accrual period (fortnox_accrual_period) on the deal or HubSpot Invoice before you create the Fortnox invoice. The app then creates a Fortnox invoice accrual (periodisering) for that new invoice. Choose Ingen to skip (default). Setting the period after the invoice already exists does not add periodisering to that invoice.
Period values:
- Ingen (
INGEN) — no accrual (default) - 1 månad (
1_MONTHS) - 2 månader (
2_MONTHS) - 3 månader (
3_MONTHS) - 6 månader (
6_MONTHS) - 12 månader (
12_MONTHS)
Accrual account: In app settings under HubSpot deal to Fortnox invoice, open Periodiseringskonto (Fortnox) and save a BAS account from your Fortnox chart of accounts. If unset, the app uses 2990. The dropdown requires the Fortnox bookkeeping scope; re-authenticate if accounts do not load.
When it runs: right after the Fortnox invoice is created, and before optional send (fortnox_way_of_delivery) and optional bookkeep (fortnox_bookkeep_after_create). Start date is the Fortnox invoice date (fakturadatum); end date is calculated from the selected period. Revenue amounts come from the created invoice; one combined accrual is created per invoice.
Where to check in Fortnox: Bokföring → Periodiseringar. The manual Periodisering dialog on the invoice (with Lägg till) is for adding accruals by hand — an empty form there does not mean the API accrual failed or succeeded; use the Periodiseringar list instead.
Not included: kreditfaktura path, recurring line items (invoice create is blocked), and Fortnox → HubSpot import.
Accrual errors are logged and appended to the create result message (deal timeline / CRM card); invoice create still succeeds. See Release notes (July 15, 2026) and July 16 reliability fixes.
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 or HubSpot invoice 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 or HubSpot Invoice (CRM card, workflow, or property trigger),
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 template mapping (company)
Use this when different customers need different Fortnox print layouts (e.g. EU vs US, or a separate template for collection agencies). Templates themselves are created in Fortnox; the app only selects them.
- Create the print templates in Fortnox.
- In HubSpot app settings, open Invoice template mapping (under HubSpot deal to Fortnox invoice).
- Add rows: type a HubSpot name and pick the matching Fortnox template, then Save mapping.
- On each company, set Fortnox invoice template (
fortnox_invoice_template) to one of those names.
When you create a Fortnox invoice (or customer) from HubSpot, the company name is resolved through the map
to Fortnox PrintTemplate and DefaultTemplates.Invoice. Email/print send from HubSpot
then uses that template.
Invoice vs Delivery Note (Print Template)
The deal/invoice property "Fortnox document type" (fortnox_print_template)
controls invoice vs delivery note when you create a Fortnox invoice.
- Faktura (value:
st) – standard invoice. The app does not forcePrintTemplate = "st"; instead it may use the company invoice template mapping or Fortnox defaults. - Följesedel (value:
ps) – delivery note. The app sendsPrintTemplate = "ps"(overrides company template mapping). - If the field is empty or has any other value,
PrintTemplateis omitted unless a company template is mapped.
Delivery note (Följesedel) always wins over the company template mapping.
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.
Betalningsvillkor (TermsOfPayment)
The optional field Fortnox Terms of Payment (Betalningsvillkor) (fortnox_terms_of_payment) on deals and HubSpot invoice records maps to Fortnox TermsOfPayment when creating an invoice.
- Use the Fortnox code from Register → Betalningsvillkor (e.g.
30,45,Z), not the description text such as "30 Days". - Leave empty to let Fortnox use the customer default / Fortnox defaults.
- If Fortnox does not recognise the code, the invoice is still created without
TermsOfPaymentand the result message includes a warning. - This is separate from
fortnox_payment_way(betalsätt: Kontant/Kort/Autogiro).
⚠️ 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)