Skip to content

Importing subscriptions

David de Boer edited this page Mar 22, 2018 · 25 revisions

It's possible to import existing SEPA direct debit (recurring) payments into a WooCommerce shop with WooCommerce Subscriptions and Mollie Payments for WooCommerce if all required information is available. The import can be done if all required data is available in a CSV file in the correct format. Mollie provides a PHP script which can then process the CSV file and import the data into WooCommerce in the correct way.

  • Importing existing credit card (recurring) payments is not possible.

  • Importing with other import plugins or tools for WooCommerce or WooCommerce Subscriptions is not possible, as these do not handle the payments part for Mollie.

  • PHP and WordPress coding experience is required. It is likely that custom modifications have to be made to this PHP script to allow it to better fit your situation and data.

  • The data that is required, is a combination of customer (general, billing, shipping) data for WooCommerce and payment information for Mollie (IBAN, BIC etc).

  • The amount of records that you can put into the CSV depends on the server on which the script is used. If your server is not performant enough, split your CSV file into smaller parts. For example, a CSV file with 10.000 records can be split into two CSV files with 5.000 records each.

  • When orders are imported, WooCommerce wil automatically send an email to the shop-owner and shop-customer. You can disable these e-mails during the import under WooCommerce > Settings > Emails.

  • The CSV file should use quotes like "data" to wrap information in a CSV column.

  • During the import, keep a close eye on the logs as success and failure is communicated there. The logs can be found at WooCommerce > System status > Logs > mollie-payments-for-woocommerce.

  • The script will automatically try to create a mandate for the recurring payment, so subscription renewals payments are processed automatically. You do not have to create the mandates yourself! If this fails for a subscription import, this will be communicated in the logs at WooCommerce > System status > Logs > mollie-payments-for-woocommerce.

  • For subscriptions in WooCommerce, a WordPress user account is required. The script will try to create one for every subscription.

  • All subscription products that you will import will need to be created in WooCommerce before the import. The ID of those products will need to be added to the CSV.

  • WooCommerce, WooCommerce Subscriptions and Mollie Payments for WooCommerce needs to be completely set up before the import. Test imports should be done with Mollie Payments for WooCommerce set to test mode, so "Enable test mode" should be checked and the final production import should be done with "Enable test mode" unchecked (on the correct live API key. You can not change your API key after the subscriptions are imported, as the mandates are connected to that single API key.

Required data

  • customer_iban
  • customer_bic
  • customer_email - required for creating the mandatory WordPress account, if unknown, add fake but unique emails to the CSV.

Optional data

  • order_shipping (integer) - an amount for the shipping costs. Now uses default description "Verzendkosten" on the subscription and default tax "21%". For other descriptions or tax rates, contact [email protected].
  • customer_bank_name - not required, add if the actual name connected to the IBAN account is known. Otherwise we will use shipping first name + shipping last name.

Importing other data

It's possible to also import other customer or subscription data into WordPress. This data will be added to the user or subscription that will be created for the import, as custom user meta or custom post meta (for subscriptions).

Please note that adding other customer data will increase the size of the CSV file and can result in server timeouts on less performant servers. Therefor, only add the customer data that is essential to your website or business.

Adding custom data to the WordPress database on import does not immediately make this data visible in the WordPress UI. To show this custom meta in the user edit view or the subscription edit view, you will need to do additional programming. This page about Custom Fields is a good starting point if you haven't done this before. Showing the data in the WordPress UI can be done at a later moment, after the import the data is already safely stored in the database.

To add other information to the WooCommerce subscription, add that information (string of text) to the CSV row for that subscription with a prefix of custom_post_meta_ and then your preferred post meta key for that information. So a complete column header could be custom_post_meta__my_custom_field.

To add other information to the WooCommerce customer/WordPress user, add that information (string of text) to the CSV row for that subscription with a prefix of custom_user_meta_ and then your preferred user meta key for that information. So a complete column header could be custom_user_meta__my_custom_field.

Clone this wiki locally