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.
  • Your order number (Ert ordernummer): Fortnox YourOrderNumber is set from the invoice’s native hs_purchase_order_number. If that is empty, a unique associated deal’s order_number is used. If that is also empty, HubSpot’s invoice number (hs_number) is used.
  • Remarks (Anmärkningar): The invoice is created without Remarks so Fortnox applies its standard Fakturatext (Inställningar → Fakturering → Fakturatexter). If the HubSpot Invoice has Comments (hs_comments), that text is then prepended to those Remarks. HTML is stripped.
  • Success: invoice_number_in_fortnox on the HubSpot Invoice is set to the new Fortnox document number. The Fortnox invoice PDF is stored on fortnox_invoice_pdf (same file as Fortnox → HubSpot import). Invoice History will show that as a property change — add Fortnox invoice PDF to the Invoice record view to open the file.

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: country -> Country (ISO code or name converted to Fortnox register name, e.g. SE → Sverige; omitted when empty or unrecognised so Fortnox copies from the customer)
Company: billing_email -> EmailInformation.EmailAddressTo
Company: fortnox_cost_center -> CostCenter
Company: fortnox_invoice_template -> PrintTemplate / DefaultTemplates.Invoice (via Settings map)
Deal: order_number -> YourOrderNumber (Ert ordernummer)
Invoice: hs_purchase_order_number (fallback: associated Deal order_number, then Invoice hs_number) -> YourOrderNumber (Ert ordernummer)
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.
Deal / HubSpot Invoice: Fortnox invoice PDF <- After optional send/bookkeep, GET /3/invoices/{n}/preview is stored on the source record. On a Deal: a Note (timeline). On a HubSpot Invoice: the file property fortnox_invoice_pdf only (Invoice has History, not a Notes timeline). Import overwrites that property on first import and when invoice status later changes (for example unpaid → paid).

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.

  1. Create the print templates in Fortnox.
  2. In HubSpot app settings, open Invoice template mapping (under HubSpot deal to Fortnox invoice).
  3. Add rows: type a HubSpot name and pick the matching Fortnox template, then Save mapping.
  4. 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.

See Release notes (July 16, 2026).

Invoice first line item

Optional informational first Fortnox row when creating an invoice from a HubSpot Deal or HubSpot Invoice. Configure it under Invoice first line item in app settings (visible when invoice create is on).

  1. Write Line text with placeholders such as {{contract}} and {{start}}.
  2. Add a row per marker: HubSpot object and property (standard or custom objects).
  3. Enable the first line item and save.

On create, each {{marker}} is replaced from the source record, the associated company, or the first associated record of another object. Dates become YYYY-MM-DD. The Fortnox row is Description (max 255 characters), Price 0, DeliveredQuantity 1 — no article number or VAT, so totals are unchanged.

  • Missing association, missing scope, or empty property → that marker is blank. Invoice create continues.
  • If the helper cannot build the row, the invoice is created without the extra first line.
  • Does not apply to invoice from an existing Fortnox order or credit invoice (kreditfaktura).
  • Fortnox → HubSpot import creates a HubSpot line item for every Fortnox row, including this first line if it exists in Fortnox.
  • Custom objects, Subscriptions, and Contracts: re-authenticate HubSpot after deploying the app so the new scopes are granted. Property lists need crm.schemas.subscriptions.read / crm.schemas.contracts.read; reading records needs the matching crm.objects.*.read scopes.

See Release notes (September 7, 2026).