![audit logging in claris filemaker.](/img/containers/main/article/2024/07/audit-logging-in-claris-filemaker.png/be35d2adf792f7f4034beba3c562c280.png)
FileMaker provides an excellent suit of features to build invoicing solutions. These solutions can be great when they are used in FileMaker only. But, sometimes it's necessary to expand your applications to take payments and send invoices on the web. Stripe provides a suite of features that allow you to manage payments and invoices online conveniently. Integrating FileMaker with Stripe using REST API allows us to create powerful online invoicing solutions for our applications. Let's dive into the fundamentals of how to set up a FileMaker integration with Stripe for invoicing.
![youtube-preview](/img/http/vi/UsBBQFTQQAE/maxresdefault.jpg/739fee1c02655eadb00b5b139b0dd260.jpg)
Stripe Account Creation & Setup
In order to integrate FileMaker with Stripe, the first thing we'll need to do is to create a free Stripe account by using Stripe's registration page. Once you create your free account, you will automatically be put into "Test mode". However, note that you can continue to activate your account, which will allow you to perform transactions with real money. Just make sure you toggle the "Test mode" switch whenever you want to test.
![filemaker stripe invoices integration test mode toggle.](/img/containers/main/article/filemaker-stripe-invoices-integration-test-mode-toggle.png/306c5ed25332f06fbd65d852dec50605.png)
Before we can continue with the FileMaker and Stripe integration, we'll need to do some setup. Keep in mind that Stripe is very flexible in terms of setup options. This is just one way you can set this up, but we'll briefly touch on other options later.
Products
The first thing we'll set up is our products. We'll want to create the products we're going to be using in our test store. For this particular demonstration, we have set up a test store with colors as placeholders for products. Ideally, the product creation would be handled from FileMaker by integrating the Products API. However, for the sake of brevity, in this case we'll be doing the product creation manually.
![filemaker stripe invoice integration product catalog.](/img/containers/main/article/filemaker-stripe-invoice-integration-product-catalog.png/8d7d3a9b74e73ad1b10ce5f700f41ea1.png)
Customers
The next step in our setup will be to create our customers. In our case, we created just one test customer, "Jason Smith". You can create multiple customers if desired, just be sure to perform the proper setup on FileMaker as well (more details on that later in this article). Once again, this can also be managed from FileMaker if you already have an existing customer base using the Customers API. We'll be doing this manually for this article, but we'll touch on how to do this briefly.
![filemaker stripe invoice integration customers.](/img/containers/main/article/filemaker-stripe-invoice-integration-customers.png/01a140b2573b43a3f5f8d97f99c70bd6.png)
FileMaker Application
For the purpose of this article, we've created an accompanying file that you can download and follow. The file is a simple application that lets us create orders for our products. We'll be able to select a customer for the order and then generate invoices using Stripe's REST API. There is some setup we'll need to do before we can continue with the solution.
Stripe API Key
First, we'll need to obtain the API key. Go to the "Home" page on your Stripe dashboard. You should see a link named "API keys for developers".
![filemaker stripe invoice integration api key for developers.](/img/containers/main/article/filemaker-stripe-invoice-integration-api-key-for-developers.png/717f39666f1922801c6d09db41e044d4.png)
Clicking this will take you to the "Developers" screen. From there simply select the "API keys" option (likely already selected) and you'll want to copy the "Secret key".
Note: If you proceeded to activate your account make sure you are in "Test mode" before you copy the "secret key". Your key will change depending on which mode you are and it will determine whether you create test data or real data.
Once you have the key, paste it into the FileMaker file vy using the layout dropdown and selecting the "PREFERENCES" layout. There you will find a field where you can enter the key.
![filemaker stripe invoice integration enter api key.](/img/containers/main/article/filemaker-stripe-invoice-integration-enter-api-key.png/46cd0d2804d5a88732d4aa254d69d458.png)
Product
Next, we'll need to go to the "PRODUCT" table using the layout dropdown. From here, we can create the products for our store. You'll want the information here to match that of the products you set up in Stripe. It is very important that you copy the "price ID" for each of the products on Stripe to the field "Stripe Price ID" for each product.
To get the price ID of a Stripe product, simply select the product from the product catalog on the Stripe dashboard. Then, scroll down to the "Pricing" section and you will see a column labeled "API ID"
![filemaker stripe invoice integration api id.](/img/containers/main/article/filemaker-stripe-invoice-integration-api-id.png/eb7a6ea4eff126451a4b77ca95f75dd9.png)
Copy this ID and paste it on the appropriate field on the product page in FileMaker.
![filemaker stripe invoice integration paste api id.](/img/containers/main/article/filemaker-stripe-invoice-integration-paste-api-id.png/5f7d422c59cdb84d4dee7b6ff1f7da92.png)
Customers
Next, we'll want to set up our customers in the FileMaker application. Using the layout dropdown again, go to the "CUSTOMER" layout. Create customers matching the information of the customers you created in Stripe. Like with the products, we'll need a specific ID from Stripe as well to link the Stripe customer to our FileMaker customer record.
To find the customer ID, simply go to the "Customers" section from your Stripe dashboard and click on the customer. From there look for the "Details" section on the far right and you will see a column of information including the customer ID.
![filemaker stripe invoice integration customer id.](/img/containers/main/article/filemaker-stripe-invoice-integration-customer-id.png/f25a12f5c507c21cba20d5514eb6ce53.png)
Once you have this key, paste it on the "Stripe ID" field in your FileMaker file. Copy and paste the ID of each of your Stripe customers onto the appropriate FileMaker customer records.
![filemaker stripe invoice integration paste customer id.](/img/containers/main/article/filemaker-stripe-invoice-integration-paste-customer-id.png/d4ad310f033df4efdf831f59f1740d3c.png)
Orders
Now that we are done with the setup, we can use the information to create orders. To create orders, simply use the layout dropdown in FileMaker to select the layout "ORDER". Then use the "+" button to create your new orders.
Once the new order record is created, you can select the customer you want using the dropdown. Then select the products you want on the portal.
Once all of that has been completed, click the "Generate Invoice" button. This will create a new invoice in your Stripe dashboard that will have different behavior depending on which API key you are using. The behavior is as follows:
Test mode - Stripe will generate an invoice entry. You can see the invoice in your Stripe dashboard under Billing -> Invoices. From there you can click on the invoice and click "Send invoice" to email it to the customer.
Live - FileMaker will generate the invoice and email it to the appropriate customer.
![filemaker stripe invoice integration order.](/img/containers/main/article/filemaker-stripe-invoice-integration-order.png/3ad455fb6a4f54d7c115c860e0ea56e8.png)
The email sent will contain the invoice and a link for the client to submit a payment no matter which option you choose.
![filemaker stripe invoices integration invoice email.](/img/containers/main/article/filemaker-stripe-invoices-integration-invoice-email.png/6d40d43a67a783abfc79984da20710de.png)
A PDF of the invoice will also be attached to the email.
![filemaker stripe invoices integration invoice pdf.](/img/containers/main/article/filemaker-stripe-invoices-integration-invoice-pdf.png/a94cf60d11e19c5775ce743a7c4eacaa.png)
FileMaker Technical Details
Now that we have seen what the application does, let's take a look at how it is done.
For the "CUSTOMER" and "PRODUCT" tables, the most important part is to have those IDs that you can obtain from Stripe. Without them, the records in FileMaker won't be connected to the records in Stripe. So make sure that those are set correctly.
The most important part of the application is in the script "Stripe - Create & Send Invoice" Let's review it in parts.
In the top section of the script, we are obtaining the key from the field in the preferences table and obtaining the customer ID from the Order record.
![filemaker stripe invoices integration obtain customer id script.](/img/containers/main/article/filemaker-stripe-invoices-integration-obtain-customer-id-script.png/277ad079d7cb7c17412feab2caded32c.png)
Next, we need to check to make sure that the order does not have an associated Stripe invoice already. If so, we just want to send the invoice rather than create a new one.
If an invoice is not created yet, we want to create a new one using the Stripe API. FileMaker gives us the ability to call REST APIs through the Insert from URL [...]
script step.
![filemaker stripe invoices integration generate invoice.](/img/containers/main/article/filemaker-stripe-invoices-integration-generate-invoice.png/7f28090a58a4e286240ddedc6f199fdf.png)
We can encode information in the URL and pass parameters to the HTTP request through cURL options. Here's a closer look at the cURL options used for this call:
![filemaker stripe invoices integration curl options.](/img/containers/main/article/filemaker-stripe-invoices-integration-curl-options.png/c756dcabd388643e85416eb044264b2d.png)
Next, we can take a look at the second part of this if/else branch. After creating the invoice, we'll create the invoice line items using the information that we have in the current order record.
![filemaker stripe invoices integration invoice line items.](/img/containers/main/article/filemaker-stripe-invoices-integration-invoice-line-items.png/2857b15ca4b0e86e29e04f1ab6a1c10e.png)
In the image above, you can also see the "Else" part of this branching. The "Else" case is really just getting the ID of the invoice if it has already been created.
Here's a closer look at what the cURL options are for this specific request:
![filemaker stripe invoices integration curl options 2.](/img/containers/main/article/filemaker-stripe-invoices-integration-curl-options-2.png/0aa74d403704b5c5ae2f43ff42cfd8fb.png)
Towards the end of the script, you can see the last part where we simply send the invoice via email to the associated email address of the customer.
![filemaker stripe invoices integration send invoice.](/img/containers/main/article/filemaker-stripe-invoices-integration-send-invoice.png/47a9da3aa4618db890b8f9a32c27ef6a.png)
Here's a closer look at the cURL options needed for this part:
![filemaker stripe invoices integration curl options 3.](/img/containers/main/article/filemaker-stripe-invoices-integration-curl-options-3.png/3cfb02cfc87c1094026e805a5930b837.png)
Conclusion
FileMaker provides very robust solutions for developing invoicing solutions. Integrating FileMaker with Stripe enables us to build powerful invoicing solutions for the web with a lot of flexibility in managing our products and customers. If you would like to start a Stripe integration in your FileMaker application, contact us and we'll be happy to help you build powerful invoicing solutions.
Did you know we are an authorized reseller for Claris FileMaker Licensing?
Contact us to discuss upgrading your Claris FileMaker software.
Download the FileMaker Stripe Invoices Integration File
Please complete the form below to download your FREE FileMaker file.