E-commerce API

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.

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/shops
1

Request body

ParameterTypeRequiredLimitations
limitintegernoDefaults to 50
pageintegernoDefaults 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": "quot;
    }
  ],
  "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
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61

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/shops
1

To update a shop, send this PUT request

PUT https://connect.mailerlite.com/api/ecommerce/shops/(:shop_id)
1

Request body

ParameterTypeRequiredLimitations
namestringyesShop name
urlstringyesShop URL address
currencystringyesISO 4217 currency code that the shop uses.
platformstringnoThe platform of the shop (e.g. shopify)
group_idintegernoThe id of the group that the shop's subscribers are automatically added to.
enable_popupsbooleannoEnables popups to the shop (the shop must have the universal script added to it). Defaults to false.
enabledbooleannoEnable/disable the ecommerce functionality for the shop. Defaults to false.
access_datastringnoPlatform 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
}
1
2
3
4
5
6
7
8

Response

If the shop was created:

Response Code: 201 Created
1
{
  "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": "quot;
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

Error

Response Code: 422 Unprocessable Entity
1

The error response will contain information about the invalid data.

{
  "message": "The given data was invalid.",
  "errors": {
    "url": ["The shop url must be provided."]
  }
}
1
2
3
4
5
6

Fetch a shop

To fetch a shop, send this GET request

GET https://connect.mailerlite.com/api/ecommerce/shops/(:shop_id)
1

Request body

ParameterTypeRequiredLimitations
idintegeryesMust provide either valid shop id
GET https://connect.mailerlite.com/api/ecommerce/shops/31986843064993537
1

Response

If shop exists:

Response Code: 200 OK
1
{
  "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": "quot;
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

Error

If the shop cannot be found:

Response Code: 404 Not Found
1

Fetch total shops count

If you want to fetch total shops count, send this GET request

GET https://connect.mailerlite.com/api/ecommerce/shops?limit=0
1

Request body

ParameterTypeRequiredLimitations
limitintegeryesValue must be 0

Response

Response Code: 200 OK
1
{
  "total": 100
}
1
2
3

Delete a shop

If you want to delete a shop, send this DELETE request

   DELETE https://connect.mailerlite.com/api/ecommerce/shops/:id
1

Request

ParameterTypeRequiredLimitations
idintegeryesValid shop id for the account

Response

Response code: 200 OK
1
{
  "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": "quot;
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

Error

Response code: 404 Not Found
1
Last Updated: