Blog - Engaging.io

HubSpot-Webflow eCommerce/Order Integration

Written by Ralph Vugts | Sep 4, 2024 3:04:12 AM

Webflow is visual-first platform. Marketers, designers, and developers alike can create, optimise, and scale web experiences that get results! It also has a great eCommerce function so you can get your shop up and running pretty quickly. 

One thing it's missing, however, is CRM and marketing tools, is  and that's where HubSpot really shines.

Integrating HubSpot and Webflow

There is an existing HubSpot-Webflow connector but this only allows for a basic exchange of form submit data. If you want to feed in more data (like orders), this connector will not cater to that requirement. 

Luckily, Webflow has outstanding API and webhook options! This means we can build custom solutions here. We recently scoped out how to best integrate Webflow with HubSpot and came up with the real time solution below.

Webhooks for the Win!

There are several APIs that would allow us to check for new orders to process and pull in, but that would require a lot of extra development time. We then discovered Webflow webhooks which allow us to be notified in real time when an order is placed. 

The webhook payload also contains all the information we need to map back to the relevant records in HubSpot:

  • Create endpoint to receive order data from Webflow when an order is placed (via webhook, triggerType: ecomm_new_order)
  • Create processing script to split out data points from payload and insert into the main syncing table to:
    • Contacts (create/update, email address to be used as primary identifier)
    • Deals (create only - no update, line items - no product sync - line items would be placed directly on the deal)

Webhook payload sample:

Any of the data properties below can be mapped to HubSpot properties:

{
  "triggerType": "ecomm_new_order",
  "payload": {
    "orderId": "1cc-8fa",
    "status": "unfulfilled",
    "comment": "",
    "orderComment": "",
    "acceptedOn": "2024-08-27T00:29:17.117Z",
    "disputedOn": null,
    "disputeUpdatedOn": null,
    "disputeLastStatus": null,
    "fulfilledOn": null,
    "refundedOn": null,
    "customerPaid": {
      "unit": "AUD",
      "value": 100,
      "string": "$ 1 "
    },
    "netAmount": {
      "unit": "AUD",
      "value": 66,
      "string": "$ 0.66 "
    },
    "applicationFee": {
      "value": 2,
      "unit": "AUD"
    },
    "shippingProvider": null,
    "shippingTracking": null,
    "shippingTrackingURL": null,
    "customerInfo": {
      "fullName": "Ralph Vugts",
      "email": "ralph@myemail.com"
    },
    "allAddresses": [
      {
        "type": "billing",
        "addressee": "Ralph",
        "line1": "72 Sydney Way",
        "line2": null,
        "city": "Sydney",
        "state": "NSW",
        "country": "AU",
        "postalCode": "2577"
      },
      {
        "type": "shipping",
        "addressee": "Ralph",
        "line1": "72 Sydney Way",
        "line2": null,
        "city": "Sydney",
        "state": "NSW",
        "country": "AU",
        "postalCode": "2577"
      }
    ],
    "shippingAddress": {
      "type": "shipping",
      "addressee": "Ralph",
      "line1": "72 Sydney Way",
      "line2": null,
      "city": "Sydney",
      "state": "NSW",
      "country": "AU",
      "postalCode": "2577"
    },
    "billingAddress": {
      "type": "billing",
      "addressee": "Ralph",
      "line1": "72 Sydney Way",
      "line2": null,
      "city": "Sydney",
      "state": "NSW",
      "country": "AU",
      "postalCode": "2577"
    },
    "purchasedItems": [
      {
        "count": 1,
        "rowTotal": {
          "unit": "AUD",
          "value": 100,
          "string": "$ 1 "
        },
        "productId": "66cb13a27aa774252e3937e9",
        "productName": "Wine Brand Name",
        "productSlug": "brand-name-chardonnay-2022-13",
        "variantId": "66cb13a32f05870430545d1e",
        "variantName": "Wine Brand Name",
        "variantSlug": "brand-name-chardonnay-2022-13",
        "variantSKU": null,
        "variantImage": {
          "fileId": "66cb0d3b0043eeaf4e4e4132",
          "url": "https://uploads-ssl.webflow.com/66c3dee4270ce96845e30a26/66cb0d3b0043eeaf4e4e4132_wine-placeholder.png",
          "alt": null,
          "file": null
        },
        "variantPrice": {
          "unit": "AUD",
          "value": 100,
          "string": "$ 1 "
        },
        "weight": 0,
        "height": 0,
        "width": 0,
        "length": 0
      }
    ],
    "purchasedItemsCount": 1,
    "totals": {
      "subtotal": {
        "unit": "AUD",
        "value": 100,
        "string": "$ 1 "
      },
      "extras": [
        {
          "type": "tax",
          "name": "Country Taxes",
          "description": "AU Taxes (10.00%)",
          "price": {
            "unit": "AUD",
            "value": 9,
            "string": "$ 0.09 "
          }
        },
        {
          "type": "shipping",
          "name": "Domestic Shipping",
          "description": "",
          "price": {
            "unit": "AUD",
            "value": 0,
            "string": "$ 0 "
          }
        }
      ],
      "total": {
        "unit": "AUD",
        "value": 109,
        "string": "$ 1.09 "
      }
    },
    "customData": [],
    "paypalDetails": null,
    "stripeCard": {
      "last4": "2254",
      "brand": "Visa",
      "ownerName": "Bella",
      "expires": {
        "month": 3,
        "year": 2028
      }
    },
    "stripeDetails": {
      "customerId": "cus_QjgexxjvGYMsCJ",
      "paymentMethod": "pm_1PsDHXLUYnEzCFDonKshI1cp",
      "chargeId": "ch_3PsDHaLUYnEzCFDo1F7wTP1h",
      "disputeId": null,
      "paymentIntentId": "pi_3PsDHaLUYnEzCFDo1kpGwdft",
      "subscriptionId": null,
      "refundId": null,
      "refundReason": null
    },
    "paymentProcessor": "stripe",
    "hasDownloads": false,
    "downloadFiles": [],
    "metadata": {
      "isBuyNow": false
    },
    "isCustomerDeleted": false,
    "isShippingRequired": true
  }
}

This integration has only been scoped so far, but if you would like us to build it out for you please get in touch below.