Files
medusa-store/www/apps/api-reference/specs/admin/paths/admin_regions.yaml
2024-07-10 09:35:59 +02:00

374 lines
10 KiB
YAML

get:
operationId: GetRegions
summary: List Regions
description: >-
Retrieve a list of regions. The regions can be filtered by fields such as
`id`. The regions can also be sorted or paginated.
x-authenticated: true
parameters:
- name: expand
in: query
description: Comma-separated relations that should be expanded in the returned data.
required: false
schema:
type: string
title: expand
description: >-
Comma-separated relations that should be expanded in the returned
data.
- name: fields
in: query
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 fields. without prefix it will
replace the entire default fields.
required: false
schema:
type: string
title: fields
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 fields. without
prefix it will replace the entire default fields.
- name: offset
in: query
description: The number of items to skip when retrieving a list.
required: false
schema:
type: number
title: offset
description: The number of items to skip when retrieving a list.
- name: limit
in: query
description: Limit the number of items returned in the list.
required: false
schema:
type: number
title: limit
description: Limit the number of items returned in the list.
- name: order
in: query
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 `-`.
required: false
schema:
type: string
title: order
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 `-`.
- name: q
in: query
description: The region's q.
required: false
schema:
type: string
title: q
description: The region's q.
- name: id
in: query
required: false
schema:
oneOf:
- type: string
title: id
description: The region's ID.
- type: array
description: The region's ID.
items:
type: string
title: id
description: The id's ID.
- name: code
in: query
required: false
schema:
oneOf:
- type: string
title: code
description: The region's code.
- type: array
description: The region's code.
items:
type: string
title: code
description: The code's details.
- name: name
in: query
required: false
schema:
oneOf:
- type: string
title: name
description: The region's name.
- type: array
description: The region's name.
items:
type: string
title: name
description: The name's details.
- name: created_at
in: query
description: The region's created at.
required: false
schema:
type: object
description: The region's created at.
required:
- $eq
- $ne
- $in
- $nin
- $like
- $ilike
- $re
- $contains
- $gt
- $gte
- $lt
- $lte
properties:
$eq: {}
$ne: {}
$in: {}
$nin: {}
$like: {}
$ilike: {}
$re: {}
$contains: {}
$gt: {}
$gte: {}
$lt: {}
$lte: {}
- name: updated_at
in: query
description: The region's updated at.
required: false
schema:
type: object
description: The region's updated at.
required:
- $eq
- $ne
- $in
- $nin
- $like
- $ilike
- $re
- $contains
- $gt
- $gte
- $lt
- $lte
properties:
$eq: {}
$ne: {}
$in: {}
$nin: {}
$like: {}
$ilike: {}
$re: {}
$contains: {}
$gt: {}
$gte: {}
$lt: {}
$lte: {}
- name: deleted_at
in: query
description: The region's deleted at.
required: false
schema:
type: object
description: The region's deleted at.
required:
- $eq
- $ne
- $in
- $nin
- $like
- $ilike
- $re
- $contains
- $gt
- $gte
- $lt
- $lte
properties:
$eq: {}
$ne: {}
$in: {}
$nin: {}
$like: {}
$ilike: {}
$re: {}
$contains: {}
$gt: {}
$gte: {}
$lt: {}
$lte: {}
- name: $and
in: query
required: false
schema: {}
- name: $or
in: query
required: false
schema: {}
security:
- api_token: []
- cookie_auth: []
- jwt_token: []
x-codeSamples:
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_regions/get.sh
tags:
- Regions
responses:
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
post:
operationId: PostRegions
summary: Create Region
description: Create a region.
x-authenticated: true
parameters:
- name: expand
in: query
description: Comma-separated relations that should be expanded in the returned data.
required: false
schema:
type: string
title: expand
description: >-
Comma-separated relations that should be expanded in the returned
data.
- name: fields
in: query
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 fields. without prefix it will
replace the entire default fields.
required: false
schema:
type: string
title: fields
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 fields. without
prefix it will replace the entire default fields.
- name: offset
in: query
description: The number of items to skip when retrieving a list.
required: false
schema:
type: number
title: offset
description: The number of items to skip when retrieving a list.
- name: limit
in: query
description: Limit the number of items returned in the list.
required: false
schema:
type: number
title: limit
description: Limit the number of items returned in the list.
- name: order
in: query
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 `-`.
required: false
schema:
type: string
title: order
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 `-`.
security:
- api_token: []
- cookie_auth: []
- jwt_token: []
requestBody:
content:
application/json:
schema:
type: object
description: SUMMARY
required:
- name
- currency_code
- metadata
properties:
name:
type: string
title: name
description: The region's name.
currency_code:
type: string
title: currency_code
description: The region's currency code.
countries:
type: array
description: The region's countries.
items:
type: string
title: countries
description: The country's countries.
automatic_taxes:
type: boolean
title: automatic_taxes
description: The region's automatic taxes.
payment_providers:
type: array
description: The region's payment providers.
items:
type: string
title: payment_providers
description: The payment provider's payment providers.
metadata:
type: object
description: The region's metadata.
is_tax_inclusive:
type: boolean
title: is_tax_inclusive
description: The region's is tax inclusive.
x-codeSamples:
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_regions/post.sh
tags:
- Regions
responses:
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml