E-commerce API
Connect external shops to MailerLite, list connected shops, and inspect each shop's e-commerce sync state.
MailerLite E-commerce API allows to connect an external shop to your MailerLite account. E-commerce API endpoints enable additional MailerLite features such as E-commerce Automation (abandoned cart automations, post-purchase emails, etc.), product import into your newsletters, sales tracking and more.
MailerLite shop
Every account has a MailerLite shop that holds the products sold through MailerLite checkout. It is created automatically the first time you list shops, and is returned with "platform": "mailerlite" and "internal": true.
The MailerLite shop cannot be updated or deleted through the API.
List e-commerce shops
If you want to get a list of all available shops connected to your account, send this GET request
GET https://connect.mailerlite.com/api/ecommerce/shopsRequest parameters
| Parameter | Type | Required | Limitations |
|---|---|---|---|
| limit | integer | no | Defaults to 50 |
| page | integer | no | Defaults to 1 |
Response
{
"data": [
{
"id": "31986843064993537",
"name": "shop name",
"url": "https://shop-url.com",
"currency": "USD",
"enabled": true,
"enable_popups": false,
"group": {
"id": "1",
"name": "dummy group",
"total": 20,
"open_rate": {
"float": 0,
"string": "0%"
},
"click_rate": {
"float": 0,
"string": "0%"
},
"created_at": "2021-08-06 10:17:45"
},
"created_at": "2021-09-01 14:03:50",
"updated_at": "2021-09-01 14:03:50",
"currency_sign": "$"
}
],
"links": {
"first": "https://connect.mailerlite.com/api/ecommerce/shops?page=1",
"last": "https://connect.mailerlite.com/api/ecommerce/shops?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "https://connect.mailerlite.com/api/ecommerce/shops?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "https://connect.mailerlite.com/api/ecommerce/shops",
"per_page": 50,
"to": 1,
"total": 1
}
}Create/update shop
You can create or update a shop.
To create a shop, send this POST request
POST https://connect.mailerlite.com/api/ecommerce/shopsTo update a shop, send this PUT request
PUT https://connect.mailerlite.com/api/ecommerce/shops/(:shop_id)Request body
| Parameter | Type | Required | Limitations |
|---|---|---|---|
| name | string | yes | Shop name |
| url | string | yes | Shop URL address |
| currency | string | yes | ISO 4217 currency code that the shop uses. |
| platform | string | no | The platform of the shop (e.g. shopify) |
| group_id | integer | no | The id of the group that the shop's subscribers are automatically added to. |
| enable_popups | boolean | no | Enables popups to the shop (the shop must have the universal script added to it). Defaults to false. |
| enabled | boolean | no | Enable/disable the ecommerce functionality for the shop. Defaults to false. |
| access_data | string | no | Platform specific information for the platform to access the shop (e.g. shopify access token or woocommerce keys). Shouldn't be needed for third party users. |
{
"name": "shop name",
"url": "https://shop-url.com",
"currency": "EUR",
"group_id": 1234567890,
"enable_popups": false,
"enabled": true
}Response
If the shop was created:
Response Code: 201 Created{
"data": {
"id": "31986843064993537",
"name": "shop name",
"url": "https://shop-url.com",
"currency": "USD",
"enabled": true,
"enable_popups": false,
"group": {
"id": "1",
"name": "dummy group",
"total": 20,
"open_rate": {
"float": 0,
"string": "0%"
},
"click_rate": {
"float": 0,
"string": "0%"
},
"created_at": "2021-08-06 10:17:45"
},
"created_at": "2021-09-01 14:03:50",
"updated_at": "2021-09-01 14:03:50",
"currency_sign": "$"
}
}Error
Response Code: 422 Unprocessable EntityThe error response will contain information about the invalid data.
{
"message": "The given data was invalid.",
"errors": {
"url": ["The shop url must be provided."]
}
}If you try to update the MailerLite shop:
Response Code: 403 ForbiddenFetch a shop
To fetch a shop, send this GET request
GET https://connect.mailerlite.com/api/ecommerce/shops/(:shop_id)Request parameters
| Parameter | Type | Required | Limitations |
|---|---|---|---|
| id | integer | yes | Must provide either valid shop id |
GET https://connect.mailerlite.com/api/ecommerce/shops/31986843064993537Response
If shop exists:
Response Code: 200 OK{
"data": {
"id": "31986843064993537",
"name": "shop name",
"url": "https://shop-url.com",
"currency": "USD",
"enabled": true,
"enable_popups": false,
"group": {
"id": "1",
"name": "dummy group",
"total": 20,
"open_rate": {
"float": 0,
"string": "0%"
},
"click_rate": {
"float": 0,
"string": "0%"
},
"created_at": "2021-08-06 10:17:45"
},
"created_at": "2021-09-01 14:03:50",
"updated_at": "2021-09-01 14:03:50",
"currency_sign": "$"
}
}Error
If the shop cannot be found:
Response Code: 404 Not FoundFetch total shops count
If you want to fetch total shops count, send this GET request
GET https://connect.mailerlite.com/api/ecommerce/shops?limit=0Request parameters
| Parameter | Type | Required | Limitations |
|---|---|---|---|
| limit | integer | yes | Value must be 0 |
Response
Response Code: 200 OK{
"total": 100
}Delete a shop
If you want to delete a shop, send this DELETE request
DELETE https://connect.mailerlite.com/api/ecommerce/shops/:idRequest
| Parameter | Type | Required | Limitations |
|---|---|---|---|
| id | integer | yes | Valid shop id for the account |
Response
Response code: 200 OK{
"data": {
"id": "31986843064993537",
"name": "shop name",
"url": "https://shop-url.com",
"currency": "USD",
"enabled": true,
"enable_popups": false,
"group": {
"id": "1",
"name": "dummy group",
"total": 20,
"open_rate": {
"float": 0,
"string": "0%"
},
"click_rate": {
"float": 0,
"string": "0%"
},
"created_at": "2021-08-06 10:17:45"
},
"created_at": "2021-09-01 14:03:50",
"updated_at": "2021-09-01 14:03:50",
"currency_sign": "$"
}
}Error
Response code: 404 Not FoundIf you try to delete the MailerLite shop:
Response code: 403 ForbiddenFetch shop e-commerce stats
To get the orders and revenue your emails earned in a shop over a period, send this GET request
GET https://connect.mailerlite.com/api/ecommerce/shops/(:shop_id)/reports/statsRequest parameters
| Parameter | Type | Required | Limitations |
|---|---|---|---|
| shop_id | integer | yes | Must provide a valid shop id |
| start_date | string | yes | First day of the period, as YYYY-MM-DD |
| end_date | string | yes | Last day of the period, as YYYY-MM-DD. Must not be before start_date |
Response
Response Code: 200 OK{
"data": {
"ecommerce": {
"orders_count": 4,
"revenue": 40,
"average_order_value": 10,
"conversion_rate": "0%"
},
"series": [
{
"date": "2026-01-01",
"campaign_orders_count": 3,
"automation_orders_count": 1,
"automation_revenue": 10,
"campaign_revenue": 30
}
]
}
}series has one entry per day in the period.
Error
If the shop cannot be found:
Response Code: 404 Not Found