How to Setup a Subscription Flow with Recart API
Walks through creating an event source and integration flow to initiate SMS subscriptions via the Recart API.
This guide walks you through the process of setting up a subscription flow using the Recart API. The flow involves creating an event source with an "optin" type, setting up an integration flow, and then initiating SMS subscriptions using that event source.
Overview
The subscription flow consists of three main steps:
Create an Event Source - Register a new event source with "optin" type
Create an Integration Flow - Create a new integration flow with the event source in Recart application
Initiate SMS Subscription - Use the registered event source to start SMS subscriptions
Step 1: Create an Event Source with Optin Type
Before you can start collecting SMS subscriptions, you need to create an event source that will track where your subscribers are coming from.
Prerequisites
Valid API credentials for the Recart API
Access to the event source creation endpoint
Process
Prepare Event Source: You'll need to specify the event source type as "optin" and provide any required metadata for your subscription source.
Example payload:
{ "data": { "type": "events", "attributes": { "category": "3rd-party-name", "name": "subscription", "type": "optin" } } }Note the two different
typefields: the outerdata.typeis the JSON:API resource type and must always be the literalevents, even when creating an event source. The innerattributes.typeis the one you set tooptin.Make API Request: Send a request to create the event source through the appropriate endpoint in the Recart API.
Step 2: Create an Integration Flow
An active welcome flow must be created to trigger legal and welcome messages for your new subscribers.
Prerequisites
Successfully created event source from Step 1
Access to Recart dashboard
Process
Navigate to SMS Integrations: Open the Recart dashboard and navigate to Automated flows > SMS Integrations.
Create a New Flow: Create a new Integration flow.
Configure the Trigger: Select the trigger and set the integration and event pair to the event source created in Step 1.
Save and Activate the Flow: Click "Activate" in the upper right corner to enable the flow.
Step 3: Initiate SMS Subscription
After your event source is registered and the flow is activated, you can begin collecting SMS subscriptions from users.
Prerequisites
Successfully created event source from Step 1
Active integration flow from Step 2
Customer contact information (phone number)
Process
Collect Customer Information: Gather the necessary customer details, including their phone number for SMS delivery.
Reference Event Source: Use the event source created in Step 1 to link the subscription to the appropriate source.
Submit Subscription Request: Send the subscription request through the SMS subscription endpoint.
Handle Response: Process the API response to confirm successful subscription creation or handle any errors.
Important Considerations
SMS Subscription Requirements
Ensure you have proper consent from customers before subscribing them to SMS
Comply with TCPA regulations and local SMS marketing laws
The integration flow must be active to send welcome messages
Phone numbers should be in E.164 format (e.g., +1234567890)
Last updated
Was this helpful?