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