For the complete documentation index, see llms.txt. This page is also available as Markdown.

Introduction

Introduces the three ways to integrate with Recart programmatically and which problem each one solves.

Recart is an SMS and email marketing platform for ecommerce stores. This section is for developers who need to integrate with it: to send messages from your own systems, to react to what shoppers do on your storefront, or to install Recart on a store that is not standard Shopify.

There are three ways to work with Recart programmatically, and they solve different problems.

Surface
Use it to
Runs

REST API

Create subscribers, trigger flows, send messages, sync carts and orders, receive webhooks

Server side

Client-side SDK

React to opt-in tool events and control popups in the browser

In the storefront

MCP server

Let an AI assistant read your Recart data

Anywhere an MCP client runs

Before you start

Install Recart on your store. Everything else assumes the Recart script is running and sending events. How you install depends on your stack:

  • Standard Shopify with a Liquid theme, which needs no code

  • Headless Shopify, which needs the script plus server-side cart syncing

  • Any non-Shopify store, which needs the script plus cart and order syncing

Get an API key. REST API keys are issued by Recart support, not self-serve: "It can be obtained in Recart account after contacting Support." The MCP server is different and self-serve, under Settings, then API & MCP, then Create new key.

The REST API

One production server:

https://api.recart.com/app-integrations/2023-12

Authenticate every request with the X-Recart-API-Key header. A quick check that your key works:

curl https://api.recart.com/app-integrations/2023-12/accounts \
  -H "X-Recart-API-Key: YOUR_KEY"

An API key belongs to one account, so that call returns a single entry with its id, name, domain, currency and time zone. Use that id wherever an integration needs to identify the account.

What you can do

Thirty-eight operations, grouped by what you are trying to achieve rather than alphabetically.

Trigger and send. Event creates event sources and submits events, which is how external systems start a Recart flow. Flow reads automated and campaign flows and their statistics. Message sends a message directly.

Shopper state. Cart and Order keep Recart's view of a shopper in step with your store, which is what makes abandonment flows fire correctly. Abandonment triggers a cart or browse abandonment explicitly. Subscriber and Subscription manage who is reachable and on which channel.

Capture and audiences. OptinTool reads popups and their experiments, including A/B test results. List reads subscriber lists.

Account and integration. Account identifies the account behind a key. Webhook registers endpoints so Recart can notify you, rather than you polling.

Webhook payloads are signed. Verify the X-Recart-Signature header as an HMAC-SHA256 before trusting a request. There is a worked Express handler in the code examples.

Two things worth reading before you build

Setting up a subscription flow walks through collecting SMS subscribers from your own form or checkout: create an event source with type optin, create and activate an integration flow in the dashboard, then submit subscriptions against that source.

Triggering a flow with custom events covers the other case, where you want your own business events to start a flow. One constraint matters and is easy to miss: custom events do not collect consent. They only trigger flows for people who are already SMS subscribers.

The client-side SDK

The storefront script exposes two things.

Events on window, for reacting to what a shopper does with a popup:

  • recart:optin-tool:interaction

  • recart:optin-tool:email-captured

  • recart:optin-tool:phone-number-captured

Listen with window.addEventListener. The interaction event covers impressions, clicks on either call to action, minimising and closing.

Methods on window._recart, for controlling and inspecting the opt-in tools: isReady(), showOptinTool(), getActiveOptinToolInExperiment(), isSubscriberIdentified() and hasSubscribedToOptinTool().

The MCP server

Point an MCP client at https://mcp.recart.com/mcp and authenticate with the same X-Recart-API-Key header. It covers opt-in tools, their statistics and A/B test results, automated and campaign flows together with their statistics, subscriber statistics, and subscriber sources.

It is read-only by design. The assistant cannot create, edit, send or delete anything.

Versioning

Two surfaces, two rules.

The REST API is versioned by date, pinned in the base path, as in 2023-12. Additive changes ship into the current version, so an integration keeps working. A breaking change gets a new dated version that runs alongside the old one, and you migrate when you choose.

The client-side script is evergreen. There is no version to pin. Every store runs the current build, so changes are live for everyone at once. Anything removed is deprecated first, with at least sixty days' notice.

Staying current

Every notable change is recorded in the changelog, and each entry is mirrored to a GitHub release. Subscribe to the feed rather than checking manually:

Release tags tell you which surface changed. REST API releases are tagged api-2023-12.1, api-2023-12.2 and so on. Client-side releases are tagged by date, as websdk-YYYY-MM-DD.

Where to go next

  • Installing on a store, if Recart is not running yet

  • Setting up a subscription flow, if you are collecting subscribers from your own form

  • Triggering a flow with custom events, if your own systems should start a flow

  • The API reference, for the full endpoint and schema detail

Was this helpful?