api-ref: custom API reference (#4770)

* initialized next.js project

* finished markdown sections

* added operation schema component

* change page metadata

* eslint fixes

* fixes related to deployment

* added response schema

* resolve max stack issue

* support for different property types

* added support for property types

* added loading for components

* added more loading

* type fixes

* added oneOf type

* removed console

* fix replace with push

* refactored everything

* use static content for description

* fixes and improvements

* added code examples section

* fix path name

* optimizations

* fixed tag navigation

* add support for admin and store references

* general enhancements

* optimizations and fixes

* fixes and enhancements

* added search bar

* loading enhancements

* added loading

* added code blocks

* added margin top

* add empty response text

* fixed oneOf parameters

* added path and query parameters

* general fixes

* added base path env variable

* small fix for arrays

* enhancements

* design enhancements

* general enhancements

* fix isRequired

* added enum values

* enhancements

* general fixes

* general fixes

* changed oas generation script

* additions to the introduction section

* added copy button for code + other enhancements

* fix response code block

* fix metadata

* formatted store introduction

* move sidebar logic to Tags component

* added test env variables

* fix code block bug

* added loading animation

* added expand param + loading

* enhance operation loading

* made responsive + improvements

* added loading provider

* fixed loading

* adjustments for small devices

* added sidebar label for endpoints

* added feedback component

* fixed analytics

* general fixes

* listen to scroll for other headings

* added sample env file

* update api ref files + support new fields

* fix for external docs link

* added new sections

* fix last item in sidebar not showing

* move docs content to www/docs

* change redirect url

* revert change

* resolve build errors

* configure rewrites

* changed to environment variable url

* revert changing environment variable name

* add environment variable for API path

* fix links

* fix tailwind settings

* remove vercel file

* reconfigured api route

* move api page under api

* fix page metadata

* fix external link in navigation bar

* update api spec

* updated api specs

* fixed google lint error

* add max-height on request samples

* add padding before loading

* fix for one of name

* fix undefined types

* general fixes

* remove response schema example

* redesigned navigation bar

* redesigned sidebar

* fixed up paddings

* added feedback component + report issue

* fixed up typography, padding, and general styling

* redesigned code blocks

* optimization

* added error timeout

* fixes

* added indexing with algolia + fixes

* fix errors with algolia script

* redesign operation sections

* fix heading scroll

* design fixes

* fix padding

* fix padding + scroll issues

* fix scroll issues

* improve scroll performance

* fixes for safari

* optimization and fixes

* fixes to docs + details animation

* padding fixes for code block

* added tab animation

* fixed incorrect link

* added selection styling

* fix lint errors

* redesigned details component

* added detailed feedback form

* api reference fixes

* fix tabs

* upgrade + fixes

* updated documentation links

* optimizations to sidebar items

* fix spacing in sidebar item

* optimizations and fixes

* fix endpoint path styling

* remove margin

* final fixes

* change margin on small devices

* generated OAS

* fixes for mobile

* added feedback modal

* optimize dark mode button

* fixed color mode useeffect

* minimize dom size

* use new style system

* radius and spacing design system

* design fixes

* fix eslint errors

* added meta files

* change cron schedule

* fix docusaurus configurations

* added operating system to feedback data

* change content directory name

* fixes to contribution guidelines

* revert renaming content

* added api-reference to documentation workflow

* fixes for search

* added dark mode + fixes

* oas fixes

* handle bugs

* added code examples for clients

* changed tooltip text

* change authentication to card

* change page title based on selected section

* redesigned mobile navbar

* fix icon colors

* fix key colors

* fix medusa-js installation command

* change external regex in algolia

* change changeset

* fix padding on mobile

* fix hydration error

* update depedencies
This commit is contained in:
Shahed Nasser
2023-08-15 18:07:54 +03:00
committed by GitHub
parent 16249ec280
commit 914d773d3a
3270 changed files with 22075 additions and 192064 deletions
@@ -0,0 +1,36 @@
get:
operationId: GetApps
summary: List Applications
description: Retrieve a list of applications registered in the Medusa backend.
x-authenticated: true
x-codegen:
method: list
x-codeSamples:
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_apps/get.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Apps Oauth
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminAppsListRes.yaml
'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
@@ -0,0 +1,43 @@
post:
operationId: PostApps
summary: Generate Token for App
description: >-
Use an app's Oauth provider to generate and store a new token for
authentication.
x-authenticated: true
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostAppsReq.yaml
x-codegen:
method: authorize
x-codeSamples:
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_apps_authorizations/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Apps Oauth
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminAppsRes.yaml
'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
@@ -0,0 +1,126 @@
get:
operationId: GetAuth
summary: Get Current User
x-authenticated: true
description: Get the currently logged in user's details.
x-codegen:
method: getSession
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_auth/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_auth/get.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Auth
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminAuthRes.yaml
'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: PostAuth
summary: User Login
x-authenticated: false
description: >-
Log a User in and includes the Cookie session in the response header. The
cookie session can be used in subsequent requests to authorize the user to
perform admin functionalities. When using Medusa's JS or Medusa React
clients, the cookie is automatically attached to subsequent requests.
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostAuthReq.yaml
x-codegen:
method: createSession
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_auth/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_auth/post.sh
tags:
- Auth
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminAuthRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/incorrect_credentials.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
delete:
operationId: DeleteAuth
summary: User Logout
x-authenticated: true
description: >-
Delete the current session for the logged in user. This will only work if
you're using Cookie session for authentication. If the API token is still
passed in the header, the user is still authorized to perform admin
functionalities in other endpoints.
x-codegen:
method: deleteSession
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_auth/delete.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_auth/delete.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Auth
responses:
'200':
description: OK
'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
@@ -0,0 +1,316 @@
get:
operationId: GetBatchJobs
summary: List Batch Jobs
description: >-
Retrieve a list of Batch Jobs. The batch jobs can be filtered by fields such
as `type` or `confirmed_at`. The batch jobs can also be sorted or paginated.
x-authenticated: true
parameters:
- in: query
name: limit
description: Limit the number of batch jobs returned.
schema:
type: integer
default: 10
- in: query
name: offset
description: The number of batch jobs to skip when retrieving the batch jobs.
schema:
type: integer
default: 0
- in: query
name: id
style: form
explode: false
description: Filter by the batch ID
schema:
oneOf:
- type: string
description: batch job ID
- type: array
description: multiple batch job IDs
items:
type: string
- in: query
name: type
style: form
explode: false
description: Filter by the batch type
schema:
type: array
items:
type: string
- in: query
name: confirmed_at
style: form
explode: false
description: Filter by a confirmation date range.
schema:
type: object
properties:
lt:
type: string
description: filter by dates less than this date
format: date
gt:
type: string
description: filter by dates greater than this date
format: date
lte:
type: string
description: filter by dates less than or equal to this date
format: date
gte:
type: string
description: filter by dates greater than or equal to this date
format: date
- in: query
name: pre_processed_at
style: form
explode: false
description: Filter by a pre-processing date range.
schema:
type: object
properties:
lt:
type: string
description: filter by dates less than this date
format: date
gt:
type: string
description: filter by dates greater than this date
format: date
lte:
type: string
description: filter by dates less than or equal to this date
format: date
gte:
type: string
description: filter by dates greater than or equal to this date
format: date
- in: query
name: completed_at
style: form
explode: false
description: Filter by a completion date range.
schema:
type: object
properties:
lt:
type: string
description: filter by dates less than this date
format: date
gt:
type: string
description: filter by dates greater than this date
format: date
lte:
type: string
description: filter by dates less than or equal to this date
format: date
gte:
type: string
description: filter by dates greater than or equal to this date
format: date
- in: query
name: failed_at
style: form
explode: false
description: Filter by a failure date range.
schema:
type: object
properties:
lt:
type: string
description: filter by dates less than this date
format: date
gt:
type: string
description: filter by dates greater than this date
format: date
lte:
type: string
description: filter by dates less than or equal to this date
format: date
gte:
type: string
description: filter by dates greater than or equal to this date
format: date
- in: query
name: canceled_at
style: form
explode: false
description: Filter by a cancelation date range.
schema:
type: object
properties:
lt:
type: string
description: filter by dates less than this date
format: date
gt:
type: string
description: filter by dates greater than this date
format: date
lte:
type: string
description: filter by dates less than or equal to this date
format: date
gte:
type: string
description: filter by dates greater than or equal to this date
format: date
- in: query
name: order
description: A batch-job field to sort-order the retrieved batch jobs by.
schema:
type: string
- in: query
name: expand
description: >-
Comma-separated relations that should be expanded in the returned batch
jobs.
schema:
type: string
- in: query
name: fields
description: >-
Comma-separated fields that should be included in the returned batch
jobs.
schema:
type: string
- in: query
name: created_at
style: form
explode: false
description: Filter by a creation date range.
schema:
type: object
properties:
lt:
type: string
description: filter by dates less than this date
format: date
gt:
type: string
description: filter by dates greater than this date
format: date
lte:
type: string
description: filter by dates less than or equal to this date
format: date
gte:
type: string
description: filter by dates greater than or equal to this date
format: date
- in: query
name: updated_at
style: form
explode: false
description: Filter by an update date range.
schema:
type: object
properties:
lt:
type: string
description: filter by dates less than this date
format: date
gt:
type: string
description: filter by dates greater than this date
format: date
lte:
type: string
description: filter by dates less than or equal to this date
format: date
gte:
type: string
description: filter by dates greater than or equal to this date
format: date
x-codegen:
method: list
queryParams: AdminGetBatchParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_batch-jobs/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_batch-jobs/get.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Batch Jobs
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminBatchJobListRes.yaml
'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: PostBatchJobs
summary: Create a Batch Job
description: >-
Create a Batch Job to be executed asynchronously in the Medusa backend. If
`dry_run` is set to `true`, the batch job will not be executed until the it
is confirmed, which can be done using the Confirm Batch Job endpoint.
externalDocs:
description: How to create a batch job
url: https://docs.medusajs.com/development/batch-jobs/create#create-batch-job
x-authenticated: true
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostBatchesReq.yaml
x-codegen:
method: create
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_batch-jobs/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_batch-jobs/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Batch Jobs
responses:
'201':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminBatchJobRes.yaml
'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
@@ -0,0 +1,47 @@
get:
operationId: GetBatchJobsBatchJob
summary: Get a Batch Job
description: Retrieve the details of a batch job.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Batch Job
schema:
type: string
x-codegen:
method: retrieve
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_batch-jobs_{id}/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_batch-jobs_{id}/get.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Batch Jobs
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminBatchJobRes.yaml
'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
@@ -0,0 +1,49 @@
post:
operationId: PostBatchJobsBatchJobCancel
summary: Cancel a Batch Job
description: >-
Mark a batch job as canceled. When a batch job is canceled, the processing
of the batch job doesnt automatically stop.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the batch job.
schema:
type: string
x-codegen:
method: cancel
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_batch-jobs_{id}_cancel/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_batch-jobs_{id}_cancel/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Batch Jobs
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminBatchJobRes.yaml
'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
@@ -0,0 +1,50 @@
post:
operationId: PostBatchJobsBatchJobConfirmProcessing
summary: Confirm a Batch Job
description: >-
When a batch job is created, it is not executed automatically if `dry_run`
is set to `true`. This endpoint confirms that the batch job should be
executed.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the batch job.
schema:
type: string
x-codegen:
method: confirm
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_batch-jobs_{id}_confirm/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_batch-jobs_{id}_confirm/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Batch Jobs
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminBatchJobRes.yaml
'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
@@ -0,0 +1,188 @@
get:
operationId: GetCollections
summary: List Collections
description: >-
Retrieve a list of Product Collection. The product collections can be
filtered by fields such as `handle` or `title`. The collections can also be
sorted or paginated.
x-authenticated: true
parameters:
- in: query
name: limit
description: The number of collections to return.
schema:
type: integer
default: 10
- in: query
name: offset
description: The number of collections to skip when retrieving the collections.
schema:
type: integer
default: 0
- in: query
name: title
description: Filter collections by their title.
schema:
type: string
- in: query
name: handle
description: Filter collections by their handle.
schema:
type: string
- in: query
name: q
description: a term to search collections by their title or handle.
schema:
type: string
- in: query
name: discount_condition_id
description: Filter collections by a discount condition ID associated with them.
schema:
type: string
- in: query
name: created_at
description: Filter by a creation date range.
schema:
type: object
properties:
lt:
type: string
description: filter by dates less than this date
format: date
gt:
type: string
description: filter by dates greater than this date
format: date
lte:
type: string
description: filter by dates less than or equal to this date
format: date
gte:
type: string
description: filter by dates greater than or equal to this date
format: date
- in: query
name: updated_at
description: Filter by an update date range.
schema:
type: object
properties:
lt:
type: string
description: filter by dates less than this date
format: date
gt:
type: string
description: filter by dates greater than this date
format: date
lte:
type: string
description: filter by dates less than or equal to this date
format: date
gte:
type: string
description: filter by dates greater than or equal to this date
format: date
- in: query
name: deleted_at
description: Filter by a deletion date range.
schema:
type: object
properties:
lt:
type: string
description: filter by dates less than this date
format: date
gt:
type: string
description: filter by dates greater than this date
format: date
lte:
type: string
description: filter by dates less than or equal to this date
format: date
gte:
type: string
description: filter by dates greater than or equal to this date
format: date
x-codegen:
method: list
queryParams: AdminGetCollectionsParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_collections/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_collections/get.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Product Collections
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminCollectionsListRes.yaml
'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: PostCollections
summary: Create a Collection
description: Create a Product Collection.
x-authenticated: true
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostCollectionsReq.yaml
x-codegen:
method: create
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_collections/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_collections/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Product Collections
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminCollectionsRes.yaml
'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
@@ -0,0 +1,148 @@
get:
operationId: GetCollectionsCollection
summary: Get a Collection
description: >-
Retrieve a Product Collection by its ID. The products associated with it are
expanded and returned as well.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Product Collection
schema:
type: string
x-codegen:
method: retrieve
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_collections_{id}/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_collections_{id}/get.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Product Collections
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminCollectionsRes.yaml
'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: PostCollectionsCollection
summary: Update a Collection
description: Update a Product Collection's details.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Collection.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostCollectionsCollectionReq.yaml
x-codegen:
method: update
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_collections_{id}/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_collections_{id}/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Product Collections
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminCollectionsRes.yaml
'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
delete:
operationId: DeleteCollectionsCollection
summary: Delete a Collection
description: Delete a Product Collection. This does not delete associated products.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Collection.
schema:
type: string
x-codegen:
method: delete
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_collections_{id}/delete.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_collections_{id}/delete.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Product Collections
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminCollectionsDeleteRes.yaml
'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
@@ -0,0 +1,108 @@
post:
operationId: PostProductsToCollection
summary: Add Products to Collection
description: Add products to a product collection.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the product collection.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostProductsToCollectionReq.yaml
x-codegen:
method: addProducts
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/admin_collections_{id}_products_batch/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_collections_{id}_products_batch/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Product Collections
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminCollectionsRes.yaml
'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
delete:
operationId: DeleteProductsFromCollection
summary: Remove Products from Collection
description: >-
Remove a list of products from a collection. This would not delete the
product, only the association between the product and the collection.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Product Collection.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminDeleteProductsFromCollectionReq.yaml
x-codegen:
method: removeProducts
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/admin_collections_{id}_products_batch/delete.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_collections_{id}_products_batch/delete.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Product Collections
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminDeleteProductsFromCollectionRes.yaml
'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
@@ -0,0 +1,57 @@
get:
operationId: GetCurrencies
summary: List Currency
description: >-
Retrieve a list of currencies. The currencies can be filtered by fields such
as `code`. The currencies can also be sorted or paginated.
x-authenticated: true
parameters:
- in: query
name: code
description: filter by currency code.
schema:
type: string
- in: query
name: includes_tax
description: filter currencies by whether they include taxes or not.
schema:
type: boolean
x-featureFlag: tax_inclusive_pricing
- in: query
name: order
description: A field to sort order the retrieved currencies by.
schema:
type: string
- in: query
name: offset
description: The number of currencies to skip when retrieving the currencies.
schema:
type: number
default: '0'
- in: query
name: limit
description: The number of currencies to return.
schema:
type: number
default: '20'
x-codegen:
method: list
queryParams: AdminGetCurrenciesParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_currencies/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_currencies/get.sh
tags:
- Currencies
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminCurrenciesListRes.yaml
@@ -0,0 +1,37 @@
post:
operationId: PostCurrenciesCurrency
summary: Update a Currency
description: Update a Currency's details.
x-authenticated: true
parameters:
- in: path
name: code
required: true
description: The code of the Currency.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostCurrenciesCurrencyReq.yaml
x-codegen:
method: update
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_currencies_{code}/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_currencies_{code}/post.sh
tags:
- Currencies
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminCurrenciesRes.yaml
@@ -0,0 +1,208 @@
get:
operationId: GetCustomerGroups
summary: List Customer Groups
description: >-
Retrieve a list of customer groups. The customer groups can be filtered by
fields such as `name` or `id. The customer groups can also be sorted or
paginated.
x-authenticated: true
parameters:
- in: query
name: q
description: term to search customer groups by name.
schema:
type: string
- in: query
name: offset
description: >-
The number of customer groups to skip when retrieving the customer
groups.
schema:
type: integer
default: 0
- in: query
name: order
description: A field to sort order the retrieved customer groups by.
schema:
type: string
- in: query
name: discount_condition_id
description: Filter by discount condition ID.
schema:
type: string
- in: query
name: id
style: form
explode: false
description: Filter by the customer group ID
schema:
oneOf:
- type: string
description: customer group ID
- type: array
description: an array of customer group IDs
items:
type: string
- type: object
properties:
lt:
type: string
description: filter by IDs less than this ID
gt:
type: string
description: filter by IDs greater than this ID
lte:
type: string
description: filter by IDs less than or equal to this ID
gte:
type: string
description: filter by IDs greater than or equal to this ID
- in: query
name: name
style: form
explode: false
description: Filter by the customer group name
schema:
type: array
description: an array of customer group names
items:
type: string
description: customer group name
- in: query
name: created_at
description: Filter by a creation date range.
schema:
type: object
properties:
lt:
type: string
description: filter by dates less than this date
format: date
gt:
type: string
description: filter by dates greater than this date
format: date
lte:
type: string
description: filter by dates less than or equal to this date
format: date
gte:
type: string
description: filter by dates greater than or equal to this date
format: date
- in: query
name: updated_at
description: Filter by an update date range.
schema:
type: object
properties:
lt:
type: string
description: filter by dates less than this date
format: date
gt:
type: string
description: filter by dates greater than this date
format: date
lte:
type: string
description: filter by dates less than or equal to this date
format: date
gte:
type: string
description: filter by dates greater than or equal to this date
format: date
- in: query
name: limit
description: The number of customer groups to return.
schema:
type: integer
default: 10
- in: query
name: expand
description: >-
Comma-separated relations that should be expanded in the returned
customer groups.
schema:
type: string
x-codegen:
method: list
queryParams: AdminGetCustomerGroupsParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_customer-groups/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_customer-groups/get.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Customer Groups
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminCustomerGroupsListRes.yaml
'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: PostCustomerGroups
summary: Create a Customer Group
description: Creates a Customer Group.
x-authenticated: true
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostCustomerGroupsReq.yaml
x-codegen:
method: create
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_customer-groups/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_customer-groups/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Customer Groups
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminCustomerGroupsRes.yaml
'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
@@ -0,0 +1,165 @@
get:
operationId: GetCustomerGroupsGroup
summary: Get a Customer Group
description: >-
Retrieve a Customer Group by its ID. You can expand the customer group's
relations or select the fields that should be returned.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Customer Group.
schema:
type: string
- in: query
name: expand
description: >-
Comma-separated relations that should be expanded in the returned
customer group.
schema:
type: string
- in: query
name: fields
description: >-
Comma-separated fields that should be included in the returned customer
group.
schema:
type: string
x-codegen:
method: retrieve
queryParams: AdminGetCustomerGroupsGroupParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_customer-groups_{id}/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_customer-groups_{id}/get.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Customer Groups
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminCustomerGroupsRes.yaml
'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: PostCustomerGroupsGroup
summary: Update a Customer Group
description: Update a Customer Group's details.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the customer group.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostCustomerGroupsGroupReq.yaml
x-codegen:
method: update
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_customer-groups_{id}/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_customer-groups_{id}/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Customer Groups
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminCustomerGroupsRes.yaml
'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
delete:
operationId: DeleteCustomerGroupsCustomerGroup
summary: Delete a Customer Group
description: >-
Delete a customer group. This doesn't delete the customers associated with
the customer group.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Customer Group
schema:
type: string
x-codegen:
method: delete
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_customer-groups_{id}/delete.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_customer-groups_{id}/delete.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Customer Groups
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminCustomerGroupsDeleteRes.yaml
'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
@@ -0,0 +1,74 @@
get:
operationId: GetCustomerGroupsGroupCustomers
summary: List Customers
description: >-
Retrieve a list of customers in a customer group. The customers can be
filtered by the `q` field. The customers can also be paginated.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the customer group.
schema:
type: string
- in: query
name: limit
description: The number of customers to return.
schema:
type: integer
default: 50
- in: query
name: offset
description: The number of customers to skip when retrieving the customers.
schema:
type: integer
default: 0
- in: query
name: expand
description: >-
Comma-separated relations that should be expanded in the returned
customers.
schema:
type: string
- in: query
name: q
description: a term to search customers by email, first_name, and last_name.
schema:
type: string
x-codegen:
method: listCustomers
queryParams: AdminGetGroupsGroupCustomersParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_customer-groups_{id}_customers/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_customer-groups_{id}_customers/get.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Customer Groups
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminCustomersListRes.yaml
'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
@@ -0,0 +1,112 @@
post:
operationId: PostCustomerGroupsGroupCustomersBatch
summary: Add Customers to Group
description: Add a list of customers to a customer group.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the customer group.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: >-
../components/schemas/AdminPostCustomerGroupsGroupCustomersBatchReq.yaml
x-codegen:
method: addCustomers
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/admin_customer-groups_{id}_customers_batch/post.js
- lang: Shell
label: cURL
source:
$ref: >-
../code_samples/Shell/admin_customer-groups_{id}_customers_batch/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Customer Groups
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminCustomerGroupsRes.yaml
'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
delete:
operationId: DeleteCustomerGroupsGroupCustomerBatch
summary: Remove Customers from Group
description: >-
Remove a list of customers from a customer group. This doesn't delete the
customer, only the association between the customer and the customer group.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the customer group.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: >-
../components/schemas/AdminDeleteCustomerGroupsGroupCustomerBatchReq.yaml
x-codegen:
method: removeCustomers
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/admin_customer-groups_{id}_customers_batch/delete.js
- lang: Shell
label: cURL
source:
$ref: >-
../code_samples/Shell/admin_customer-groups_{id}_customers_batch/delete.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Customer Groups
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminCustomerGroupsRes.yaml
'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
@@ -0,0 +1,122 @@
get:
operationId: GetCustomers
summary: List Customers
description: >-
Retrieve a list of Customers. The customers can be filtered by fields such
as `q` or `groups`. The customers can also be paginated.
x-authenticated: true
parameters:
- in: query
name: limit
description: The number of customers to return.
schema:
type: integer
default: 50
- in: query
name: offset
description: The number of customers to skip when retrieving the customers.
schema:
type: integer
default: 0
- in: query
name: expand
description: >-
Comma-separated relations that should be expanded in the returned
customer.
schema:
type: string
- in: query
name: q
description: term to search customers' email, first_name, and last_name fields.
schema:
type: string
- in: query
name: groups
style: form
explode: false
description: Filter by customer group IDs.
schema:
type: array
items:
type: string
x-codegen:
method: list
queryParams: AdminGetCustomersParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_customers/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_customers/get.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Customers
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminCustomersListRes.yaml
'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: PostCustomers
summary: Create a Customer
description: Allow admins to create a customer.
x-authenticated: true
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostCustomersReq.yaml
x-codegen:
method: create
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_customers/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_customers/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Customers
responses:
'201':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminCustomersRes.yaml
'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
@@ -0,0 +1,125 @@
get:
operationId: GetCustomersCustomer
summary: Get a Customer
description: Retrieve the details of a customer.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Customer.
schema:
type: string
- in: query
name: expand
description: >-
Comma-separated relations that should be expanded in the returned
customer.
schema:
type: string
- in: query
name: fields
description: Comma-separated fields that should be included in the returned customer.
schema:
type: string
x-codegen:
method: retrieve
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_customers_{id}/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_customers_{id}/get.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Customers
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminCustomersRes.yaml
'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: PostCustomersCustomer
summary: Update a Customer
description: Update a Customer's details.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Customer.
schema:
type: string
- in: query
name: expand
description: >-
Comma-separated relations that should be expanded in the returned
customer.
schema:
type: string
- in: query
name: fields
description: >-
Comma-separated fields that should be retrieved in the returned
customer.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostCustomersCustomerReq.yaml
x-codegen:
method: update
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_customers_{id}/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_customers_{id}/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Customers
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminCustomersRes.yaml
'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
@@ -0,0 +1,160 @@
get:
operationId: GetDiscounts
summary: List Discounts
x-authenticated: true
description: >-
Retrieve a list of Discounts. The discounts can be filtered by fields such
as `rule` or `is_dynamic`. The discounts can also be paginated.
parameters:
- in: query
name: q
description: term to search discounts' code field.
schema:
type: string
- in: query
name: rule
description: Filter discounts by rule fields.
schema:
type: object
properties:
type:
type: string
enum:
- fixed
- percentage
- free_shipping
description: Filter discounts by type.
allocation:
type: string
enum:
- total
- item
description: Filter discounts by allocation type.
- in: query
name: is_dynamic
description: Filter discounts by whether they're dynamic or not.
schema:
type: boolean
- in: query
name: is_disabled
description: Filter discounts by whether they're disabled or not.
schema:
type: boolean
- in: query
name: limit
description: The number of discounts to return
schema:
type: number
default: '20'
- in: query
name: offset
description: The number of discounts to skip when retrieving the discounts.
schema:
type: number
default: '0'
- in: query
name: expand
description: >-
Comma-separated relations that should be expanded in each returned
discount.
schema:
type: string
x-codegen:
method: list
queryParams: AdminGetDiscountsParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_discounts/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_discounts/get.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Discounts
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminDiscountsListRes.yaml
'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: PostDiscounts
summary: Create a Discount
x-authenticated: true
description: >-
Create a Discount with a given set of rules that defines how the Discount is
applied.
parameters:
- in: query
name: expand
description: >-
Comma-separated relations that should be expanded in the returned
discount.
schema:
type: string
- in: query
name: fields
description: >-
Comma-separated fields that should be retrieved in the returned
discount.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostDiscountsReq.yaml
x-codegen:
method: create
queryParams: AdminPostDiscountsParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_discounts/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_discounts/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Discounts
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminDiscountsRes.yaml
'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
@@ -0,0 +1,60 @@
get:
operationId: GetDiscountsDiscountCode
summary: Get Discount by Code
description: Retrieve a Discount's details by its discount code
x-authenticated: true
parameters:
- in: path
name: code
required: true
description: The code of the Discount
schema:
type: string
- in: query
name: expand
description: >-
Comma-separated relations that should be expanded in the returned
discount.
schema:
type: string
- in: query
name: fields
description: Comma-separated fields that should be included in the returned discount.
schema:
type: string
x-codegen:
method: retrieveByCode
queryParams: AdminGetDiscountsDiscountCodeParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_discounts_code_{code}/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_discounts_code_{code}/get.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Discounts
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminDiscountsRes.yaml
'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
@@ -0,0 +1,71 @@
post:
operationId: PostDiscountsDiscountConditions
summary: Create a Condition
description: >-
Create a Discount Condition. Only one of `products`, `product_types`,
`product_collections`, `product_tags`, and `customer_groups` should be
provided, based on the type of discount condition. For example, if the
discount condition's type is `products`, the `products` field should be
provided in the request body.
x-authenticated: true
parameters:
- in: path
name: discount_id
required: true
description: The ID of the discount.
schema:
type: string
- in: query
name: expand
description: >-
Comma-separated relations that should be expanded in the returned
discount.
schema:
type: string
- in: query
name: fields
description: Comma-separated fields that should be included in the returned discount.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostDiscountsDiscountConditions.yaml
x-codegen:
method: createCondition
queryParams: AdminPostDiscountsDiscountConditionsParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/admin_discounts_{discount_id}_conditions/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_discounts_{discount_id}_conditions/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Discounts
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminDiscountsRes.yaml
'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
@@ -0,0 +1,219 @@
get:
operationId: GetDiscountsDiscountConditionsCondition
summary: Get a Condition
description: Retrieve a Discount Condition's details.
x-authenticated: true
parameters:
- in: path
name: discount_id
required: true
description: The ID of the Discount.
schema:
type: string
- in: path
name: condition_id
required: true
description: The ID of the Discount Condition.
schema:
type: string
- in: query
name: expand
description: >-
Comma-separated relations that should be expanded in the returned
discount condition.
schema:
type: string
- in: query
name: fields
description: >-
Comma-separated fields that should be included in the returned discount
condition.
schema:
type: string
x-codegen:
method: getCondition
queryParams: AdminGetDiscountsDiscountConditionsConditionParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/admin_discounts_{discount_id}_conditions_{condition_id}/get.js
- lang: Shell
label: cURL
source:
$ref: >-
../code_samples/Shell/admin_discounts_{discount_id}_conditions_{condition_id}/get.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Discounts
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminDiscountConditionsRes.yaml
'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: PostDiscountsDiscountConditionsCondition
summary: Update a Condition
description: >-
Update a Discount Condition. Only one of `products`, `product_types`,
`product_collections`, `product_tags`, and `customer_groups` should be
provided, based on the type of discount condition. For example, if the
discount condition's type is `products`, the `products` field should be
provided in the request body.
x-authenticated: true
parameters:
- in: path
name: discount_id
required: true
description: The ID of the Discount.
schema:
type: string
- in: path
name: condition_id
required: true
description: The ID of the Discount Condition.
schema:
type: string
- in: query
name: expand
description: >-
Comma-separated relations that should be expanded in the returned
discount.
schema:
type: string
- in: query
name: fields
description: Comma-separated fields that should be included in the returned discount.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: >-
../components/schemas/AdminPostDiscountsDiscountConditionsCondition.yaml
x-codegen:
method: updateCondition
queryParams: AdminPostDiscountsDiscountConditionsConditionParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/admin_discounts_{discount_id}_conditions_{condition_id}/post.js
- lang: Shell
label: cURL
source:
$ref: >-
../code_samples/Shell/admin_discounts_{discount_id}_conditions_{condition_id}/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Discounts
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminDiscountsRes.yaml
'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
delete:
operationId: DeleteDiscountsDiscountConditionsCondition
summary: Delete a Condition
description: >-
Deletes a Discount Condition. This does not delete resources associated to
the discount condition.
x-authenticated: true
parameters:
- in: path
name: discount_id
required: true
description: The ID of the Discount
schema:
type: string
- in: path
name: condition_id
required: true
description: The ID of the Discount Condition
schema:
type: string
- in: query
name: expand
description: >-
Comma-separated relations that should be expanded in the returned
discount.
schema:
type: string
- in: query
name: fields
description: Comma-separated fields that should be included in the returned discount.
schema:
type: string
x-codegen:
method: deleteCondition
queryParams: AdminDeleteDiscountsDiscountConditionsConditionParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/admin_discounts_{discount_id}_conditions_{condition_id}/delete.js
- lang: Shell
label: cURL
source:
$ref: >-
../code_samples/Shell/admin_discounts_{discount_id}_conditions_{condition_id}/delete.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Discounts
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminDiscountConditionsDeleteRes.yaml
'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
@@ -0,0 +1,154 @@
post:
operationId: PostDiscountsDiscountConditionsConditionBatch
summary: Add Batch Resources
description: >-
Add a batch of resources to a discount condition. The type of resource
depends on the type of discount condition. For example, if the discount
condition's type is `products`, the resources being added should be
products.
x-authenticated: true
parameters:
- in: path
name: discount_id
required: true
description: The ID of the discount the condition belongs to.
schema:
type: string
- in: path
name: condition_id
required: true
description: The ID of the discount condition on which to add the item.
schema:
type: string
- in: query
name: expand
description: >-
Comma-separated relations that should be expanded in the returned
discount.
schema:
type: string
- in: query
name: fields
description: Comma-separated fields that should be included in the returned discount.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: >-
../components/schemas/AdminPostDiscountsDiscountConditionsConditionBatchReq.yaml
x-codegen:
method: addConditionResourceBatch
queryParams: AdminPostDiscountsDiscountConditionsConditionBatchParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/admin_discounts_{discount_id}_conditions_{condition_id}_batch/post.js
- lang: Shell
label: cURL
source:
$ref: >-
../code_samples/Shell/admin_discounts_{discount_id}_conditions_{condition_id}_batch/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Discounts
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminDiscountsRes.yaml
'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
delete:
operationId: DeleteDiscountsDiscountConditionsConditionBatch
summary: Remove Batch Resources
description: >-
Remove a batch of resources from a discount condition. This will only remove
the association between the resource and the discount condition, but not the
resource itself.
x-authenticated: true
parameters:
- in: path
name: discount_id
required: true
description: The ID of the discount.
schema:
type: string
- in: path
name: condition_id
required: true
description: The ID of the condition to remove the resources from.
schema:
type: string
- in: query
name: expand
description: >-
Comma-separated relations that should be expanded in the returned
discount.
schema:
type: string
- in: query
name: fields
description: Comma-separated fields that should be included in the returned discount.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: >-
../components/schemas/AdminDeleteDiscountsDiscountConditionsConditionBatchReq.yaml
x-codegen:
method: deleteConditionResourceBatch
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/admin_discounts_{discount_id}_conditions_{condition_id}_batch/delete.js
- lang: Shell
label: cURL
source:
$ref: >-
../code_samples/Shell/admin_discounts_{discount_id}_conditions_{condition_id}_batch/delete.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Discounts
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminDiscountsRes.yaml
'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
@@ -0,0 +1,178 @@
get:
operationId: GetDiscountsDiscount
summary: Get a Discount
description: Retrieves a Discount
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Discount
schema:
type: string
- in: query
name: expand
description: >-
Comma-separated relations that should be expanded in the returned
discount.
schema:
type: string
- in: query
name: fields
description: Comma-separated fields that should be included in the returned discount.
schema:
type: string
x-codegen:
method: retrieve
queryParams: AdminGetDiscountParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_discounts_{id}/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_discounts_{id}/get.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Discounts
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminDiscountsRes.yaml
'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: PostDiscountsDiscount
summary: Update a Discount
description: >-
Update a Discount with a given set of rules that define how the Discount is
applied.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Discount.
schema:
type: string
- in: query
name: expand
description: >-
Comma-separated relations that should be expanded in the returned
discount.
schema:
type: string
- in: query
name: fields
description: >-
Comma-separated fields that should be retrieved in the returned
discount.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostDiscountsDiscountReq.yaml
x-codegen:
method: update
queryParams: AdminPostDiscountsDiscountParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_discounts_{id}/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_discounts_{id}/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Discounts
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminDiscountsRes.yaml
'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
delete:
operationId: DeleteDiscountsDiscount
summary: Delete a Discount
description: >-
Delete a Discount. Deleting the discount will make it unavailable for
customers to use.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Discount
schema:
type: string
x-codegen:
method: delete
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_discounts_{id}/delete.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_discounts_{id}/delete.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Discounts
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminDiscountsDeleteRes.yaml
'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
@@ -0,0 +1,55 @@
post:
operationId: PostDiscountsDiscountDynamicCodes
summary: Create a Dynamic Code
description: >-
Create a dynamic unique code that can map to a parent Discount. This is
useful if you want to automatically generate codes with the same rules and
conditions.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Discount to create the dynamic code for."
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostDiscountsDiscountDynamicCodesReq.yaml
x-codegen:
method: createDynamicCode
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_discounts_{id}_dynamic-codes/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_discounts_{id}_dynamic-codes/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Discounts
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminDiscountsRes.yaml
'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
@@ -0,0 +1,55 @@
delete:
operationId: DeleteDiscountsDiscountDynamicCodesCode
summary: Delete a Dynamic Code
description: Delete a dynamic code from a Discount.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Discount
schema:
type: string
- in: path
name: code
required: true
description: The dynamic code to delete
schema:
type: string
x-codegen:
method: deleteDynamicCode
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/admin_discounts_{id}_dynamic-codes_{code}/delete.js
- lang: Shell
label: cURL
source:
$ref: >-
../code_samples/Shell/admin_discounts_{id}_dynamic-codes_{code}/delete.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Discounts
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminDiscountsRes.yaml
'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
@@ -0,0 +1,112 @@
post:
operationId: PostDiscountsDiscountRegionsRegion
summary: Add Region to Discount
description: Add a Region to the list of Regions a Discount can be used in.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Discount.
schema:
type: string
- in: path
name: region_id
required: true
description: The ID of the Region.
schema:
type: string
x-codegen:
method: addRegion
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/admin_discounts_{id}_regions_{region_id}/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_discounts_{id}_regions_{region_id}/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Discounts
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminDiscountsRes.yaml
'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
delete:
operationId: DeleteDiscountsDiscountRegionsRegion
summary: Remove Region
x-authenticated: true
description: >-
Remove a Region from the list of Regions that a Discount can be used in.
This does not delete a region, only the association between it and the
discount.
parameters:
- in: path
name: id
required: true
description: The ID of the Discount.
schema:
type: string
- in: path
name: region_id
required: true
description: The ID of the Region.
schema:
type: string
x-codegen:
method: removeRegion
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/admin_discounts_{id}_regions_{region_id}/delete.js
- lang: Shell
label: cURL
source:
$ref: >-
../code_samples/Shell/admin_discounts_{id}_regions_{region_id}/delete.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Discounts
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminDiscountsRes.yaml
'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
@@ -0,0 +1,110 @@
get:
operationId: GetDraftOrders
summary: List Draft Orders
description: >-
Retrieve an list of Draft Orders. The draft orders can be filtered by fields
such as `q`. The draft orders can also paginated.
x-authenticated: true
parameters:
- in: query
name: offset
description: The number of draft orders to skip when retrieving the draft orders.
schema:
type: number
default: '0'
- in: query
name: limit
description: Limit the number of draft orders returned.
schema:
type: number
default: '50'
- in: query
name: q
description: >-
a term to search draft orders' display IDs and emails in the draft
order's cart
schema:
type: string
x-codegen:
method: list
queryParams: AdminGetDraftOrdersParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_draft-orders/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_draft-orders/get.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Draft Orders
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminDraftOrdersListRes.yaml
'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: PostDraftOrders
summary: Create a Draft Order
description: >-
Create a Draft Order. A draft order is not transformed into an order until
payment is captured.
x-authenticated: true
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostDraftOrdersReq.yaml
x-codegen:
method: create
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_draft-orders/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_draft-orders/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Draft Orders
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminDraftOrdersRes.yaml
'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
@@ -0,0 +1,146 @@
get:
operationId: GetDraftOrdersDraftOrder
summary: Get a Draft Order
description: Retrieve a Draft Order's details.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Draft Order.
schema:
type: string
x-codegen:
method: retrieve
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_draft-orders_{id}/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_draft-orders_{id}/get.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Draft Orders
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminDraftOrdersRes.yaml
'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: PostDraftOrdersDraftOrder
summary: Update a Draft Order
description: Update a Draft Order's details.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Draft Order.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostDraftOrdersDraftOrderReq.yaml
x-codegen:
method: update
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_draft-orders_{id}/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_draft-orders_{id}/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Draft Orders
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminDraftOrdersRes.yaml
'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
delete:
operationId: DeleteDraftOrdersDraftOrder
summary: Delete a Draft Order
description: Delete a Draft Order
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Draft Order.
schema:
type: string
x-codegen:
method: delete
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_draft-orders_{id}/delete.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_draft-orders_{id}/delete.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Draft Orders
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminDraftOrdersDeleteRes.yaml
'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
@@ -0,0 +1,53 @@
post:
operationId: PostDraftOrdersDraftOrderLineItems
summary: Create a Line Item
description: Create a Line Item in the Draft Order.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Draft Order.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: >-
../components/schemas/AdminPostDraftOrdersDraftOrderLineItemsReq.yaml
x-codegen:
method: addLineItem
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_draft-orders_{id}_line-items/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_draft-orders_{id}_line-items/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Draft Orders
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminDraftOrdersRes.yaml
'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
@@ -0,0 +1,116 @@
post:
operationId: PostDraftOrdersDraftOrderLineItemsItem
summary: Update a Line Item
description: Update a Line Item in a Draft Order
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Draft Order.
schema:
type: string
- in: path
name: line_id
required: true
description: The ID of the Line Item.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: >-
../components/schemas/AdminPostDraftOrdersDraftOrderLineItemsItemReq.yaml
x-codegen:
method: updateLineItem
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/admin_draft-orders_{id}_line-items_{line_id}/post.js
- lang: Shell
label: cURL
source:
$ref: >-
../code_samples/Shell/admin_draft-orders_{id}_line-items_{line_id}/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Draft Orders
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminDraftOrdersRes.yaml
'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
delete:
operationId: DeleteDraftOrdersDraftOrderLineItemsItem
summary: Delete a Line Item
description: Deletes a Line Item from a Draft Order.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Draft Order.
schema:
type: string
- in: path
name: line_id
required: true
description: The ID of the line item.
schema:
type: string
x-codegen:
method: removeLineItem
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/admin_draft-orders_{id}_line-items_{line_id}/delete.js
- lang: Shell
label: cURL
source:
$ref: >-
../code_samples/Shell/admin_draft-orders_{id}_line-items_{line_id}/delete.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Draft Orders
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminDraftOrdersRes.yaml
'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
@@ -0,0 +1,53 @@
post:
summary: Mark Paid
operationId: PostDraftOrdersDraftOrderRegisterPayment
description: >-
Capture the draft order's payment. This will also set the draft order's
status to `completed` and create an Order from the draft order. The payment
is captured through Medusa's system payment, which is manual payment that
isn't integrated with any third-party payment provider. It is assumed that
the payment capturing is handled manually by the admin.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The Draft Order ID.
schema:
type: string
x-codegen:
method: markPaid
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_draft-orders_{id}_pay/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_draft-orders_{id}_pay/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Draft Orders
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: >-
../components/schemas/AdminPostDraftOrdersDraftOrderRegisterPaymentRes.yaml
'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
@@ -0,0 +1,108 @@
get:
operationId: GetGiftCards
summary: List Gift Cards
description: >-
Retrieve a list of Gift Cards. The gift cards can be filtered by fields such
as `q`. The gift cards can also paginated.
x-authenticated: true
parameters:
- in: query
name: offset
description: The number of gift cards to skip when retrieving the gift cards.
schema:
type: number
default: '0'
- in: query
name: limit
description: Limit the number of gift cards returned.
schema:
type: number
default: '50'
- in: query
name: q
description: a term to search gift cards' code or display ID
schema:
type: string
x-codegen:
method: list
queryParams: AdminGetGiftCardsParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_gift-cards/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_gift-cards/get.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Gift Cards
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminGiftCardsListRes.yaml
'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: PostGiftCards
summary: Create a Gift Card
description: >-
Create a Gift Card that can redeemed by its unique code. The Gift Card is
only valid within 1 region.
x-authenticated: true
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostGiftCardsReq.yaml
x-codegen:
method: create
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_gift-cards/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_gift-cards/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Gift Cards
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminGiftCardsRes.yaml
'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
@@ -0,0 +1,146 @@
get:
operationId: GetGiftCardsGiftCard
summary: Get a Gift Card
description: Retrieve a Gift Card's details.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Gift Card.
schema:
type: string
x-codegen:
method: retrieve
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_gift-cards_{id}/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_gift-cards_{id}/get.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Gift Cards
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminGiftCardsRes.yaml
'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: PostGiftCardsGiftCard
summary: Update a Gift Card
description: Update a Gift Card's details.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Gift Card.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostGiftCardsGiftCardReq.yaml
x-codegen:
method: update
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_gift-cards_{id}/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_gift-cards_{id}/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Gift Cards
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminGiftCardsRes.yaml
'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
delete:
operationId: DeleteGiftCardsGiftCard
summary: Delete a Gift Card
description: Delete a Gift Card. Once deleted, it can't be used by customers.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Gift Card to delete.
schema:
type: string
x-codegen:
method: delete
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_gift-cards_{id}/delete.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_gift-cards_{id}/delete.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Gift Cards
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminGiftCardsDeleteRes.yaml
'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
@@ -0,0 +1,212 @@
get:
operationId: GetInventoryItems
summary: List Inventory Items
description: >-
Retrieve a list of inventory items. The inventory items can be filtered by
fields such as `q` or `location_id`. The inventory items can also be
paginated.
x-authenticated: true
parameters:
- in: query
name: offset
description: >-
The number of inventory items to skip when retrieving the inventory
items.
schema:
type: integer
default: 0
- in: query
name: limit
description: Limit the number of inventory items returned.
schema:
type: integer
default: 20
- in: query
name: expand
description: >-
Comma-separated relations that should be expanded in each returned
inventory item.
schema:
type: string
- in: query
name: fields
description: >-
Comma-separated fields that should be included in the returned inventory
item.
schema:
type: string
- in: query
name: q
description: term to search inventory item's sku, title, and description.
schema:
type: string
- in: query
name: location_id
style: form
explode: false
description: Filter by location IDs.
schema:
type: array
items:
type: string
- in: query
name: id
style: form
explode: false
description: Filter by the inventory ID
schema:
oneOf:
- type: string
description: inventory ID
- type: array
description: an array of inventory IDs
items:
type: string
- in: query
name: sku
description: Filter by SKU
schema:
type: string
- in: query
name: origin_country
description: Filter by origin country
schema:
type: string
- in: query
name: mid_code
description: Filter by MID code
schema:
type: string
- in: query
name: material
description: Filter by material
schema:
type: string
- in: query
name: hs_code
description: Filter by HS Code
schema:
type: string
- in: query
name: weight
description: Filter by weight
schema:
type: string
- in: query
name: length
description: Filter by length
schema:
type: string
- in: query
name: height
description: Filter by height
schema:
type: string
- in: query
name: width
description: Filter by width
schema:
type: string
- in: query
name: requires_shipping
description: Filter by whether the item requires shipping
schema:
type: string
x-codegen:
method: list
queryParams: AdminGetInventoryItemsParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_inventory-items/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_inventory-items/get.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Inventory Items
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: >-
../components/schemas/AdminInventoryItemsListWithVariantsAndLocationLevelsRes.yaml
'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: PostInventoryItems
summary: Create an Inventory Item
description: Create an Inventory Item.
x-authenticated: true
parameters:
- in: query
name: expand
description: >-
Comma-separated relations that should be expanded in the returned
inventory item.
schema:
type: string
- in: query
name: fields
description: >-
Comma-separated fields that should be included in the returned inventory
item.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostInventoryItemsReq.yaml
x-codegen:
method: create
queryParams: AdminPostInventoryItemsParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_inventory-items/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_inventory-items/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Inventory Items
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminInventoryItemsRes.yaml
'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
@@ -0,0 +1,168 @@
get:
operationId: GetInventoryItemsInventoryItem
summary: Get an Inventory Item
description: Retrieve an Inventory Item's details.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Inventory Item.
schema:
type: string
- in: query
name: expand
description: >-
Comma-separated relations that should be expanded in the returned
inventory item.
schema:
type: string
- in: query
name: fields
description: >-
Comma-separated fields that should be included in the returned inventory
item.
schema:
type: string
x-codegen:
method: retrieve
queryParams: AdminGetInventoryItemsItemParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_inventory-items_{id}/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_inventory-items_{id}/get.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Inventory Items
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminInventoryItemsRes.yaml
'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: PostInventoryItemsInventoryItem
summary: Update an Inventory Item
description: Update an Inventory Item's details.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Inventory Item.
schema:
type: string
- in: query
name: expand
description: >-
Comma-separated relations that should be expanded in the returned
inventory level.
schema:
type: string
- in: query
name: fields
description: >-
Comma-separated fields that should be included in the returned inventory
level.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostInventoryItemsInventoryItemReq.yaml
x-codegen:
method: update
queryParams: AdminPostInventoryItemsInventoryItemParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_inventory-items_{id}/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_inventory-items_{id}/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Inventory Items
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminInventoryItemsRes.yaml
'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
delete:
operationId: DeleteInventoryItemsInventoryItem
summary: Delete an Inventory Item
description: >-
Delete an Inventory Item. This does not delete the associated product
variant.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Inventory Item to delete.
schema:
type: string
x-codegen:
method: delete
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_inventory-items_{id}/delete.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_inventory-items_{id}/delete.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Inventory Items
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminInventoryItemsDeleteRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
@@ -0,0 +1,146 @@
get:
operationId: GetInventoryItemsInventoryItemLocationLevels
summary: List Inventory Level
description: >-
Retrieve a list of inventory levels of an inventory item. The inventory
levels can be filtered by fields such as `location_id`. The inventory levels
can also be paginated.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Inventory Item the locations are associated with.
schema:
type: string
- in: query
name: location_id
style: form
explode: false
description: Filter by location IDs.
schema:
type: array
items:
type: string
- in: query
name: expand
description: >-
Comma-separated relations that should be expanded in the returned
inventory levels.
schema:
type: string
- in: query
name: fields
description: >-
Comma-separated fields that should be included in the returned inventory
levels.
schema:
type: string
x-codegen:
method: listLocationLevels
queryParams: AdminGetInventoryItemsItemLocationLevelsParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/admin_inventory-items_{id}_location-levels/get.js
- lang: Shell
label: cURL
source:
$ref: >-
../code_samples/Shell/admin_inventory-items_{id}_location-levels/get.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Inventory Items
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminInventoryItemsLocationLevelsRes.yaml
'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: PostInventoryItemsInventoryItemLocationLevels
summary: Create an Location Level
description: Create an Location Level for a given Inventory Item.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Inventory Item.
schema:
type: string
- in: query
name: expand
description: >-
Comma-separated relations that should be expanded in the returned
inventory item.
schema:
type: string
- in: query
name: fields
description: >-
Comma-separated fields that should be included in the returned inventory
item.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: >-
../components/schemas/AdminPostInventoryItemsItemLocationLevelsReq.yaml
x-codegen:
method: createLocationLevel
queryParams: AdminPostInventoryItemsItemLocationLevelsParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/admin_inventory-items_{id}_location-levels/post.js
- lang: Shell
label: cURL
source:
$ref: >-
../code_samples/Shell/admin_inventory-items_{id}_location-levels/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Inventory Items
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminInventoryItemsRes.yaml
'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
@@ -0,0 +1,131 @@
post:
operationId: PostInventoryItemsInventoryItemLocationLevelsLocationLevel
summary: Update a Location Level
description: Update a Location Level's details for a given Inventory Item.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Inventory Item that the location is associated with.
schema:
type: string
- in: path
name: location_id
required: true
description: The ID of the Location to update.
schema:
type: string
- in: query
name: expand
description: >-
Comma-separated relations that should be expanded in the returned
location level.
schema:
type: string
- in: query
name: fields
description: >-
Comma-separated fields that should be included in the returned location
level.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: >-
../components/schemas/AdminPostInventoryItemsItemLocationLevelsLevelReq.yaml
x-codegen:
method: updateLocationLevel
queryParams: AdminPostInventoryItemsItemLocationLevelsLevelParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/admin_inventory-items_{id}_location-levels_{location_id}/post.js
- lang: Shell
label: cURL
source:
$ref: >-
../code_samples/Shell/admin_inventory-items_{id}_location-levels_{location_id}/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Inventory Items
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminInventoryItemsRes.yaml
'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
delete:
operationId: DeleteInventoryItemsInventoryIteLocationLevelsLocation
summary: Delete a Location Level
description: Delete a location level of an Inventory Item.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Inventory Item.
schema:
type: string
- in: path
name: location_id
required: true
description: The ID of the location.
schema:
type: string
x-codegen:
method: deleteLocationLevel
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/admin_inventory-items_{id}_location-levels_{location_id}/delete.js
- lang: Shell
label: cURL
source:
$ref: >-
../code_samples/Shell/admin_inventory-items_{id}_location-levels_{location_id}/delete.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Inventory Items
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminInventoryItemsRes.yaml
'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
@@ -0,0 +1,85 @@
get:
operationId: GetInvites
summary: Lists Invites
description: Retrieve a list of invites.
x-authenticated: true
x-codegen:
method: list
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_invites/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_invites/get.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Invites
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminListInvitesRes.yaml
'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: PostInvites
summary: Create an Invite
description: >-
Create an Invite. This will generate a token associated with the invite and
trigger an `invite.created` event. If you have a Notification Provider
installed that handles this event, a notification should be sent to the
email associated with the invite to allow them to accept the invite.
x-authenticated: true
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostInvitesReq.yaml
x-codegen:
method: create
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_invites/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_invites/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Invites
responses:
'200':
description: OK
'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
@@ -0,0 +1,44 @@
post:
operationId: PostInvitesInviteAccept
summary: Accept an Invite
description: >-
Accept an Invite. This will also delete the invite and create a new user
that can log in and perform admin functionalities. The user will have the
email associated with the invite, and the password provided in the request
body.
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostInvitesInviteAcceptReq.yaml
x-codegen:
method: accept
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_invites_accept/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_invites_accept/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Invites
responses:
'200':
description: OK
'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
@@ -0,0 +1,47 @@
delete:
operationId: DeleteInvitesInvite
summary: Delete an Invite
description: Delete an Invite. Only invites that weren't accepted can be deleted.
x-authenticated: true
parameters:
- in: path
name: invite_id
required: true
description: The ID of the Invite
schema:
type: string
x-codegen:
method: delete
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_invites_{invite_id}/delete.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_invites_{invite_id}/delete.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Invites
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminInviteDeleteRes.yaml
'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
@@ -0,0 +1,48 @@
post:
operationId: PostInvitesInviteResend
summary: Resend an Invite
description: >-
Resend an Invite. This renews the expiry date by 7 days and generates a new
token for the invite. It also triggers the `invite.created` event, so if you
have a Notification Provider installed that handles this event, a
notification should be sent to the email associated with the invite to allow
them to accept the invite.
x-authenticated: true
parameters:
- in: path
name: invite_id
required: true
description: The ID of the Invite
schema:
type: string
x-codegen:
method: resend
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_invites_{invite_id}_resend/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_invites_{invite_id}_resend/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Invites
responses:
'200':
description: OK
'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
@@ -0,0 +1,106 @@
get:
operationId: GetNotes
summary: List Notes
x-authenticated: true
description: >-
Retrieve a list of notes. The notes can be filtered by fields such as
`resource_id`. The notes can also be paginated.
parameters:
- in: query
name: limit
description: Limit the number of notes returned.
schema:
type: number
default: '50'
- in: query
name: offset
description: The number of notes to skip when retrieving the notes.
schema:
type: number
default: '0'
- in: query
name: resource_id
description: Filter by resource ID
schema:
type: string
x-codegen:
method: list
queryParams: AdminGetNotesParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_notes/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_notes/get.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Notes
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminNotesListRes.yaml
'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: PostNotes
summary: Create a Note
description: Create a Note which can be associated with any resource.
x-authenticated: true
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostNotesReq.yaml
x-codegen:
method: create
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_notes/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_notes/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Notes
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminNotesRes.yaml
'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
@@ -0,0 +1,146 @@
get:
operationId: GetNotesNote
summary: Get a Note
description: Retrieve a note's details.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the note.
schema:
type: string
x-codegen:
method: retrieve
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_notes_{id}/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_notes_{id}/get.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Notes
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminNotesRes.yaml
'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: PostNotesNote
summary: Update a Note
x-authenticated: true
description: Update a Note's details.'
parameters:
- in: path
name: id
required: true
description: The ID of the Note
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostNotesNoteReq.yaml
x-codegen:
method: update
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_notes_{id}/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_notes_{id}/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Notes
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminNotesRes.yaml
'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
delete:
operationId: DeleteNotesNote
summary: Delete a Note
description: Delete a Note.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Note to delete.
schema:
type: string
x-codegen:
method: delete
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_notes_{id}/delete.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_notes_{id}/delete.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Notes
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminNotesDeleteRes.yaml
'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
@@ -0,0 +1,105 @@
get:
operationId: GetNotifications
summary: List Notifications
description: >-
Retrieve a list of notifications. The notifications can be filtered by
fields such as `event_name` or `resource_type`. The notifications can also
be paginated.
x-authenticated: true
parameters:
- in: query
name: offset
description: >-
The number of inventory items to skip when retrieving the inventory
items.
schema:
type: integer
default: 0
- in: query
name: limit
description: Limit the number of notifications returned.
schema:
type: integer
default: 50
- in: query
name: fields
description: >-
Comma-separated fields that should be included in each returned
notification.
schema:
type: string
- in: query
name: expand
description: >-
Comma-separated relations that should be expanded in each returned
notification.
schema:
type: string
- in: query
name: event_name
description: >-
Filter by the name of the event that triggered sending this
notification.
schema:
type: string
- in: query
name: resource_type
description: Filter by the resource type.
schema:
type: string
- in: query
name: resource_id
description: Filter by the resource ID.
schema:
type: string
- in: query
name: to
description: >-
Filter by the address that the Notification was sent to. This will
usually be an email address, but it can also represent other addresses
such as a chat bot user id.
schema:
type: string
- in: query
name: include_resends
description: >-
A boolean indicating whether the result set should include resent
notifications or not
schema:
type: string
x-codegen:
method: list
queryParams: AdminGetNotificationsParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_notifications/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_notifications/get.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Notifications
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminNotificationsListRes.yaml
'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
@@ -0,0 +1,55 @@
post:
operationId: PostNotificationsNotificationResend
summary: Resend Notification
description: >-
Resend a previously sent notifications, with the same data but optionally to
a different address.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Notification
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: >-
../components/schemas/AdminPostNotificationsNotificationResendReq.yaml
x-codegen:
method: resend
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_notifications_{id}_resend/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_notifications_{id}_resend/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Notifications
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminNotificationsRes.yaml
'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
@@ -0,0 +1,125 @@
get:
operationId: GetOrderEdits
summary: List Order Edits
description: >-
Retrieve a list of order edits. The order edits can be filtered by fields
such as `q` or `order_id`. The order edits can also be paginated.
x-authenticated: true
parameters:
- in: query
name: q
description: term to search order edits' internal note.
schema:
type: string
- in: query
name: order_id
description: Filter by order ID
schema:
type: string
- in: query
name: limit
description: Limit the number of order edits returned.
schema:
type: number
default: '20'
- in: query
name: offset
description: The number of order edits to skip when retrieving the order edits.
schema:
type: number
default: '0'
- in: query
name: expand
description: >-
Comma-separated relations that should be expanded in each returned order
edit.
schema:
type: string
- in: query
name: fields
description: >-
Comma-separated fields that should be included in each returned order
edit.
schema:
type: string
x-codegen:
method: list
queryParams: GetOrderEditsParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_order-edits/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_order-edits/get.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Order Edits
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminOrderEditsListRes.yaml
'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: PostOrderEdits
summary: Create an OrderEdit
description: Create an Order Edit.
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostOrderEditsReq.yaml
x-authenticated: true
x-codegen:
method: create
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_order-edits/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_order-edits/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Order Edits
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminOrderEditsRes.yaml
'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
@@ -0,0 +1,153 @@
get:
operationId: GetOrderEditsOrderEdit
summary: Get an Order Edit
description: Retrieve an Order Edit's details.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the OrderEdit.
schema:
type: string
- in: query
name: expand
description: >-
Comma-separated relations that should be expanded in each returned order
edit.
schema:
type: string
- in: query
name: fields
description: >-
Comma-separated fields that should be included in the returned order
edit.
schema:
type: string
x-codegen:
method: retrieve
queryParams: GetOrderEditsOrderEditParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_order-edits_{id}/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_order-edits_{id}/get.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Order Edits
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminOrderEditsRes.yaml
'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: PostOrderEditsOrderEdit
summary: Update an Order Edit
description: Updates an Order Edit's details.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the OrderEdit.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostOrderEditsOrderEditReq.yaml
x-codegen:
method: update
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_order-edits_{id}/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_order-edits_{id}/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Order Edits
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminOrderEditsRes.yaml
'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
delete:
operationId: DeleteOrderEditsOrderEdit
summary: Delete an Order Edit
description: >-
Delete an Order Edit. Only order edits that have the status `created` can be
deleted.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Order Edit to delete.
schema:
type: string
x-codegen:
method: delete
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_order-edits_{id}/delete.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_order-edits_{id}/delete.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Order Edits
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminOrderEditDeleteRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
@@ -0,0 +1,43 @@
post:
operationId: PostOrderEditsOrderEditCancel
summary: Cancel an Order Edit
description: Cancel an OrderEdit.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the OrderEdit.
schema:
type: string
x-codegen:
method: cancel
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_order-edits_{id}_cancel/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_order-edits_{id}_cancel/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Order Edits
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminOrderEditsRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -0,0 +1,47 @@
delete:
operationId: DeleteOrderEditsOrderEditItemChange
summary: Delete a Line Item Change
description: >-
Delete a line item change that indicates the addition, deletion, or update
of a line item in the original order.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Order Edit.
schema:
type: string
- in: path
name: change_id
required: true
description: The ID of the Line Item Change to delete.
schema:
type: string
x-codegen:
method: deleteItemChange
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/admin_order-edits_{id}_changes_{change_id}/delete.js
- lang: Shell
label: cURL
source:
$ref: >-
../code_samples/Shell/admin_order-edits_{id}_changes_{change_id}/delete.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Order Edits
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminOrderEditItemChangeDeleteRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
@@ -0,0 +1,45 @@
post:
operationId: PostOrderEditsOrderEditConfirm
summary: Confirm an OrderEdit
description: >-
Confirm an Order Edit. This will reflect the changes in the order edit on
the associated order.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the order edit.
schema:
type: string
x-codegen:
method: confirm
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_order-edits_{id}_confirm/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_order-edits_{id}_confirm/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Order Edits
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminOrderEditsRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -0,0 +1,55 @@
post:
operationId: PostOrderEditsEditLineItems
summary: Add a Line Item
description: >-
Create a line item change in the order edit that indicates adding an item in
the original order. The item will not be added to the original order until
the order edit is confirmed.
parameters:
- in: path
name: id
required: true
description: The ID of the Order Edit.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostOrderEditsEditLineItemsReq.yaml
x-authenticated: true
x-codegen:
method: addLineItem
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_order-edits_{id}_items/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_order-edits_{id}_items/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Order Edits
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminOrderEditsRes.yaml
'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
@@ -0,0 +1,121 @@
post:
operationId: PostOrderEditsEditLineItemsLineItem
summary: Upsert Line Item Change
description: >-
Create or update a line item change in the order edit that indicates
addition, deletion, or update of a line item into an original order. Line
item changes are only reflected on the original order after the order edit
is confirmed.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Order Edit.
schema:
type: string
- in: path
name: item_id
required: true
description: The ID of the line item in the original order.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: >-
../components/schemas/AdminPostOrderEditsEditLineItemsLineItemReq.yaml
x-codegen:
method: updateLineItem
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/admin_order-edits_{id}_items_{item_id}/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_order-edits_{id}_items_{item_id}/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Order Edits
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminOrderEditsRes.yaml
'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
delete:
operationId: DeleteOrderEditsOrderEditLineItemsLineItem
summary: Delete Line Item
description: >-
Create a line item change in the order edit that indicates deleting an item
in the original order. The item in the original order will not be deleted
until the order edit is confirmed.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Order Edit.
schema:
type: string
- in: path
name: item_id
required: true
description: The ID of line item in the original order.
schema:
type: string
x-codegen:
method: removeLineItem
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/admin_order-edits_{id}_items_{item_id}/delete.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_order-edits_{id}_items_{item_id}/delete.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Order Edits
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminOrderEditsRes.yaml
'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
@@ -0,0 +1,46 @@
post:
operationId: PostOrderEditsOrderEditRequest
summary: Request Confirmation
description: >-
Request customer confirmation of an Order Edit. This would emit the event
`order-edit.requested` which Notification Providers listen to and send a
notification to the customer about the order edit.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Order Edit.
schema:
type: string
x-codegen:
method: requestConfirmation
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_order-edits_{id}_request/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_order-edits_{id}_request/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Order Edits
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminOrderEditsRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
@@ -0,0 +1,253 @@
get:
operationId: GetOrders
summary: List Orders
description: >-
Retrieve a list of Orders. The orders can be filtered by fields such as
`status` or `display_id`. The order can also be paginated.
x-authenticated: true
parameters:
- in: query
name: q
description: >-
term to search orders' shipping address, first name, email, and display
ID
schema:
type: string
- in: query
name: id
description: Filter by ID.
schema:
type: string
- in: query
name: status
style: form
explode: false
description: Filter by status
schema:
type: array
items:
type: string
enum:
- pending
- completed
- archived
- canceled
- requires_action
- in: query
name: fulfillment_status
style: form
explode: false
description: Filter by fulfillment status
schema:
type: array
items:
type: string
enum:
- not_fulfilled
- fulfilled
- partially_fulfilled
- shipped
- partially_shipped
- canceled
- returned
- partially_returned
- requires_action
- in: query
name: payment_status
style: form
explode: false
description: Filter by payment status
schema:
type: array
items:
type: string
enum:
- captured
- awaiting
- not_paid
- refunded
- partially_refunded
- canceled
- requires_action
- in: query
name: display_id
description: Filter by display ID
schema:
type: string
- in: query
name: cart_id
description: Filter by cart ID
schema:
type: string
- in: query
name: customer_id
description: Filter by customer ID
schema:
type: string
- in: query
name: email
description: Filter by email
schema:
type: string
- in: query
name: region_id
style: form
explode: false
description: Filter by region IDs.
schema:
oneOf:
- type: string
description: ID of a Region.
- type: array
items:
type: string
description: ID of a Region.
- in: query
name: currency_code
style: form
explode: false
description: Filter by currency codes.
schema:
type: string
externalDocs:
url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes
description: See a list of codes.
- in: query
name: tax_rate
description: Filter by tax rate.
schema:
type: string
- in: query
name: created_at
description: Filter by a creation date range.
schema:
type: object
properties:
lt:
type: string
description: filter by dates less than this date
format: date
gt:
type: string
description: filter by dates greater than this date
format: date
lte:
type: string
description: filter by dates less than or equal to this date
format: date
gte:
type: string
description: filter by dates greater than or equal to this date
format: date
- in: query
name: updated_at
description: Filter by an update date range.
schema:
type: object
properties:
lt:
type: string
description: filter by dates less than this date
format: date
gt:
type: string
description: filter by dates greater than this date
format: date
lte:
type: string
description: filter by dates less than or equal to this date
format: date
gte:
type: string
description: filter by dates greater than or equal to this date
format: date
- in: query
name: canceled_at
description: Filter by a cancelation date range.
schema:
type: object
properties:
lt:
type: string
description: filter by dates less than this date
format: date
gt:
type: string
description: filter by dates greater than this date
format: date
lte:
type: string
description: filter by dates less than or equal to this date
format: date
gte:
type: string
description: filter by dates greater than or equal to this date
format: date
- in: query
name: sales_channel_id
style: form
explode: false
description: Filter by Sales Channel IDs
schema:
type: array
items:
type: string
description: The ID of a Sales Channel
- in: query
name: offset
description: The number of orders to skip when retrieving the orders.
schema:
type: integer
default: 0
- in: query
name: limit
description: Limit the number of orders returned.
schema:
type: integer
default: 50
- in: query
name: expand
description: Comma-separated relations that should be expanded in the returned order.
schema:
type: string
- in: query
name: fields
description: Comma-separated fields that should be included in the returned order.
schema:
type: string
x-codegen:
method: list
queryParams: AdminGetOrdersParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_orders/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_orders/get.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Orders
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminOrdersListRes.yaml
'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
@@ -0,0 +1,121 @@
get:
operationId: GetOrdersOrder
summary: Get an Order
description: Retrieve an Order's details.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Order.
schema:
type: string
- in: query
name: expand
description: Comma-separated relations that should be expanded in the returned order.
schema:
type: string
- in: query
name: fields
description: Comma-separated fields that should be included in the returned order.
schema:
type: string
x-codegen:
method: retrieve
queryParams: AdminGetOrdersOrderParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_orders_{id}/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_orders_{id}/get.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Orders
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminOrdersRes.yaml
'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: PostOrdersOrder
summary: Update an Order
description: Update and order's details.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Order.
schema:
type: string
- in: query
name: expand
description: Comma-separated relations that should be expanded in the returned order.
schema:
type: string
- in: query
name: fields
description: Comma-separated fields that should be included in the returned order.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostOrdersOrderReq.yaml
x-codegen:
method: update
params: AdminPostOrdersOrderParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_orders_{id}/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_orders_{id}/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Orders
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminOrdersRes.yaml
'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
@@ -0,0 +1,58 @@
post:
operationId: PostOrdersOrderArchive
summary: Archive Order
description: Archive an order and change its status.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Order.
schema:
type: string
- in: query
name: expand
description: Comma-separated relations that should be expanded in the returned order.
schema:
type: string
- in: query
name: fields
description: Comma-separated fields that should be included in the returned order.
schema:
type: string
x-codegen:
method: archive
params: AdminPostOrdersOrderArchiveParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_orders_{id}_archive/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_orders_{id}_archive/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Orders
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminOrdersRes.yaml
'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
@@ -0,0 +1,61 @@
post:
operationId: PostOrdersOrderCancel
summary: Cancel an Order
description: >-
Cancel an order and change its status. This will also cancel any associated
Fulfillments and Payments, and it may fail if the Payment or Fulfillment
Provider is unable to cancel the Payment/Fulfillment.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Order.
schema:
type: string
- in: query
name: expand
description: Comma-separated relations that should be expanded in the returned order.
schema:
type: string
- in: query
name: fields
description: Comma-separated fields that should be included in the returned order.
schema:
type: string
x-codegen:
method: cancel
params: AdminPostOrdersOrderCancel
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_orders_{id}_cancel/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_orders_{id}_cancel/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Orders
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminOrdersRes.yaml
'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
@@ -0,0 +1,60 @@
post:
operationId: PostOrdersOrderCapture
summary: Capture an Order's Payments
description: >-
Capture all the Payments associated with an Order. The payment of canceled
orders can't be captured.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Order.
schema:
type: string
- in: query
name: expand
description: Comma-separated relations that should be expanded in the returned order.
schema:
type: string
- in: query
name: fields
description: Comma-separated fields that should be included in the returned order.
schema:
type: string
x-codegen:
method: capturePayment
params: AdminPostOrdersOrderCaptureParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_orders_{id}_capture/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_orders_{id}_capture/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Orders
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminOrdersRes.yaml
'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
@@ -0,0 +1,69 @@
post:
operationId: PostOrdersOrderClaims
summary: Create a Claim
description: >-
Create a Claim for an order. If a return shipping method is specified, a
return will also be created and associated with the claim. If the claim's
type is `refund`, the refund is processed as well.
externalDocs:
description: How are claims created
url: https://docs.medusajs.com/modules/orders/claims#how-are-claims-created
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Order.
schema:
type: string
- in: query
name: expand
description: Comma-separated relations that should be expanded in the returned order.
schema:
type: string
- in: query
name: fields
description: Comma-separated fields that should be included in the returned order.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostOrdersOrderClaimsReq.yaml
x-codegen:
method: createClaim
params: AdminPostOrdersOrderClaimsParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_orders_{id}_claims/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_orders_{id}_claims/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Orders
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminOrdersRes.yaml
'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
@@ -0,0 +1,69 @@
post:
operationId: PostOrdersOrderClaimsClaim
summary: Update a Claim
description: Update a Claim's details.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Order associated with the claim.
schema:
type: string
- in: path
name: claim_id
required: true
description: The ID of the Claim.
schema:
type: string
- in: query
name: expand
description: Comma-separated relations that should be expanded in the returned order.
schema:
type: string
- in: query
name: fields
description: Comma-separated fields that should be included in the returned order.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostOrdersOrderClaimsClaimReq.yaml
x-codegen:
method: updateClaim
params: AdminPostOrdersOrderClaimsClaimParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_orders_{id}_claims_{claim_id}/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_orders_{id}_claims_{claim_id}/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Orders
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminOrdersRes.yaml
'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
@@ -0,0 +1,72 @@
post:
operationId: PostOrdersClaimCancel
summary: Cancel a Claim
description: >-
Cancel a Claim and change its status. A claim can't be canceled if it has a
refund, if its fulfillments haven't been canceled, of if its associated
return hasn't been canceled.
x-authenticated: true
externalDocs:
description: Canceling a claim
url: https://docs.medusajs.com/modules/orders/claims#cancel-a-claim
parameters:
- in: path
name: id
required: true
description: The ID of the order the claim is associated with.
schema:
type: string
- in: path
name: claim_id
required: true
description: The ID of the Claim.
schema:
type: string
- in: query
name: expand
description: Comma-separated relations that should be expanded in the returned order.
schema:
type: string
- in: query
name: fields
description: Comma-separated fields that should be included in the returned order.
schema:
type: string
x-codegen:
method: cancelClaim
params: AdminPostOrdersClaimCancel
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/admin_orders_{id}_claims_{claim_id}_cancel/post.js
- lang: Shell
label: cURL
source:
$ref: >-
../code_samples/Shell/admin_orders_{id}_claims_{claim_id}_cancel/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Orders
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminOrdersRes.yaml
'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
@@ -0,0 +1,75 @@
post:
operationId: PostOrdersOrderClaimsClaimFulfillments
summary: Create a Claim Fulfillment
description: Create a Fulfillment for a Claim.
x-authenticated: true
externalDocs:
description: Fulfill a claim
url: https://docs.medusajs.com/modules/orders/claims#fulfill-a-claim
parameters:
- in: path
name: id
required: true
description: The ID of the Order the claim is associated with.
schema:
type: string
- in: path
name: claim_id
required: true
description: The ID of the Claim.
schema:
type: string
- in: query
name: expand
description: Comma-separated relations that should be expanded in the returned order.
schema:
type: string
- in: query
name: fields
description: Comma-separated fields that should be included in the returned order.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: >-
../components/schemas/AdminPostOrdersOrderClaimsClaimFulfillmentsReq.yaml
x-codegen:
method: fulfillClaim
params: AdminPostOrdersOrderClaimsClaimFulfillmentsReq
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/admin_orders_{id}_claims_{claim_id}_fulfillments/post.js
- lang: Shell
label: cURL
source:
$ref: >-
../code_samples/Shell/admin_orders_{id}_claims_{claim_id}_fulfillments/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Orders
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminOrdersRes.yaml
'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
@@ -0,0 +1,72 @@
post:
operationId: PostOrdersClaimFulfillmentsCancel
summary: Cancel Claim's Fulfillment
description: Cancel a claim's fulfillment and change its status.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the order the claim is associated with.
schema:
type: string
- in: path
name: claim_id
required: true
description: The ID of the claim.
schema:
type: string
- in: path
name: fulfillment_id
required: true
description: The ID of the fulfillment.
schema:
type: string
- in: query
name: expand
description: Comma-separated relations that should be expanded in the returned order.
schema:
type: string
- in: query
name: fields
description: Comma-separated fields that should be included in the returned order.
schema:
type: string
x-codegen:
method: cancelClaimFulfillment
params: AdminPostOrdersClaimFulfillmentsCancelParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/admin_orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel/post.js
- lang: Shell
label: cURL
source:
$ref: >-
../code_samples/Shell/admin_orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Orders
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminOrdersRes.yaml
'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
@@ -0,0 +1,78 @@
post:
operationId: PostOrdersOrderClaimsClaimShipments
summary: Ship a Claim's Fulfillment
description: >-
Mark a claim's fulfillment as shipped. This changes the claim's fulfillment
status to either `shipped` or `partially_shipped`, depending on whether all
the items were shipped.
x-authenticated: true
externalDocs:
description: Fulfill a claim
url: https://docs.medusajs.com/modules/orders/claims#fulfill-a-claim
parameters:
- in: path
name: id
required: true
description: The ID of the Order the claim is associated with.
schema:
type: string
- in: path
name: claim_id
required: true
description: The ID of the Claim.
schema:
type: string
- in: query
name: expand
description: Comma-separated relations that should be expanded in the returned order.
schema:
type: string
- in: query
name: fields
description: Comma-separated fields that should be included in the returned order.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: >-
../components/schemas/AdminPostOrdersOrderClaimsClaimShipmentsReq.yaml
x-codegen:
method: createClaimShipment
params: AdminPostOrdersOrderClaimsClaimShipmentsParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/admin_orders_{id}_claims_{claim_id}_shipments/post.js
- lang: Shell
label: cURL
source:
$ref: >-
../code_samples/Shell/admin_orders_{id}_claims_{claim_id}_shipments/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Orders
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminOrdersRes.yaml
'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
@@ -0,0 +1,60 @@
post:
operationId: PostOrdersOrderComplete
summary: Complete an Order
description: >-
Complete an Order and change its status. A canceled order can't be
completed.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Order.
schema:
type: string
- in: query
name: expand
description: Comma-separated relations that should be expanded in the returned order.
schema:
type: string
- in: query
name: fields
description: Comma-separated fields that should be included in the returned order.
schema:
type: string
x-codegen:
method: complete
params: AdminPostOrdersOrderCompleteParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_orders_{id}_complete/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_orders_{id}_complete/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Orders
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminOrdersRes.yaml
'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
@@ -0,0 +1,66 @@
post:
operationId: PostOrdersOrderFulfillments
summary: Create a Fulfillment
description: Create a Fulfillment of an Order using the fulfillment provider.
x-authenticated: true
externalDocs:
description: Fulfillments of orders
url: https://docs.medusajs.com/modules/orders/#fulfillments-in-orders
parameters:
- in: path
name: id
required: true
description: The ID of the Order.
schema:
type: string
- in: query
name: expand
description: Comma-separated relations that should be expanded in the returned order.
schema:
type: string
- in: query
name: fields
description: Comma-separated fields that should be included in the returned order.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostOrdersOrderFulfillmentsReq.yaml
x-codegen:
method: createFulfillment
params: AdminPostOrdersOrderFulfillmentsParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_orders_{id}_fulfillment/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_orders_{id}_fulfillment/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Orders
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminOrdersRes.yaml
'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
@@ -0,0 +1,66 @@
post:
operationId: PostOrdersOrderFulfillmentsCancel
summary: Cancel a Fulfilmment
description: Cancel an order's fulfillment and change its status.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Order.
schema:
type: string
- in: path
name: fulfillment_id
required: true
description: The ID of the Fulfillment.
schema:
type: string
- in: query
name: expand
description: Comma-separated relations that should be expanded in the returned order.
schema:
type: string
- in: query
name: fields
description: Comma-separated fields that should be included in the returned order.
schema:
type: string
x-codegen:
method: cancelFulfillment
params: AdminPostOrdersOrderFulfillementsCancelParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/admin_orders_{id}_fulfillments_{fulfillment_id}_cancel/post.js
- lang: Shell
label: cURL
source:
$ref: >-
../code_samples/Shell/admin_orders_{id}_fulfillments_{fulfillment_id}_cancel/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Orders
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminOrdersRes.yaml
'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
@@ -0,0 +1,55 @@
post:
operationId: PostOrdersOrderLineItemReservations
summary: Create a Reservation
description: >-
Create a Reservation for a line item at a specified location, optionally for
a partial quantity.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Order.
schema:
type: string
- in: path
name: line_item_id
required: true
description: The ID of the Line item.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminOrdersOrderLineItemReservationReq.yaml
x-codeSamples:
- lang: Shell
label: cURL
source:
$ref: >-
../code_samples/Shell/admin_orders_{id}_line-items_{line_item_id}_reserve/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Orders
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostReservationsReq.yaml
'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
@@ -0,0 +1,65 @@
post:
operationId: PostOrdersOrderRefunds
summary: Create a Refund
description: >-
Refund an amount for an order. The amount must be less than or equal the
`refundable_amount` of the order.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Order.
schema:
type: string
- in: query
name: expand
description: Comma-separated relations that should be expanded in the returned order.
schema:
type: string
- in: query
name: fields
description: Comma-separated fields that should be included in the returned order.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostOrdersOrderRefundsReq.yaml
x-codegen:
method: refundPayment
params: AdminPostOrdersOrderRefundsParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_orders_{id}_refund/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_orders_{id}_refund/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Orders
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminOrdersRes.yaml
'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
@@ -0,0 +1,53 @@
get:
operationId: GetOrdersOrderReservations
summary: Get Order Reservations
description: Retrieve the list of reservations of an Order
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Order.
schema:
type: string
- in: query
name: offset
description: The number of reservations to skip when retrieving the reservations.
schema:
type: integer
default: 0
- in: query
name: limit
description: Limit the number of reservations returned.
schema:
type: integer
default: 20
x-codeSamples:
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_orders_{id}_reservations/get.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Orders
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminReservationsListRes.yaml
'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
@@ -0,0 +1,68 @@
post:
operationId: PostOrdersOrderReturns
summary: Request a Return
description: >-
Request and create a Return for items in an order. If the return shipping
method is specified, it will be automatically fulfilled.
x-authenticated: true
externalDocs:
description: Return creation process
url: https://docs.medusajs.com/modules/orders/returns#returns-process
parameters:
- in: path
name: id
required: true
description: The ID of the Order.
schema:
type: string
- in: query
name: expand
description: Comma-separated relations that should be expanded in the returned order.
schema:
type: string
- in: query
name: fields
description: Comma-separated fields that should be included in the returned order.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostOrdersOrderReturnsReq.yaml
x-codegen:
method: requestReturn
params: AdminPostOrdersOrderReturnsParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_orders_{id}_return/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_orders_{id}_return/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Orders
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminOrdersRes.yaml
'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
@@ -0,0 +1,69 @@
post:
operationId: PostOrdersOrderShipment
summary: Ship a Fulfillment
description: >-
Mark a fulfillment as shipped. This changes the order's fulfillment status
to either `shipped` or `partially_shipped`, depending on whether all the
items were shipped.
x-authenticated: true
externalDocs:
description: Fulfillments of orders
url: https://docs.medusajs.com/modules/orders/#fulfillments-in-orders
parameters:
- in: path
name: id
required: true
description: The ID of the Order.
schema:
type: string
- in: query
name: expand
description: Comma-separated relations that should be expanded in the returned order.
schema:
type: string
- in: query
name: fields
description: Comma-separated fields that should be included in the returned order.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostOrdersOrderShipmentReq.yaml
x-codegen:
method: createShipment
params: AdminPostOrdersOrderShipmentParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_orders_{id}_shipment/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_orders_{id}_shipment/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Orders
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminOrdersRes.yaml
'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
@@ -0,0 +1,65 @@
post:
operationId: PostOrdersOrderShippingMethods
summary: Add a Shipping Method
description: >-
Adds a Shipping Method to an Order. If another Shipping Method exists with
the same Shipping Profile, the previous Shipping Method will be replaced.
parameters:
- in: path
name: id
required: true
description: The ID of the Order.
schema:
type: string
- in: query
name: expand
description: Comma-separated relations that should be expanded in the returned order.
schema:
type: string
- in: query
name: fields
description: Comma-separated fields that should be included in the returned order.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostOrdersOrderShippingMethodsReq.yaml
x-authenticated: true
x-codegen:
method: addShippingMethod
params: AdminPostOrdersOrderShippingMethodsParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_orders_{id}_shipping-methods/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_orders_{id}_shipping-methods/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Orders
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminOrdersRes.yaml
'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
@@ -0,0 +1,68 @@
post:
operationId: PostOrdersOrderSwaps
summary: Create a Swap
description: >-
Create a Swap. This includes creating a return that is associated with the
swap.
x-authenticated: true
externalDocs:
description: How are swaps created
url: https://docs.medusajs.com/modules/orders/swaps#how-are-swaps-created
parameters:
- in: path
name: id
required: true
description: The ID of the Order.
schema:
type: string
- in: query
name: expand
description: Comma-separated relations that should be expanded in the returned order.
schema:
type: string
- in: query
name: fields
description: Comma-separated fields that should be included in the returned order.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostOrdersOrderSwapsReq.yaml
x-codegen:
method: createSwap
queryParams: AdminPostOrdersOrderSwapsParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_orders_{id}_swaps/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_orders_{id}_swaps/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Orders
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminOrdersRes.yaml
'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
@@ -0,0 +1,68 @@
post:
operationId: PostOrdersSwapCancel
summary: Cancel a Swap
description: Cancel a Swap and change its status.
x-authenticated: true
externalDocs:
description: Canceling a swap
url: https://docs.medusajs.com/modules/orders/swaps#canceling-a-swap
parameters:
- in: path
name: id
required: true
description: The ID of the Order the swap is associated with.
schema:
type: string
- in: path
name: swap_id
required: true
description: The ID of the Swap.
schema:
type: string
- in: query
name: expand
description: Comma-separated relations that should be expanded in the returned order.
schema:
type: string
- in: query
name: fields
description: Comma-separated fields that should be included in the returned order.
schema:
type: string
x-codegen:
method: cancelSwap
params: AdminPostOrdersSwapCancelParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/admin_orders_{id}_swaps_{swap_id}_cancel/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_orders_{id}_swaps_{swap_id}_cancel/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Orders
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminOrdersRes.yaml
'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
@@ -0,0 +1,75 @@
post:
operationId: PostOrdersOrderSwapsSwapFulfillments
summary: Create a Swap Fulfillment
description: Create a Fulfillment for a Swap.
x-authenticated: true
externalDocs:
description: Handling a swap's fulfillment
url: https://docs.medusajs.com/modules/orders/swaps#handling-swap-fulfillment
parameters:
- in: path
name: id
required: true
description: The ID of the Order the swap is associated with.
schema:
type: string
- in: path
name: swap_id
required: true
description: The ID of the Swap.
schema:
type: string
- in: query
name: expand
description: Comma-separated relations that should be expanded in the returned order.
schema:
type: string
- in: query
name: fields
description: Comma-separated fields that should be included in the returned order.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: >-
../components/schemas/AdminPostOrdersOrderSwapsSwapFulfillmentsReq.yaml
x-codegen:
method: fulfillSwap
params: AdminPostOrdersOrderSwapsSwapFulfillmentsParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/admin_orders_{id}_swaps_{swap_id}_fulfillments/post.js
- lang: Shell
label: cURL
source:
$ref: >-
../code_samples/Shell/admin_orders_{id}_swaps_{swap_id}_fulfillments/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Orders
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminOrdersRes.yaml
'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
@@ -0,0 +1,72 @@
post:
operationId: PostOrdersSwapFulfillmentsCancel
summary: Cancel Swap's Fulfilmment
description: Cancel a swap's fulfillment and change its status.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the order the swap is associated with.
schema:
type: string
- in: path
name: swap_id
required: true
description: The ID of the swap.
schema:
type: string
- in: path
name: fulfillment_id
required: true
description: The ID of the fulfillment.
schema:
type: string
- in: query
name: expand
description: Comma-separated relations that should be expanded in the returned order.
schema:
type: string
- in: query
name: fields
description: Comma-separated fields that should be included in the returned order.
schema:
type: string
x-codegen:
method: cancelSwapFulfillment
params: AdminPostOrdersSwapFulfillementsCancelParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/admin_orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel/post.js
- lang: Shell
label: cURL
source:
$ref: >-
../code_samples/Shell/admin_orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Orders
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminOrdersRes.yaml
'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
@@ -0,0 +1,73 @@
post:
operationId: PostOrdersOrderSwapsSwapProcessPayment
summary: Process a Swap Payment
description: >-
Process a swap's payment either by refunding or issuing a payment. This
depends on the `difference_due` of the swap. If `difference_due` is
negative, the amount is refunded. If `difference_due` is positive, the
amount is captured.
x-authenticated: true
externalDocs:
description: Handling a swap's payment
url: https://docs.medusajs.com/modules/orders/swaps#handling-swap-payment
parameters:
- in: path
name: id
required: true
description: The ID of the order the swap is associated with.
schema:
type: string
- in: path
name: swap_id
required: true
description: The ID of the swap.
schema:
type: string
- in: query
name: expand
description: Comma-separated relations that should be expanded in the returned order.
schema:
type: string
- in: query
name: fields
description: Comma-separated fields that should be included in the returned order.
schema:
type: string
x-codegen:
method: processSwapPayment
params: AdminPostOrdersOrderSwapsSwapProcessPaymentParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/admin_orders_{id}_swaps_{swap_id}_process-payment/post.js
- lang: Shell
label: cURL
source:
$ref: >-
../code_samples/Shell/admin_orders_{id}_swaps_{swap_id}_process-payment/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Orders
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminOrdersRes.yaml
'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
@@ -0,0 +1,77 @@
post:
operationId: PostOrdersOrderSwapsSwapShipments
summary: Ship a Swap's Fulfillment
description: >-
RMark a swap's fulfillment as shipped. This changes the swap's fulfillment
status to either `shipped` or `partially_shipped`, depending on whether all
the items were shipped.
x-authenticated: true
externalDocs:
description: Handling swap fulfillments
url: https://docs.medusajs.com/modules/orders/swaps#handling-swap-fulfillment
parameters:
- in: path
name: id
required: true
description: The ID of the Order.
schema:
type: string
- in: path
name: swap_id
required: true
description: The ID of the Swap.
schema:
type: string
- in: query
name: expand
description: Comma-separated relations that should be expanded in the returned order.
schema:
type: string
- in: query
name: fields
description: Comma-separated fields that should be included in the returned order.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostOrdersOrderSwapsSwapShipmentsReq.yaml
x-codegen:
method: createSwapShipment
params: AdminPostOrdersOrderSwapsSwapShipmentsParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/admin_orders_{id}_swaps_{swap_id}_shipments/post.js
- lang: Shell
label: cURL
source:
$ref: >-
../code_samples/Shell/admin_orders_{id}_swaps_{swap_id}_shipments/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Orders
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminOrdersRes.yaml
'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
@@ -0,0 +1,155 @@
get:
operationId: GetPaymentCollectionsPaymentCollection
summary: Get a Payment Collection
description: Retrieve a Payment Collection's details.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Payment Collection.
schema:
type: string
- in: query
name: expand
description: >-
Comma-separated relations that should be expanded in the returned
payment collection.
schema:
type: string
- in: query
name: fields
description: >-
Comma-separated fields that should be included in the returned payment
collection.
schema:
type: string
x-codegen:
method: retrieve
queryParams: AdminGetPaymentCollectionsParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_payment-collections_{id}/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_payment-collections_{id}/get.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Payment Collections
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminPaymentCollectionsRes.yaml
'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: PostPaymentCollectionsPaymentCollection
summary: Update Payment Collection
description: Update a Payment Collection's details.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Payment Collection.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminUpdatePaymentCollectionsReq.yaml
x-codegen:
method: update
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_payment-collections_{id}/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_payment-collections_{id}/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Payment Collections
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminPaymentCollectionsRes.yaml
'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
delete:
operationId: DeletePaymentCollectionsPaymentCollection
summary: Delete a Payment Collection
description: >-
Delete a Payment Collection. Only payment collections with the statuses
`canceled` or `not_paid` can be deleted.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Payment Collection.
schema:
type: string
x-codegen:
method: delete
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_payment-collections_{id}/delete.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_payment-collections_{id}/delete.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Payment Collections
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminPaymentCollectionDeleteRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
@@ -0,0 +1,50 @@
post:
operationId: PostPaymentCollectionsPaymentCollectionAuthorize
summary: Mark Authorized
description: >-
Set the status of a Payment Collection as `authorized`. This will also
change the `authorized_amount` of the payment collection.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Payment Collection.
schema:
type: string
x-codegen:
method: markAsAuthorized
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/admin_payment-collections_{id}_authorize/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_payment-collections_{id}_authorize/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Payment Collections
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminPaymentCollectionsRes.yaml
'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
@@ -0,0 +1,48 @@
get:
operationId: GetPaymentsPayment
summary: Get Payment details
description: Retrieve a Payment's details.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Payment.
schema:
type: string
x-codegen:
method: retrieve
queryParams: GetPaymentsParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_payments_{id}/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_payments_{id}/get.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Payments
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminPaymentRes.yaml
'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
@@ -0,0 +1,47 @@
post:
operationId: PostPaymentsPaymentCapture
summary: Capture a Payment
description: Capture a Payment.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Payment.
schema:
type: string
x-codegen:
method: capturePayment
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_payments_{id}_capture/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_payments_{id}_capture/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Payments
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminPaymentRes.yaml
'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
@@ -0,0 +1,52 @@
post:
operationId: PostPaymentsPaymentRefunds
summary: Refund Payment
description: Refund a payment. The payment must be captured first.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Payment.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostPaymentRefundsReq.yaml
x-codegen:
method: refundPayment
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_payments_{id}_refund/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_payments_{id}_refund/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Payments
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminRefundRes.yaml
'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
@@ -0,0 +1,236 @@
get:
operationId: GetPriceLists
summary: List Price Lists
description: >-
Retrieve a list of price lists. The price lists can be filtered by fields
such as `q` or `status`. The price lists can also be sorted or paginated.
x-authenticated: true
parameters:
- in: query
name: limit
description: Limit the number of price lists returned.
schema:
type: number
default: '10'
- in: query
name: offset
description: The number of price lists to skip when retrieving the price lists.
schema:
type: number
default: '0'
- in: query
name: expand
description: >-
Comma-separated relations that should be expanded in the returned price
lists.
schema:
type: string
- in: query
name: fields
description: >-
Comma-separated fields that should be included in the returned price
lists.
schema:
type: string
- in: query
name: order
description: A price-list field to sort-order the retrieved price lists by.
schema:
type: string
- in: query
name: id
description: Filter by ID
schema:
type: string
- in: query
name: q
description: >-
term to search price lists' description, name, and customer group's
name.
schema:
type: string
- in: query
name: status
style: form
explode: false
description: Filter by status.
schema:
type: array
items:
type: string
enum:
- active
- draft
- in: query
name: name
description: Filter by name
schema:
type: string
- in: query
name: customer_groups
style: form
explode: false
description: Filter by customer-group IDs.
schema:
type: array
items:
type: string
- in: query
name: type
style: form
explode: false
description: Filter by type.
schema:
type: array
items:
type: string
enum:
- sale
- override
- in: query
name: created_at
description: Filter by a creation date range.
schema:
type: object
properties:
lt:
type: string
description: filter by dates less than this date
format: date
gt:
type: string
description: filter by dates greater than this date
format: date
lte:
type: string
description: filter by dates less than or equal to this date
format: date
gte:
type: string
description: filter by dates greater than or equal to this date
format: date
- in: query
name: updated_at
description: Filter by an update date range.
schema:
type: object
properties:
lt:
type: string
description: filter by dates less than this date
format: date
gt:
type: string
description: filter by dates greater than this date
format: date
lte:
type: string
description: filter by dates less than or equal to this date
format: date
gte:
type: string
description: filter by dates greater than or equal to this date
format: date
- in: query
name: deleted_at
description: Filter by a deletion date range.
schema:
type: object
properties:
lt:
type: string
description: filter by dates less than this date
format: date
gt:
type: string
description: filter by dates greater than this date
format: date
lte:
type: string
description: filter by dates less than or equal to this date
format: date
gte:
type: string
description: filter by dates greater than or equal to this date
format: date
x-codegen:
method: list
queryParams: AdminGetPriceListPaginationParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_price-lists/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_price-lists/get.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Price Lists
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminPriceListsListRes.yaml
'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: PostPriceListsPriceList
summary: Create a Price List
description: Create a Price List.
x-authenticated: true
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostPriceListsPriceListReq.yaml
x-codegen:
method: create
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_price-lists/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_price-lists/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Price Lists
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminPriceListRes.yaml
'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
@@ -0,0 +1,146 @@
get:
operationId: GetPriceListsPriceList
summary: Get a Price List
description: Retrieve a Price List's details.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Price List.
schema:
type: string
x-codegen:
method: retrieve
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_price-lists_{id}/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_price-lists_{id}/get.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Price Lists
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminPriceListRes.yaml
'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: PostPriceListsPriceListPriceList
summary: Update a Price List
description: Update a Price List's details.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Price List.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostPriceListsPriceListPriceListReq.yaml
x-codegen:
method: update
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_price-lists_{id}/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_price-lists_{id}/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Price Lists
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminPriceListRes.yaml
'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
delete:
operationId: DeletePriceListsPriceList
summary: Delete a Price List
description: Delete a Price List and its associated prices.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Price List.
schema:
type: string
x-codegen:
method: delete
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_price-lists_{id}/delete.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_price-lists_{id}/delete.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Price Lists
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminPriceListDeleteRes.yaml
'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
@@ -0,0 +1,105 @@
post:
operationId: PostPriceListsPriceListPricesBatch
summary: Add or Update Prices
description: Add or update a list of prices in a Price List
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Price List.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostPriceListPricesPricesReq.yaml
x-codegen:
method: addPrices
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_price-lists_{id}_prices_batch/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_price-lists_{id}_prices_batch/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Price Lists
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminPriceListRes.yaml
'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
delete:
operationId: DeletePriceListsPriceListPricesBatch
summary: Delete Prices
description: Delete a list of prices in a Price List
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Price List
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminDeletePriceListPricesPricesReq.yaml
x-codegen:
method: deletePrices
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/admin_price-lists_{id}_prices_batch/delete.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_price-lists_{id}_prices_batch/delete.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Price Lists
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminPriceListDeleteBatchRes.yaml
'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
@@ -0,0 +1,218 @@
get:
operationId: GetPriceListsPriceListProducts
summary: List Products
description: >-
Retrieve a price list's products. The products can be filtered by fields
such as `q` or `status`. The products can also be sorted or paginated.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: ID of the price list.
schema:
type: string
- in: query
name: q
description: >-
term used to search products' title, description, product variant's
title and sku, and product collection's title.
schema:
type: string
- in: query
name: id
description: Filter by product ID
schema:
type: string
- in: query
name: status
description: Filter by product status
style: form
explode: false
schema:
type: array
items:
type: string
enum:
- draft
- proposed
- published
- rejected
- in: query
name: collection_id
description: >-
Filter by product collection ID. Only products in the specified
collections are retrieved.
style: form
explode: false
schema:
type: array
items:
type: string
- in: query
name: tags
description: >-
Filter by tag IDs. Only products having the specified tags are
retrieved.
style: form
explode: false
schema:
type: array
items:
type: string
- in: query
name: title
description: Filter by title
schema:
type: string
- in: query
name: description
description: Filter by description
schema:
type: string
- in: query
name: handle
description: Filter by handle
schema:
type: string
- in: query
name: is_giftcard
description: A boolean value to filter by whether the product is a gift card or not.
schema:
type: string
- in: query
name: type
description: Filter product type.
schema:
type: string
- in: query
name: order
description: A product field to sort-order the retrieved products by.
schema:
type: string
- in: query
name: created_at
description: Filter by a creation date range.
schema:
type: object
properties:
lt:
type: string
description: filter by dates less than this date
format: date
gt:
type: string
description: filter by dates greater than this date
format: date
lte:
type: string
description: filter by dates less than or equal to this date
format: date
gte:
type: string
description: filter by dates greater than or equal to this date
format: date
- in: query
name: updated_at
description: Filter by an update date range.
schema:
type: object
properties:
lt:
type: string
description: filter by dates less than this date
format: date
gt:
type: string
description: filter by dates greater than this date
format: date
lte:
type: string
description: filter by dates less than or equal to this date
format: date
gte:
type: string
description: filter by dates greater than or equal to this date
format: date
- in: query
name: deleted_at
description: Filter by a deletion date range.
schema:
type: object
properties:
lt:
type: string
description: filter by dates less than this date
format: date
gt:
type: string
description: filter by dates greater than this date
format: date
lte:
type: string
description: filter by dates less than or equal to this date
format: date
gte:
type: string
description: filter by dates greater than or equal to this date
format: date
- in: query
name: offset
description: The number of products to skip when retrieving the products.
schema:
type: integer
default: 0
- in: query
name: limit
description: Limit the number of products returned.
schema:
type: integer
default: 50
- in: query
name: expand
description: >-
Comma-separated relations that should be expanded in the returned
products.
schema:
type: string
- in: query
name: fields
description: Comma-separated fields that should be included in the returned products.
schema:
type: string
x-codegen:
method: listProducts
queryParams: AdminGetPriceListsPriceListProductsParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_price-lists_{id}_products/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_price-lists_{id}_products/get.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Price Lists
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminPriceListsProductsListRes.yaml
'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
@@ -0,0 +1,55 @@
delete:
operationId: DeletePriceListsPriceListProductsProductPrices
summary: Delete a Product's Prices
description: Delete all the prices related to a specific product in a price list.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Price List.
schema:
type: string
- in: path
name: product_id
required: true
description: The ID of the product from which the prices will be deleted.
schema:
type: string
x-codegen:
method: deleteProductPrices
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/admin_price-lists_{id}_products_{product_id}_prices/delete.js
- lang: Shell
label: cURL
source:
$ref: >-
../code_samples/Shell/admin_price-lists_{id}_products_{product_id}_prices/delete.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Price Lists
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminPriceListDeleteProductPricesRes.yaml
'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
@@ -0,0 +1,55 @@
delete:
operationId: DeletePriceListsPriceListVariantsVariantPrices
summary: Delete a Variant's Prices
description: Delete all the prices related to a specific variant in a price list
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Price List.
schema:
type: string
- in: path
name: variant_id
required: true
description: The ID of the variant.
schema:
type: string
x-codegen:
method: deleteVariantPrices
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/admin_price-lists_{id}_variants_{variant_id}_prices/delete.js
- lang: Shell
label: cURL
source:
$ref: >-
../code_samples/Shell/admin_price-lists_{id}_variants_{variant_id}_prices/delete.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Price Lists
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminPriceListDeleteVariantPricesRes.yaml
'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
@@ -0,0 +1,168 @@
get:
operationId: GetProductCategories
summary: List Product Categories
description: >-
Retrieve a list of product categories. The product categories can be
filtered by fields such as `q` or `handle`. The product categories can also
be paginated.
x-authenticated: true
x-featureFlag: product_categories
parameters:
- in: query
name: q
description: term to search product categories' names and handles.
schema:
type: string
- in: query
name: handle
description: Filter by handle.
schema:
type: string
- in: query
name: is_internal
description: Filter by whether the category is internal or not.
schema:
type: boolean
- in: query
name: is_active
description: Filter by whether the category is active or not.
schema:
type: boolean
- in: query
name: include_descendants_tree
description: >-
If set to `true`, all nested descendants of a category are included in
the response.
schema:
type: boolean
- in: query
name: parent_category_id
description: Filter by the ID of a parent category.
schema:
type: string
- in: query
name: offset
description: >-
The number of product categories to skip when retrieving the product
categories.
schema:
type: integer
default: 0
- in: query
name: limit
description: Limit the number of product categories returned.
schema:
type: integer
default: 100
- in: query
name: expand
description: >-
Comma-separated relations that should be expanded in the returned
product categories.
schema:
type: string
- in: query
name: fields
description: >-
Comma-separated fields that should be included in the returned product
categories.
schema:
type: string
x-codegen:
method: list
queryParams: AdminGetProductCategoriesParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_product-categories/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_product-categories/get.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Product Categories
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminProductCategoriesListRes.yaml
'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: PostProductCategories
summary: Create a Product Category
description: Create a Product Category.
x-authenticated: true
x-featureFlag: product_categories
parameters:
- in: query
name: expand
description: >-
Comma-separated relations that should be expanded in the returned
product category.
schema:
type: string
- in: query
name: fields
description: >-
Comma-separated fields that should be included in the returned product
category.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostProductCategoriesReq.yaml
x-codegen:
method: create
queryParams: AdminPostProductCategoriesParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_product-categories/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_product-categories/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Product Categories
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminProductCategoriesCategoryRes.yaml
'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
@@ -0,0 +1,179 @@
get:
operationId: GetProductCategoriesCategory
summary: Get a Product Category
description: Retrieve a Product Category's details.
x-authenticated: true
x-featureFlag: product_categories
parameters:
- in: path
name: id
required: true
description: The ID of the Product Category
schema:
type: string
- in: query
name: expand
description: >-
Comma-separated relations that should be expanded in the returned
product category.
schema:
type: string
- in: query
name: fields
description: >-
Comma-separated fields that should be included in the returned product
category.
schema:
type: string
x-codegen:
method: retrieve
queryParams: AdminGetProductCategoryParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_product-categories_{id}/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_product-categories_{id}/get.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Product Categories
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminProductCategoriesCategoryRes.yaml
'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: PostProductCategoriesCategory
summary: Update a Product Category
description: Updates a Product Category.
x-authenticated: true
x-featureFlag: product_categories
parameters:
- in: path
name: id
required: true
description: The ID of the Product Category.
schema:
type: string
- in: query
name: expand
description: >-
(Comma separated) Which fields should be expanded in each product
category.
schema:
type: string
- in: query
name: fields
description: >-
(Comma separated) Which fields should be retrieved in each product
category.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostProductCategoriesCategoryReq.yaml
x-codegen:
method: update
queryParams: AdminPostProductCategoriesCategoryParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_product-categories_{id}/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_product-categories_{id}/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Product Categories
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminProductCategoriesCategoryRes.yaml
'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
delete:
operationId: DeleteProductCategoriesCategory
summary: Delete a Product Category
description: Delete a Product Category. This does not delete associated products.
x-authenticated: true
x-featureFlag: product_categories
parameters:
- in: path
name: id
required: true
description: The ID of the Product Category
schema:
type: string
x-codegen:
method: delete
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_product-categories_{id}/delete.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_product-categories_{id}/delete.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Product Categories
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminProductCategoriesCategoryDeleteRes.yaml
'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
@@ -0,0 +1,142 @@
post:
operationId: PostProductCategoriesCategoryProductsBatch
summary: Add Products to a Category
description: Add a list of products to a product category.
x-authenticated: true
x-featureFlag: product_categories
parameters:
- in: path
name: id
required: true
description: The ID of the Product Category.
schema:
type: string
- in: query
name: expand
description: >-
Comma-separated relations that should be expanded in the returned
product category.
schema:
type: string
- in: query
name: fields
description: >-
Comma-separated fields that should be included in the returned product
category.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: >-
../components/schemas/AdminPostProductCategoriesCategoryProductsBatchReq.yaml
x-codegen:
method: addProducts
queryParams: AdminPostProductCategoriesCategoryProductsBatchParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/admin_product-categories_{id}_products_batch/post.js
- lang: Shell
label: cURL
source:
$ref: >-
../code_samples/Shell/admin_product-categories_{id}_products_batch/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Product Categories
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminProductCategoriesCategoryRes.yaml
'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
delete:
operationId: DeleteProductCategoriesCategoryProductsBatch
summary: Remove Products from Category
description: Remove a list of products from a product category.
x-authenticated: true
x-featureFlag: product_categories
parameters:
- in: path
name: id
required: true
description: The ID of the Product Category.
schema:
type: string
- in: query
name: expand
description: >-
Comma-separated relations that should be expanded in the returned
product category.
schema:
type: string
- in: query
name: fields
description: >-
Comma-separated fields that should be included in the returned product
category.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: >-
../components/schemas/AdminDeleteProductCategoriesCategoryProductsBatchReq.yaml
x-codegen:
method: removeProducts
queryParams: AdminDeleteProductCategoriesCategoryProductsBatchParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/admin_product-categories_{id}_products_batch/delete.js
- lang: Shell
label: cURL
source:
$ref: >-
../code_samples/Shell/admin_product-categories_{id}_products_batch/delete.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Product Categories
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminProductCategoriesCategoryRes.yaml
'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
@@ -0,0 +1,135 @@
get:
operationId: GetProductTags
summary: List Product Tags
description: >-
Retrieve a list of product tags. The product tags can be filtered by fields
such as `q` or `value`. The product tags can also be sorted or paginated.
x-authenticated: true
parameters:
- in: query
name: limit
description: Limit the number of product tags returned.
schema:
type: integer
default: 10
- in: query
name: offset
description: The number of product tags to skip when retrieving the product tags.
schema:
type: integer
default: 0
- in: query
name: order
description: A product tag field to sort-order the retrieved product tags by.
schema:
type: string
- in: query
name: discount_condition_id
description: >-
Filter by the ID of a discount condition. Only product tags that this
discount condition is applied to will be retrieved.
schema:
type: string
- in: query
name: value
style: form
explode: false
description: Filter by tag value.
schema:
type: array
items:
type: string
- in: query
name: q
description: term to search product tags' values.
schema:
type: string
- in: query
name: id
style: form
explode: false
description: Filter by tag IDs.
schema:
type: array
items:
type: string
- in: query
name: created_at
description: Filter by a creation date range.
schema:
type: object
properties:
lt:
type: string
description: filter by dates less than this date
format: date
gt:
type: string
description: filter by dates greater than this date
format: date
lte:
type: string
description: filter by dates less than or equal to this date
format: date
gte:
type: string
description: filter by dates greater than or equal to this date
format: date
- in: query
name: updated_at
description: Filter by an update date range.
schema:
type: object
properties:
lt:
type: string
description: filter by dates less than this date
format: date
gt:
type: string
description: filter by dates greater than this date
format: date
lte:
type: string
description: filter by dates less than or equal to this date
format: date
gte:
type: string
description: filter by dates greater than or equal to this date
format: date
x-codegen:
method: list
queryParams: AdminGetProductTagsParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_product-tags/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_product-tags/get.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Product Tags
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminProductTagsListRes.yaml
'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
@@ -0,0 +1,136 @@
get:
operationId: GetProductTypes
summary: List Product Types
description: >-
Retrieve a list of product types. The product types can be filtered by
fields such as `q` or `value`. The product types can also be sorted or
paginated.
x-authenticated: true
parameters:
- in: query
name: limit
description: Limit the number of product types returned.
schema:
type: integer
default: 20
- in: query
name: offset
description: The number of product types to skip when retrieving the product types.
schema:
type: integer
default: 0
- in: query
name: order
description: A product type field to sort-order the retrieved product types by.
schema:
type: string
- in: query
name: discount_condition_id
description: >-
Filter by the ID of a discount condition. Only product types that this
discount condition is applied to will be retrieved.
schema:
type: string
- in: query
name: value
style: form
explode: false
description: Filter by value.
schema:
type: array
items:
type: string
- in: query
name: id
style: form
explode: false
description: Filter by product type IDs.
schema:
type: array
items:
type: string
- in: query
name: q
description: term to search product types' values.
schema:
type: string
- in: query
name: created_at
description: Filter by a creation date range.
schema:
type: object
properties:
lt:
type: string
description: filter by dates less than this date
format: date
gt:
type: string
description: filter by dates greater than this date
format: date
lte:
type: string
description: filter by dates less than or equal to this date
format: date
gte:
type: string
description: filter by dates greater than or equal to this date
format: date
- in: query
name: updated_at
description: Filter by an update date range.
schema:
type: object
properties:
lt:
type: string
description: filter by dates less than this date
format: date
gt:
type: string
description: filter by dates greater than this date
format: date
lte:
type: string
description: filter by dates less than or equal to this date
format: date
gte:
type: string
description: filter by dates greater than or equal to this date
format: date
x-codegen:
method: list
queryParams: AdminGetProductTypesParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_product-types/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_product-types/get.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Product Types
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminProductTypesListRes.yaml
'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
@@ -0,0 +1,324 @@
get:
operationId: GetProducts
summary: List Products
description: >-
Retrieve a list of products. The products can be filtered by fields such as
`q` or `status`. The products can also be sorted or paginated.
x-authenticated: true
parameters:
- in: query
name: q
description: >-
term to search products' title, description, variants' title and sku,
and collections' title.
schema:
type: string
- in: query
name: discount_condition_id
description: >-
Filter by the ID of a discount condition. Only products that this
discount condition is applied to will be retrieved.
schema:
type: string
- in: query
name: id
style: form
explode: false
description: Filter by product IDs.
schema:
oneOf:
- type: string
description: ID of the product.
- type: array
items:
type: string
description: ID of a product.
- in: query
name: status
style: form
explode: false
description: Filter by status.
schema:
type: array
items:
type: string
enum:
- draft
- proposed
- published
- rejected
- in: query
name: collection_id
style: form
explode: false
description: >-
Filter by product collection IDs. Only products that are associated with
the specified collections will be retrieved.
schema:
type: array
items:
type: string
- in: query
name: tags
style: form
explode: false
description: >-
Filter by product tag IDs. Only products that are associated with the
specified tags will be retrieved.
schema:
type: array
items:
type: string
- in: query
name: price_list_id
style: form
explode: false
description: >-
Filter by IDs of price lists. Only products that these price lists are
applied to will be retrieved.
schema:
type: array
items:
type: string
- in: query
name: sales_channel_id
style: form
explode: false
description: >-
Filter by sales channel IDs. Only products that are available in the
specified sales channels will be retrieved.
schema:
type: array
items:
type: string
- in: query
name: type_id
style: form
explode: false
description: >-
Filter by product type IDs. Only products that are associated with the
specified types will be retrieved.
schema:
type: array
items:
type: string
- in: query
name: category_id
style: form
explode: false
description: >-
Filter by product category IDs. Only products that are associated with
the specified categories will be retrieved.
schema:
type: array
x-featureFlag: product_categories
items:
type: string
- in: query
name: include_category_children
style: form
explode: false
description: >-
whether to include product category children when filtering by
`category_id`
schema:
type: boolean
x-featureFlag: product_categories
- in: query
name: title
description: Filter by title.
schema:
type: string
- in: query
name: description
description: Filter by description.
schema:
type: string
- in: query
name: handle
description: Filter by handle.
schema:
type: string
- in: query
name: is_giftcard
description: Whether to retrieve gift cards or regular products.
schema:
type: boolean
- in: query
name: created_at
description: Filter by a creation date range.
schema:
type: object
properties:
lt:
type: string
description: filter by dates less than this date
format: date
gt:
type: string
description: filter by dates greater than this date
format: date
lte:
type: string
description: filter by dates less than or equal to this date
format: date
gte:
type: string
description: filter by dates greater than or equal to this date
format: date
- in: query
name: updated_at
description: Filter by an update date range.
schema:
type: object
properties:
lt:
type: string
description: filter by dates less than this date
format: date
gt:
type: string
description: filter by dates greater than this date
format: date
lte:
type: string
description: filter by dates less than or equal to this date
format: date
gte:
type: string
description: filter by dates greater than or equal to this date
format: date
- in: query
name: deleted_at
description: Filter by a deletion date range.
schema:
type: object
properties:
lt:
type: string
description: filter by dates less than this date
format: date
gt:
type: string
description: filter by dates greater than this date
format: date
lte:
type: string
description: filter by dates less than or equal to this date
format: date
gte:
type: string
description: filter by dates greater than or equal to this date
format: date
- in: query
name: offset
description: The number of products to skip when retrieving the products.
schema:
type: integer
default: 0
- in: query
name: limit
description: Limit the number of products returned.
schema:
type: integer
default: 50
- in: query
name: expand
description: >-
Comma-separated relations that should be expanded in the returned
products.
schema:
type: string
- in: query
name: fields
description: Comma-separated fields that should be included in the returned products.
schema:
type: string
- in: query
name: order
description: A product field to sort-order the retrieved products by.
schema:
type: string
x-codegen:
method: list
queryParams: AdminGetProductsParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_products/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_products/get.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Products
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminProductsListRes.yaml
'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: PostProducts
summary: Create a Product
x-authenticated: true
description: >-
Create a new Product. This endpoint can also be used to create a gift card
if the `is_giftcard` field is set to `true`.
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostProductsReq.yaml
x-codegen:
method: create
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_products/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_products/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Products
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminProductsRes.yaml
'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
@@ -0,0 +1,42 @@
get:
operationId: GetProductsTagUsage
summary: List Tags Usage Number
description: >-
Retrieve a list of Product Tags with how many times each is used in
products.
x-authenticated: true
x-codegen:
method: listTags
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_products_tag-usage/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_products_tag-usage/get.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Products
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminProductsListTagsRes.yaml
'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
@@ -0,0 +1,41 @@
get:
deprecated: true
operationId: GetProductsTypes
summary: List Product Types
description: Retrieve a list of Product Types.
x-authenticated: true
x-codegen:
method: listTypes
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_products_types/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_products_types/get.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Products
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminProductsListTypesRes.yaml
'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
@@ -0,0 +1,146 @@
get:
operationId: GetProductsProduct
summary: Get a Product
description: Retrieve a Product's details.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Product.
schema:
type: string
x-codegen:
method: retrieve
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_products_{id}/get.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_products_{id}/get.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Products
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminProductsRes.yaml
'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: PostProductsProduct
summary: Update a Product
description: Update a Product's details.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Product.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostProductsProductReq.yaml
x-codegen:
method: update
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_products_{id}/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_products_{id}/post.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Products
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminProductsRes.yaml
'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
delete:
operationId: DeleteProductsProduct
summary: Delete a Product
description: Delete a Product and its associated product variants and options.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Product.
schema:
type: string
x-codegen:
method: delete
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_products_{id}/delete.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_products_{id}/delete.sh
security:
- api_token: []
- cookie_auth: []
tags:
- Products
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminProductsDeleteRes.yaml
'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

Some files were not shown because too many files have changed in this diff Show More