1 get:
2 operationId: GetShippingOptions
3 summary: List Shipping Options for Cart
4 description: >
5 Retrieve a list of shipping options for a cart. The cart's ID is set in the
6 required `cart_id` query parameter.
7
8
9 The shipping options also be sorted or paginated.
10
11
12 For a shipping option whose `price_type` is `calculated`, the returned
13 `amount` isn't reliable, as its price is computed on the fly by the
14 fulfillment provider. To retrieve its price, use the [Calculate Shipping
15 Option Price API
16 route](https://docs.medusajs.com/api/store#shipping-options_postshippingoptionsidcalculate).
17 externalDocs:
18 url: >-
19 https://docs.medusajs.com/resources/storefront-development/checkout/shipping
20 description: 'Storefront guide: How to implement shipping during checkout.'
21 x-authenticated: false
22 parameters:
23 - name: x-publishable-api-key
24 in: header
25 description: Publishable API Key created in the Medusa Admin.
26 required: true
27 schema:
28 type: string
29 externalDocs:
30 url: https://docs.medusajs.com/api/store#publishable-api-key
31 - name: x-medusa-locale
32 in: header
33 description: The locale in BCP 47 format to retrieve localized content.
34 required: false
35 schema:
36 type: string
37 example: en-US
38 externalDocs:
39 url: >-
40 https://docs.medusajs.com/resources/commerce-modules/translation/storefront
41 description: Learn more in the Serve Translations in Storefront guide.
42 - name: fields
43 in: query
44 description: >-
45 Comma-separated fields that should be included in the returned data. if
46 a field is prefixed with `+` it will be added to the default fields,
47 using `-` will remove it from the default fields. without prefix it will
48 replace the entire default fields.
49 required: false
50 schema:
51 type: string
52 title: fields
53 description: >-
54 Comma-separated fields that should be included in the returned data.
55 if a field is prefixed with `+` it will be added to the default
56 fields, using `-` will remove it from the default fields. without
57 prefix it will replace the entire default fields.
58 externalDocs:
59 url: '#select-fields-and-relations'
60 - name: offset
61 in: query
62 description: The number of items to skip when retrieving a list.
63 required: false
64 schema:
65 type: number
66 title: offset
67 description: The number of items to skip when retrieving a list.
68 externalDocs:
69 url: '#pagination'
70 - name: limit
71 in: query
72 description: Limit the number of items returned in the list.
73 required: false
74 schema:
75 type: number
76 title: limit
77 description: Limit the number of items returned in the list.
78 externalDocs:
79 url: '#pagination'
80 - name: order
81 in: query
82 description: >-
83 The field to sort the data by. By default, the sort order is ascending.
84 To change the order to descending, prefix the field name with `-`.
85 required: false
86 schema:
87 type: string
88 title: order
89 description: >-
90 The field to sort the data by. By default, the sort order is
91 ascending. To change the order to descending, prefix the field name
92 with `-`.
93 - name: cart_id
94 in: query
95 description: The ID of the cart to retrieve its shipping options.
96 required: true
97 schema:
98 type: string
99 title: cart_id
100 description: The ID of the cart to retrieve its shipping options.
101 - name: $and
102 in: query
103 description: >-
104 Join query parameters with an AND condition. Each object's content is
105 the same type as the expected query parameters.
106 required: false
107 schema:
108 type: array
109 description: >-
110 Join query parameters with an AND condition. Each object's content is
111 the same type as the expected query parameters.
112 items:
113 type: object
114 title: $and
115 - name: $or
116 in: query
117 description: >-
118 Join query parameters with an OR condition. Each object's content is the
119 same type as the expected query parameters.
120 required: false
121 schema:
122 type: array
123 description: >-
124 Join query parameters with an OR condition. Each object's content is
125 the same type as the expected query parameters.
126 items:
127 type: object
128 title: $or
129 - name: is_return
130 in: query
131 description: Whether the shipping option can be used for returns.
132 required: false
133 schema:
134 type: boolean
135 title: is_return
136 description: Whether the shipping option can be used for returns.
137 - name: locale
138 in: query
139 description: The locale in BCP 47 format to retrieve localized content.
140 required: false
141 schema:
142 type: string
143 example: en-US
144 externalDocs:
145 url: >-
146 https://docs.medusajs.com/resources/commerce-modules/translation/storefront
147 description: Learn more in the Serve Translations in Storefront guide.
148 x-codeSamples:
149 - lang: JavaScript
150 label: JS SDK
151 source:
152 $ref: ../code_samples/JavaScript/store_shipping-options/get.js
153 - lang: Shell
154 label: cURL
155 source:
156 $ref: ../code_samples/Shell/store_shipping-options/get.sh
157 tags:
158 - Shipping Options
159 responses:
160 '200':
161 description: OK
162 content:
163 application/json:
164 schema:
165 $ref: ../components/schemas/StoreShippingOptionListResponse.yaml
166 '400':
167 $ref: ../components/responses/400_error.yaml
168 '401':
169 $ref: ../components/responses/unauthorized.yaml
170 '404':
171 $ref: ../components/responses/not_found_error.yaml
172 '409':
173 $ref: ../components/responses/invalid_state_error.yaml
174 '422':
175 $ref: ../components/responses/invalid_request_error.yaml
176 '500':
177 $ref: ../components/responses/500_error.yaml
178 x-workflow: listShippingOptionsForCartWorkflow
179 x-events: []
180 x-allowed:
181 - id
182 - name
183 - price_type
184 - service_zone_id
185 - shipping_profile_id
186 - provider_id
187 - shipping_option_type_id
188 - metadata
189 - data
190 - type
191 - type.id
192 - type.label
193 - type.description
194 - type.code
195 - provider
196 - provider.id
197 - provider.is_enabled
198 - prices
199 - prices.id
200 - prices.currency_code
201 - prices.amount
202 - prices.min_quantity
203 - prices.max_quantity
204 - prices.price_rules
205 - prices.price_rules.id
206 - prices.price_rules.attribute
207 - prices.price_rules.operator
208 - prices.price_rules.value
209 - calculated_price
210 - calculated_price.id
211 - calculated_price.currency_code
212 - calculated_price.calculated_amount
213 - calculated_price.calculated_amount_with_tax
214 - calculated_price.calculated_amount_without_tax
215 - calculated_price.original_amount
216 - calculated_price.original_amount_with_tax
217 - calculated_price.original_amount_without_tax
218 - calculated_price.is_calculated_price_price_list
219 - calculated_price.is_calculated_price_tax_inclusive
220 - calculated_price.is_original_price_price_list
221 - calculated_price.is_original_price_tax_inclusive
222 - calculated_price.calculated_price
223 - calculated_price.calculated_price.id
224 - calculated_price.calculated_price.price_list_id
225 - calculated_price.calculated_price.price_list_type
226 - calculated_price.calculated_price.min_quantity
227 - calculated_price.calculated_price.max_quantity
228 - calculated_price.original_price
229 - calculated_price.original_price.id
230 - calculated_price.original_price.price_list_id
231 - calculated_price.original_price.price_list_type
232 - calculated_price.original_price.min_quantity
233 - calculated_price.original_price.max_quantity
234 - service_zone
235 - service_zone.id
236 - service_zone.fulfillment_set_id
237 - service_zone.fulfillment_set
238 - service_zone.fulfillment_set.id
239 - service_zone.fulfillment_set.type
240 - service_zone.fulfillment_set.location
241 - service_zone.fulfillment_set.location.id
242 - service_zone.fulfillment_set.location.address
243 - service_zone.fulfillment_set.location.address.id
244 - service_zone.fulfillment_set.location.address.company
245 - service_zone.fulfillment_set.location.address.address_1
246 - service_zone.fulfillment_set.location.address.address_2
247 - service_zone.fulfillment_set.location.address.city
248 - service_zone.fulfillment_set.location.address.country_code
249 - service_zone.fulfillment_set.location.address.province
250 - service_zone.fulfillment_set.location.address.postal_code
251 - service_zone.fulfillment_set.location.address.phone
252 - service_zone.fulfillment_set.location.address.metadata
253 - service_zone.fulfillment_set.location.address.created_at
254 - service_zone.fulfillment_set.location.address.updated_at
255 - service_zone.fulfillment_set.location.address.deleted_at