245 lines
7.6 KiB
YAML
245 lines
7.6 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
|
|
x-associatedSchema:
|
|
$ref: "#/components/schemas/AdminCollection"
|
|
- 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
|
|
x-associatedSchema:
|
|
$ref: "#/components/schemas/AdminCustomerGroup"
|
|
- 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
|
|
x-associatedSchema:
|
|
$ref: "#/components/schemas/AdminCustomer"
|
|
- name: Draft Orders
|
|
- name: Fulfillment Providers
|
|
x-associatedSchema:
|
|
$ref: "#/components/schemas/AdminFulfillmentProvider"
|
|
- name: Fulfillment Sets
|
|
x-associatedSchema:
|
|
$ref: "#/components/schemas/AdminFulfillmentSet"
|
|
- name: Fulfillments
|
|
- name: 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: Orders
|
|
- name: Payments
|
|
- name: Price Lists
|
|
- name: Product Categories
|
|
x-associatedSchema:
|
|
$ref: "#/components/schemas/AdminProductCategory"
|
|
- name: Product Tags
|
|
- name: Product Types
|
|
- name: Products
|
|
x-associatedSchema:
|
|
$ref: "#/components/schemas/AdminProduct"
|
|
- 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: Reservations
|
|
- name: Return Reasons
|
|
- name: Returns
|
|
- 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
|
|
x-associatedSchema:
|
|
$ref: "#/components/schemas/AdminSalesChannel"
|
|
- name: Shipping Options
|
|
x-associatedSchema:
|
|
$ref: "#/components/schemas/AdminShippingOption"
|
|
- name: Shipping Profiles
|
|
x-associatedSchema:
|
|
$ref: "#/components/schemas/AdminShippingProfile"
|
|
- name: Stock Locations
|
|
- name: Stores
|
|
- name: Tax Rates
|
|
- name: Tax Regions
|
|
- name: Uploads
|
|
- name: 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
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/Error"
|
|
examples:
|
|
not_allowed:
|
|
$ref: "#/components/examples/not_allowed_error"
|
|
invalid_data:
|
|
$ref: "#/components/examples/invalid_data_error"
|
|
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
|