261 lines
8.9 KiB
YAML
261 lines
8.9 KiB
YAML
openapi: 3.0.0
|
|
info:
|
|
version: 2.0.0
|
|
title: Medusa Admin API
|
|
license:
|
|
name: MIT
|
|
url: https://github.com/medusajs/medusa/blob/master/LICENSE
|
|
tags:
|
|
- name: Api Keys
|
|
- name: Campaigns
|
|
- name: Collections
|
|
- name: Currencies
|
|
description: >
|
|
A store can use unlimited currencies, and each region must be associated
|
|
with at least one currency.
|
|
|
|
Currencies are defined within the Medusa backend. Currency API Routes allow admins to list and update currencies.
|
|
externalDocs:
|
|
description: How to manage currencies
|
|
url: https://docs.medusajs.com/modules/regions-and-currencies/admin/manage-currencies
|
|
- name: Customer Groups
|
|
description: >
|
|
Customer Groups can be used to organize customers that share similar data
|
|
or attributes into dedicated groups.
|
|
|
|
This can be useful for different purposes such as setting a different price for a specific customer group.
|
|
externalDocs:
|
|
description: How to manage customer groups
|
|
url: https://docs.medusajs.com/modules/customers/admin/manage-customer-groups
|
|
- name: Customers
|
|
description: >
|
|
Customers can either be created when they register through the Store APIs,
|
|
or created by the admin using the Admin APIs.
|
|
externalDocs:
|
|
description: How to manage customers
|
|
url: https://docs.medusajs.com/modules/customers/admin/manage-customers
|
|
- name: Fulfillment
|
|
- name: Inventory Items
|
|
description: >
|
|
Inventory items, provided by the [Inventory
|
|
Module](https://docs.medusajs.com/modules/multiwarehouse/inventory-module),
|
|
can be used to manage the inventory of saleable items in your store.
|
|
externalDocs:
|
|
description: How to manage inventory items
|
|
url: https://docs.medusajs.com/modules/multiwarehouse/admin/manage-inventory-items
|
|
- name: Invites
|
|
description: >
|
|
An admin can invite new users to manage their team. This would allow new
|
|
users to authenticate as admins and perform admin functionalities.
|
|
externalDocs:
|
|
description: How to manage invites
|
|
url: https://docs.medusajs.com/modules/users/admin/manage-invites
|
|
- name: Payments
|
|
description: >
|
|
A payment can be related to an order, swap, return, or more. It can be
|
|
captured or refunded.
|
|
- name: Price Lists
|
|
description: >
|
|
A price list are special prices applied to products based on a set of
|
|
conditions, such as customer group.
|
|
externalDocs:
|
|
description: How to manage price lists
|
|
url: https://docs.medusajs.com/modules/price-lists/admin/manage-price-lists
|
|
- name: Pricing
|
|
- name: Products
|
|
description: >
|
|
Products are saleable items in a store. This also includes [saleable gift
|
|
cards](https://docs.medusajs.com/modules/gift-cards/admin/manage-gift-cards#manage-gift-card-product)
|
|
in a store.
|
|
externalDocs:
|
|
description: How to manage products
|
|
url: https://docs.medusajs.com/modules/products/admin/manage-products
|
|
- name: Promotions
|
|
- name: Regions
|
|
description: >
|
|
Regions are different countries or geographical regions that the commerce
|
|
store serves customers in.
|
|
|
|
Admins can manage these regions, their providers, and more.
|
|
externalDocs:
|
|
description: How to manage regions
|
|
url: https://docs.medusajs.com/modules/regions-and-currencies/admin/manage-regions
|
|
- name: Sales Channels
|
|
description: >
|
|
A sales channel indicates a channel where products can be sold in. For
|
|
example, a webshop or a mobile app.
|
|
|
|
Admins can manage sales channels and the products available in them.
|
|
externalDocs:
|
|
description: How to manage sales channels
|
|
url: https://docs.medusajs.com/modules/sales-channels/admin/manage
|
|
- name: Stock Locations
|
|
- name: Stores
|
|
- name: Tax Rates
|
|
description: >
|
|
Each region has at least a default tax rate. Admins can create and manage
|
|
additional tax rates that can be applied for certain conditions, such as
|
|
for specific product types.
|
|
externalDocs:
|
|
description: How to manage tax rates
|
|
url: https://docs.medusajs.com/modules/taxes/admin/manage-tax-rates
|
|
- name: Tax Regions
|
|
- name: Users
|
|
description: >
|
|
A store can have more than one user, each having the same privileges.
|
|
Admins can manage users, their passwords, and more.
|
|
externalDocs:
|
|
description: How to manage users
|
|
url: https://docs.medusajs.com/modules/users/admin/manage-users
|
|
- name: Workflows Executions
|
|
servers:
|
|
- url: http://localhost:9000
|
|
- url: https://api.medusa-commerce.com
|
|
paths: {}
|
|
components:
|
|
responses:
|
|
default_error:
|
|
description: Default Error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/Error"
|
|
example:
|
|
code: unknown_error
|
|
message: An unknown error occurred.
|
|
type: unknown_error
|
|
invalid_state_error:
|
|
description: Invalid State Error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/Error"
|
|
example:
|
|
code: unknown_error
|
|
message: The request conflicted with another request. You may retry the request
|
|
with the provided Idempotency-Key.
|
|
type: QueryRunnerAlreadyReleasedError
|
|
invalid_request_error:
|
|
description: Invalid Request Error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/Error"
|
|
example:
|
|
code: invalid_request_error
|
|
message: Discount with code TEST already exists.
|
|
type: duplicate_error
|
|
not_found_error:
|
|
description: Not Found Error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/Error"
|
|
example:
|
|
message: Entity with id 1 was not found
|
|
type: not_found
|
|
400_error:
|
|
description: Client Error or Multiple Errors
|
|
content:
|
|
application/json:
|
|
schema:
|
|
oneOf:
|
|
- $ref: "#/components/schemas/Error"
|
|
- $ref: "#/components/schemas/MultipleErrors"
|
|
examples:
|
|
not_allowed:
|
|
$ref: "#/components/examples/not_allowed_error"
|
|
invalid_data:
|
|
$ref: "#/components/examples/invalid_data_error"
|
|
MultipleErrors:
|
|
$ref: "#/components/examples/multiple_errors"
|
|
500_error:
|
|
description: Server Error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/Error"
|
|
examples:
|
|
database:
|
|
$ref: "#/components/examples/database_error"
|
|
unexpected_state:
|
|
$ref: "#/components/examples/unexpected_state_error"
|
|
invalid_argument:
|
|
$ref: "#/components/examples/invalid_argument_error"
|
|
default_error:
|
|
$ref: "#/components/examples/default_error"
|
|
unauthorized:
|
|
description: User is not authorized. Must log in first
|
|
content:
|
|
text/plain:
|
|
schema:
|
|
type: string
|
|
default: Unauthorized
|
|
example: Unauthorized
|
|
incorrect_credentials:
|
|
description: User does not exist or incorrect credentials
|
|
content:
|
|
text/plain:
|
|
schema:
|
|
type: string
|
|
default: Unauthorized
|
|
example: Unauthorized
|
|
examples:
|
|
not_allowed_error:
|
|
summary: Not Allowed Error
|
|
value:
|
|
message: Discount must be set to dynamic
|
|
type: not_allowed
|
|
invalid_data_error:
|
|
summary: Invalid Data Error
|
|
value:
|
|
message: first_name must be a string
|
|
type: invalid_data
|
|
multiple_errors:
|
|
summary: Multiple Errors
|
|
value:
|
|
message: Provided request body contains errors. Please check the data and retry
|
|
the request
|
|
errors:
|
|
- message: first_name must be a string
|
|
type: invalid_data
|
|
- message: Discount must be set to dynamic
|
|
type: not_allowed
|
|
database_error:
|
|
summary: Database Error
|
|
value:
|
|
code: api_error
|
|
message: An error occured while hashing password
|
|
type: database_error
|
|
unexpected_state_error:
|
|
summary: Unexpected State Error
|
|
value:
|
|
message: cart.total must be defined
|
|
type: unexpected_state
|
|
invalid_argument_error:
|
|
summary: Invalid Argument Error
|
|
value:
|
|
message: cart.total must be defined
|
|
type: unexpected_state
|
|
default_error:
|
|
summary: Default Error
|
|
value:
|
|
code: unknown_error
|
|
message: An unknown error occurred.
|
|
type: unknown_error
|
|
securitySchemes:
|
|
api_token:
|
|
type: apiKey
|
|
x-displayName: API Token
|
|
in: header
|
|
name: x-medusa-access-token
|
|
jwt_token:
|
|
type: http
|
|
x-displayName: JWT Token
|
|
scheme: bearer
|
|
cookie_auth:
|
|
type: apiKey
|
|
in: cookie
|
|
name: connect.sid
|
|
x-displayName: Cookie Session ID
|