chore(docs): Generated API Reference (#2927)
Co-authored-by: shahednasser <shahednasser@users.noreply.github.com>
This commit is contained in:
1 parent
19d7be31eb
commit
cd32795595
12 files changed
+3847
-3419
No files matched your search
+1783
-1636
File diff suppressed because it is too large.
Load diff
+1678
-1531
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,9 @@
|
|||||||
|
import Medusa from "@medusajs/medusa-js"
|
||||||
|
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||||
|
// must be previously logged in or use api token
|
||||||
|
medusa.admin.uploads.delete({
|
||||||
|
file_key
|
||||||
|
})
|
||||||
|
.then(({ id, object, deleted }) => {
|
||||||
|
console.log(id);
|
||||||
|
});
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import Medusa from "@medusajs/medusa-js"
|
||||||
|
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||||
|
// must be previously logged in or use api token
|
||||||
|
medusa.admin.uploads.getPresignedDownloadUrl({
|
||||||
|
file_key
|
||||||
|
})
|
||||||
|
.then(({ download_url }) => {
|
||||||
|
console.log(download_url);
|
||||||
|
});
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
curl --location --request DELETE 'https://medusa-url.com/admin/uploads' \
|
||||||
|
--header 'Authorization: Bearer {api_token}' \
|
||||||
|
--header 'Content-Type: application/json' \
|
||||||
|
--data-raw '{
|
||||||
|
"file_key": "{file_key}"
|
||||||
|
}'
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
curl --location --request POST 'https://medusa-url.com/admin/uploads/download-url' \
|
||||||
|
--header 'Authorization: Bearer {api_token}' \
|
||||||
|
--header 'Content-Type: application/json' \
|
||||||
|
--data-raw '{
|
||||||
|
"file_key": "{file_key}"
|
||||||
|
}'
|
||||||
+28
-26
@@ -193,6 +193,10 @@ paths:
|
|||||||
$ref: paths/collections.yaml
|
$ref: paths/collections.yaml
|
||||||
/collections/{id}:
|
/collections/{id}:
|
||||||
$ref: paths/collections_{id}.yaml
|
$ref: paths/collections_{id}.yaml
|
||||||
|
/currencies:
|
||||||
|
$ref: paths/currencies.yaml
|
||||||
|
/currencies/{code}:
|
||||||
|
$ref: paths/currencies_{code}.yaml
|
||||||
/customer-groups/{id}/customers/batch:
|
/customer-groups/{id}/customers/batch:
|
||||||
$ref: paths/customer-groups_{id}_customers_batch.yaml
|
$ref: paths/customer-groups_{id}_customers_batch.yaml
|
||||||
/customer-groups:
|
/customer-groups:
|
||||||
@@ -201,10 +205,6 @@ paths:
|
|||||||
$ref: paths/customer-groups_{id}.yaml
|
$ref: paths/customer-groups_{id}.yaml
|
||||||
/customer-groups/{id}/customers:
|
/customer-groups/{id}/customers:
|
||||||
$ref: paths/customer-groups_{id}_customers.yaml
|
$ref: paths/customer-groups_{id}_customers.yaml
|
||||||
/currencies:
|
|
||||||
$ref: paths/currencies.yaml
|
|
||||||
/currencies/{code}:
|
|
||||||
$ref: paths/currencies_{code}.yaml
|
|
||||||
/customers:
|
/customers:
|
||||||
$ref: paths/customers.yaml
|
$ref: paths/customers.yaml
|
||||||
/customers/{id}:
|
/customers/{id}:
|
||||||
@@ -227,10 +227,6 @@ paths:
|
|||||||
$ref: paths/discounts_{id}_dynamic-codes_{code}.yaml
|
$ref: paths/discounts_{id}_dynamic-codes_{code}.yaml
|
||||||
/discounts/code/{code}:
|
/discounts/code/{code}:
|
||||||
$ref: paths/discounts_code_{code}.yaml
|
$ref: paths/discounts_code_{code}.yaml
|
||||||
/gift-cards:
|
|
||||||
$ref: paths/gift-cards.yaml
|
|
||||||
/gift-cards/{id}:
|
|
||||||
$ref: paths/gift-cards_{id}.yaml
|
|
||||||
/draft-orders:
|
/draft-orders:
|
||||||
$ref: paths/draft-orders.yaml
|
$ref: paths/draft-orders.yaml
|
||||||
/draft-orders/{id}/line-items:
|
/draft-orders/{id}/line-items:
|
||||||
@@ -243,6 +239,10 @@ paths:
|
|||||||
$ref: paths/draft-orders_{id}_pay.yaml
|
$ref: paths/draft-orders_{id}_pay.yaml
|
||||||
/admin/draft-orders/{id}:
|
/admin/draft-orders/{id}:
|
||||||
$ref: paths/admin_draft-orders_{id}.yaml
|
$ref: paths/admin_draft-orders_{id}.yaml
|
||||||
|
/gift-cards:
|
||||||
|
$ref: paths/gift-cards.yaml
|
||||||
|
/gift-cards/{id}:
|
||||||
|
$ref: paths/gift-cards_{id}.yaml
|
||||||
/invites/accept:
|
/invites/accept:
|
||||||
$ref: paths/invites_accept.yaml
|
$ref: paths/invites_accept.yaml
|
||||||
/invites:
|
/invites:
|
||||||
@@ -329,6 +329,12 @@ paths:
|
|||||||
$ref: paths/payment-collections_{id}.yaml
|
$ref: paths/payment-collections_{id}.yaml
|
||||||
/payment-collections/{id}/authorize:
|
/payment-collections/{id}/authorize:
|
||||||
$ref: paths/payment-collections_{id}_authorize.yaml
|
$ref: paths/payment-collections_{id}_authorize.yaml
|
||||||
|
/payments/{id}/capture:
|
||||||
|
$ref: paths/payments_{id}_capture.yaml
|
||||||
|
/payments/{id}:
|
||||||
|
$ref: paths/payments_{id}.yaml
|
||||||
|
/payments/{id}/refund:
|
||||||
|
$ref: paths/payments_{id}_refund.yaml
|
||||||
/price-lists/{id}/prices/batch:
|
/price-lists/{id}/prices/batch:
|
||||||
$ref: paths/price-lists_{id}_prices_batch.yaml
|
$ref: paths/price-lists_{id}_prices_batch.yaml
|
||||||
/price-lists:
|
/price-lists:
|
||||||
@@ -341,10 +347,10 @@ paths:
|
|||||||
$ref: paths/price-lists_{id}_variants_{variant_id}_prices.yaml
|
$ref: paths/price-lists_{id}_variants_{variant_id}_prices.yaml
|
||||||
/price-lists/{id}/products:
|
/price-lists/{id}/products:
|
||||||
$ref: paths/price-lists_{id}_products.yaml
|
$ref: paths/price-lists_{id}_products.yaml
|
||||||
/product-types:
|
|
||||||
$ref: paths/product-types.yaml
|
|
||||||
/product-tags:
|
/product-tags:
|
||||||
$ref: paths/product-tags.yaml
|
$ref: paths/product-tags.yaml
|
||||||
|
/product-types:
|
||||||
|
$ref: paths/product-types.yaml
|
||||||
/products/{id}/options:
|
/products/{id}/options:
|
||||||
$ref: paths/products_{id}_options.yaml
|
$ref: paths/products_{id}_options.yaml
|
||||||
/products:
|
/products:
|
||||||
@@ -363,12 +369,6 @@ paths:
|
|||||||
$ref: paths/products_types.yaml
|
$ref: paths/products_types.yaml
|
||||||
/products/{id}/metadata:
|
/products/{id}/metadata:
|
||||||
$ref: paths/products_{id}_metadata.yaml
|
$ref: paths/products_{id}_metadata.yaml
|
||||||
/payments/{id}/capture:
|
|
||||||
$ref: paths/payments_{id}_capture.yaml
|
|
||||||
/payments/{id}:
|
|
||||||
$ref: paths/payments_{id}.yaml
|
|
||||||
/payments/{id}/refund:
|
|
||||||
$ref: paths/payments_{id}_refund.yaml
|
|
||||||
/publishable-api-keys/{id}/sales-channels/batch:
|
/publishable-api-keys/{id}/sales-channels/batch:
|
||||||
$ref: paths/publishable-api-keys_{id}_sales-channels_batch.yaml
|
$ref: paths/publishable-api-keys_{id}_sales-channels_batch.yaml
|
||||||
/publishable-api-keys:
|
/publishable-api-keys:
|
||||||
@@ -403,22 +403,26 @@ paths:
|
|||||||
$ref: paths/return-reasons.yaml
|
$ref: paths/return-reasons.yaml
|
||||||
/return-reasons/{id}:
|
/return-reasons/{id}:
|
||||||
$ref: paths/return-reasons_{id}.yaml
|
$ref: paths/return-reasons_{id}.yaml
|
||||||
/sales-channels/{id}/products/batch:
|
|
||||||
$ref: paths/sales-channels_{id}_products_batch.yaml
|
|
||||||
/sales-channels:
|
|
||||||
$ref: paths/sales-channels.yaml
|
|
||||||
/sales-channels/{id}:
|
|
||||||
$ref: paths/sales-channels_{id}.yaml
|
|
||||||
/returns/{id}/cancel:
|
/returns/{id}/cancel:
|
||||||
$ref: paths/returns_{id}_cancel.yaml
|
$ref: paths/returns_{id}_cancel.yaml
|
||||||
/returns:
|
/returns:
|
||||||
$ref: paths/returns.yaml
|
$ref: paths/returns.yaml
|
||||||
/returns/{id}/receive:
|
/returns/{id}/receive:
|
||||||
$ref: paths/returns_{id}_receive.yaml
|
$ref: paths/returns_{id}_receive.yaml
|
||||||
|
/sales-channels/{id}/products/batch:
|
||||||
|
$ref: paths/sales-channels_{id}_products_batch.yaml
|
||||||
|
/sales-channels:
|
||||||
|
$ref: paths/sales-channels.yaml
|
||||||
|
/sales-channels/{id}:
|
||||||
|
$ref: paths/sales-channels_{id}.yaml
|
||||||
/shipping-options:
|
/shipping-options:
|
||||||
$ref: paths/shipping-options.yaml
|
$ref: paths/shipping-options.yaml
|
||||||
/shipping-options/{id}:
|
/shipping-options/{id}:
|
||||||
$ref: paths/shipping-options_{id}.yaml
|
$ref: paths/shipping-options_{id}.yaml
|
||||||
|
/shipping-profiles:
|
||||||
|
$ref: paths/shipping-profiles.yaml
|
||||||
|
/shipping-profiles/{id}:
|
||||||
|
$ref: paths/shipping-profiles_{id}.yaml
|
||||||
/store/currencies/{code}:
|
/store/currencies/{code}:
|
||||||
$ref: paths/store_currencies_{code}.yaml
|
$ref: paths/store_currencies_{code}.yaml
|
||||||
/store:
|
/store:
|
||||||
@@ -441,14 +445,12 @@ paths:
|
|||||||
$ref: paths/tax-rates.yaml
|
$ref: paths/tax-rates.yaml
|
||||||
/tax-rates/{id}:
|
/tax-rates/{id}:
|
||||||
$ref: paths/tax-rates_{id}.yaml
|
$ref: paths/tax-rates_{id}.yaml
|
||||||
/shipping-profiles:
|
|
||||||
$ref: paths/shipping-profiles.yaml
|
|
||||||
/shipping-profiles/{id}:
|
|
||||||
$ref: paths/shipping-profiles_{id}.yaml
|
|
||||||
/uploads/protected:
|
/uploads/protected:
|
||||||
$ref: paths/uploads_protected.yaml
|
$ref: paths/uploads_protected.yaml
|
||||||
/uploads:
|
/uploads:
|
||||||
$ref: paths/uploads.yaml
|
$ref: paths/uploads.yaml
|
||||||
|
/uploads/download-url:
|
||||||
|
$ref: paths/uploads_download-url.yaml
|
||||||
/users:
|
/users:
|
||||||
$ref: paths/users.yaml
|
$ref: paths/users.yaml
|
||||||
/users/{id}:
|
/users/{id}:
|
||||||
|
|||||||
@@ -57,3 +57,58 @@ post:
|
|||||||
$ref: ../components/responses/invalid_request_error.yaml
|
$ref: ../components/responses/invalid_request_error.yaml
|
||||||
'500':
|
'500':
|
||||||
$ref: ../components/responses/500_error.yaml
|
$ref: ../components/responses/500_error.yaml
|
||||||
|
delete:
|
||||||
|
operationId: AdminDeleteUploads
|
||||||
|
summary: Delete an Uploaded File
|
||||||
|
description: Removes an uploaded file using the installed fileservice
|
||||||
|
x-authenticated: true
|
||||||
|
requestBody:
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: ../components/schemas/AdminDeleteUploadsReq.yaml
|
||||||
|
x-codeSamples:
|
||||||
|
- lang: JavaScript
|
||||||
|
label: JS Client
|
||||||
|
source:
|
||||||
|
$ref: ../code_samples/JavaScript/uploads/deleteundefined
|
||||||
|
- lang: Shell
|
||||||
|
label: cURL
|
||||||
|
source:
|
||||||
|
$ref: ../code_samples/Shell/uploads/deleteundefined
|
||||||
|
security:
|
||||||
|
- api_token: []
|
||||||
|
- cookie_auth: []
|
||||||
|
tags:
|
||||||
|
- Upload
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: OK
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
id:
|
||||||
|
type: string
|
||||||
|
description: The file key of the upload deleted
|
||||||
|
object:
|
||||||
|
type: string
|
||||||
|
description: The type of the object that was deleted.
|
||||||
|
default: file
|
||||||
|
deleted:
|
||||||
|
type: boolean
|
||||||
|
description: Whether or not the items were deleted.
|
||||||
|
default: true
|
||||||
|
'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: PostUploadsDownloadUrl
|
||||||
|
summary: Get a File's Download URL
|
||||||
|
description: Creates a presigned download url for a file
|
||||||
|
x-authenticated: true
|
||||||
|
requestBody:
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: ../components/schemas/AdminPostUploadsDownloadUrlReq.yaml
|
||||||
|
x-codeSamples:
|
||||||
|
- lang: JavaScript
|
||||||
|
label: JS Client
|
||||||
|
source:
|
||||||
|
$ref: ../code_samples/JavaScript/uploads_download-url/postundefined
|
||||||
|
- lang: Shell
|
||||||
|
label: cURL
|
||||||
|
source:
|
||||||
|
$ref: ../code_samples/Shell/uploads_download-url/postundefined
|
||||||
|
security:
|
||||||
|
- api_token: []
|
||||||
|
- cookie_auth: []
|
||||||
|
tags:
|
||||||
|
- Upload
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: OK
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
download_url:
|
||||||
|
type: string
|
||||||
|
description: The Download URL of the file
|
||||||
|
'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
|
||||||
+53
-53
@@ -1429,59 +1429,6 @@ paths:
|
|||||||
$ref: '#/components/responses/invalid_request_error'
|
$ref: '#/components/responses/invalid_request_error'
|
||||||
'500':
|
'500':
|
||||||
$ref: '#/components/responses/500_error'
|
$ref: '#/components/responses/500_error'
|
||||||
'/gift-cards/{code}':
|
|
||||||
get:
|
|
||||||
operationId: GetGiftCardsCode
|
|
||||||
summary: Get Gift Card by Code
|
|
||||||
description: Retrieves a Gift Card by its associated unqiue code.
|
|
||||||
parameters:
|
|
||||||
- in: path
|
|
||||||
name: code
|
|
||||||
required: true
|
|
||||||
description: The unique Gift Card code.
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
x-codeSamples:
|
|
||||||
- lang: JavaScript
|
|
||||||
label: JS Client
|
|
||||||
source: >
|
|
||||||
import Medusa from "@medusajs/medusa-js"
|
|
||||||
|
|
||||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries:
|
|
||||||
3 })
|
|
||||||
|
|
||||||
medusa.giftCards.retrieve(code)
|
|
||||||
|
|
||||||
.then(({ gift_card }) => {
|
|
||||||
console.log(gift_card.id);
|
|
||||||
});
|
|
||||||
- lang: Shell
|
|
||||||
label: cURL
|
|
||||||
source: >
|
|
||||||
curl --location --request GET
|
|
||||||
'https://medusa-url.com/store/gift-cards/{code}'
|
|
||||||
tags:
|
|
||||||
- Gift Card
|
|
||||||
responses:
|
|
||||||
'200':
|
|
||||||
description: OK
|
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
gift_card:
|
|
||||||
$ref: '#/components/schemas/GiftCard'
|
|
||||||
'400':
|
|
||||||
$ref: '#/components/responses/400_error'
|
|
||||||
'404':
|
|
||||||
$ref: '#/components/responses/not_found_error'
|
|
||||||
'409':
|
|
||||||
$ref: '#/components/responses/invalid_state_error'
|
|
||||||
'422':
|
|
||||||
$ref: '#/components/responses/invalid_request_error'
|
|
||||||
'500':
|
|
||||||
$ref: '#/components/responses/500_error'
|
|
||||||
/customers/me/addresses:
|
/customers/me/addresses:
|
||||||
post:
|
post:
|
||||||
operationId: PostCustomersCustomerAddresses
|
operationId: PostCustomersCustomerAddresses
|
||||||
@@ -2344,6 +2291,59 @@ paths:
|
|||||||
$ref: '#/components/responses/invalid_request_error'
|
$ref: '#/components/responses/invalid_request_error'
|
||||||
'500':
|
'500':
|
||||||
$ref: '#/components/responses/500_error'
|
$ref: '#/components/responses/500_error'
|
||||||
|
'/gift-cards/{code}':
|
||||||
|
get:
|
||||||
|
operationId: GetGiftCardsCode
|
||||||
|
summary: Get Gift Card by Code
|
||||||
|
description: Retrieves a Gift Card by its associated unqiue code.
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: code
|
||||||
|
required: true
|
||||||
|
description: The unique Gift Card code.
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
x-codeSamples:
|
||||||
|
- lang: JavaScript
|
||||||
|
label: JS Client
|
||||||
|
source: >
|
||||||
|
import Medusa from "@medusajs/medusa-js"
|
||||||
|
|
||||||
|
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries:
|
||||||
|
3 })
|
||||||
|
|
||||||
|
medusa.giftCards.retrieve(code)
|
||||||
|
|
||||||
|
.then(({ gift_card }) => {
|
||||||
|
console.log(gift_card.id);
|
||||||
|
});
|
||||||
|
- lang: Shell
|
||||||
|
label: cURL
|
||||||
|
source: >
|
||||||
|
curl --location --request GET
|
||||||
|
'https://medusa-url.com/store/gift-cards/{code}'
|
||||||
|
tags:
|
||||||
|
- Gift Card
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: OK
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
gift_card:
|
||||||
|
$ref: '#/components/schemas/GiftCard'
|
||||||
|
'400':
|
||||||
|
$ref: '#/components/responses/400_error'
|
||||||
|
'404':
|
||||||
|
$ref: '#/components/responses/not_found_error'
|
||||||
|
'409':
|
||||||
|
$ref: '#/components/responses/invalid_state_error'
|
||||||
|
'422':
|
||||||
|
$ref: '#/components/responses/invalid_request_error'
|
||||||
|
'500':
|
||||||
|
$ref: '#/components/responses/500_error'
|
||||||
'/order-edits/{id}/complete':
|
'/order-edits/{id}/complete':
|
||||||
post:
|
post:
|
||||||
operationId: PostOrderEditsOrderEditComplete
|
operationId: PostOrderEditsOrderEditComplete
|
||||||
|
|||||||
+169
-169
@@ -343,175 +343,6 @@ paths:
|
|||||||
$ref: '#/components/responses/invalid_request_error'
|
$ref: '#/components/responses/invalid_request_error'
|
||||||
'500':
|
'500':
|
||||||
$ref: '#/components/responses/500_error'
|
$ref: '#/components/responses/500_error'
|
||||||
'/collections/{id}':
|
|
||||||
get:
|
|
||||||
operationId: GetCollectionsCollection
|
|
||||||
summary: Get a Collection
|
|
||||||
description: Retrieves a Product Collection.
|
|
||||||
parameters:
|
|
||||||
- in: path
|
|
||||||
name: id
|
|
||||||
required: true
|
|
||||||
description: The id of the Product Collection
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
x-codeSamples:
|
|
||||||
- lang: JavaScript
|
|
||||||
label: JS Client
|
|
||||||
source: >
|
|
||||||
import Medusa from "@medusajs/medusa-js"
|
|
||||||
|
|
||||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries:
|
|
||||||
3 })
|
|
||||||
|
|
||||||
medusa.collections.retrieve(collection_id)
|
|
||||||
|
|
||||||
.then(({ collection }) => {
|
|
||||||
console.log(collection.id);
|
|
||||||
});
|
|
||||||
- lang: Shell
|
|
||||||
label: cURL
|
|
||||||
source: >
|
|
||||||
curl --location --request GET
|
|
||||||
'https://medusa-url.com/store/collections/{id}'
|
|
||||||
tags:
|
|
||||||
- Collection
|
|
||||||
responses:
|
|
||||||
'200':
|
|
||||||
description: OK
|
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
collection:
|
|
||||||
$ref: '#/components/schemas/ProductCollection'
|
|
||||||
'400':
|
|
||||||
$ref: '#/components/responses/400_error'
|
|
||||||
'404':
|
|
||||||
$ref: '#/components/responses/not_found_error'
|
|
||||||
'409':
|
|
||||||
$ref: '#/components/responses/invalid_state_error'
|
|
||||||
'422':
|
|
||||||
$ref: '#/components/responses/invalid_request_error'
|
|
||||||
'500':
|
|
||||||
$ref: '#/components/responses/500_error'
|
|
||||||
/collections:
|
|
||||||
get:
|
|
||||||
operationId: GetCollections
|
|
||||||
summary: List Collections
|
|
||||||
description: Retrieve a list of Product Collection.
|
|
||||||
parameters:
|
|
||||||
- in: query
|
|
||||||
name: offset
|
|
||||||
description: >-
|
|
||||||
The number of collections to skip before starting to collect the
|
|
||||||
collections set
|
|
||||||
schema:
|
|
||||||
type: integer
|
|
||||||
default: 0
|
|
||||||
- in: query
|
|
||||||
name: limit
|
|
||||||
description: The number of collections to return
|
|
||||||
schema:
|
|
||||||
type: integer
|
|
||||||
default: 10
|
|
||||||
- in: query
|
|
||||||
name: created_at
|
|
||||||
description: Date comparison for when resulting collections were created.
|
|
||||||
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: Date comparison for when resulting collections were updated.
|
|
||||||
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-codeSamples:
|
|
||||||
- lang: JavaScript
|
|
||||||
label: JS Client
|
|
||||||
source: >
|
|
||||||
import Medusa from "@medusajs/medusa-js"
|
|
||||||
|
|
||||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries:
|
|
||||||
3 })
|
|
||||||
|
|
||||||
medusa.collections.list()
|
|
||||||
|
|
||||||
.then(({ collections, limit, offset, count }) => {
|
|
||||||
console.log(collections.length);
|
|
||||||
});
|
|
||||||
- lang: Shell
|
|
||||||
label: cURL
|
|
||||||
source: >
|
|
||||||
curl --location --request GET
|
|
||||||
'https://medusa-url.com/store/collections'
|
|
||||||
tags:
|
|
||||||
- Collection
|
|
||||||
responses:
|
|
||||||
'200':
|
|
||||||
description: OK
|
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
collections:
|
|
||||||
type: array
|
|
||||||
items:
|
|
||||||
$ref: '#/components/schemas/ProductCollection'
|
|
||||||
count:
|
|
||||||
type: integer
|
|
||||||
description: The total number of items available
|
|
||||||
offset:
|
|
||||||
type: integer
|
|
||||||
description: The number of items skipped before these items
|
|
||||||
limit:
|
|
||||||
type: integer
|
|
||||||
description: The number of items per page
|
|
||||||
'400':
|
|
||||||
$ref: '#/components/responses/400_error'
|
|
||||||
'404':
|
|
||||||
$ref: '#/components/responses/not_found_error'
|
|
||||||
'409':
|
|
||||||
$ref: '#/components/responses/invalid_state_error'
|
|
||||||
'422':
|
|
||||||
$ref: '#/components/responses/invalid_request_error'
|
|
||||||
'500':
|
|
||||||
$ref: '#/components/responses/500_error'
|
|
||||||
'/carts/{id}/shipping-methods':
|
'/carts/{id}/shipping-methods':
|
||||||
post:
|
post:
|
||||||
operationId: PostCartsCartShippingMethod
|
operationId: PostCartsCartShippingMethod
|
||||||
@@ -1429,6 +1260,175 @@ paths:
|
|||||||
provider_id:
|
provider_id:
|
||||||
type: string
|
type: string
|
||||||
description: The ID of the Payment Provider.
|
description: The ID of the Payment Provider.
|
||||||
|
'/collections/{id}':
|
||||||
|
get:
|
||||||
|
operationId: GetCollectionsCollection
|
||||||
|
summary: Get a Collection
|
||||||
|
description: Retrieves a Product Collection.
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: id
|
||||||
|
required: true
|
||||||
|
description: The id of the Product Collection
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
x-codeSamples:
|
||||||
|
- lang: JavaScript
|
||||||
|
label: JS Client
|
||||||
|
source: >
|
||||||
|
import Medusa from "@medusajs/medusa-js"
|
||||||
|
|
||||||
|
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries:
|
||||||
|
3 })
|
||||||
|
|
||||||
|
medusa.collections.retrieve(collection_id)
|
||||||
|
|
||||||
|
.then(({ collection }) => {
|
||||||
|
console.log(collection.id);
|
||||||
|
});
|
||||||
|
- lang: Shell
|
||||||
|
label: cURL
|
||||||
|
source: >
|
||||||
|
curl --location --request GET
|
||||||
|
'https://medusa-url.com/store/collections/{id}'
|
||||||
|
tags:
|
||||||
|
- Collection
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: OK
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
collection:
|
||||||
|
$ref: '#/components/schemas/ProductCollection'
|
||||||
|
'400':
|
||||||
|
$ref: '#/components/responses/400_error'
|
||||||
|
'404':
|
||||||
|
$ref: '#/components/responses/not_found_error'
|
||||||
|
'409':
|
||||||
|
$ref: '#/components/responses/invalid_state_error'
|
||||||
|
'422':
|
||||||
|
$ref: '#/components/responses/invalid_request_error'
|
||||||
|
'500':
|
||||||
|
$ref: '#/components/responses/500_error'
|
||||||
|
/collections:
|
||||||
|
get:
|
||||||
|
operationId: GetCollections
|
||||||
|
summary: List Collections
|
||||||
|
description: Retrieve a list of Product Collection.
|
||||||
|
parameters:
|
||||||
|
- in: query
|
||||||
|
name: offset
|
||||||
|
description: >-
|
||||||
|
The number of collections to skip before starting to collect the
|
||||||
|
collections set
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
default: 0
|
||||||
|
- in: query
|
||||||
|
name: limit
|
||||||
|
description: The number of collections to return
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
default: 10
|
||||||
|
- in: query
|
||||||
|
name: created_at
|
||||||
|
description: Date comparison for when resulting collections were created.
|
||||||
|
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: Date comparison for when resulting collections were updated.
|
||||||
|
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-codeSamples:
|
||||||
|
- lang: JavaScript
|
||||||
|
label: JS Client
|
||||||
|
source: >
|
||||||
|
import Medusa from "@medusajs/medusa-js"
|
||||||
|
|
||||||
|
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries:
|
||||||
|
3 })
|
||||||
|
|
||||||
|
medusa.collections.list()
|
||||||
|
|
||||||
|
.then(({ collections, limit, offset, count }) => {
|
||||||
|
console.log(collections.length);
|
||||||
|
});
|
||||||
|
- lang: Shell
|
||||||
|
label: cURL
|
||||||
|
source: >
|
||||||
|
curl --location --request GET
|
||||||
|
'https://medusa-url.com/store/collections'
|
||||||
|
tags:
|
||||||
|
- Collection
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: OK
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
collections:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/ProductCollection'
|
||||||
|
count:
|
||||||
|
type: integer
|
||||||
|
description: The total number of items available
|
||||||
|
offset:
|
||||||
|
type: integer
|
||||||
|
description: The number of items skipped before these items
|
||||||
|
limit:
|
||||||
|
type: integer
|
||||||
|
description: The number of items per page
|
||||||
|
'400':
|
||||||
|
$ref: '#/components/responses/400_error'
|
||||||
|
'404':
|
||||||
|
$ref: '#/components/responses/not_found_error'
|
||||||
|
'409':
|
||||||
|
$ref: '#/components/responses/invalid_state_error'
|
||||||
|
'422':
|
||||||
|
$ref: '#/components/responses/invalid_request_error'
|
||||||
|
'500':
|
||||||
|
$ref: '#/components/responses/500_error'
|
||||||
/customers/me/addresses:
|
/customers/me/addresses:
|
||||||
post:
|
post:
|
||||||
operationId: PostCustomersCustomerAddresses
|
operationId: PostCustomersCustomerAddresses
|
||||||
|
|||||||
@@ -137,10 +137,6 @@ paths:
|
|||||||
$ref: paths/auth.yaml
|
$ref: paths/auth.yaml
|
||||||
/auth/{email}:
|
/auth/{email}:
|
||||||
$ref: paths/auth_{email}.yaml
|
$ref: paths/auth_{email}.yaml
|
||||||
/collections/{id}:
|
|
||||||
$ref: paths/collections_{id}.yaml
|
|
||||||
/collections:
|
|
||||||
$ref: paths/collections.yaml
|
|
||||||
/carts/{id}/shipping-methods:
|
/carts/{id}/shipping-methods:
|
||||||
$ref: paths/carts_{id}_shipping-methods.yaml
|
$ref: paths/carts_{id}_shipping-methods.yaml
|
||||||
/carts/{id}/taxes:
|
/carts/{id}/taxes:
|
||||||
@@ -163,6 +159,10 @@ paths:
|
|||||||
$ref: paths/carts_{id}_payment-sessions_{provider_id}_refresh.yaml
|
$ref: paths/carts_{id}_payment-sessions_{provider_id}_refresh.yaml
|
||||||
/carts/{id}/payment-session:
|
/carts/{id}/payment-session:
|
||||||
$ref: paths/carts_{id}_payment-session.yaml
|
$ref: paths/carts_{id}_payment-session.yaml
|
||||||
|
/collections/{id}:
|
||||||
|
$ref: paths/collections_{id}.yaml
|
||||||
|
/collections:
|
||||||
|
$ref: paths/collections.yaml
|
||||||
/customers/me/addresses:
|
/customers/me/addresses:
|
||||||
$ref: paths/customers_me_addresses.yaml
|
$ref: paths/customers_me_addresses.yaml
|
||||||
/customers:
|
/customers:
|
||||||
|
|||||||
Reference in new issue
Block a user