XM
Members
Add Shipping to Line Items
This documentation is now outdated, please find the latest docs for this endpoint here
Path:
1
PATCH https://{baseurl}/api-cart/cart/{cartId}/ship-to
Copied!
Your customers might want to ship items to different addresses. Using this API, they can add shipping information for each item. Fabric also supports rules to set up international shipping methods.
Note: A postal address is only needed for physical items. For digital items, email address is sufficient.

Headers

Content-Type : application/json
x-site-context : { "date": "2020-08-28T02:35:27.787Z", "channel": 12, "account": 5f493c9f30ec2a0007a94fc8", "stage": "sandbox" }

Parameters

Type : path
Name : The 24 character system-generated cart ID (from the Add Items to Cart or Retrieve Cart by userAuthToken API).
Required: true
Type: requestBody
Name: The shipping details.
Required: true

Sample Request

Path:
1
https://{baseurl}/api-cart/cart/5e99d75cfcef0314e06b64b8/ship-to
Copied!
Request Body:
1
[
2
{
3
"itemId": 1000000012,
4
"lineItemId": 1,
5
"shipToId": "5e99dd58fcef0314e06b64fe"
6
},
7
{
8
"itemId": 1000000014,
9
"lineItemId": 2,
10
"shipToId": "5e99dd58fcef0314e06b64fe"
11
},
12
{
13
"itemId": 1000000012,
14
"lineItemId": 3,
15
"shipToId": "5e99dd58fcef0314e06b64fe"
16
},
17
{
18
"itemId": 1000000014,
19
"lineItemId": 4,
20
"shipToId": "5e99dd58fcef0314e06b64fe"
21
}
22
]
23
Copied!

Response

Success Code: 200
Message: OK
Description: You'll see this message when the promo is successfully applied.
1
{
2
"_id": "5e99d75cfcef0314e06b64b8",
3
"deleted": false,
4
"allPromosApplied": [],
5
"cartId": 355,
6
"items": [
7
{
8
"price": {
9
"discount": {
10
"promosApplied": [],
11
"price": 0
12
},
13
"validate": true,
14
"sale": 0,
15
"base": 260,
16
"currency": "USD"
17
},
18
"group": [
19
"5ddd1a156c5a5fed1e0d91fb"
20
],
21
"createdAt": "2020-04-17T01:02:12.054Z",
22
"updatedAt": "2020-04-17T16:33:21.191Z",
23
"_id": "5e99d75cfcef0314e06b64b9",
24
"itemId": 1000000012,
25
"quantity": 15,
26
"sku": "1554369",
27
"taxCode": "PH060771",
28
"lineItemId": 1,
29
"totalPrice": {
30
"currency": "USD",
31
"amount": 3900
32
},
33
"shipTo": "5e99dd58fcef0314e06b64fe",
34
"id": "5e99d75cfcef0314e06b64b9"
35
},
36
{
37
"price": {
38
"discount": {
39
"promosApplied": [],
40
"price": 0
41
},
42
"validate": true,
43
"sale": 0,
44
"base": 380,
45
"currency": "USD"
46
},
47
"group": [
48
"5ddd1a156c5a5fed1e0d91fb"
49
],
50
"createdAt": "2020-04-17T01:02:12.054Z",
51
"updatedAt": "2020-04-17T16:33:21.212Z",
52
"_id": "5e99d75cfcef0314e06b64ba",
53
"itemId": 1000000014,
54
"quantity": 15,
55
"sku": "1539213",
56
"taxCode": "PH060771",
57
"lineItemId": 2,
58
"totalPrice": {
59
"currency": "USD",
60
"amount": 5700
61
},
62
"shipTo": "5e99dd58fcef0314e06b64fe",
63
"id": "5e99d75cfcef0314e06b64ba"
64
},
65
{
66
"price": {
67
"discount": {
68
"promosApplied": [],
69
"price": 0
70
},
71
"validate": true,
72
"sale": 0,
73
"base": 260,
74
"currency": "USD"
75
},
76
"group": [
77
"5ddd1a156c5a5fed1e0d91fb"
78
],
79
"createdAt": "2020-04-17T01:02:12.054Z",
80
"updatedAt": "2020-04-17T16:33:21.231Z",
81
"_id": "5e99d6e2fcef0314e06b64b2",
82
"itemId": 1000000012,
83
"quantity": 2,
84
"sku": "1554369",
85
"taxCode": "PH060771",
86
"lineItemId": 3,
87
"totalPrice": {
88
"currency": "USD",
89
"amount": 520
90
},
91
"shipTo": "5e99dd58fcef0314e06b64fe",
92
"id": "5e99d6e2fcef0314e06b64b2"
93
},
94
{
95
"price": {
96
"discount": {
97
"promosApplied": [],
98
"price": 0
99
},
100
"validate": true,
101
"sale": 0,
102
"base": 380,
103
"currency": "USD"
104
},
105
"group": [
106
"5ddd1a156c5a5fed1e0d91fb"
107
],
108
"createdAt": "2020-04-17T01:02:12.054Z",
109
"updatedAt": "2020-04-17T16:33:21.249Z",
110
"_id": "5e99d6e2fcef0314e06b64b3",
111
"itemId": 1000000014,
112
"quantity": 2,
113
"sku": "1539213",
114
"taxCode": "PH060771",
115
"lineItemId": 4,
116
"totalPrice": {
117
"currency": "USD",
118
"amount": 760
119
},
120
"shipTo": "5e99dd58fcef0314e06b64fe",
121
"id": "5e99d6e2fcef0314e06b64b3"
122
}
123
],
124
"userId": "5e97947d3cb8553c0e43d87f",
125
"createdAt": "2020-04-17T16:20:44.093Z",
126
"updatedAt": "2020-04-17T17:06:03.833Z",
127
"__v": 0,
128
"totalAmount": {
129
"currency": "USD",
130
"amount": 10880
131
},
132
"quantity": 34
133
}
Copied!
Error Code: 404
Message: Not found
Description: You will see this error when the specified cart ID doesn't exist in the system.
1
{
2
"code": "CART_NOT_FOUND",
3
"message": "Cart not found."
4
}
Copied!
Error Code: 400
Message: Request validation
Description: You will see this error when the specified cart ID is lesser or greater than 24 characters.
1
{
2
"code": "REQUEST_VALIDATION",
3
"message": "Invalid data in path: /cartId should NOT be shorter than 24 characters"
4
}
Copied!
Error Code: 500
Message: Internal Server Error
Description: You will see this error when the account number is incorrect in the x-site-context (for a multi-tenent client).

Change Log

  • June - 2021
  • July - 2020 First updated
Last modified 1mo ago
Copy link
Contents
Change Log