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