In this Article
đź“‹ Important Note: Only registered users with a Marketing Cloud account can access the API URL and get the Auth Keys to use it with their store. Users can generate and use different Auth Keys for their multiple stores.
Authentication Process
Marketing Cloud users need to register their stores with us and integrate it with their Marketing Cloud account via a series of REST API method calls. The Base URL for these REST methods is https://api.maropost.com/v2/:account_id.
Â
You can initiate the connection by this API method call:
POST /register_shop.json
Â
To access information about this method call from your Marketing Cloud account, visit the Navigation panel >> Integrations >> Abandoned Cart REST API.

This POST method requires the following JSON payload:
{
"shop": {
"shop_name": "My Testing Shop",
"shop_type": "amazon",
"shop_url": "test.amazon.com.au"
},
"create_journey": true
}
“shop_name” is the name of your web store that will appear in Marketing Cloud.
Â
“shop_type” will appear in the Segment Builder when creating segment rules based on Purchase Activity. The value that you provide here in “shop_type” will be used to determine what product Brand and/or product Category you wish to specify for your segment.
Â
“shop_url” is the base domain of your web store. You do not need to provide the protocol (e.g. omit “https://”) from your shop_url. This web store URL will appear in the abandoned cart trigger in the Journey Builder and is used to specify which web store’s abandoned cart event will trigger a particular Journey.
📋 Note: Once you provide the “shop_url”, you cannot change its value.
You will have a choice to create a journey for your store. By default, “create_journey” is set to “false” in the payload. In this case, only the store details get registered and you’ll have to create a new journey from scratch.
Â
If you set “create_journey” to “true,” the abandoned cart Journey gets automatically created. The method response payload will include the Journey ID and auto-generated Journey name. To learn more about creating such journeys, read our Abandoned Cart Journey Template article.
Â
A successful POST action will return the HTTP Status Code 201.
Â
Upon a successful POST action, Marketing Cloud registers the store with your account and creates a unique shop ID and shop name.
Â
Return Response:
{
"data": {
"shop_id": 101,
"shop_name": "My Testing Shop",
"shop_url": "test.amazon.com.au",
"shop_type": "amazon",
"is_active": true,
"created_at": "2024-02-13T08:20:14.000-05:00",
"updated_at": "2024-02-13T08:20:14.000-05:00",
"journey_id": 54,
"journey_name": "Journey created for the shop: My Testing Shop"
},
"message": "Shop registered successfully."
}
The store name and its details get integrated with your Marketing Cloud account.
Update Store Details
Under the Actions tab, you can enable/disable your store depending on the shop’s status, permanently disconnect it, or edit its store details.

Under the edit section, you can modify the store name and set the abandoned cart delay timer between 0 to 6 hours. This delay timer is added to the “Last Activity” time field of the abandoned cart’s POST payload, after which the first abandoned cart email is sent to the contact.
📋 Note: The trigger is initiated based on the timings provided in the "last_activity_at" payload’s field, and not when the POST payload is received.
For example, if the last activity time is 1:00 PM and the abandoned cart delay is set to 30 minutes, Marketing Cloud will send the first abandoned cart email at 1:30 PM. However, due to the execution time required to process the information, this email may take up to 5 to 10 minutes longer to be delivered. So, if you set the abandoned cart delay time to 0, you might have to wait a further 5 to 10 minutes for the first email to be sent after the cart's “Last Activity” time.
Â
By default, the Abandoned Cart Delay is set to 30 minutes.

You can edit such store details via the PATCH /update_shop/:shop_id API method call.
{
"shop": {
"shop_name": "New shop name",
"is_active": false
}
}
đź“‹ Note: You can update only the name of your web store and the status of its abandoned cart listener. The web store URL cannot be changed once you set it.
A successful update will return an HTTP Status Code 200.
Sending Abandoned Cart Data to Marketing Cloud
Once the store is integrated with your Marketing Cloud account, you’ll need to build a journey template for customers who have abandoned their carts. By default, a journey draft is not created during the store authentication process. Only when you provide "create_journey": true in the POST /register_shop.json method call will one be automatically created.
Â
- To access the journey draft, go to the Navigation panel, select Automation, and click on Journeys. Choose a draft that you need to edit.

- You’ll be redirected to the builder’s page wherein you can modify the journey layout and the trigger settings. Click on the Abandoned Cart Trigger box.

- From the drop-down list, choose a store for which the abandoned cart trigger has to be set up. Click on Save. However, if you’ve already registered your store with its journey status set to “true”, the drop-down gets auto-populated with the URL of the registered store.

- Similarly, create email templates for the abandoned cart journey. To learn more about such email templates, read our Content Builders: Overview article.

- While creating email templates, you’ll need to include the products that were abandoned by the user. To help with this, Marketing Cloud automatically inserts abandoned cart tags in such emails. To learn more about the email structure and the contents within it, read our Sending Abandoned Cart Emails article.

- Once your Journey workflow is prepared, you can now send an abandoned cart’s data to Maropost. Use the method call POST /abandoned_carts/:shop_id to trigger an abandoned cart event in a Journey.
A successful triggering of an abandoned cart event will return an HTTP Status Code 200.
API Payload:
{
"cart_data": {
"contact": "testing@maropost.com",
"original_cart_id": 104,
"status": "abandoned",
"last_activity_at": "2024-03-21T07:46:48",
"restore_url": "url_to_the_abandoned_cart_page",
"order_items": [
{
"name": "Samsung tab",
"sku": "Tab12",
"quantity": "1",
"unit_price": 150,
"image_url": "actual_image_url_will_be_here",
"store_url": "product_landing_page_url_will_be_hhere"
},
{
"name": "Iphone",
"sku": "IPH15",
"quantity": "2",
"unit_price": 200,
"image_url": "actual_image_url_will_be_here",
"store_url": "product_landing_page_url_will_be_there"
}
]
}
}
The default timezone for “last_activity_at” is in Eastern time zone (EST). Append a different timezone code if the timezone of your web store is different. For example, "last_activity_at": "2024-03-21T07:46:48Z” will register the abandoned cart event in GMT timezone format. - Upon a successful POST, the store’s abandoned cart data is sent to Marketing Cloud for processing. Marketing Cloud saves the contact, abandoned cart ID, and abandoned order item information for reference.
Return Response:
{
"abandoned_cart": {
"id": 2200,
"original_cart_id": "10",
"status": "abandoned",
"last_activity_at": "2024-04-05T03:35:08.000-04:00",
"restore_url": null,
"abandoned_items": [
{
"name": "Samsung tab",
"sku": "Tab12",
"quantity": 1,
"unit_price": 150000.0,
"image_url": null,
"store_url": null
},
{
"name": "Iphone tab",
"sku": "IPH12",
"quantity": 2,
"unit_price": 150000.0,
"image_url": null,
"store_url": null
}
]
},
"message": "Abandoned cart created successfully. Email will be delivered soon to testing@maropost.com"
}
Henceforth, whenever a store’s cart has been left unattended by a customer, an abandoned cart trigger gets initiated, which prompts the system to send an email to the contacts requesting them to complete the checkout process.
Suppose a customer has already purchased the abandoned cart items after getting Abandoned Cart email. In that case, such contacts can be reported to us and no further emails will be sent to these contacts.
To do this, you must report that particular cart with "Closed" status in the POST API. Maropost only considers "Closed" as a status for recovered carts. No other keywords/statuses will be accepted.