1 /**
2 * @oas [get] /admin/shipping-options
3 * operationId: GetShippingOptions
4 * summary: List Shipping Options
5 * description: Retrieve a list of shipping options. The shipping options can be filtered by fields such as `id`. The shipping options can also be sorted or paginated.
6 * x-authenticated: true
7 * parameters:
8 * - name: fields
9 * in: query
10 * description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default
11 * fields. without prefix it will replace the entire default fields.
12 * required: false
13 * schema:
14 * type: string
15 * title: fields
16 * description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default
17 * fields. without prefix it will replace the entire default fields.
18 * externalDocs:
19 * url: "#select-fields-and-relations"
20 * - name: offset
21 * in: query
22 * description: The number of items to skip when retrieving a list.
23 * required: false
24 * schema:
25 * type: number
26 * title: offset
27 * description: The number of items to skip when retrieving a list.
28 * externalDocs:
29 * url: "#pagination"
30 * - name: limit
31 * in: query
32 * description: Limit the number of items returned in the list.
33 * required: false
34 * schema:
35 * type: number
36 * title: limit
37 * description: Limit the number of items returned in the list.
38 * externalDocs:
39 * url: "#pagination"
40 * - name: order
41 * in: query
42 * description: The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with `-`.
43 * required: false
44 * schema:
45 * type: string
46 * title: order
47 * description: The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with `-`.
48 * - name: id
49 * in: query
50 * required: false
51 * schema:
52 * oneOf:
53 * - type: string
54 * title: id
55 * description: Filter by a shipping option ID.
56 * - type: array
57 * description: Filter by shipping option IDs.
58 * items:
59 * type: string
60 * title: id
61 * description: A shipping option's ID.
62 * - name: q
63 * in: query
64 * description: Search term to filter the shipping option's searchable properties.
65 * required: false
66 * schema:
67 * type: string
68 * title: q
69 * description: Search term to filter the shipping option's searchable properties.
70 * - name: service_zone_id
71 * in: query
72 * required: false
73 * schema:
74 * oneOf:
75 * - type: string
76 * title: service_zone_id
77 * description: Filter by a service zone's ID to retrieve its associated shipping options.
78 * - type: array
79 * description: Filter by service zone IDs to retrieve their associated shipping options.
80 * items:
81 * type: string
82 * title: service_zone_id
83 * description: A service zone ID.
84 * - name: shipping_profile_id
85 * in: query
86 * required: false
87 * schema:
88 * oneOf:
89 * - type: string
90 * title: shipping_profile_id
91 * description: Filter by a shipping profile's ID to retrieve its associated shipping options.
92 * - type: array
93 * description: Filter by shipping profile IDs to retrieve their associated shipping options.
94 * items:
95 * type: string
96 * title: shipping_profile_id
97 * description: A shipping profile ID.
98 * - name: provider_id
99 * in: query
100 * required: false
101 * schema:
102 * oneOf:
103 * - type: string
104 * title: provider_id
105 * description: Filter by a fulfillment provider's ID to retrieve its associated shipping options.
106 * - type: array
107 * description: Filter by fulfillment provider IDs to retrieve their associated shipping options.
108 * items:
109 * type: string
110 * title: provider_id
111 * description: A fulfillment provider ID.
112 * - name: shipping_option_type_id
113 * in: query
114 * required: false
115 * schema:
116 * oneOf:
117 * - type: string
118 * title: shipping_option_type_id
119 * description: Filter by a shipping option type's ID to retrieve its associated shipping options.
120 * - type: array
121 * description: Filter by shipping option type IDs to retrieve its associated shipping options.
122 * items:
123 * type: string
124 * title: shipping_option_type_id
125 * description: A shipping option type ID.
126 * - name: created_at
127 * in: query
128 * description: Filter by a shipping option's creation date.
129 * required: false
130 * schema:
131 * type: object
132 * description: Filter by a shipping option's creation date.
133 * properties:
134 * $and:
135 * type: array
136 * description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters.
137 * items:
138 * type: object
139 * title: $and
140 * $or:
141 * type: array
142 * description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters.
143 * items:
144 * type: object
145 * title: $or
146 * $eq:
147 * oneOf:
148 * - type: string
149 * title: $eq
150 * description: Filter by an exact match.
151 * - type: array
152 * description: Filter by an exact match.
153 * items:
154 * type: string
155 * title: $eq
156 * description: Filter by an exact match.
157 * $ne:
158 * type: string
159 * title: $ne
160 * description: Filter by values not equal to this parameter.
161 * $in:
162 * type: array
163 * description: Filter by values in this array.
164 * items:
165 * type: string
166 * title: $in
167 * description: Filter by values in this array.
168 * $nin:
169 * type: array
170 * description: Filter by values not in this array.
171 * items:
172 * type: string
173 * title: $nin
174 * description: Filter by values not in this array.
175 * $not:
176 * oneOf:
177 * - type: string
178 * title: $not
179 * description: Filter by values not matching the conditions in this parameter.
180 * - type: object
181 * description: Filter by values not matching the conditions in this parameter.
182 * - type: array
183 * description: Filter by values not matching the conditions in this parameter.
184 * items:
185 * type: string
186 * title: $not
187 * description: Filter by values not matching the conditions in this parameter.
188 * $gt:
189 * type: string
190 * title: $gt
191 * description: Filter by values greater than this parameter. Useful for numbers and dates only.
192 * $gte:
193 * type: string
194 * title: $gte
195 * description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only.
196 * $lt:
197 * type: string
198 * title: $lt
199 * description: Filter by values less than this parameter. Useful for numbers and dates only.
200 * $lte:
201 * type: string
202 * title: $lte
203 * description: Filter by values less than or equal to this parameter. Useful for numbers and dates only.
204 * $like:
205 * type: string
206 * title: $like
207 * description: Apply a `like` filter. Useful for strings only.
208 * $re:
209 * type: string
210 * title: $re
211 * description: Apply a regex filter. Useful for strings only.
212 * $ilike:
213 * type: string
214 * title: $ilike
215 * description: Apply a case-insensitive `like` filter. Useful for strings only.
216 * $fulltext:
217 * type: string
218 * title: $fulltext
219 * description: Filter to apply on full-text properties.
220 * $overlap:
221 * type: array
222 * description: Filter arrays that have overlapping values with this parameter.
223 * items:
224 * type: string
225 * title: $overlap
226 * description: Filter arrays that have overlapping values with this parameter.
227 * $contains:
228 * type: array
229 * description: Filter arrays that contain some of the values of this parameter.
230 * items:
231 * type: string
232 * title: $contains
233 * description: Filter arrays that contain some of the values of this parameter.
234 * $contained:
235 * type: array
236 * description: Filter arrays that contain all values of this parameter.
237 * items:
238 * type: string
239 * title: $contained
240 * description: Filter arrays that contain all values of this parameter.
241 * $exists:
242 * type: boolean
243 * title: $exists
244 * description: Filter by whether a value for this parameter exists (not `null`).
245 * title: created_at
246 * - name: updated_at
247 * in: query
248 * description: Filter by a shipping option's update date.
249 * required: false
250 * schema:
251 * type: object
252 * description: Filter by a shipping option's update date.
253 * properties:
254 * $and:
255 * type: array
256 * description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters.
257 * items:
258 * type: object
259 * title: $and
260 * $or:
261 * type: array
262 * description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters.
263 * items:
264 * type: object
265 * title: $or
266 * $eq:
267 * oneOf:
268 * - type: string
269 * title: $eq
270 * description: Filter by an exact match.
271 * - type: array
272 * description: Filter by an exact match.
273 * items:
274 * type: string
275 * title: $eq
276 * description: Filter by an exact match.
277 * $ne:
278 * type: string
279 * title: $ne
280 * description: Filter by values not equal to this parameter.
281 * $in:
282 * type: array
283 * description: Filter by values in this array.
284 * items:
285 * type: string
286 * title: $in
287 * description: Filter by values in this array.
288 * $nin:
289 * type: array
290 * description: Filter by values not in this array.
291 * items:
292 * type: string
293 * title: $nin
294 * description: Filter by values not in this array.
295 * $not:
296 * oneOf:
297 * - type: string
298 * title: $not
299 * description: Filter by values not matching the conditions in this parameter.
300 * - type: object
301 * description: Filter by values not matching the conditions in this parameter.
302 * - type: array
303 * description: Filter by values not matching the conditions in this parameter.
304 * items:
305 * type: string
306 * title: $not
307 * description: Filter by values not matching the conditions in this parameter.
308 * $gt:
309 * type: string
310 * title: $gt
311 * description: Filter by values greater than this parameter. Useful for numbers and dates only.
312 * $gte:
313 * type: string
314 * title: $gte
315 * description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only.
316 * $lt:
317 * type: string
318 * title: $lt
319 * description: Filter by values less than this parameter. Useful for numbers and dates only.
320 * $lte:
321 * type: string
322 * title: $lte
323 * description: Filter by values less than or equal to this parameter. Useful for numbers and dates only.
324 * $like:
325 * type: string
326 * title: $like
327 * description: Apply a `like` filter. Useful for strings only.
328 * $re:
329 * type: string
330 * title: $re
331 * description: Apply a regex filter. Useful for strings only.
332 * $ilike:
333 * type: string
334 * title: $ilike
335 * description: Apply a case-insensitive `like` filter. Useful for strings only.
336 * $fulltext:
337 * type: string
338 * title: $fulltext
339 * description: Filter to apply on full-text properties.
340 * $overlap:
341 * type: array
342 * description: Filter arrays that have overlapping values with this parameter.
343 * items:
344 * type: string
345 * title: $overlap
346 * description: Filter arrays that have overlapping values with this parameter.
347 * $contains:
348 * type: array
349 * description: Filter arrays that contain some of the values of this parameter.
350 * items:
351 * type: string
352 * title: $contains
353 * description: Filter arrays that contain some of the values of this parameter.
354 * $contained:
355 * type: array
356 * description: Filter arrays that contain all values of this parameter.
357 * items:
358 * type: string
359 * title: $contained
360 * description: Filter arrays that contain all values of this parameter.
361 * $exists:
362 * type: boolean
363 * title: $exists
364 * description: Filter by whether a value for this parameter exists (not `null`).
365 * title: updated_at
366 * - name: deleted_at
367 * in: query
368 * description: Filter by a shipping option's deletion date.
369 * required: false
370 * schema:
371 * type: object
372 * description: Filter by a shipping option's deletion date.
373 * properties:
374 * $and:
375 * type: array
376 * description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters.
377 * items:
378 * type: object
379 * title: $and
380 * $or:
381 * type: array
382 * description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters.
383 * items:
384 * type: object
385 * title: $or
386 * $eq:
387 * oneOf:
388 * - type: string
389 * title: $eq
390 * description: Filter by an exact match.
391 * - type: array
392 * description: Filter by an exact match.
393 * items:
394 * type: string
395 * title: $eq
396 * description: Filter by an exact match.
397 * $ne:
398 * type: string
399 * title: $ne
400 * description: Filter by values not equal to this parameter.
401 * $in:
402 * type: array
403 * description: Filter by values in this array.
404 * items:
405 * type: string
406 * title: $in
407 * description: Filter by values in this array.
408 * $nin:
409 * type: array
410 * description: Filter by values not in this array.
411 * items:
412 * type: string
413 * title: $nin
414 * description: Filter by values not in this array.
415 * $not:
416 * oneOf:
417 * - type: string
418 * title: $not
419 * description: Filter by values not matching the conditions in this parameter.
420 * - type: object
421 * description: Filter by values not matching the conditions in this parameter.
422 * - type: array
423 * description: Filter by values not matching the conditions in this parameter.
424 * items:
425 * type: string
426 * title: $not
427 * description: Filter by values not matching the conditions in this parameter.
428 * $gt:
429 * type: string
430 * title: $gt
431 * description: Filter by values greater than this parameter. Useful for numbers and dates only.
432 * $gte:
433 * type: string
434 * title: $gte
435 * description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only.
436 * $lt:
437 * type: string
438 * title: $lt
439 * description: Filter by values less than this parameter. Useful for numbers and dates only.
440 * $lte:
441 * type: string
442 * title: $lte
443 * description: Filter by values less than or equal to this parameter. Useful for numbers and dates only.
444 * $like:
445 * type: string
446 * title: $like
447 * description: Apply a `like` filter. Useful for strings only.
448 * $re:
449 * type: string
450 * title: $re
451 * description: Apply a regex filter. Useful for strings only.
452 * $ilike:
453 * type: string
454 * title: $ilike
455 * description: Apply a case-insensitive `like` filter. Useful for strings only.
456 * $fulltext:
457 * type: string
458 * title: $fulltext
459 * description: Filter to apply on full-text properties.
460 * $overlap:
461 * type: array
462 * description: Filter arrays that have overlapping values with this parameter.
463 * items:
464 * type: string
465 * title: $overlap
466 * description: Filter arrays that have overlapping values with this parameter.
467 * $contains:
468 * type: array
469 * description: Filter arrays that contain some of the values of this parameter.
470 * items:
471 * type: string
472 * title: $contains
473 * description: Filter arrays that contain some of the values of this parameter.
474 * $contained:
475 * type: array
476 * description: Filter arrays that contain all values of this parameter.
477 * items:
478 * type: string
479 * title: $contained
480 * description: Filter arrays that contain all values of this parameter.
481 * $exists:
482 * type: boolean
483 * title: $exists
484 * description: Filter by whether a value for this parameter exists (not `null`).
485 * title: deleted_at
486 * - name: stock_location_id
487 * in: query
488 * required: false
489 * schema:
490 * oneOf:
491 * - type: string
492 * title: stock_location_id
493 * description: Filter by a location ID to retrieve its associated shipping option.
494 * - type: array
495 * description: Filter by location IDs to retrieve their associated shipping option.
496 * items:
497 * type: string
498 * title: stock_location_id
499 * description: A stock location's ID.
500 * - name: is_return
501 * in: query
502 * description: Filter by whether the shipping option is used for returns.
503 * required: false
504 * schema:
505 * type: boolean
506 * title: is_return
507 * description: Filter by whether the shipping option is used for returns.
508 * - name: admin_only
509 * in: query
510 * description: Filter by whether the shipping option is used by admin users only.
511 * required: false
512 * schema:
513 * type: boolean
514 * title: admin_only
515 * description: Filter by whether the shipping option is used by admin users only.
516 * - name: with_deleted
517 * in: query
518 * description: Whether to include deleted records in the result.
519 * required: false
520 * schema:
521 * type: boolean
522 * title: with_deleted
523 * description: Whether to include deleted records in the result.
524 * security:
525 * - api_token: []
526 * - cookie_auth: []
527 * - jwt_token: []
528 * x-codeSamples:
529 * - lang: JavaScript
530 * label: JS SDK
531 * source: |-
532 * import Medusa from "@medusajs/js-sdk"
533 *
534 * export const sdk = new Medusa({
535 * baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
536 * debug: import.meta.env.DEV,
537 * auth: {
538 * type: "session",
539 * },
540 * })
541 *
542 * sdk.admin.shippingOption.list()
543 * .then(({ shipping_options, count, limit, offset }) => {
544 * console.log(shipping_options)
545 * })
546 * - lang: Shell
547 * label: cURL
548 * source: |-
549 * curl '{backend_url}/admin/shipping-options' \
550 * -H 'Authorization: Bearer {jwt_token}'
551 * tags:
552 * - Shipping Options
553 * responses:
554 * "200":
555 * description: OK
556 * content:
557 * application/json:
558 * schema:
559 * allOf:
560 * - type: object
561 * description: The paginated list of shipping options.
562 * required:
563 * - limit
564 * - offset
565 * - count
566 * properties:
567 * limit:
568 * type: number
569 * title: limit
570 * description: The maximum number of items returned.
571 * offset:
572 * type: number
573 * title: offset
574 * description: The number of items skipped before retrieving the returned items.
575 * count:
576 * type: number
577 * title: count
578 * description: The total number of items.
579 * - type: object
580 * description: The paginated list of shipping options.
581 * required:
582 * - shipping_options
583 * properties:
584 * shipping_options:
585 * type: array
586 * description: The list of shipping options.
587 * items:
588 * $ref: "#/components/schemas/AdminShippingOption"
589 * "400":
590 * $ref: "#/components/responses/400_error"
591 * "401":
592 * $ref: "#/components/responses/unauthorized"
593 * "404":
594 * $ref: "#/components/responses/not_found_error"
595 * "409":
596 * $ref: "#/components/responses/invalid_state_error"
597 * "422":
598 * $ref: "#/components/responses/invalid_request_error"
599 * "500":
600 * $ref: "#/components/responses/500_error"
601 *
602 */
603