oas: update examples and security tags (#5256)
- Change cURL examples to use `x-medusa-access-token` instead of bearer - Add `jwt_token` to `securitySchemes` and update existing `api_token`.
This commit is contained in:
@@ -366,89 +366,16 @@ components:
|
||||
type: "unknown_error"
|
||||
securitySchemes:
|
||||
api_token:
|
||||
type: http
|
||||
type: apiKey
|
||||
x-displayName: API Token
|
||||
description: |
|
||||
Use a user's API Token to send authenticated requests.
|
||||
|
||||
### How to Add API Token to a User
|
||||
|
||||
At the moment, there's no direct way of adding an API Token for a user. The only way it can be done is through directly editing the database.
|
||||
|
||||
If you're using a PostgreSQL database, you can run the following commands in your command line to add API token:
|
||||
|
||||
```bash
|
||||
psql -d <DB_NAME> -U <DB_USER>
|
||||
UPDATE public.user SET api_token='<API_TOKEN>' WHERE email='<USER_EMAIL>';
|
||||
```
|
||||
|
||||
Where:
|
||||
- `<DB_NAME>` is the name of the database schema you use for the Medusa server.
|
||||
- `<DB_USER>` is the name of the user that has privileges over the database schema.
|
||||
- `<API_TOKEN>` is the API token you want to associate with the user. You can use [this tool to generate a random token](https://randomkeygen.com/).
|
||||
- `<USER_EMAIL>` is the email address of the admin user you want to have this API token.
|
||||
|
||||
### How to Use the API Token
|
||||
|
||||
The API token can be used for Bearer Authentication. It's passed in the `Authorization` header as the following:
|
||||
|
||||
```
|
||||
Authorization: Bearer {api_token}
|
||||
```
|
||||
|
||||
In this API reference, you'll find in the cURL request samples the use of `{api_token}`. This is where you must pass the API token.
|
||||
|
||||
If you're following along with the JS Client request samples, you must provide the `apiKey` option when creating the Medusa client:
|
||||
|
||||
```ts
|
||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3, apiKey: '{api_token}' })
|
||||
```
|
||||
|
||||
If you're using Medusa React, you can pass the `apiKey` prop to `MedusaProvider`:
|
||||
|
||||
```tsx
|
||||
<MedusaProvider
|
||||
apiKey='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
|
||||
description: |
|
||||
Use a cookie session to send authenticated requests.
|
||||
|
||||
### How to Obtain the Cookie Session
|
||||
|
||||
If you're sending requests through a browser, using JS Client, or using tools like Postman, the cookie session should be automatically set when the admin user is logged in.
|
||||
|
||||
If you're sending requests using cURL, you must set the Session ID in the cookie manually.
|
||||
|
||||
To do that, send a request to [authenticate the user](#tag/Auth/operation/PostAuth) and pass the cURL option `-v`:
|
||||
|
||||
```bash
|
||||
curl -v --location --request POST 'https://medusa-url.com/admin/auth' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"email": "user@example.com",
|
||||
"password": "supersecret"
|
||||
}'
|
||||
```
|
||||
|
||||
The headers will be logged in the terminal as well as the response. You should find in the headers a Cookie header similar to this:
|
||||
|
||||
```bash
|
||||
Set-Cookie: connect.sid=s%3A2Bu8BkaP9JUfHu9rG59G16Ma0QZf6Gj1.WT549XqX37PN8n0OecqnMCq798eLjZC5IT7yiDCBHPM;
|
||||
```
|
||||
|
||||
Copy the value after `connect.sid` (without the `;` at the end) and pass it as a cookie in subsequent requests as the following:
|
||||
|
||||
```bash
|
||||
curl --location --request GET 'https://medusa-url.com/admin/products' \
|
||||
--header 'Cookie: connect.sid={sid}'
|
||||
```
|
||||
|
||||
Where `{sid}` is the value of `connect.sid` that you copied.
|
||||
x-displayName: Cookie Session ID
|
||||
@@ -241,6 +241,10 @@ components:
|
||||
message: "An unknown error occurred."
|
||||
type: "unknown_error"
|
||||
securitySchemes:
|
||||
jwt_token:
|
||||
type: http
|
||||
x-displayName: JWT Token
|
||||
scheme: bearer
|
||||
cookie_auth:
|
||||
type: apiKey
|
||||
x-displayName: Cookie Session ID
|
||||
|
||||
@@ -21,7 +21,7 @@ import { validator } from "../../../../utils/validator"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/apps/authorizations' \
|
||||
* -H 'Authorization: Bearer {api_token}' \
|
||||
* -H 'x-medusa-access-token: {api_token}' \
|
||||
* -H 'Content-Type: application/json' \
|
||||
* --data-raw '{
|
||||
* "application_name": "example",
|
||||
@@ -31,6 +31,7 @@ import { validator } from "../../../../utils/validator"
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Apps Oauth
|
||||
* responses:
|
||||
|
||||
@@ -13,10 +13,11 @@ import { OauthService } from "../../../../services"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl '{backend_url}/admin/apps' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Apps Oauth
|
||||
* responses:
|
||||
|
||||
@@ -19,10 +19,11 @@
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X DELETE '{backend_url}/admin/auth' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Auth
|
||||
* responses:
|
||||
@@ -42,9 +43,11 @@
|
||||
* $ref: "#/components/responses/500_error"
|
||||
*/
|
||||
export default async (req, res) => {
|
||||
if (req.session.customer_id) { // if we are also logged in as a customer, persist that session
|
||||
if (req.session.customer_id) {
|
||||
// if we are also logged in as a customer, persist that session
|
||||
delete req.session.user_id
|
||||
} else { // otherwise, destroy the session
|
||||
} else {
|
||||
// otherwise, destroy the session
|
||||
req.session.destroy()
|
||||
}
|
||||
|
||||
|
||||
@@ -24,10 +24,11 @@ import _ from "lodash"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl '{backend_url}/admin/auth' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Auth
|
||||
* responses:
|
||||
|
||||
@@ -26,10 +26,11 @@ import { EntityManager } from "typeorm"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/batch-jobs/{id}/cancel' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Batch Jobs
|
||||
* responses:
|
||||
|
||||
@@ -26,10 +26,11 @@ import { EntityManager } from "typeorm"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/batch-jobs/{id}/confirm' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Batch Jobs
|
||||
* responses:
|
||||
|
||||
@@ -41,7 +41,7 @@ import { validator } from "../../../../utils/validator"
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/batch-jobs' \
|
||||
* -H 'Content-Type: application/json' \
|
||||
* -H 'Authorization: Bearer {api_token}' \
|
||||
* -H 'x-medusa-access-token: {api_token}' \
|
||||
* --data-raw '{
|
||||
* "type": "product-export",
|
||||
* "context": { }
|
||||
@@ -49,6 +49,7 @@ import { validator } from "../../../../utils/validator"
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Batch Jobs
|
||||
* responses:
|
||||
|
||||
@@ -23,10 +23,11 @@
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl '{backend_url}/admin/batch-jobs/{id}' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Batch Jobs
|
||||
* responses:
|
||||
|
||||
@@ -228,10 +228,11 @@ import { isDefined } from "medusa-core-utils"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl '{backend_url}/admin/batch-jobs' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Batch Jobs
|
||||
* responses:
|
||||
|
||||
@@ -40,7 +40,7 @@ import { defaultAdminCollectionsRelations } from "./index"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/collections/{id}/products/batch' \
|
||||
* -H 'Authorization: Bearer {api_token}' \
|
||||
* -H 'x-medusa-access-token: {api_token}' \
|
||||
* -H 'Content-Type: application/json' \
|
||||
* --data-raw '{
|
||||
* "product_ids": [
|
||||
@@ -50,6 +50,7 @@ import { defaultAdminCollectionsRelations } from "./index"
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Product Collections
|
||||
* responses:
|
||||
|
||||
@@ -34,7 +34,7 @@ import { defaultAdminCollectionsRelations } from "."
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/collections' \
|
||||
* -H 'Authorization: Bearer {api_token}' \
|
||||
* -H 'x-medusa-access-token: {api_token}' \
|
||||
* -H 'Content-Type: application/json' \
|
||||
* --data-raw '{
|
||||
* "title": "New Collection"
|
||||
@@ -42,6 +42,7 @@ import { defaultAdminCollectionsRelations } from "."
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Product Collections
|
||||
* responses:
|
||||
|
||||
@@ -28,10 +28,11 @@ import ProductCollectionService from "../../../../services/product-collection"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X DELETE '{backend_url}/admin/collections/{id}' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Product Collections
|
||||
* responses:
|
||||
|
||||
@@ -28,10 +28,11 @@ import { defaultAdminCollectionsRelations } from "."
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl '{backend_url}/admin/collections/{id}' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Product Collections
|
||||
* responses:
|
||||
|
||||
@@ -102,10 +102,11 @@ import { Type } from "class-transformer"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl '{backend_url}/admin/collections' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Product Collections
|
||||
* responses:
|
||||
|
||||
@@ -39,7 +39,7 @@ import ProductCollectionService from "../../../../services/product-collection"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X DELETE '{backend_url}/admin/collections/{id}/products/batch' \
|
||||
* -H 'Authorization: Bearer {api_token}' \
|
||||
* -H 'x-medusa-access-token: {api_token}' \
|
||||
* -H 'Content-Type: application/json' \
|
||||
* --data-raw '{
|
||||
* "product_ids": [
|
||||
@@ -49,6 +49,7 @@ import ProductCollectionService from "../../../../services/product-collection"
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Product Collections
|
||||
* responses:
|
||||
|
||||
@@ -36,7 +36,7 @@ import { defaultAdminCollectionsRelations } from "."
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/collections/{id}' \
|
||||
* -H 'Authorization: Bearer {api_token}' \
|
||||
* -H 'x-medusa-access-token: {api_token}' \
|
||||
* -H 'Content-Type: application/json' \
|
||||
* --data-raw '{
|
||||
* "title": "New Collection"
|
||||
@@ -44,6 +44,7 @@ import { defaultAdminCollectionsRelations } from "."
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Product Collections
|
||||
* responses:
|
||||
|
||||
@@ -41,10 +41,11 @@ import { FeatureFlagDecorators } from "../../../../utils/feature-flag-decorators
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/currencies' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Currencies
|
||||
* responses:
|
||||
|
||||
@@ -38,7 +38,7 @@ import { EntityManager } from "typeorm"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/currencies/{code}' \
|
||||
* -H 'Authorization: Bearer {api_token}' \
|
||||
* -H 'x-medusa-access-token: {api_token}' \
|
||||
* -H 'Content-Type: application/json' \
|
||||
* --data-raw '{
|
||||
* "includes_tax": true
|
||||
@@ -46,6 +46,7 @@ import { EntityManager } from "typeorm"
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Currencies
|
||||
* responses:
|
||||
|
||||
@@ -43,7 +43,7 @@ import { validator } from "../../../../utils/validator"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/customer-groups/{id}/customers/batch' \
|
||||
* -H 'Authorization: Bearer {api_token}' \
|
||||
* -H 'x-medusa-access-token: {api_token}' \
|
||||
* -H 'Content-Type: application/json' \
|
||||
* --data-raw '{
|
||||
* "customer_ids": [
|
||||
@@ -55,6 +55,7 @@ import { validator } from "../../../../utils/validator"
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Customer Groups
|
||||
* responses:
|
||||
|
||||
@@ -35,7 +35,7 @@ import { validator } from "../../../../utils/validator"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/customer-groups' \
|
||||
* -H 'Authorization: Bearer {api_token}' \
|
||||
* -H 'x-medusa-access-token: {api_token}' \
|
||||
* -H 'Content-Type: application/json' \
|
||||
* --data-raw '{
|
||||
* "name": "VIP"
|
||||
@@ -43,6 +43,7 @@ import { validator } from "../../../../utils/validator"
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Customer Groups
|
||||
* responses:
|
||||
|
||||
@@ -28,10 +28,11 @@ import { EntityManager } from "typeorm"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X DELETE '{backend_url}/admin/customer-groups/{id}' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Customer Groups
|
||||
* responses:
|
||||
|
||||
@@ -43,7 +43,7 @@ import { validator } from "../../../../utils/validator"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X DELETE '{backend_url}/admin/customer-groups/{id}/customers/batch' \
|
||||
* -H 'Authorization: Bearer {api_token}' \
|
||||
* -H 'x-medusa-access-token: {api_token}' \
|
||||
* -H 'Content-Type: application/json' \
|
||||
* --data-raw '{
|
||||
* "customer_ids": [
|
||||
@@ -55,6 +55,7 @@ import { validator } from "../../../../utils/validator"
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Customer Groups
|
||||
* responses:
|
||||
|
||||
+2
-1
@@ -34,10 +34,11 @@ import { Type } from "class-transformer"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl '{backend_url}/admin/customer-groups/{id}/customers' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Customer Groups
|
||||
* responses:
|
||||
|
||||
@@ -31,10 +31,11 @@ import { FindParams } from "../../../../types/common"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl '{backend_url}/admin/customer-groups/{id}' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Customer Groups
|
||||
* responses:
|
||||
|
||||
@@ -118,10 +118,11 @@ import { Type } from "class-transformer"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl '{backend_url}/admin/customer-groups' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Customer Groups
|
||||
* responses:
|
||||
|
||||
@@ -39,7 +39,7 @@ import { validator } from "../../../../utils/validator"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/customer-groups/{id}' \
|
||||
* -H 'Authorization: Bearer {api_token}' \
|
||||
* -H 'x-medusa-access-token: {api_token}' \
|
||||
* -H 'Content-Type: application/json' \
|
||||
* --data-raw '{
|
||||
* "name": "VIP"
|
||||
@@ -47,6 +47,7 @@ import { validator } from "../../../../utils/validator"
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Customer Groups
|
||||
* responses:
|
||||
|
||||
@@ -37,7 +37,7 @@ import { EntityManager } from "typeorm"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/customers' \
|
||||
* -H 'Authorization: Bearer {api_token}' \
|
||||
* -H 'x-medusa-access-token: {api_token}' \
|
||||
* -H 'Content-Type: application/json' \
|
||||
* --data-raw '{
|
||||
* "email": "user@example.com",
|
||||
@@ -48,6 +48,7 @@ import { EntityManager } from "typeorm"
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Customers
|
||||
* responses:
|
||||
|
||||
@@ -30,10 +30,11 @@ import { validator } from "../../../../utils/validator"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl '{backend_url}/admin/customers/{id}' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Customers
|
||||
* responses:
|
||||
|
||||
@@ -42,10 +42,11 @@ import customerController from "../../../../controllers/customers"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl '{backend_url}/admin/customers' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Customers
|
||||
* responses:
|
||||
|
||||
@@ -49,7 +49,7 @@ import { validator } from "../../../../utils/validator"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/customers/{id}' \
|
||||
* -H 'Authorization: Bearer {api_token}' \
|
||||
* -H 'x-medusa-access-token: {api_token}' \
|
||||
* -H 'Content-Type: application/json' \
|
||||
* --data-raw '{
|
||||
* "first_name": "Dolly"
|
||||
@@ -57,6 +57,7 @@ import { validator } from "../../../../utils/validator"
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Customers
|
||||
* responses:
|
||||
|
||||
@@ -30,10 +30,11 @@ import { EntityManager } from "typeorm"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/discounts/{id}/regions/{region_id}' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Discounts
|
||||
* responses:
|
||||
|
||||
@@ -46,7 +46,7 @@ import { FindParams } from "../../../../types/common"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/discounts/{id}/conditions/{condition_id}/batch' \
|
||||
* -H 'Authorization: Bearer {api_token}' \
|
||||
* -H 'x-medusa-access-token: {api_token}' \
|
||||
* -H 'Content-Type: application/json' \
|
||||
* --data-raw '{
|
||||
* "resources": [{ "id": "item_id" }]
|
||||
@@ -54,6 +54,7 @@ import { FindParams } from "../../../../types/common"
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Discounts
|
||||
* responses:
|
||||
|
||||
@@ -45,7 +45,7 @@ import { FindParams } from "../../../../types/common"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/discounts/{id}/conditions' \
|
||||
* -H 'Authorization: Bearer {api_token}' \
|
||||
* -H 'x-medusa-access-token: {api_token}' \
|
||||
* -H 'Content-Type: application/json' \
|
||||
* --data-raw '{
|
||||
* "operator": "in"
|
||||
@@ -53,6 +53,7 @@ import { FindParams } from "../../../../types/common"
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Discounts
|
||||
* responses:
|
||||
|
||||
@@ -68,7 +68,7 @@ import { FindParams } from "../../../../types/common"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/discounts' \
|
||||
* -H 'Authorization: Bearer {api_token}' \
|
||||
* -H 'x-medusa-access-token: {api_token}' \
|
||||
* -H 'Content-Type: application/json' \
|
||||
* --data-raw '{
|
||||
* "code": "TEST",
|
||||
@@ -82,6 +82,7 @@ import { FindParams } from "../../../../types/common"
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Discounts
|
||||
* responses:
|
||||
|
||||
@@ -44,7 +44,7 @@ import { EntityManager } from "typeorm"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/discounts/{id}/dynamic-codes' \
|
||||
* -H 'Authorization: Bearer {api_token}' \
|
||||
* -H 'x-medusa-access-token: {api_token}' \
|
||||
* -H 'Content-Type: application/json' \
|
||||
* --data-raw '{
|
||||
* "code": "TEST"
|
||||
@@ -52,6 +52,7 @@ import { EntityManager } from "typeorm"
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Discounts
|
||||
* responses:
|
||||
|
||||
@@ -33,10 +33,11 @@ import { FindParams } from "../../../../types/common"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X DELETE '{backend_url}/admin/discounts/{id}/conditions/{condition_id}' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Discounts
|
||||
* responses:
|
||||
|
||||
@@ -26,10 +26,11 @@ import { EntityManager } from "typeorm"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X DELETE '{backend_url}/admin/discounts/{id}' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Discounts
|
||||
* responses:
|
||||
|
||||
@@ -29,10 +29,11 @@ import { EntityManager } from "typeorm"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X DELETE '{backend_url}/admin/discounts/{id}/dynamic-codes/{code}' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Discounts
|
||||
* responses:
|
||||
|
||||
+2
-1
@@ -43,7 +43,7 @@ import { FindParams } from "../../../../types/common"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X DELETE '{backend_url}/admin/discounts/{id}/conditions/{condition_id}/batch' \
|
||||
* -H 'Authorization: Bearer {api_token}' \
|
||||
* -H 'x-medusa-access-token: {api_token}' \
|
||||
* -H 'Content-Type: application/json' \
|
||||
* --data-raw '{
|
||||
* "resources": [{ "id": "item_id" }]
|
||||
@@ -51,6 +51,7 @@ import { FindParams } from "../../../../types/common"
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Discounts
|
||||
* responses:
|
||||
|
||||
@@ -31,10 +31,11 @@ import { FindParams } from "../../../../types/common"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl '{backend_url}/admin/discounts/{id}/conditions/{condition_id}' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Discounts
|
||||
* responses:
|
||||
|
||||
@@ -30,10 +30,11 @@ import { FindParams } from "../../../../types/common"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl '{backend_url}/admin/discounts/code/{code}' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Discounts
|
||||
* responses:
|
||||
|
||||
@@ -30,10 +30,11 @@ import { FindParams } from "../../../../types/common"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl '{backend_url}/admin/discounts/{id}' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Discounts
|
||||
* responses:
|
||||
|
||||
@@ -57,10 +57,11 @@ import { optionalBooleanMapper } from "../../../../utils/validators/is-boolean"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl '{backend_url}/admin/discounts' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Discounts
|
||||
* responses:
|
||||
|
||||
@@ -29,10 +29,11 @@ import { EntityManager } from "typeorm"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X DELETE '{backend_url}/admin/discounts/{id}/regions/{region_id}' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Discounts
|
||||
* responses:
|
||||
|
||||
@@ -44,7 +44,7 @@ import { FindParams } from "../../../../types/common"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/discounts/{id}/conditions/{condition}' \
|
||||
* -H 'Authorization: Bearer {api_token}' \
|
||||
* -H 'x-medusa-access-token: {api_token}' \
|
||||
* -H 'Content-Type: application/json' \
|
||||
* --data-raw '{
|
||||
* "products": [
|
||||
@@ -54,6 +54,7 @@ import { FindParams } from "../../../../types/common"
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Discounts
|
||||
* responses:
|
||||
|
||||
@@ -57,7 +57,7 @@ import { FindParams } from "../../../../types/common"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/discounts/{id}' \
|
||||
* -H 'Authorization: Bearer {api_token}' \
|
||||
* -H 'x-medusa-access-token: {api_token}' \
|
||||
* -H 'Content-Type: application/json' \
|
||||
* --data-raw '{
|
||||
* "code": "TEST"
|
||||
@@ -65,6 +65,7 @@ import { FindParams } from "../../../../types/common"
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Discounts
|
||||
* responses:
|
||||
|
||||
@@ -68,7 +68,7 @@ import { cleanResponseData } from "../../../../utils/clean-response-data"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/draft-orders' \
|
||||
* -H 'Authorization: Bearer {api_token}' \
|
||||
* -H 'x-medusa-access-token: {api_token}' \
|
||||
* -H 'Content-Type: application/json' \
|
||||
* --data-raw '{
|
||||
* "email": "user@example.com",
|
||||
@@ -87,6 +87,7 @@ import { cleanResponseData } from "../../../../utils/clean-response-data"
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Draft Orders
|
||||
* responses:
|
||||
|
||||
@@ -53,7 +53,7 @@ import { validator } from "../../../../utils/validator"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/draft-orders/{id}/line-items' \
|
||||
* -H 'Authorization: Bearer {api_token}' \
|
||||
* -H 'x-medusa-access-token: {api_token}' \
|
||||
* -H 'Content-Type: application/json' \
|
||||
* --data-raw '{
|
||||
* "quantity": 1
|
||||
@@ -61,6 +61,7 @@ import { validator } from "../../../../utils/validator"
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Draft Orders
|
||||
* responses:
|
||||
|
||||
@@ -26,10 +26,11 @@ import { EntityManager } from "typeorm"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X DELETE '{backend_url}/admin/draft-orders/{id}' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Draft Orders
|
||||
* responses:
|
||||
|
||||
@@ -36,10 +36,11 @@ import { cleanResponseData } from "../../../../utils/clean-response-data"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X DELETE '{backend_url}/admin/draft-orders/{id}/line-items/{line_id}' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Draft Orders
|
||||
* responses:
|
||||
|
||||
@@ -34,10 +34,11 @@ import { cleanResponseData } from "../../../../utils/clean-response-data"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl '{backend_url}/admin/draft-orders/{id}' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Draft Orders
|
||||
* responses:
|
||||
|
||||
@@ -39,10 +39,11 @@ import { validator } from "../../../../utils/validator"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl '{backend_url}/admin/draft-orders' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Draft Orders
|
||||
* responses:
|
||||
|
||||
@@ -41,10 +41,11 @@ import { cleanResponseData } from "../../../../utils/clean-response-data"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/draft-orders/{id}/pay' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Draft Orders
|
||||
* responses:
|
||||
|
||||
@@ -53,7 +53,7 @@ import { cleanResponseData } from "../../../../utils/clean-response-data"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/draft-orders/{id}' \
|
||||
* -H 'Authorization: Bearer {api_token}' \
|
||||
* -H 'x-medusa-access-token: {api_token}' \
|
||||
* -H 'Content-Type: application/json' \
|
||||
* --data-raw '{
|
||||
* "email": "user@example.com"
|
||||
@@ -61,6 +61,7 @@ import { cleanResponseData } from "../../../../utils/clean-response-data"
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Draft Orders
|
||||
* responses:
|
||||
|
||||
@@ -46,7 +46,7 @@ import { cleanResponseData } from "../../../../utils/clean-response-data"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/draft-orders/{id}/line-items/{line_id}' \
|
||||
* -H 'Authorization: Bearer {api_token}' \
|
||||
* -H 'x-medusa-access-token: {api_token}' \
|
||||
* -H 'Content-Type: application/json' \
|
||||
* --data-raw '{
|
||||
* "quantity": 1
|
||||
@@ -54,6 +54,7 @@ import { cleanResponseData } from "../../../../utils/clean-response-data"
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Draft Orders
|
||||
* responses:
|
||||
|
||||
@@ -35,7 +35,7 @@ import { EntityManager } from "typeorm"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/gift-cards' \
|
||||
* -H 'Authorization: Bearer {api_token}' \
|
||||
* -H 'x-medusa-access-token: {api_token}' \
|
||||
* -H 'Content-Type: application/json' \
|
||||
* --data-raw '{
|
||||
* "region_id": "{region_id}"
|
||||
@@ -43,6 +43,7 @@ import { EntityManager } from "typeorm"
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Gift Cards
|
||||
* responses:
|
||||
|
||||
@@ -25,10 +25,11 @@ import { EntityManager } from "typeorm"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X DELETE '{backend_url}/admin/gift-cards/{id}' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Gift Cards
|
||||
* responses:
|
||||
|
||||
@@ -25,10 +25,11 @@ import { defaultAdminGiftCardFields, defaultAdminGiftCardRelations } from "./"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl '{backend_url}/admin/gift-cards/{id}' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Gift Cards
|
||||
* responses:
|
||||
|
||||
@@ -34,10 +34,11 @@ import { isDefined } from "medusa-core-utils"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl '{backend_url}/admin/gift-cards' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Gift Cards
|
||||
* responses:
|
||||
|
||||
@@ -38,7 +38,7 @@ import { validator } from "../../../../utils/validator"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/gift-cards/{id}' \
|
||||
* -H 'Authorization: Bearer {api_token}' \
|
||||
* -H 'x-medusa-access-token: {api_token}' \
|
||||
* -H 'Content-Type: application/json' \
|
||||
* --data-raw '{
|
||||
* "region_id": "{region_id}"
|
||||
@@ -46,6 +46,7 @@ import { validator } from "../../../../utils/validator"
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Gift Cards
|
||||
* responses:
|
||||
|
||||
@@ -45,7 +45,7 @@ import { validator } from "../../../../utils/validator"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/inventory-items' \
|
||||
* -H 'Authorization: Bearer {api_token}' \
|
||||
* -H 'x-medusa-access-token: {api_token}' \
|
||||
* -H 'Content-Type: application/json' \
|
||||
* --data-raw '{
|
||||
* "variant_id": "variant_123",
|
||||
@@ -53,6 +53,7 @@ import { validator } from "../../../../utils/validator"
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Inventory Items
|
||||
* responses:
|
||||
|
||||
@@ -39,7 +39,7 @@ import { FindParams } from "../../../../types/common"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/inventory-items/{id}/location-levels' \
|
||||
* -H 'Authorization: Bearer {api_token}' \
|
||||
* -H 'x-medusa-access-token: {api_token}' \
|
||||
* -H 'Content-Type: application/json' \
|
||||
* --data-raw '{
|
||||
* "location_id": "sloc_123",
|
||||
@@ -48,6 +48,7 @@ import { FindParams } from "../../../../types/common"
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Inventory Items
|
||||
* responses:
|
||||
|
||||
@@ -28,10 +28,11 @@ import { ProductVariantInventoryService } from "../../../../services"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X DELETE '{backend_url}/admin/inventory-items/{id}' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Inventory Items
|
||||
* responses:
|
||||
|
||||
@@ -29,10 +29,11 @@ import { EntityManager } from "typeorm"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X DELETE '{backend_url}/admin/inventory-items/{id}/location-levels/{location_id}' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Inventory Items
|
||||
* responses:
|
||||
|
||||
@@ -31,10 +31,11 @@ import { joinLevels } from "./utils/join-levels"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl '{backend_url}/admin/inventory-items/{id}' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Inventory Items
|
||||
* responses:
|
||||
|
||||
@@ -81,10 +81,11 @@ import { Transform } from "class-transformer"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl '{backend_url}/admin/inventory-items' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Inventory Items
|
||||
* responses:
|
||||
|
||||
@@ -42,10 +42,11 @@ import { IsType } from "../../../../utils/validators/is-type"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl '{backend_url}/admin/inventory-items/{id}/location-levels' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Inventory Items
|
||||
* responses:
|
||||
|
||||
@@ -40,7 +40,7 @@ import { IInventoryService } from "@medusajs/types"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/inventory-items/{id}' \
|
||||
* -H 'Authorization: Bearer {api_token}' \
|
||||
* -H 'x-medusa-access-token: {api_token}' \
|
||||
* -H 'Content-Type: application/json' \
|
||||
* --data-raw '{
|
||||
* "origin_country": "US"
|
||||
@@ -48,6 +48,7 @@ import { IInventoryService } from "@medusajs/types"
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Inventory Items
|
||||
* responses:
|
||||
|
||||
@@ -40,7 +40,7 @@ import { FindParams } from "../../../../types/common"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/inventory-items/{id}/location-levels/{location_id}' \
|
||||
* -H 'Authorization: Bearer {api_token}' \
|
||||
* -H 'x-medusa-access-token: {api_token}' \
|
||||
* -H 'Content-Type: application/json' \
|
||||
* --data-raw '{
|
||||
* "stocked_quantity": 15
|
||||
@@ -48,6 +48,7 @@ import { FindParams } from "../../../../types/common"
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Inventory Items
|
||||
* responses:
|
||||
|
||||
@@ -43,7 +43,7 @@ import { EntityManager } from "typeorm"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/invites/accept' \
|
||||
* -H 'Authorization: Bearer {api_token}' \
|
||||
* -H 'x-medusa-access-token: {api_token}' \
|
||||
* -H 'Content-Type: application/json' \
|
||||
* --data-raw '{
|
||||
* "token": "{token}",
|
||||
@@ -56,6 +56,7 @@ import { EntityManager } from "typeorm"
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Invites
|
||||
* responses:
|
||||
|
||||
@@ -40,7 +40,7 @@ import { EntityManager } from "typeorm"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/invites' \
|
||||
* -H 'Authorization: Bearer {api_token}' \
|
||||
* -H 'x-medusa-access-token: {api_token}' \
|
||||
* -H 'Content-Type: application/json' \
|
||||
* --data-raw '{
|
||||
* "user": "user@example.com",
|
||||
@@ -49,6 +49,7 @@ import { EntityManager } from "typeorm"
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Invites
|
||||
* responses:
|
||||
|
||||
@@ -26,10 +26,11 @@ import InviteService from "../../../../services/invite"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X DELETE '{backend_url}/admin/invites/{invite_id}' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Invites
|
||||
* responses:
|
||||
|
||||
@@ -23,10 +23,11 @@ import InviteService from "../../../../services/invite"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl '{backend_url}/admin/invites' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Invites
|
||||
* responses:
|
||||
|
||||
@@ -30,10 +30,11 @@ import { EntityManager } from "typeorm"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/invites/{invite_id}/resend' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Invites
|
||||
* responses:
|
||||
|
||||
@@ -36,7 +36,7 @@ import { EntityManager } from "typeorm"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/notes' \
|
||||
* -H 'Authorization: Bearer {api_token}' \
|
||||
* -H 'x-medusa-access-token: {api_token}' \
|
||||
* -H 'Content-Type: application/json' \
|
||||
* --data-raw '{
|
||||
* "resource_id": "{resource_id}",
|
||||
@@ -46,6 +46,7 @@ import { EntityManager } from "typeorm"
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Notes
|
||||
* responses:
|
||||
|
||||
@@ -26,10 +26,11 @@ import NoteService from "../../../../services/note"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X DELETE '{backend_url}/admin/notes/{id}' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Notes
|
||||
* responses:
|
||||
|
||||
@@ -25,10 +25,11 @@ import NoteService from "../../../../services/note"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl '{backend_url}/admin/notes/{id}' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Notes
|
||||
* responses:
|
||||
|
||||
@@ -33,10 +33,11 @@ import { validator } from "../../../../utils/validator"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl '{backend_url}/admin/notes' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Notes
|
||||
* responses:
|
||||
|
||||
@@ -35,7 +35,7 @@ import { EntityManager } from "typeorm"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/notes/{id}' \
|
||||
* -H 'Authorization: Bearer {api_token}' \
|
||||
* -H 'x-medusa-access-token: {api_token}' \
|
||||
* -H 'Content-Type: application/json' \
|
||||
* --data-raw '{
|
||||
* "value": "We delivered this order"
|
||||
@@ -43,6 +43,7 @@ import { EntityManager } from "typeorm"
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Notes
|
||||
* responses:
|
||||
|
||||
@@ -45,10 +45,11 @@ import { validator } from "../../../../utils/validator"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl '{backend_url}/admin/notifications' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Notifications
|
||||
* responses:
|
||||
|
||||
@@ -39,10 +39,11 @@ import { validator } from "../../../../utils/validator"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/notifications/{id}/resend' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Notifications
|
||||
* responses:
|
||||
|
||||
@@ -42,12 +42,13 @@ import {
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/order-edits/{id}/items' \
|
||||
* -H 'Authorization: Bearer {api_token}' \
|
||||
* -H 'x-medusa-access-token: {api_token}' \
|
||||
* -H 'Content-Type: application/json' \
|
||||
* --data-raw '{ "variant_id": "variant_01G1G5V2MRX2V3PVSR2WXYPFB6", "quantity": 3 }'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Order Edits
|
||||
* responses:
|
||||
|
||||
@@ -31,10 +31,11 @@ import {
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/order-edits/{id}/cancel' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Order Edits
|
||||
* responses:
|
||||
|
||||
@@ -31,10 +31,11 @@ import {
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/order-edits/{id}/confirm' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Order Edits
|
||||
* responses:
|
||||
|
||||
@@ -35,12 +35,13 @@ import {
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/order-edits' \
|
||||
* -H 'Authorization: Bearer {api_token}' \
|
||||
* -H 'x-medusa-access-token: {api_token}' \
|
||||
* -H 'Content-Type: application/json' \
|
||||
* --data-raw '{ "order_id": "my_order_id", "internal_note": "my_optional_note" }'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Order Edits
|
||||
* responses:
|
||||
|
||||
@@ -33,10 +33,11 @@ import {
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X DELETE '{backend_url}/admin/order-edits/{id}/items/{item_id}' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Order Edits
|
||||
* responses:
|
||||
|
||||
@@ -27,10 +27,11 @@ import { OrderEditService } from "../../../../services"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X DELETE '{backend_url}/admin/order-edits/{id}/changes/{change_id}' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Order Edits
|
||||
* responses:
|
||||
|
||||
@@ -26,10 +26,11 @@ import { OrderEditService } from "../../../../services"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X DELETE '{backend_url}/admin/order-edits/{id}' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Order Edits
|
||||
* responses:
|
||||
|
||||
@@ -30,10 +30,11 @@ import { FindParams } from "../../../../types/common"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl '{backend_url}/admin/order-edits/{id}' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Order Edits
|
||||
* responses:
|
||||
|
||||
@@ -34,10 +34,11 @@ import { IsOptional, IsString } from "class-validator"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl '{backend_url}/admin/order-edits' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Order Edits
|
||||
* responses:
|
||||
|
||||
@@ -37,10 +37,11 @@ import {
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/order-edits/{id}/request' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Order Edits
|
||||
* responses:
|
||||
|
||||
@@ -41,12 +41,13 @@ import {
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/order-edits/{id}/items/{item_id}' \
|
||||
* -H 'Authorization: Bearer {api_token}' \
|
||||
* -H 'x-medusa-access-token: {api_token}' \
|
||||
* -H 'Content-Type: application/json' \
|
||||
* --data-raw '{ "quantity": 5 }'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Order Edits
|
||||
* responses:
|
||||
|
||||
@@ -40,7 +40,7 @@ import {
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/order-edits/{id}' \
|
||||
* -H 'Authorization: Bearer {api_token}' \
|
||||
* -H 'x-medusa-access-token: {api_token}' \
|
||||
* -H 'Content-Type: application/json' \
|
||||
* --data-raw '{
|
||||
* "internal_note": "internal reason XY"
|
||||
@@ -48,6 +48,7 @@ import {
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Order Edits
|
||||
* responses:
|
||||
|
||||
@@ -47,7 +47,7 @@ import { cleanResponseData } from "../../../../utils/clean-response-data"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/orders/{id}/shipping-methods' \
|
||||
* -H 'Authorization: Bearer {api_token}' \
|
||||
* -H 'x-medusa-access-token: {api_token}' \
|
||||
* -H 'Content-Type: application/json' \
|
||||
* --data-raw '{
|
||||
* "price": 1000,
|
||||
@@ -56,6 +56,7 @@ import { cleanResponseData } from "../../../../utils/clean-response-data"
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Orders
|
||||
* responses:
|
||||
|
||||
@@ -31,10 +31,11 @@ import { cleanResponseData } from "../../../../utils/clean-response-data"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/orders/{id}/archive' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Orders
|
||||
* responses:
|
||||
|
||||
@@ -37,10 +37,11 @@ import { cleanResponseData } from "../../../../utils/clean-response-data"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/orders/{id}/claims/{claim_id}/cancel' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Orders
|
||||
* responses:
|
||||
|
||||
@@ -39,10 +39,11 @@ import { cleanResponseData } from "../../../../utils/clean-response-data"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/orders/{id}/claims/{claim_id}/fulfillments/{fulfillment_id}/cancel' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Orders
|
||||
* responses:
|
||||
|
||||
@@ -39,10 +39,11 @@ import { cleanResponseData } from "../../../../utils/clean-response-data"
|
||||
* label: cURL
|
||||
* source: |
|
||||
* curl -X POST '{backend_url}/admin/orders/{id}/swaps/{swap_id}/fulfillments/{fulfillment_id}/cancel' \
|
||||
* -H 'Authorization: Bearer {api_token}'
|
||||
* -H 'x-medusa-access-token: {api_token}'
|
||||
* security:
|
||||
* - api_token: []
|
||||
* - cookie_auth: []
|
||||
* - jwt_token: []
|
||||
* tags:
|
||||
* - Orders
|
||||
* responses:
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user