E-commerce Import API
You can bulk import categories, products and orders to the platform.
Categories import
If you want to import multiple categories for the given shop, send this POST
request
POST https://connect.mailerlite.com/api/ecommerce/shops/:shop_id/categories/import
1
Request body
Parameter | Type | Required | Limitations |
---|---|---|---|
shop_id | integer | yes | Must provide valid shop id |
[
{
"name": "Category 1",
"exclude_from_automations": false
},
{
"name": "Category 2",
"exclude_from_automations": false
}
]
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
Response
If the categories were created:
Response Code: 200 OK
1
{
"data": [
{
"id": 46919150796276752,
"name": "Category 1",
"exclude_from_automations": false,
"created_at": "2022-02-13T09:46:29.000000Z",
"updated_at": "2022-02-13T09:46:29.000000Z"
},
{
"id": 46919150798373905,
"name": "Category 2",
"exclude_from_automations": false,
"created_at": "2022-02-13T09:46:29.000000Z",
"updated_at": "2022-02-13T09:46:29.000000Z"
}
]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Error
Response Code: 422 Unprocessable Entity
1
The error response will contain information about the invalid data.
{
"message": "The given data was invalid.",
"errors": {
"0.name": ["The name field is required."]
}
}
1
2
3
4
5
6
2
3
4
5
6
Products import
If you want to import products for the given shop, use this POST
request
POST https://connect.mailerlite.com/api/ecommerce/shops/:shop_id/products/import
1
Request body
Parameter | Type | Required | Limitations |
---|---|---|---|
shop_id | integer | yes | Must provide valid shop id |
[
{
"name": "Product name",
"price": 123.40,
"url": "https://shop-url.com/product-name",
"image": "https://shop-url.com/product-image.jpg",
"exclude_from_automations": false,
"categories": [
46919150796276752,
46919150798373905
]
},
{
"name": "Product 2 name",
"price": 123.40,
"url": "https://shop-url.com/product-name",
"image": "https://shop-url.com/product-image.jpg",
"exclude_from_automations": false,
"categories": [
46919150796276752,
46919150798373905
]
}
]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Response
If the products were created:
Response Code: 200 OK
1
{
"data": [
{
"id": 46920297804203043,
"name": "Product name",
"price": 123.4,
"url": null,
"image": null,
"exclude_from_automations": false,
"categories": [
{
"id": 46919150796276752,
"name": "Category 1",
"exclude_from_automations": false,
"created_at": "2022-02-13T09:46:29.000000Z",
"updated_at": "2022-02-13T09:46:29.000000Z"
},
{
"id": 46919150798373905,
"name": "Category 2",
"exclude_from_automations": false,
"created_at": "2022-02-13T09:46:29.000000Z",
"updated_at": "2022-02-13T09:46:29.000000Z"
}
]
},
{
"id": 46920297809445924,
"name": "Product 2 name",
"price": 123.4,
"url": null,
"image": null,
"exclude_from_automations": false,
"categories": [
{
"id": 46919150796276752,
"name": "Category 1",
"exclude_from_automations": false,
"created_at": "2022-02-13T09:46:29.000000Z",
"updated_at": "2022-02-13T09:46:29.000000Z"
},
{
"id": 46919150798373905,
"name": "Category 2",
"exclude_from_automations": false,
"created_at": "2022-02-13T09:46:29.000000Z",
"updated_at": "2022-02-13T09:46:29.000000Z"
}
]
}
]
}
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
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
Error
Response Code: 422 Unprocessable Entity
1
The error response will contain information about the invalid data.
{
"message": "The given data was invalid.",
"errors": {
"0.name": ["The name field is required."]
}
}
1
2
3
4
5
6
2
3
4
5
6
Orders import
If you want to import orders including customers, carts and cart items for the given shop, send this POST
request
POST https://connect.mailerlite.com/api/ecommerce/shops/:shop_id/orders/import
1
Request body
Parameter | Type | Required | Limitations |
---|---|---|---|
shop_id | integer | yes | Must provide valid shop id |
[
{
"customer": {
"email": "customer@email.com",
"create_subscriber": true,
"accepts_marketing": true
},
"cart": {
"items": [
{
"ecommerce_product_id": "46920297804203043",
"variant": "product variant",
"quantity": 1,
"price": 123.40
}
]
},
"status": "pending",
"total_price": 123.40
},
{
"customer": {
"email": "customer2@email.com",
"create_subscriber": true,
"accepts_marketing": true
},
"cart": {
"items": [
{
"ecommerce_product_id": "46920297804203043",
"variant": "product variant",
"quantity": 1,
"price": 123.40
}
]
},
"status": "pending",
"total_price": 123.40
}
]
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
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
Response
If the orders were created:
Response Code: 200 OK
1
{
"data": [
{
"id": 46920756608631854,
"customer": {
"id": 46920756260504617,
"email": "customer@email.com",
"accepts_marketing": true,
"subscriber": {
"id": "46920756366410794",
"email": "customer@email.com",
"status": "active",
"source": "manual",
"sent": 0,
"opens_count": 0,
"clicks_count": 0,
"open_rate": 0,
"click_rate": 0,
"ip_address": null,
"subscribed_at": "2022-02-13 10:12:00",
"unsubscribed_at": null,
"created_at": "2022-02-13 10:12:00",
"updated_at": "2022-02-13 10:12:00",
"opted_in_at": null,
"optin_ip": null
}
},
"cart": {
"id": 46920756586611756,
"checkout_url": null,
"cart_total": "0",
"items": [
{
"id": 46920756598146093,
"product": {
"id": 46920297804203043,
"name": "Product name",
"price": "123.4",
"url": null,
"image": null,
"exclude_from_automations": false,
"categories": [
{
"id": 46919150796276752,
"name": "Category 1",
"exclude_from_automations": false,
"created_at": "2022-02-13T09:46:29.000000Z",
"updated_at": "2022-02-13T09:46:29.000000Z"
},
{
"id": 46919150798373905,
"name": "Category 2",
"exclude_from_automations": false,
"created_at": "2022-02-13T09:46:29.000000Z",
"updated_at": "2022-02-13T09:46:29.000000Z"
}
]
},
"variant": "product variant",
"quantity": 1,
"price": "123.4"
}
]
},
"total": 123.4,
"status": "pending",
"created_at": "2022-02-13T10:12:00.000000Z",
"updated_at": "2022-02-13T10:12:00.000000Z"
},
{
"id": 46920756705100851,
"customer": {
"id": 46920756614923311,
"email": "customer2@email.com",
"accepts_marketing": true,
"subscriber": {
"id": "46920756639040560",
"email": "customer2@email.com",
"status": "active",
"source": "manual",
"sent": 0,
"opens_count": 0,
"clicks_count": 0,
"open_rate": 0,
"click_rate": 0,
"ip_address": null,
"subscribed_at": "2022-02-13 10:12:00",
"unsubscribed_at": null,
"created_at": "2022-02-13 10:12:00",
"updated_at": "2022-02-13 10:12:00",
"opted_in_at": null,
"optin_ip": null
}
},
"cart": {
"id": 46920756693566513,
"checkout_url": null,
"cart_total": "0",
"items": [
{
"id": 46920756700906546,
"product": {
"id": 46920297804203043,
"name": "Product name",
"price": "123.4",
"url": null,
"image": null,
"exclude_from_automations": false,
"categories": [
{
"id": 46919150796276752,
"name": "Category 1",
"exclude_from_automations": false,
"created_at": "2022-02-13T09:46:29.000000Z",
"updated_at": "2022-02-13T09:46:29.000000Z"
},
{
"id": 46919150798373905,
"name": "Category 2",
"exclude_from_automations": false,
"created_at": "2022-02-13T09:46:29.000000Z",
"updated_at": "2022-02-13T09:46:29.000000Z"
}
]
},
"variant": "product variant",
"quantity": 1,
"price": "123.4"
}
]
},
"total": 123.4,
"status": "pending",
"created_at": "2022-02-13T10:12:00.000000Z",
"updated_at": "2022-02-13T10:12:00.000000Z"
}
]
}
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
Error
Response Code: 422 Unprocessable Entity
1
The error response will contain information about the invalid data.
{
"message": "The given data was invalid.",
"errors": {
"0.customer": ["The 0.customer field is required."]
}
}
1
2
3
4
5
6
2
3
4
5
6