Site Logo

Rate Multiple Shipments

With ShipEngine you're able to request rates for multiple shipments at once. Unlike in the Get Shipping Rates section, this process is asynchronous. If you subscribe to webhooks, you will receive a notification when the operation is complete.

You can then retrieve the rates and create a label using the rate_id.

Example Request

POST /v1/rates/bulk

This example requests rates for shipments that were previously created by passing the shipment_ids property.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
POST /v1/rates/bulk HTTP/1.1
Host: api.shipengine.com
API-Key: __YOUR_API_KEY_HERE__
Content-Type: application/json
{
"shipment_ids": [
"se-2127226",
"se-2127227"
],
"rate_options": {
"carrier_ids": [
"se-123890",
"se-121861"
]
}
}

This example includes the shipment information directly in the rate request rather than referencing an existing shipment. In this case, ShipEngine will create a shipment for you and include a shipment_id with the each rate when you retrieve the rates.

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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
POST /v1/rates/bulk HTTP/1.1
Host: api.shipengine.com
API-Key: __YOUR_API_KEY_HERE__
Content-Type: application/json
{
"rate_options": {
"carrier_ids": [
"se-123890",
"se-123890"
]
},
"shipments": [{
"ship_to": {
"name": "Amanda Miller",
"phone": "555-555-5555",
"address_line1": "525 S Winchester Blvd",
"city_locality": "San Jose",
"state_province": "CA",
"postal_code": "95128",
"country_code": "US",
"address_residential_indicator": "yes"
},
"ship_from": {
"company_name": "Example Corp.",
"name": "John Doe",
"phone": "111-111-1111",
"address_line1": "4009 Marathon Blvd",
"address_line2": "Suite 300",
"city_locality": "Austin",
"state_province": "TX",
"postal_code": "78756",
"country_code": "US",
"address_residential_indicator": "no"
},
"confirmation": "none",
"packages": [{
"package_code": "package",
"weight": {
"value": 12,
"unit": "ounce"
}
}]
},
{
"ship_to": {
"name": "Amanda Miller",
"phone": "555-555-5555",
"address_line1": "525 S Winchester Blvd",
"city_locality": "San Jose",
"state_province": "CA",
"postal_code": "95128",
"country_code": "US",
"address_residential_indicator": "yes"
},
"ship_from": {
"company_name": "Example Corp.",
"name": "John Doe",
"phone": "111-111-1111",
"address_line1": "4009 Marathon Blvd",
"address_line2": "Suite 300",
"city_locality": "Austin",
"state_province": "TX",
"postal_code": "78756",
"country_code": "US",
"address_residential_indicator": "no"
},
"confirmation": "none",
"packages": [{
"package_code": "package",
"weight": {
"value": 1,
"unit": "pound"
}
}]
},
{
"ship_to": {
"name": "Waffle HQ",
"company_name": "Waffle House",
"address_line1": "5986 Financial Drive",
"address_line2": null,
"address_line3": null,
"city_locality": "Norcross",
"state_province": "GA",
"postal_code": "30071",
"country_code": "US",
"phone": "111-111-1111"
},
"ship_from": {
"company_name": "Example Corp.",
"name": "John Doe",
"phone": "111-111-1111",
"address_line1": "4009 Marathon Blvd",
"address_line2": "Suite 300",
"city_locality": "Austin",
"state_province": "TX",
"postal_code": "78756",
"country_code": "US",
"address_residential_indicator": "no"
},
"confirmation": "none",
"packages": [{
"package_code": "package",
"weight": {
"value": 1,
"unit": "ounce"
}
}]
},
{
"ship_to": {
"name": "Jony Ive",
"company_name": "Apple",
"address_line1": "1 Infinite Loop",
"address_line2": null,
"address_line3": null,
"city_locality": "Cupertino",
"state_province": "CA",
"postal_code": "95014",
"country_code": "US",
"phone": "408-996-1010"
},
"ship_from": {
"company_name": "Example Corp.",
"name": "John Doe",
"phone": "111-111-1111",
"address_line1": "4009 Marathon Blvd",
"address_line2": "Suite 300",
"city_locality": "Austin",
"state_province": "TX",
"postal_code": "78756",
"country_code": "US",
"address_residential_indicator": "no"
},
"confirmation": "none",
"packages": [{
"package_code": "package",
"weight": {
"value": 1,
"unit": "ounce"
}
}]
},
{
"ship_to": {
"name": "Amanda Miller",
"phone": "555-555-5555",
"address_line1": "525 S Winchester Blvd",
"city_locality": "San Jose",
"state_province": "CA",
"postal_code": "95128",
"country_code": "US",
"address_residential_indicator": "yes"
},
"ship_from": {
"company_name": "Example Corp.",
"name": "John Doe",
"phone": "111-111-1111",
"address_line1": "4009 Marathon Blvd",
"address_line2": "Suite 300",
"city_locality": "Austin",
"state_province": "TX",
"postal_code": "78756",
"country_code": "US",
"address_residential_indicator": "no"
},
"confirmation": "none",
"packages": [{
"package_code": "package",
"weight": {
"value": 1,
"unit": "ounce"
}
}]
}
]
}

Example Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
[
{
"rate_request_id": 501846,
"shipment_id": "se-2127226",
"status": "working",
"created_at": "2019-07-25T15:24:46.657Z"
},
{
"rate_request_id": 501847,
"shipment_id": "se-2127227",
"status": "working",
"created_at": "2019-07-25T15:24:46.657Z"
}
]

As we've done before in other examples, we have truncated the response to only show a single rate. When you run this command, you will notice that there are many more rates that exist.