Skip to main content

Fortnox - Create customer

Fortnox - Create Customer This document describes the process of creating a new customer in Fortnox via App4Sales. The functionality is tr...

Updated over a week ago

Fortnox - Create Customer

This document describes the process of creating a new customer in Fortnox via App4Sales. The functionality is triggered when a new customer is created in the App4Sales application. The connector either creates a new customer or updates an existing one based on the presence of a customer number.

Trigger & Permissions

The customer creation process is initiated from the App4Sales application. The connector must be configured to allow customer creation. This is controlled by the CreateCustomer and EditCustomer connector information flags. The request is sent as an XML payload.

Payload Mapping

The incoming customer data from App4Sales is mapped to the Fortnox customer model. The following tables detail the field mappings.

Customer Header

Fortnox Field

App4Sales Field

Logic/Notes

Active

N/A

Hardcoded to true.

CustomerNumber

CustomerCode

If this field is empty or null, a new customer will be created. Otherwise, the existing customer with this number will be updated.

Name

CustomerName

VATNumber

VatCode

PriceList

UsesPrice

The UsesPrice (ID) is used to find the corresponding price list. The Code of that price list is then used.

TermsOfPayment

PaymentCondition

Email

Email

Phone1

Phone

Phone2

Mobile

OrganisationNumber

ChamberOfCommerceCode

Type

N/A

Hardcoded to COMPANY.

VATType

CountryCode, VatCode

Determined based on the customer's country and VAT number. See the "Validation & Defaults" section for more details.

Currency

UsesPrice

The currency is derived from the price list associated with the customer.

YourReference

ContactFullName

OurReference

(from SalesRep)

If the SetSalesRepNameAsOurReference setting is enabled and it's a new customer, this field is populated with the name of the sales representative.

Comments

(from SalesRep)

If the UseCommentsForCustomerManager setting is enabled and it's a new customer, this field is populated with the name of the sales representative.

Addresses

Fortnox supports three types of addresses: Invoice, Visiting, and Delivery. The mappings for these are as follows:

Fortnox Address Field

App4Sales Field

Address Type

City

VisitCity

Invoice

Address1

VisitAddress1

Invoice

CountryCode

CountryCode

Invoice

ZipCode

VisitPostCode

Invoice

VisitingCity

VisitCity

Visiting

VisitingAddress

VisitAddress1

Visiting

VisitingCountryCode

CountryCode

Visiting

VisitingZipCode

VisitPostCode

Visiting

DeliveryCity

DeliveryCity

Delivery

DeliveryAddress1

DeliveryAddress1

Delivery

DeliveryAddress2

DeliveryAddress2

Delivery

DeliveryCountryCode

CountryCode

Delivery

DeliveryZipCode

DeliveryPostCode

Delivery

Validation & Defaults

VAT Type Determination

The VATType is determined by the following rules:

  • If the CountryCode is empty, the VATType is set to EXPORT.

  • If the CountryCode is "SE" (Sweden), the VATType is set to SEVAT.

  • If the CountryCode is another European country:

    • If a VatCode (VAT number) is provided, the VATType is set to EUREVERSEDVAT.

    • If no VatCode is provided, the VATType is set to EUVAT.

  • For all other countries, the VATType is set to EXPORT.

Response & Error Handling

After attempting to create or update a customer, the connector checks for errors from the Fortnox API.

  • If an error occurs, the process is stopped and an error message is returned (e.g., "ERROR: [Error message from Fortnox]").

  • If the operation is successful, a success message with the customer number is returned (e.g., "Succes: [Customer Number]").

Related Settings & Prerequisites

  • SetSalesRepNameAsOurReference: When enabled, the sales representative's name is placed in the 'OurReference' field for new customers.

  • UseCommentsForCustomerManager: When enabled, the sales representative's name is placed in the 'Comments' field for new customers.

Did this answer your question?