1.Introduction

This is the manual for the integration between Prestashop and Twinfield.

This integration ensures that orders from Prestashop webshop are automatically processed to draft entries or invoices in Twinfield. Because the orders go directly into the online retailer's accounting system, this saves time on financial administration. It is also possible to process payments for the Prestashop orders to Twinfield. This can be requested via webcare@webwinkelfacturen.nl.

The option processing of payments is only available if the orders are processed to Twinfield draft entries. This option is not available for Twinfield invoices. Additional costs are charged for this option.

Please pay special attention to the following
  1. This integration is a financial integration. It is not a logistics integration. It is not suitable for updating customers in Twinfield, printing packing slips, or synchronizing products/inventory.
  2. This integration does not replace the work of an accountant. It saves time because you no longer have to retype documents. The accountant is still needed for advice, expertise, and control.
  3. Tip: Other customers using this integration found the tips in the FAQ for Prestashop and in the FAQ for Twinfield.

Read more Introduction .... Read less Introduction ....

Install integration
Installing the integration starts with signing up for a trial period, via our integrations page. After registration, you will receive an email containing an installation URL and login details. With this installation URL, you start the installation of the integration.
The installation is complete when both connection dots are green, and the settings in the Configuration tab have been entered and saved.
There is a trial period of 30 days.
If you want to install another integration, you can do so in the same way. Make sure you are logged out of the integration dashboard and preferably start the new installation in an incognito browser.

Cancel integration
At the end of the trial or subscription period, the integration will not be automatically renewed. You will receive an offer for a one-year subscription or renewal by email at the end of this period. You can confirm the renewal by using the payment link in that email. Do you want to terminate the integration in the meantime? This can be done via the dashboard, tab Profile>>Cancel integration.
Are you switching to another web shop/accounting system and do you want to re-establish a connection? In this faq we explain how to do this.
We advise you to revoke the API key in Prestashop when uninstalling the integration.

2.How the integration works

A order from the Prestashop webshop can be processed to Twinfield as a Twinfield draft entry or invoice. The option draft entry is default and is used most often. The option invoices can be requested from us. For the option invoices you need the paid invoice module, see also the FAQ.

It is also possible to process the payments based on the orders from to Twinfield. This is only available if the orders are processed to Twinfield draft entries. For Twinfield invoices, this option is not available.

New orders from your webshop are retrieved at least once per hour. If they have the correct status, they are processed to Twinfield. You can set the statuses via the dashboard, tab Configuration.
Read more How the integration works .... Read less How the integration works ....

Pre-check orders
At the start of processing an order, we perform a number of checks on the Prestashop order:
  • It is checked whether the total of the Prestashop order is equal to the sum of the amounts in the order lines plus the shipping cost amount.
  • If the order is an ICP order, the VAT number is checked.
  • It is checked whether a corresponding VAT code exists in Twinfield for the VAT in each line.
  • It is checked whether the order has not already been processed.

Pre-check payments
A payment is processed for every order that has been processed to Twinfield and that has been paid in Prestashop. It is possible to always process the payment, regardless of the status in Prestashop. This can be requested via webcare@webwinkelfacturen.nl.

Processing order
Processing a Prestashop order to Twinfield takes place in two steps:
  1. It is checked if the customer already exists in Twinfield. If not, the customer is created. Matching is based on the email address.
  2. The Twinfield transaction (draft entry, invoice) is created and processed.

Process payments
When processing a payment, the integration first looks up the draft entry in Twinfield that belongs to the payment. The integration uses the following criteria to search for the draft entry:
  • A match is performed on the amount
  • If a customer email address is available, a match is performed on this email address
  • A match is performed on the order number and the description in the payment
If the draft entry in Twinfield is found, the memo entry is created. If the draft entry is not found, the integration will attempt to find the entry for another three days. Should the draft entry arrive later, it can be processed via the blue Process button on the dashboard.
After processing the payment, the integration will reconcile the payment and the draft entry against each other.

Post-check
After the order has been forwarded and a success message from Twinfield has been received, the order is marked as handled. The Prestashop order appears at the Reporting tab on the dashboard.

If Twinfield returns an error while processing the order, the order appears in the Errors tab on the dashboard. Via the yellow button More info more information about the problem can be found. Via the red button Report problem can the order with all necessary information easily be submitted to us after you have tried to resolve the problem yourself. If the problem is solved, in some cases the orders can be processed again with the blue Process button.

When forwarding the payment, the payment is also registered so that it cannot be processed again. Payments can also be reviewed via the dashboard.
Data
Information about the data that is processed can be found in the section Day-to-day: To Twinfield later in the manual.

3.Required: Prestashop API key

To create the API key in your PrestaShop webshop, go to Advanced parameters - Web services via the menu.

Read more Required Prestashop ....
Read less Required Prestashop ....

 

PrestaShop API sleutel menu webservices

 

Click on Add New to create a new API key.

 

PrestaShop API sleutel aanmaken

 

If you click Generate on the next screen, an API key will be automatically generated. You can also create an API key yourself, but it is safer to let the system do it. Also provide a description so that you know later what you are using the API key for.

 

PrestaShop API sleutel naam en omschrijving

Finally, you need to set the permissions for the API key. The integration only wants to read from the PrestaShop webshop. So, only select View permissions for the following items:
addresses
categories
countries
customers
order details
orders
order state
producten
statussen
taxes

 

PrestaShop API sleutel instellen rechten

 

 

 

4.Preparation Twinfield

To connect with Twinfield, your own username/password is required to log in. The connection must be established using this username/password.

Read more Preparation Twinfield....
Read less Preparation Twinfield....

When using an accountancy username/password, the integration gains access to all records under the accountant's responsibility. This is highly undesirable. The consequence may be that the integration posts to the wrong record. Additionally, the integration has access to all records covered by the accountancy license. This is undesirable from a security perspective and is contrary to GDPR regulations.

For more information, see: FAQ.

5.Installation

After the installation, check using this FAQ, whether the integration works.

Installing the integration starts with signing up for a trial period, via our integrations page. After registering, you'll receive an email with an installation URL and login details. Use this installation URL to start the integration installation.

Activating the integration consists of three steps:
1. Establishing the connection with the Prestashop webshop. Through this step, you authorize the integration to read the data from your webshop.
2. Establishing the connection with Twinfield. This authorizes the integration to write transactions to your Twinfield administration and read information.
3. Configuring additional data, such as the VAT settings.


Read more Installation ....Read less Installation ....

Before the integration can be used, the terms and conditions must first be accepted. The terms and conditions are based on the general ICT Terms and Conditions (industry organization) and the general GDPR guidelines. We also need a name, email address, and the country of the webshop.

Authentication PrestaShop webshop:
Authentication with your PrestaShop webshop is done via the API key you created in a previous section. Click the red Connect button next to PrestaShop and enter the API key in the popup window. If the connection is correctly established, the indicator will turn green. If the connection is not established, check that the web service is enabled in the PrestaShop webshop.

Twinfield connection
The connection with Twinfield is handled via OAuth. Ensure you are logged out of Twinfield before starting the connection. Now click the red Connect button. A login screen for your Twinfield account will automatically appear. Once you log in, you will see a screen asking if you allow the connection. If you confirm this, the connection with Twinfield will be established.

If you want to re-establish the connection at a later time - for example because you want to use a different one - you can do so by clicking the Connect button.

Administration and debtors account
It is important that after establishing the connection with Twinfield, you first set the administration code of your Twinfield administration. You can also change the debtors dimension. The default in Twinfield is a debtors dimension 1300.

Configure VAT rates and general ledger accounts
When configuring the VAT rates and general ledger accounts, a link is created between the VAT rates in webshop and the VAT codes and revenue accounts in Twinfield. You can always make changes by clicking the blue 'Edit' button and selecting an option from the drop-down menus.

By default, all EU countries are shown in the list. You only need to configure the countries you sell to, and - if applicable - ICP and International.
The integration shows the standard VAT rates for Europe. You can adjust the VAT percentage with which you sell - left column. For example: By default, sales to Germany are set to 21%, but if you sell in the webshop with 19%, you can adjust that in the left column. Intra-Community (ICP) and international deliveries
The Intra-Community supplies / ICP option is intended for business-to-business deliveries within the EU. These sales are invoiced with 0% VAT. A VAT number from the customer is required. The International option applies to deliveries outside the EU. For these sales, the integration expects 0% VAT; otherwise, the sales cannot be processed. Separate VAT codes and general ledger accounts can be configured for both ICP and international deliveries.

Once the VAT settings have been configured and saved, you will always see the selected VAT rates. If you want to start over, you can use the grey 'Remove VAT settings' button. Your current settings will then be deleted and you can begin again.

Configure payment methods
When processing orders without processing payments, a link can be established for each payment method in with a fixed debtor. The list of debtors contains the Twinfield debtors with the specific substring WWF_. See this faq for more information, if the list is empty.

If the payments are processed, a link is established between payment methods in webshop and clearing accounts from Twinfield. The possibility to assign payment methods to fixed debtors will then lapse. Processing payments is only possible if the orders are processed to Twinfield draft entries. It is not possible if the orders are processed to Twinfield invoices.

6.Day-to-day: From PrestaShop

In this section, we show how we retrieve the orders from the webshop.

Processing schedule: New orders from your webshop are retrieved and processed to Twinfield at least once per hour. In addition, every night the orders that were previously retrieved and not yet forwarded to your accounting system are reviewed. The order status of these orders is checked to determine if they should now be processed.

Once an order has been processed, it cannot be processed again. Any order changed in the webshop after it has been processed will not be updated in Twinfield.

Please note: Due to the load on our systems, we go back a maximum of 3 months in time to check the status of orders and process them anyway. In addition, the number of orders that can be checked is limited to 300. Therefore, ensure that orders are completed in a timely manner so that the integration can process them and you do not have to manually re-enter them.
Order and invoice numbers: It is possible to provide the Prestashop order or invoice number to the Twinfield draft entries or invoices. When processing the invoice number, we only process the number and not the fixed prefix that is sometimes set in Prestashop. Sometimes it is desirable for reconciliation to process the checkout ID or cart ID of the Prestashop, but unfortunately, we cannot read those via the PrestaShop API. Here is an explanation of how other Prestashop webshop owners have solved this: Cart ID Prestashop.

Payments (if activated)
When processing payments, the integration checks every day the Prestashop orders that have been successfully processed to Twinfield. If the order has been processed, a payment will be created in Twinfield for this order.

VAT numbers For business orders within the EU, outside the Netherlands, a VAT number is mandatory. The integration checks for this and also verifies the validity of the VAT number.

VAT calculation: Prestashop webshops sometimes have VAT rates for all countries with characters from the respective country in the name. For example for Cyprus or Greece. In that case, the integration cannot store the VAT rates. We advise adjusting the names of the VAT rates in the webshop. An explanation can be found here: VAT rates Prestashop.


Field-level specification orders
Specification Prestashop order. +-
Below is an elaboration at field level when retrieving orders. The general values in the order, the order lines, discounts, surcharges are addressed, the shipping costs and the debtor details.
Name field Values from Prestashop order
Order-identifier [id]
Order number [reference]
Invoice number [invoice_number]
Date [date]
Order date [date_add]
Status order [current_state]
Payment method [payment_details][method_title]
Total VAT order [price][tax][amount] or - if [price][tax] consists of multiple lines, the sum of the [amount] fields of the [price][tax] lines
Order total incl VAT [total_products_wt + total_shipping_tax_incl + total_wrapping_tax_incl - total_discounts_tax_incl]
Order total excl VAT [total_products + total_shipping_tax_excl + total_wrapping_tax_excl - total_discounts_tax_excl]
Total VAT order Order total incl - Order total excl
Delivery country [], please note that the country of delivery is NOT used here.
ICP indication The integration determines as follows whether it concerns an ICP order:
  • If [total_paid_tax_incl] is unequal to 0
  • And the fields [total_paid_tax_incl] and [total_paid_tax_excl] are equal to eachother
  • And the delivery country is not the same as the country of the Prestashop webshop
  • And the delivery country is an EU country
  • Then it is an ICP delivery, otherwise it is not an ICP delivery
International indication The integration determines as follows whether it concerns an international order:
  • If [total_paid_tax_incl] is unequal to 0
  • And the fields [total_paid_tax_incl] and [total_paid_tax_excl] are equal to eachother
  • And the delivery country is not the same as the country of the Prestashop webshop
  • And the delivery country is not an EU country
  • Then it is an international delivery outside the EU, otherwise it is not an international delivery outside the EU
Specification Prestashop order lines. +-
To read the order lines, the integration takes the field [orderlines]. In Prestashop, order lines have different types. These are indicated by the field [type]. For the order lines, this concerns type article or type [custom].
Name field Values from Prestashop order line
Productid [articles][0][id]
Amount [quantity]. Please note, if the quantity is 0, the line is skipped.
SKU [articles][0][sku] if it is filled. If not, the product is retrieved from Prestashop and the SKU is determined based on that.
Description [description]
VAT percentage [price][rate], if smaller than 1, the VAT percentage is multiplied by 100.
Line amount excl VAT Amount in the field [price][amount]
Line amount incl VAT Amount in the field [price][amount_including_tax]
Unit amounts Divide the line item amounts by the amount
VAT code and accounts Twinfield These are determined based on the settings, the VAT percentage and the delivery country. It also takes into account whether it is an ICP or international order.
Specification Prestashop payment costs - lines. +-
Only the payment method and possibly the set debtor are retrieved here. Payment costs are not in the Prestashop order, so they cannot be processed either.
Specification Prestashop discount rules. +-
To read the order lines, the integration takes the fields total_discounts_tax_excl] and total_discounts_tax_incl]. This concerns a discount on the entire order. The integration calculates the discount proportionally back to the VAT percentages in the shopping cart.
Name field Values from Prestashop discountline
Amount 1
Description Discount <>
Line amount incl VAT Relative with value [total_products_wt]
Line amount excl VAT Relative with value [total_products_wt] and the VAT percentage
VAT code and accounts Twinfield These are determined based on the settings, the VAT percentage and the delivery country. It also takes into account whether it is an ICP or international order.
Specification Prestashop surcharges +-
Name field Values from Prestashop surcharge-fields
Amount 1
Description Surcharge
Amount excl VAT [total_wrapping_tax_excl]
Amount incl VAT [total_wrapping_tax_incl]
VAT amount [total_wrapping_tax_incl] - [total_wrapping_tax_excl]
VAT percentage Amount incl - Amount excl A percentage greater than 0.204 and smaller than 0.21 is rounded to 21%.
VAT code and accounts Twinfield These are determined based on the settings, the VAT percentage and the delivery country. It also takes into account whether it is an ICP or international order.
Specification Prestashop customer details +-
Name field Values from Prestashop customer
A customer's addresses must be retrieved separately in the webshop. This works as follows:
  • The integration retrieves the addresses via field [id] of the customer.
  • Subsequently, the integration first searches for the address that matches the address ID in the Prestashop order.
  • If this address is not present, the integration searches for the address with the same first and last name.
  • If this address is also not present, the integration takes the first address.
A similar method is used to determine the delivery address.
Customer Customer fields
  • Email - [email]
Address Address-fields
  • First name - [firstname]
  • Last name - [lastname], part of the first space
  • Company name - [company]
  • Addressline1 - [address1]
  • Addressline1 - [address1]
  • Zipcode - [zipcode]
  • City - [city]
  • Iso country code - [iso_code], the iso code is retrieved from the Prestashop webshop with a separate request based on field [id_country]
  • Country - Based on the iso country code and our own reference table between ISO code and country name
  • Phone nr - [phone]
  • VAT number - [vat_number]
Specification Prestashop payments +-
Name field Values from Prestashop order line
Payment-identifier [order_payment][id]
Paymentmethod-id [order_payment][payment_method]
Payment method [order_payment][module] - [order_payment][payment_method]
Order-id and transaction-id [id] from the order
Transaction-id [order_payment][transaction_id] from the order
Amount [order_payment][amount]
Date [order_payment][date_add]

7.Day-to-day: To Twinfield

Create draft entries
For orders in Prestashop, draft entries or invoices can be created in Twinfield. The option draft entry is default and is used most often. The option invoices can be requested from us. For the invoices option, you need the paid invoice module, see also the FAQ. If you are in doubt between draft entries (financial transactions) or invoices, we recommend draft entries / transactions.


Create debtors
When processing customer information, it is first checked whether the customer has been processed before. If so, this Twinfield debtor is used as the debtor for the Twinfield transaction. If the customer is not yet known, they are added to Twinfield. Matching is based on email address.
Please note: The integration only creates debtors. The integration does not modify debtors.

Create payments
Payments from Prestashop are imported into as memo entries. A memo entry consists of two lines, one line for the payment and one for the associated sales entry. If the sales entry for the payment cannot be found, the memo entry cannot be created.
Please note: we can only process payments if they are processed to draft sales entries, not with invoices. Additionally, the invoice number that is in the outstanding sales entry in Twinfield must be present in the payment transaction of the sale.

Reconcile
After processing the payment, the integration will perform an additional action to reconcile the payment and sale.

Automatically sending invoices
The integration cannot automatically have Twinfield invoices or draft entries sent from Twinfield.


Field-level specification Twinfield

Field-level specification of the Twinfield draft entry. +-
Twinfield concept boeking
Name Example Note
@attributes
destiny temporary
raisewarning true
header
code VRK
office 300333
invoicenumber 5869 order number / invoice number on request
date 20230203 order date
Currency EUR Default, variable on request.
Totalline
type total
id 4 debtor id
dim1 1600 Debtor dimension
dim2 4539 Debtor dimension
debitcredit debit
value 82.20 Total price Incl. VAT
basevalue 82.20 Total price Incl. VAT
description 4121 Description: order number, or invoice number - this cannot be adjusted.
Detaillines
@attributes
type detail
id 5
dim1 2000 Debtor dimension
debitcredit credit
basevalue 33.47 Line price Excl. VAT
value 33.47 Line price Excl. VAT
description 24 pcs Prof. drawing paper. Product description, max length 35.
vatvalue 7.03 VAT amount
vatcode VH VAT code
Cost center 1 default cost center per integration.
ICP If it is an ICP entry:
Performancetype goods
Performancecountry [isocountry] Country of delivery
Performancevatnumber [vatnr] VAT number
In the VAT amounts, any rounding difference is processed if the rounding difference is at most 5 cents.
Field-level specification of the Twinfield invoice. +-
Twinfield factuur
Name Example Note
header
office KJ903932
invoicetype INVOICE This cannot be adjusted.
invoicedate 20230308 order date
headertext Order 3234002342 If the invoice number is equal to the order number: Order order number
Otherwise Invoice invoice number.
customer 9023 Customer code
currency EUR Default, variable on request.
status draft
Payment method Bank
Detailline
@attributes
id 4
article 0
description 70 x 70 painter's canvas Description
quantity 9 quantity
units 1
unitspriceexcl 21.50 unit price excl. VAT
dim1 3456 Ledger account
vatcode VH VAT code
Field-level specification of the Twinfield customer. +-
Name Example Note
name [name]
website
Cocnumber [coc]
VATnumber [VATnr]
Address
contact [firstname][lastname]
Country [isocountry]
City [city]
Postal code [zipcode]
Phone number [telnr]
Email [email] not longer than 200 characters.
Detailed specification at field level Twinfield payment. +-
Name Example Note
Payment line The information of the payment.
Suspense account As set in the configuration tab of the dashboard. This is the field dim1 in Twinfield
Type debit This is the field debitcredit in Twinfield
Description [transaction_id] payment
Invoicenumber [ordernumber] If the length > 40, the last 40 characters are shown. This is to keep the invoice numbers unique.
Amount Amount from the payment
Sales line The information from the sales entry.
Debtors-account 1300 This is the field dim1 in Twinfield. This is usually 1300 but can be adjusted in the configuration tab of the dashboard.
Customer code [Debtor code] This is the field dim2 in Twinfield
Type credit This is the field debitcredit in Twinfield
Description [ordernumber] If the length > 40, the first 40 characters are shown.
Invoicenumber [ordernumber] If the length > 40, the last 40 characters are shown. This is to keep the invoice numbers unique.
Amount Amount from the sale

8.Support

We believe it is important that you as online retailer have direct access to information about the integration whenever you want. That is why every customer has a personal dashboard.
Read more Support .... Read less Support ....

Persoonlijk

Explanation tabs dashboard

On the Dashboard >> Report you can see which orders from your Prestashop webshop, and when, have been transferred to Twinfield.

At Dashboard >> Errors you can see which orders have not been processed. Via the blue Process button you can (re)submit the order. Via the red Report problem button you can create a ticket with us.

At Dashboard >> Open the orders are listed that have not yet been processed because they do not yet have the correct status in the webshop. Every night jobs run to review the status again and still process the order.

At Dashboard >> Configuration the settings of your integration are listed. You can adjust the settings there.

At Dashboard >> Profile invoices are available for download. You can also specify an additional email address here for sending emails and stop the integration.

What if orders are missing in Twinfield

If orders are missing in Twinfield we recommend following the steps below:
  1. Log in to the dashboard: https://uwkoppeling.webwinkelfacturen.nl. The username and password are included in the registration email.
  2. Go to the Errors tab and check if order is there. You may need to adjust the search period if the order is from a previous month. If you find order in this overview:
    1. Check the error code and verify whether you can resolve it yourself.
    2. If yes resolve the issue and click the blue Process button to resubmit the order.
    3. If not use the red Report problem button to create a ticket with us.
    4. Note if there are multiple errors, please create only 1 or 2 tickets. We will automatically see the other issues.
  3. Go to the Report tab and see if order is listed there. If so, you'll often see an identifier for Twinfield (in the purple section of the overview) that you can use to search for order.
  4. Go to the Open tab and check if order is there.
  5. If you cannot resolve the issue, you can always create a ticket via the green Ask us button.

You can send any other questions or comments to webcare@webwinkelfacturen.nl. For a quick response, please always include the license key and as much information as possible. If you encounter any problems during installation, please let us know where you're experiencing the issue. And if there's an error message, please include that as well. If you think orders is missing, please provide the number and date. This way, we can perform a more targeted search and tell you what's wrong.

We have an extensive FAQ-section on the website. Pay particular attention to these sections: https://faq.webwinkelfacturen.nl/category/27/prestashop.html and https://faq.webwinkelfacturen.nl/category/41/twinfield.html.

Would you rather have us do the installation of the integration for you? That is possible. Send an email to webcare@webwinkelfacturen.nl with the request. For an installation, we charge € 39.50 excl. VAT. For installations, we need access to the webshop and the accounting system.

We can perform migrations for orders that took place in the past. The request procedure and method are described in this faq. For migrations we charge €67.50 excl. VAT per 1000 orders.