---
title: "Action: Sales orders and order lines"
description: "Sales orders (header). Imports sales orders into Sapera, creating or updating the order header with customer, address and order details."
url: https://support.sapera.io/en/articles/613-action-sales-orders-and-order-lines
collection: "SyncTool"
updated: 2026-09-25
language: en
alternates: [da]
---

# Action: Sales orders and order lines

Sales orders (header). Imports sales orders into Sapera, creating or updating the order header with customer, address and order details.

**Sales orders (header).** Imports sales orders into Sapera, creating or updating the order header with customer, address and order details.

**Order lines.** Imports sales order lines into Sapera, attaching each line to its sales order with product, quantity, price and VAT details.

## How to use the action

1\. Select the action in the **Action** field. 2. Point to your data source – a **file** (CSV or Excel) or a **SQL query**. 3. Map the source columns to Sapera's fields in the column mapping (see _Source fields_ below). 4. Run **Compare** to see what will be created, changed or stay unchanged – without writing to Sapera. 5. Run **Update Sapera** to perform the import.

Use the **Allow create** and **Allow update** parameters to control whether new rows are created and whether existing ones are updated.

## How matching and updating works

Import the **order header** first (the _Sales orders_ action) and then the **order lines** (the _Sales order lines_ action).

-   The order header is matched on the order's **identifier** (Identifier); matching orders are updated and new ones created with customer, address and order details.
    
-   Each order line is matched on **order identifier + line number**. If the order is in a state that cannot be changed, the line is skipped with a warning.
    
-   Direction: from file/SQL into Sapera.
    

## Key parameters

### Sales orders (header)

<table data-id="421442c3-e7a3-468b-832c-dfc8dc4ccb2a" style="min-width: 50px;"><colgroup><col style="min-width: 25px;"><col style="min-width: 25px;"></colgroup><tbody><tr><td colspan="1" rowspan="1"><p data-id="ab5e4f7d-b57b-4673-afda-9126f9992f2e" style="text-align: left;"><strong>Parameter</strong></p></td><td colspan="1" rowspan="1"><p data-id="0b7dc01c-3a35-404f-815b-59d6efbfe4b6" style="text-align: left;"><strong>Explanation</strong></p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="b0a91259-3917-4e88-8281-3eed422c5afd" style="text-align: left;">ForceIdentifierInHigherRangeThan</p></td><td colspan="1" rowspan="1"><p data-id="1b30de76-3e6e-49e6-b6c8-b6704a5e5bbd" style="text-align: left;">Forces newly created sales order numbers to start above the given value to avoid clashing with existing numbers.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="7f5fa3ff-4539-45b0-ad9e-f54838a0dee6" style="text-align: left;">TreatCompletedSalesOrdersAsWarning</p></td><td colspan="1" rowspan="1"><p data-id="0fd98b77-9066-48be-941b-099847520050" style="text-align: left;">When enabled, hitting an already completed sales order is reported as a warning instead of an error.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="feb49368-8091-4e1b-ba3c-97486bac855b" style="text-align: left;">TreatExistingSalesOrdersAsWarning</p></td><td colspan="1" rowspan="1"><p data-id="b9fe0f7d-879b-49d7-adde-62d944efa0d0" style="text-align: left;">When enabled, hitting an already existing sales order is reported as a warning instead of an error.</p></td></tr></tbody></table>

### Order lines

<table data-id="2f2c6e3a-a2da-4b7b-a5c6-4214818a6f6b" style="min-width: 50px;"><colgroup><col style="min-width: 25px;"><col style="min-width: 25px;"></colgroup><tbody><tr><td colspan="1" rowspan="1"><p data-id="a1478912-0b28-4817-9f08-7371116c6e58" style="text-align: left;"><strong>Parameter</strong></p></td><td colspan="1" rowspan="1"><p data-id="9b7ec847-adc4-4aab-a246-b431b35c911e" style="text-align: left;"><strong>Explanation</strong></p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="646a922c-ce4f-43c5-b788-1b5f9bb013be" style="text-align: left;">ForceSalesOrderIdentifierInHigherRangeThan</p></td><td colspan="1" rowspan="1"><p data-id="573dbdc1-73db-4f32-8d00-ef74f82df330" style="text-align: left;">Forces newly created sales order numbers to start above the given value to avoid clashing with existing numbers.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="9072b3e3-8ce6-4659-a3fd-1bade5c4b0b5" style="text-align: left;">TreatCompletedSalesOrdersAsWarning</p></td><td colspan="1" rowspan="1"><p data-id="a15d5be7-9a34-4044-ab64-695bc7db3ff3" style="text-align: left;">When enabled, a line belonging to an already completed sales order is reported as a warning instead of an error.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="cd161daf-ca98-4df6-a267-12061c24d172" style="text-align: left;">TreatExistingSalesOrdersAsWarning</p></td><td colspan="1" rowspan="1"><p data-id="d65cd62e-f5f0-40d3-a032-3b9a2b3494d4" style="text-align: left;">When enabled, a line belonging to an already existing sales order is reported as a warning instead of an error.</p></td></tr></tbody></table>

## Source fields

### Sales orders (header)

<table data-id="3ef28f48-368b-415b-80c6-810141eb5adb" style="min-width: 50px;"><colgroup><col style="min-width: 25px;"><col style="min-width: 25px;"></colgroup><tbody><tr><td colspan="1" rowspan="1"><p data-id="3508d289-daad-495b-b7b1-8a4378f053e6" style="text-align: left;"><strong>Field</strong></p></td><td colspan="1" rowspan="1"><p data-id="c8bdc197-9e57-448b-bb9f-17a5ab4a5192" style="text-align: left;"><strong>Explanation</strong></p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="ef10db34-b59f-4765-a291-00b7ffd3954c" style="text-align: left;">AddressLine1</p></td><td colspan="1" rowspan="1"><p data-id="a0beb2ba-3892-4d78-b089-3ee5aa9183ff" style="text-align: left;">First line of the order address.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="638b9d4a-d1e6-4949-a628-a356ecb80d34" style="text-align: left;">AddressLine2</p></td><td colspan="1" rowspan="1"><p data-id="adb4567b-68bd-4c77-a7d0-c2eaa62134a8" style="text-align: left;">Second line of the order address.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="90c7546e-d478-4065-b0e2-9ac8955746ec" style="text-align: left;">Country</p></td><td colspan="1" rowspan="1"><p data-id="573ae98e-553d-477c-b267-f237ed17e369" style="text-align: left;">Country of the order address.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="0ffecd44-1da0-47ae-b37c-287c2425da2e" style="text-align: left;">CurrencyCode</p></td><td colspan="1" rowspan="1"><p data-id="4d4e2625-6ca4-4c3c-bcd5-27d01dff0487" style="text-align: left;">Currency code of the sales order, for example DKK or EUR.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="e0cbb986-2e84-4ac4-ae9c-7ac419735077" style="text-align: left;">CurrencyRate</p></td><td colspan="1" rowspan="1"><p data-id="02bf9bad-1d81-4539-897a-07d44bbd5bb8" style="text-align: left;">Exchange rate applied to the order currency.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="18012699-4a1c-452a-a273-25cbc2ef2041" style="text-align: left;">CustomerEmail</p></td><td colspan="1" rowspan="1"><p data-id="28b4c1ee-1c01-4cd6-8fdf-ca7e4b055b74" style="text-align: left;">Email address of the customer.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="efc95705-fe17-4ff7-bf4c-0ad8b39f6581" style="text-align: left;">CustomerFullName</p></td><td colspan="1" rowspan="1"><p data-id="8d7d6594-55e4-4bdb-b25d-09e8e57c66de" style="text-align: left;">Full name of the customer on the sales order.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="b6e59e9a-ba56-4457-ac37-e80c6da24a90" style="text-align: left;">CustomerIdentifier</p></td><td colspan="1" rowspan="1"><p data-id="ce5bd745-e4e2-4394-8e6a-aecd1ac1b0a0" style="text-align: left;">Identifier of the customer the sales order belongs to.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="80f9b076-826b-4ae7-9971-f440ceb9a87c" style="text-align: left;">CustomerOrganizationIdentifier</p></td><td colspan="1" rowspan="1"><p data-id="17437235-19ea-4b06-8411-fd5b31687474" style="text-align: left;">Organization or CVR number of the customer.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="dd34042c-64dd-40c8-83c2-1019f6c7b636" style="text-align: left;">CustomerPhone</p></td><td colspan="1" rowspan="1"><p data-id="ed0aff11-ac61-4a13-be10-0685e090660b" style="text-align: left;">Phone number of the customer.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="30d093bb-e29e-49c7-acb6-ecce51239edd" style="text-align: left;">CustomerReferenceNumber</p></td><td colspan="1" rowspan="1"><p data-id="6e35bab8-661d-4b04-aa93-526e9e9196d2" style="text-align: left;">Customer reference shown on the sales order.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="b16ecd03-a2b9-4ee2-80a3-20cff052ad2b" style="text-align: left;">Identifier</p></td><td colspan="1" rowspan="1"><p data-id="2e1f1934-fa33-4702-8d2e-38e2a0bfc216" style="text-align: left;">Unique identifier (order number) of the sales order.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="f1536d27-d772-4a0d-a875-db44765cd468" style="text-align: left;">InternalNote</p></td><td colspan="1" rowspan="1"><p data-id="08bcb55c-dce5-4d88-a8e4-29fbbe75826a" style="text-align: left;">Internal note not shown to the customer.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="2b4245eb-4c1d-413b-90fa-c5b6d736c210" style="text-align: left;">InvoiceDate</p></td><td colspan="1" rowspan="1"><p data-id="393eeec5-d968-411a-a179-3222f1199944" style="text-align: left;">Invoice date applied to the sales order.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="e462025a-ecf4-4bf0-88dd-932b626fecd9" style="text-align: left;">IsCostPriceOrder</p></td><td colspan="1" rowspan="1"><p data-id="ca64bf5f-8a22-47a9-bedb-35edf22b68f6" style="text-align: left;">Whether the order is priced at cost price.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="ac7015bb-48e9-4c32-8591-1b08880e21e1" style="text-align: left;">IsExemptVat</p></td><td colspan="1" rowspan="1"><p data-id="25a3c726-bd55-4bdb-af13-43a6b2602ad9" style="text-align: left;">Whether the sales order is exempt from VAT.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="f7e398f3-0355-475d-8912-2fa555f0e2a0" style="text-align: left;">MaxTotal</p></td><td colspan="1" rowspan="1"><p data-id="46d6a213-3de7-439f-b1ba-e7ef3a3ce02b" style="text-align: left;">Maximum allowed total for the sales order.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="c3388552-17d4-467f-8c36-1d4dcd9039fb" style="text-align: left;">OtherPayerIdentifier</p></td><td colspan="1" rowspan="1"><p data-id="6cecd8cb-c629-49e8-9436-4340d2ae0865" style="text-align: left;">Identifier of an alternative payer when someone other than the customer pays.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="e64b45ea-1ed5-482e-afe2-a12d27d99949" style="text-align: left;">ParentSalesOrder</p></td><td colspan="1" rowspan="1"><p data-id="bbe6960f-4981-4aed-8dc3-5b061f004d0e" style="text-align: left;">Identifier of a parent sales order this order is linked to.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="d81cdba8-8138-401a-8055-ca560888f219" style="text-align: left;">PaymentTerm</p></td><td colspan="1" rowspan="1"><p data-id="087085a5-66d6-4543-ad21-b153cb0049ac" style="text-align: left;">Payment term applied to the sales order.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="2d889afa-afc7-4487-99eb-6589e95abb7d" style="text-align: left;">PostalCode</p></td><td colspan="1" rowspan="1"><p data-id="5effc5ef-8ad7-4ce8-9f91-137668f0f3a0" style="text-align: left;">Postal code of the order address.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="e9ca8bd6-7213-48d8-a4e2-20c15cfd7476" style="text-align: left;">PostalDistrict</p></td><td colspan="1" rowspan="1"><p data-id="705ce1b3-0aab-489d-8a85-2efdf5cad05f" style="text-align: left;">Postal district or city of the order address.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="5977f104-00e3-4f82-8c67-35fe72d40d14" style="text-align: left;">PromisedCompletionDate</p></td><td colspan="1" rowspan="1"><p data-id="5ba3dbdd-3065-4966-9f87-3c7a0646354b" style="text-align: left;">Promised completion or delivery date of the order.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="598e7903-9cb2-4477-a37e-985144dce120" style="text-align: left;">PublicNote</p></td><td colspan="1" rowspan="1"><p data-id="9a0b1275-dba6-4738-8e31-5dafd55b8c49" style="text-align: left;">Public note shown on the sales order.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="4a8f8aed-fdfb-4b71-8409-c483fcba4d94" style="text-align: left;">RelatedProductInstanceIdentifier</p></td><td colspan="1" rowspan="1"><p data-id="9baa9176-ae95-416f-9cc7-eb6aac871eee" style="text-align: left;">Identifier of a related serial-number item linked to the sales order.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="59106971-7cbd-4fbe-9ad7-474df6a09ec3" style="text-align: left;">RequisitionNumber</p></td><td colspan="1" rowspan="1"><p data-id="73bec3f0-03fb-4366-90d7-bcb2d689cc13" style="text-align: left;">Requisition number associated with the sales order.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="a40f35b4-ca78-464b-beee-483f16cfb6d3" style="text-align: left;">SalesOrderType</p></td><td colspan="1" rowspan="1"><p data-id="0fd47f98-4091-49ea-9a81-2fb743c08023" style="text-align: left;">Type of the sales order.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="e8f3334a-e2c2-40b2-976b-ca4848a76060" style="text-align: left;">Subject</p></td><td colspan="1" rowspan="1"><p data-id="32751a6b-25db-47e9-92d3-62ce9c70e13e" style="text-align: left;">Subject or heading of the sales order.</p></td></tr></tbody></table>

### Order lines

<table data-id="6057451f-3dc2-40ba-9e32-6530cc6592fe" style="min-width: 50px;"><colgroup><col style="min-width: 25px;"><col style="min-width: 25px;"></colgroup><tbody><tr><td colspan="1" rowspan="1"><p data-id="0bbd109d-35f5-44f5-8d3e-c5a1b8bc9296" style="text-align: left;"><strong>Field</strong></p></td><td colspan="1" rowspan="1"><p data-id="8f3be2b5-2081-4955-8881-e4cb7a019c7d" style="text-align: left;"><strong>Explanation</strong></p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="0c79b158-4178-4bcc-850d-f6bebb563065" style="text-align: left;">AwaitsDeliveryQuantity</p></td><td colspan="1" rowspan="1"><p data-id="c66a9fe7-5f4b-4869-bc29-584106d555e7" style="text-align: left;">Quantity on the line still awaiting delivery.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="694d553c-fa7c-464c-b880-c47c49edc486" style="text-align: left;">ContraAccountAccountNumber</p></td><td colspan="1" rowspan="1"><p data-id="c0e33049-239c-4007-a06c-27b39f7bd996" style="text-align: left;">Contra account number used when posting the line.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="94240c86-7570-4d51-9ca4-02d13b3ee028" style="text-align: left;">CostPrice</p></td><td colspan="1" rowspan="1"><p data-id="f32ad6e4-707a-4d3d-aa47-1e8106ba2f76" style="text-align: left;">Unit cost price of the line.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="58d354cf-f7c7-48e2-98b4-97b0394ec191" style="text-align: left;">DiscountAccountNumber</p></td><td colspan="1" rowspan="1"><p data-id="df7b4194-3bf0-4fac-9af2-139cdef38041" style="text-align: left;">Financial account number used for the line discount.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="fd04cf7a-c23a-46a9-95e9-66a124a2780e" style="text-align: left;">DisplayName</p></td><td colspan="1" rowspan="1"><p data-id="3e55f312-9476-4544-bd9d-3a8e5267f369" style="text-align: left;">Text shown for the line on the sales order.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="41f2c162-2092-4392-be1c-fc59db0ef8b5" style="text-align: left;">InstanceIdentifier</p></td><td colspan="1" rowspan="1"><p data-id="f741040f-5454-4c19-ab5a-a40c77bbf02d" style="text-align: left;">Identifier of the specific serial-number item on the line.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="82d739c4-b31f-4332-9a54-ed2fc9c25456" style="text-align: left;">IsExemptVat</p></td><td colspan="1" rowspan="1"><p data-id="53472bc2-1e6c-4177-81d7-f702f51dd510" style="text-align: left;">Whether the line is exempt from VAT.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="4530a9cc-f917-45ab-a628-2a8ff5d0af4a" style="text-align: left;">ItemOrder</p></td><td colspan="1" rowspan="1"><p data-id="9a9bf71f-f7b6-4b71-9818-2652f29600ff" style="text-align: left;">Sequence number that orders the line within its sales order.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="992b7f78-f3f9-44d8-b5b6-d9653da81a06" style="text-align: left;">LocationDisplayName</p></td><td colspan="1" rowspan="1"><p data-id="a29627e4-c490-44d5-98c7-ba21ee2723d6" style="text-align: left;">Display name of the location associated with the line.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="39019654-1bfb-4dca-acbc-1e5a2efbc969" style="text-align: left;">ManualDiscountAmount</p></td><td colspan="1" rowspan="1"><p data-id="898f9727-52e8-439f-8922-34e7e27625b3" style="text-align: left;">Manual discount amount applied to the line.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="70dc209a-180e-436f-8382-12e4fe69e75e" style="text-align: left;">Price</p></td><td colspan="1" rowspan="1"><p data-id="2d90fbe9-b9cf-43ee-9233-84169f68bb2c" style="text-align: left;">Unit sales price of the line.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="01f126c5-d67a-4223-9899-ad88574e9ded" style="text-align: left;">ProductDisplayName</p></td><td colspan="1" rowspan="1"><p data-id="0b8dde11-937f-43a2-a335-3f3fd23026ae" style="text-align: left;">Display name of the product on the line.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="2867d19d-be6e-4929-ab6f-9fe1d1205cb4" style="text-align: left;">ProductIdentifier</p></td><td colspan="1" rowspan="1"><p data-id="f80001ba-0595-42be-a105-9554c6aac85c" style="text-align: left;">Identifier of the product on the line.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="186689c9-3afc-4b1d-8393-26665fc7e5c1" style="text-align: left;">ProductKind</p></td><td colspan="1" rowspan="1"><p data-id="37e7df93-8d4a-4780-8226-fcf2b22ea2a7" style="text-align: left;">Kind of product on the line.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="e9f9f1f6-cc76-4526-a2ed-a50c22aa3419" style="text-align: left;">Quantity</p></td><td colspan="1" rowspan="1"><p data-id="9a4c3d70-2912-4d18-8598-221e54c5c6ea" style="text-align: left;">Quantity ordered on the line.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="4d4bf49a-1744-47d5-bafe-f7b4f0f26f80" style="text-align: left;">SaleFinancialAccountNumber</p></td><td colspan="1" rowspan="1"><p data-id="42789559-ff8a-4c68-ad33-f3fe0fa6e564" style="text-align: left;">Sales financial account number the line revenue is posted to.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="f468c92f-8ee4-4b81-bd98-3499ba5cb38d" style="text-align: left;">SalesOrderIdentifier</p></td><td colspan="1" rowspan="1"><p data-id="1a665fe4-12c0-42b7-9fc3-6ee34d99f538" style="text-align: left;">Identifier of the sales order this line belongs to.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="d579adda-7aa9-4367-afb5-abc865188f22" style="text-align: left;">UsedVatFinancialAccountNumber</p></td><td colspan="1" rowspan="1"><p data-id="bbbd273e-6e88-4f94-b155-47610fbdcffe" style="text-align: left;">Financial account number actually used for the line VAT when posting.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="29e666df-73dd-4c27-aaec-947eacc03cbc" style="text-align: left;">UsedVatRate</p></td><td colspan="1" rowspan="1"><p data-id="aab7d2da-8e9e-4244-86c0-f07881d7a9e0" style="text-align: left;">Actual VAT rate used when posting the line.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="6ad8c5d3-0fc5-4c20-ba7b-4b1e3cfe350d" style="text-align: left;">VatAccountNumber</p></td><td colspan="1" rowspan="1"><p data-id="abe8d094-b274-412a-bdeb-ea9f5f1ec200" style="text-align: left;">Financial account number used for the line VAT.</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="4f42f23d-5b99-46d3-a061-0a1c2a2183bb" style="text-align: left;">VatRate</p></td><td colspan="1" rowspan="1"><p data-id="deb60bc6-2421-46f0-b5a4-deb29bcce1f1" style="text-align: left;">VAT rate applied to the line.</p></td></tr></tbody></table>

* * *

See also the overview [SyncTool – actions](https://support.sapera.io/en/articles/547-synctool-handlinger.md).

* * *

**Want to know more?**

Read more in these related articles:

[

Standard parameters for all actions

The general parameters available on most SyncTool actions: step control, error handling, timeout, etc.

](https://support.sapera.io/en/articles/648.md)
