Skip to main content
All CollectionsGetting started with ShopifyShipping
Configure Shopify order generation on payment completion
Configure Shopify order generation on payment completion

Configure your project to only send orders to Shopify when the payment is completed instead of when the payment is triggered.

Denisa Ștefana Judea avatar
Written by Denisa Ștefana Judea
Updated over a month ago

The logic used for managing recurring payments and subscription orders influences your customers' experience with your brand and your own risk tolerance when working with certain payment methods.

Default behaviour

By default, Firmhouse uses the subscription frequency to guide the generation of recurring payments and orders, which are triggered at the same time. This ensures a steady and reliable experience for your customers, who always get their subscription products on a fixed schedule and without delays. From a merchant perspective, this approach can imply a certain level of risk since the products are shipped to the customer before the payment is confirmed.

In some cases, like when selling high-value items, you might want to have a different approach and wait for the payment confirmation before sending an order toward fulfillment. This can be easily set up using Pipedream.

Solution overview

This solution ensures that orders are sent to Shopify once the payment is confirmed instead of being pushed upon creation (while the payment might still be pending).

⚠️ Please note that the order will be generated in Firmhouse at the same time as the payment. The solution described below changes only the moment when the order arrives in Shopify, not when it is created in Firmhouse.

1. Disable the automatic order creation in Shopify

The first step is to disable the automatic order generation in App > Shopify > Configure in the Firmhouse Portal. This will ensure the order is not pushed to Shopify upon its creation in Firmhouse.

2. Configure your Pipedream script

Now let's go over to Pipedream and configure the logic to push the orders to Shopify. For easier integration, you can use this Pipedream project to get started. Once you create your Pipedream account, follow the next steps to configure the Pipedream for your project.

2.1. Create an access token in Firmhouse

Navigate to Integrations in the Firmhouse portal and clicking on Generate new token.

In the configuration popup that opens, select No expiration and Access type Write.

Once the token is created, you can copy the value:

2.2. Add the access token value to Pipedream

In the Code tab in Pipedream, you need to configure the Firmhouse Access token secret before using the workflow. Paste here the value you just copied from Firmhouse.

Save your trigger settings in Pipedream. This will show you the unique URL to your Pipedream. Copy this value.

3. Create a new outgoing webhook in Firmhouse

We will now create a webhook in Firmhouse that will send a signal to Pipedream when the invoice is paid. Navigate to App > Webhooks and click on New outgoing webhook.

You need to configure an Invoice paid webhook with the following settings:

For easier setup, you can copy-paste the payload from the following block:

{   
"event": "invoice_paid",
"invoice": {
"id": "{{invoice.id}}",
"status": "{{invoice.status}}",
"orderId": "{{invoice.order_id}}"
}
}

For the endpoint URL value, make sure to add the URL we just copied from Pipedream:

4. Test your configuration

The best way to test your configuration is to create a recurring order for an existing test customer. You can do this by accessing the customer page in Firmhouse and clicking the Ship now button for one of their active products.


When the payment is confirmed in Firmhouse, you should see the test results in Pipedream, on both the Trigger and Code tabs:

Trigger tab

Code tab

The last step is to verify if the order was generated successfully in Shopify. If so, you can deploy your Pipedream script using the Deploy button on the Code tab.

Did this answer your question?