
Login to the WooCommerce RESTful API
To be able to read data from a WooCommerce online store, the RESTful API must first be activated in WooCommerce. This setting can be made in the WordPress backend under [WooCommerce > Settings] in the register [API] be made.
Click on the button [Save changes]to confirm the activation of the interface. In the next step, create a new API key. To do this, click on the [Key/Applications] and then click on the button [Add key].
In the field [Description] you can add a description of your choice. Select a user who is to be granted access to the WooCommerce RESTful API. Depending on whether the user should also write data to the store system via the interface, you can assign appropriate permissions. The "Read" permission is sufficient for the FileMaker solution presented here. Then click on the button [Create API key].
Now make a note of the content of the two fields "Key (Consumer Key)" and "Consumer Secret". This step is important because you will no longer be able to view the content of these fields in future as the key data is stored in masked form.
Interface in FileMaker to the WooCommerce REST API
The sample solution presented in this article can be used to transfer store orders and associated customer data such as billing and delivery addresses from a WooCommerce online store to a FileMaker database. The example file (or your own solution) can easily be expanded to include additional functions and tables. WooCommerce provides the following endpoints for accessing the RESTful API:
- Coupons
- Customers
- Orders (used in the example file)
- Order Notes
- Refunds
- Products
- Product attributes
- Product attribute terms
- Product categories
- Product shipping classes
- Product tags
- Reports
- Tax rates
- Tax classes
With the WooCommerce RESTful API, many other data sources can also be read and/or processed with FileMaker, such as vouchers, products, product attributes or even tax classes. In our sample FileMaker solution, we use the "Orders" endpoint to import orders from WooCommerce into FileMaker.
Example solution requires the MBS FileMaker plugin
For the development of the interface, the MBS FileMaker Plugin from Monkeybread Software. The plugin offers all the functions required for an interface with RESTful API. Alternatively, functions of the free Base Elements Plugin if the software is reprogrammed accordingly.
Default settings in the FileMaker solution
You can download the trial version of the FileMaker solution for the interface to a WooCommerce online store at download here. The solution lies in the .fmp12 format for FileMaker 13 to 15 and requires the MBS FileMaker plugin at least in version 4.4. After you have unpacked the zip archive and started the solution with FileMaker, you must first enter the data for the RESTful API of your WooCommerce online store.
Enter all data in the fields highlighted in yellow:
- API URL - URL of your server and the extension /wp-api/v3
- End point - Standard: /orders
- Start object - Standard: orders
- Consumer key - Consumer key that you have created and noted in the WordPress backend
- Consumer Secret - Consumer secret that you have created and noted in the WordPress backend
If all data has been entered correctly, clicking on the [Data import] imports all orders from the specified WooCommerce online store and the associated customer data.
Structure of the FileMaker sample database
The sample database for importing store orders has a simple structure and contains the following data tables:
- Orders - Master data record of an order, contains the following fields:
- __ORDERS (data from the "orders" start object, for illustrative purposes only)
- Order number (order number from WooCommerce)
- _ID_Fremdsystem (Primary key [post_id] from WooCommerce)
- _pk_Order_ID (primary key)
- Remarks (remarks from WooCommerce)
- Order status
- Amount_total_gross
- Amount_total_net
- Amount_VAT
- Amount_VAT_items
- Amount_VAT_shipping_costs
- Amount_discount
- Amount_shipping_costs
- Amount_Subtotal
- Date_Order
- E_Mail
- JSON_Ausgabe (Global field for output of the JSON data, is used in the Script used)
- Customer_No_WC
- LiAdr_Address (delivery address)
- LiAdr_Company
- LiAdr_Country_code
- LiAdr_Name
- LiAdr_City
- LiAdr_PLZ
- LiAdr_first_name
- VAT rate
- ReAdr_Address (billing address)
- ReAdr_Company
- ReAdr_Country_Code
- ReAdr_Name
- ReAdr_City
- ReAdr_PLZ
- ReAdr_first_name
- Status_paid
- Telephone
- Shipping method
- Currency
- Payment method
- Positions - Table of order items, contains the following fields:
- Order number (order number from WooCommerce)
- _pk_Position_ID (primary key)
- Quantity
- Article_No
- Article description
- Amount_VAT
- Amount_net
- id (primary key from WooCommerce)
- product_id (ID of the product in WooCommerce)
- Settings - Settings for the WooCommerce RESTful API
- External system (Global) - Name of the external system (only used if several external systems are used)
- rf_URL (Global) - URL of the server with path to the API
- rf_Benutzer (Global) - User name/consumer key for RESTful API
- rf_Password (Global) - Password/Consumer Secret
- rf_Status_SSL (Global) - Status, whether SSL should be used or not
- rf_Endpoint (Global) - Endpoint of the RESTful API
- rf_Start object (Global) - Start object within the end point
The "Orders" and "Items" tables are linked via the "_Order number" key. The fields in these tables can be renamed as required for integration into your own FileMaker solutions. The "Settings" table does not contain a link because all fields have been defined globally. If several third-party systems are to be connected with RESTful API, it is recommended not to define the fields as global fields and to add a primary key to select the third-party system.
Login to the RESTful API
The FileMaker sample solution contains two partial scripts with which the order data from the online store can be imported into FileMaker. In the "ts.Query_REST_API" script, the login to the Server. For this purpose, the MBS plugin calls the corresponding cURL functions with the following sequence:
- Open new cURL session
- Set URL for REST API
- Set login data
- Set header option
- Set SSL
- Switch on log messages
- Execute query with error message
- Result in the field [Orders::JSON_Output] write
- Close cURL session, Cleanup
Read JSON data from the interface
The second subscript "ts.Parse_JSON_Orders_WC" reads the JSON data supplied by the server and enters it in the individual fields of the "Orders" and "Items" tables. First, all data from the start object "orders" (see field "Start object" in the settings) is transferred to the Variable $ordersJSON is written. This is followed by a main execution loop for reading all orders and a further execution loop for importing all items for an order. The server is no longer accessed in this script.
All fields of the shipping address (shipping_address), billing address (billing_address) and line items (line_items) are located in a tree structure and must be filled with the command:
MBS( "JSON.GetObjectItemTree"; json; names )
can be read from the corresponding tree. All other fields can be read as normal using the functions MBS( "JSON.GetStringValue"; json ) or MBS( "JSON.GetIntegerValue"; json ).
Download FileMaker sample database
You can download the FileMaker sample database download here and test it with any WooCommerce online store. The public version is locked for editing field definitions and scripts. Would you like to start using the sample solution immediately and adapt it to your own requirements? Then you are welcome to Contact us with us.

Markus Schall has been developing individual databases, interfaces and business applications based on Claris FileMaker since 1994. He is a Claris partner, FMM Award winner 2011 and developer of the ERP software gFM-Business. He is also a book author and founder of the M. Schall Publishers.







That sounds like what I'm looking for. Is the reverse also possible? So writing changes back into the mysql-DB?
The plugins used in the sample solution naturally also support the reverse method, which allows data to be written to the WooCommerce database via the RESTful API.
After the released FMP 16 with integrated RESTful API and Json, would it now be possible to connect to WC without the MBC plugin?
Yes, with FileMaker 16 the whole thing should now be possible without using the MBS plugin. However, the solution only runs on FileMaker 16 and not with older versions.
Very interesting, will it be necessary to update your example to take this into account?
Yes, if the functions are to run natively with the new FileMaker 16 functions, the MBS-based functions must be reprogrammed accordingly.
Do you plan to realize a native FMP 16 version without MBS plugin?
if so I am very interested
No, I do not intend to develop a native FileMaker version of this solution, as I generally use the MBS plugin for such functions.
Hello, is there any experience whether the current demo also runs with the current Woocommerce version and fm 19? Thank you
Hello, the software should have no problem with FileMaker 19 - but here you could probably solve the whole thing with on-board tools, then you no longer necessarily need the MBS FileMaker plugin. With regard to the store, the software is no longer up to date and may need to be adapted for newer WooCommerce versions. However, this does not change the basic principle.
The basic principle has not changed since the development until today, except that possibly more fields have been added in the WooCommerce interface.