chore(docs): Generated API Reference (#3061)

Co-authored-by: olivermrbl <olivermrbl@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2023-01-19 10:06:17 +02:00
committed by GitHub
parent 3a0f37ef02
commit 296d6e229f
375 changed files with 8467 additions and 5775 deletions

View File

@@ -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.orders.createReservation(order_id, line_item_id, {
location_id
})
.then(({ reservation }) => {
console.log(reservation.id);
});

View File

@@ -0,0 +1,7 @@
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.orders.retrieveReservations(order_id)
.then(({ reservations }) => {
console.log(reservations[0].id);
});

View File

@@ -0,0 +1,8 @@
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.reservations.create({
})
.then(({ reservations }) => {
console.log(reservations.id);
});

View File

@@ -0,0 +1,7 @@
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.reservations.delete(reservation.id)
.then(({ id, object, deleted }) => {
console.log(id);
});

View File

@@ -0,0 +1,7 @@
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.reservations.retrieve(reservation_id)
.then(({ reservation }) => {
console.log(reservation.id);
});

View File

@@ -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.reservations.update(reservation.id, {
quantity: 3
})
.then(({ reservations }) => {
console.log(reservations.id);
});

View File

@@ -0,0 +1,6 @@
curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/line-items/{line_item_id}/reservations' \
--header 'Authorization: Bearer {api_token}' \
--header 'Content-Type: application/json' \
--data-raw '{
"location_id": "loc_1"
}'

View File

@@ -0,0 +1,2 @@
curl --location --request GET 'https://medusa-url.com/admin/orders/{id}/reservations' \
--header 'Authorization: Bearer {api_token}'

View File

@@ -0,0 +1,6 @@
curl --location --request POST 'https://medusa-url.com/admin/product-categories/{id}' \
--header 'Authorization: Bearer {api_token}' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Skinny Jeans"
}'

View File

@@ -0,0 +1,2 @@
curl --location --request GET 'https://medusa-url.com/admin/product-categories' \
--header 'Authorization: Bearer {api_token}'

View File

@@ -0,0 +1,8 @@
curl --location --request POST 'https://medusa-url.com/admin/reservations' \
--header 'Authorization: Bearer {api_token}' \
--header 'Content-Type: application/json' \
--data-raw '{
"resource_id": "{resource_id}",
"resource_type": "order",
"value": "We delivered this order"
}'

View File

@@ -0,0 +1,2 @@
curl --location --request DELETE 'https://medusa-url.com/admin/reservations/{id}' \
--header 'Authorization: Bearer {api_token}'

View File

@@ -0,0 +1,2 @@
curl --location --request GET 'https://medusa-url.com/admin/reservations/{id}' \
--header 'Authorization: Bearer {api_token}'

View File

@@ -0,0 +1,6 @@
curl --location --request POST 'https://medusa-url.com/admin/reservations/{id}' \
--header 'Authorization: Bearer {api_token}' \
--header 'Content-Type: application/json' \
--data-raw '{
"quantity": 3,
}'

View File

@@ -0,0 +1,6 @@
type: object
properties:
apps:
type: array
items:
$ref: ./OAuth.yaml

View File

@@ -0,0 +1,4 @@
type: object
properties:
apps:
$ref: ./OAuth.yaml

View File

@@ -0,0 +1,4 @@
type: object
properties:
user:
$ref: ./User.yaml

View File

@@ -0,0 +1,15 @@
type: object
properties:
batch_jobs:
type: array
items:
$ref: ./BatchJob.yaml
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

View File

@@ -0,0 +1,4 @@
type: object
properties:
batch_job:
$ref: ./BatchJob.yaml

View File

@@ -0,0 +1,13 @@
type: object
properties:
id:
type: string
description: The ID of the deleted Collection
object:
type: string
description: The type of the object that was deleted.
default: product-collection
deleted:
type: boolean
description: Whether the collection was deleted successfully or not.
default: true

View File

@@ -0,0 +1,15 @@
type: object
properties:
collections:
type: array
items:
$ref: ./ProductCollection.yaml
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

View File

@@ -0,0 +1,4 @@
type: object
properties:
collection:
$ref: ./ProductCollection.yaml

View File

@@ -0,0 +1,15 @@
type: object
properties:
currencies:
type: array
items:
$ref: ./Currency.yaml
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

View File

@@ -0,0 +1,4 @@
type: object
properties:
currency:
$ref: ./Currency.yaml

View File

@@ -0,0 +1,13 @@
type: object
properties:
id:
type: string
description: The ID of the deleted customer group.
object:
type: string
description: The type of the object that was deleted.
default: customer_group
deleted:
type: boolean
description: Whether the customer group was deleted successfully or not.
default: true

View File

@@ -0,0 +1,15 @@
type: object
properties:
customer_groups:
type: array
items:
$ref: ./CustomerGroup.yaml
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

View File

@@ -0,0 +1,4 @@
type: object
properties:
customer_group:
$ref: ./CustomerGroup.yaml

View File

@@ -0,0 +1,15 @@
type: object
properties:
customers:
type: array
items:
$ref: ./Customer.yaml
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

View File

@@ -0,0 +1,4 @@
type: object
properties:
customer:
$ref: ./Customer.yaml

View File

@@ -0,0 +1,15 @@
type: object
properties:
id:
type: string
description: The ID of the collection
object:
type: string
description: The type of object the removal was executed on
default: product-collection
removed_products:
description: The IDs of the products removed from the collection
type: array
items:
description: The ID of a Product to add to the Product Collection.
type: string

View File

@@ -0,0 +1,13 @@
type: object
properties:
id:
type: string
description: The ID of the deleted Shipping Profile.
object:
type: string
description: The type of the object that was deleted.
default: shipping_profile
deleted:
type: boolean
description: Whether or not the items were deleted.
default: true

View File

@@ -0,0 +1,13 @@
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

View File

@@ -0,0 +1,13 @@
type: object
properties:
id:
type: string
description: The ID of the deleted user.
object:
type: string
description: The type of the object that was deleted.
default: user
deleted:
type: boolean
description: Whether or not the items were deleted.
default: true

View File

@@ -0,0 +1,16 @@
type: object
properties:
id:
type: string
description: The ID of the deleted DiscountCondition
object:
type: string
description: The type of the object that was deleted.
default: discount-condition
deleted:
type: boolean
description: Whether the discount condition was deleted successfully or not.
default: true
discount:
description: The Discount to which the condition used to belong
$ref: ./Discount.yaml

View File

@@ -0,0 +1,4 @@
type: object
properties:
discount_condition:
$ref: ./DiscountCondition.yaml

View File

@@ -0,0 +1,13 @@
type: object
properties:
id:
type: string
description: The ID of the deleted Discount
object:
type: string
description: The type of the object that was deleted.
default: discount
deleted:
type: boolean
description: Whether the discount was deleted successfully or not.
default: true

View File

@@ -0,0 +1,15 @@
type: object
properties:
discounts:
type: array
items:
$ref: ./Discount.yaml
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

View File

@@ -0,0 +1,4 @@
type: object
properties:
discount:
$ref: ./Discount.yaml

View File

@@ -0,0 +1,13 @@
type: object
properties:
id:
type: string
description: The ID of the deleted Draft Order.
object:
type: string
description: The type of the object that was deleted.
default: draft-order
deleted:
type: boolean
description: Whether the draft order was deleted successfully or not.
default: true

View File

@@ -0,0 +1,15 @@
type: object
properties:
draft_orders:
type: array
items:
$ref: ./DraftOrder.yaml
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

View File

@@ -0,0 +1,4 @@
type: object
properties:
draft_order:
$ref: ./DraftOrder.yaml

View File

@@ -0,0 +1,17 @@
type: object
properties:
fulfillment_options:
type: array
items:
type: object
properties:
provider_id:
type: string
description: ID of the fulfillment provider
options:
type: array
description: fulfillment provider options
example:
- id: manual-fulfillment
- id: manual-fulfillment-return
is_return: true

View File

@@ -0,0 +1,15 @@
type: object
properties:
reservations:
type: array
items:
$ref: ./ReservationItemDTO.yaml
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

View File

@@ -0,0 +1,13 @@
type: object
properties:
id:
type: string
description: The ID of the deleted Gift Card
object:
type: string
description: The type of the object that was deleted.
default: gift-card
deleted:
type: boolean
description: Whether the gift card was deleted successfully or not.
default: true

View File

@@ -0,0 +1,15 @@
type: object
properties:
gift_cards:
type: array
items:
$ref: ./GiftCard.yaml
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

View File

@@ -0,0 +1,4 @@
type: object
properties:
gift_card:
$ref: ./GiftCard.yaml

View File

@@ -0,0 +1,13 @@
type: object
properties:
id:
type: string
description: The ID of the deleted Invite.
object:
type: string
description: The type of the object that was deleted.
default: invite
deleted:
type: boolean
description: Whether or not the Invite was deleted.
default: true

View File

@@ -0,0 +1,6 @@
type: object
properties:
invites:
type: array
items:
$ref: ./Invite.yaml

View File

@@ -0,0 +1,13 @@
type: object
properties:
id:
type: string
description: The ID of the deleted Note.
object:
type: string
description: The type of the object that was deleted.
default: note
deleted:
type: boolean
description: Whether or not the Note was deleted.
default: true

View File

@@ -0,0 +1,15 @@
type: object
properties:
notes:
type: array
items:
$ref: ./Note.yaml
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

View File

@@ -0,0 +1,4 @@
type: object
properties:
note:
$ref: ./Note.yaml

View File

@@ -0,0 +1,6 @@
type: object
properties:
notifications:
type: array
items:
$ref: ./Notification.yaml

View File

@@ -0,0 +1,4 @@
type: object
properties:
notification:
$ref: ./Notification.yaml

View File

@@ -0,0 +1,13 @@
type: object
properties:
id:
type: string
description: The ID of the deleted Order Edit.
object:
type: string
description: The type of the object that was deleted.
default: order_edit
deleted:
type: boolean
description: Whether or not the Order Edit was deleted.
default: true

View File

@@ -0,0 +1,13 @@
type: object
properties:
id:
type: string
description: The ID of the deleted Order Edit Item Change.
object:
type: string
description: The type of the object that was deleted.
default: item_change
deleted:
type: boolean
description: Whether or not the Order Edit Item Change was deleted.
default: true

View File

@@ -0,0 +1,15 @@
type: object
properties:
order_edits:
type: array
items:
$ref: ./OrderEdit.yaml
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

View File

@@ -0,0 +1,4 @@
type: object
properties:
order_edit:
$ref: ./OrderEdit.yaml

View File

@@ -0,0 +1,15 @@
type: object
properties:
orders:
type: array
items:
$ref: ./Order.yaml
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

View File

@@ -0,0 +1,10 @@
type: object
required:
- location_id
properties:
location_id:
description: The id of the location of the reservation
type: string
quantity:
description: The quantity to reserve
type: number

View File

@@ -0,0 +1,4 @@
type: object
properties:
order:
$ref: ./Order.yaml

View File

@@ -0,0 +1,13 @@
type: object
properties:
id:
type: string
description: The ID of the deleted Payment Collection.
object:
type: string
description: The type of the object that was deleted.
default: payment_collection
deleted:
type: boolean
description: Whether or not the Payment Collection was deleted.
default: true

View File

@@ -0,0 +1,4 @@
type: object
properties:
payment_collection:
$ref: ./PaymentCollection.yaml

View File

@@ -0,0 +1,6 @@
type: object
properties:
payment_providers:
type: array
items:
$ref: ./PaymentProvider.yaml

View File

@@ -0,0 +1,4 @@
type: object
properties:
payment:
$ref: ./Payment.yaml

View File

@@ -0,0 +1,4 @@
type: object
properties:
order:
$ref: ./Order.yaml

View File

@@ -0,0 +1,17 @@
type: object
properties:
name:
type: string
description: The name to identify the Product Category by.
handle:
type: string
description: A handle to be used in slugs.
is_internal:
type: boolean
description: A flag to make product category an internal category for admins
is_active:
type: boolean
description: A flag to make product category visible/hidden in the store front
parent_category_id:
type: string
description: The ID of the parent product category

View File

@@ -34,6 +34,7 @@ properties:
Whether Medusa should keep track of the inventory for this Product
Variant.
type: boolean
default: true
weight:
description: The wieght of the Product Variant.
type: number

View File

@@ -0,0 +1,6 @@
type: object
required:
- reservation
properties:
reservation:
$ref: ./ReservationItemDTO.yaml

View File

@@ -0,0 +1,11 @@
type: object
properties:
location_id:
description: The id of the location of the reservation
type: string
quantity:
description: The id of the reservation item
type: number
metadata:
description: An optional set of key-value pairs with additional information.
type: object

View File

@@ -0,0 +1,15 @@
type: object
properties:
ids:
type: array
items:
type: string
description: The IDs of the deleted Money Amounts (Prices).
object:
type: string
description: The type of the object that was deleted.
default: money-amount
deleted:
type: boolean
description: Whether or not the items were deleted.
default: true

View File

@@ -0,0 +1,15 @@
type: object
properties:
ids:
type: array
description: The price ids that have been deleted.
items:
type: string
object:
type: string
description: The type of the object that was deleted.
default: money-amount
deleted:
type: boolean
description: Whether or not the items were deleted.
default: true

View File

@@ -0,0 +1,13 @@
type: object
properties:
id:
type: string
description: The ID of the deleted Price List.
object:
type: string
description: The type of the object that was deleted.
default: price-list
deleted:
type: boolean
description: Whether or not the items were deleted.
default: true

View File

@@ -0,0 +1,15 @@
type: object
properties:
ids:
type: array
description: The price ids that have been deleted.
items:
type: string
object:
type: string
description: The type of the object that was deleted.
default: money-amount
deleted:
type: boolean
description: Whether or not the items were deleted.
default: true

View File

@@ -0,0 +1,4 @@
type: object
properties:
price_list:
$ref: ./PriceList.yaml

View File

@@ -0,0 +1,15 @@
type: object
properties:
price_lists:
type: array
items:
$ref: ./PriceList.yaml
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

View File

@@ -0,0 +1,15 @@
type: object
properties:
products:
type: array
items:
$ref: ./Product.yaml
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

View File

@@ -0,0 +1,15 @@
type: object
properties:
product_tags:
type: array
items:
$ref: ./ProductTag.yaml
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

View File

@@ -0,0 +1,15 @@
type: object
properties:
product_types:
type: array
items:
$ref: ./ProductType.yaml
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

View File

@@ -0,0 +1,15 @@
type: object
properties:
option_id:
type: string
description: The ID of the deleted Product Option
object:
type: string
description: The type of the object that was deleted.
default: option
deleted:
type: boolean
description: Whether or not the items were deleted.
default: true
product:
$ref: ./Product.yaml

View File

@@ -0,0 +1,13 @@
type: object
properties:
id:
type: string
description: The ID of the deleted Product.
object:
type: string
description: The type of the object that was deleted.
default: product
deleted:
type: boolean
description: Whether or not the items were deleted.
default: true

View File

@@ -0,0 +1,15 @@
type: object
properties:
variant_id:
type: string
description: The ID of the deleted Product Variant.
object:
type: string
description: The type of the object that was deleted.
default: product-variant
deleted:
type: boolean
description: Whether or not the items were deleted.
default: true
product:
$ref: ./Product.yaml

View File

@@ -0,0 +1,17 @@
type: object
properties:
products:
type: array
items:
oneOf:
- $ref: ./Product.yaml
- $ref: ./PricedProduct.yaml
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

View File

@@ -0,0 +1,15 @@
type: object
properties:
tags:
type: array
items:
properties:
id:
description: The ID of the tag.
type: string
usage_count:
description: The number of products that use this tag.
type: string
value:
description: The value of the tag.
type: string

View File

@@ -0,0 +1,6 @@
type: object
properties:
types:
type: array
items:
$ref: ./ProductType.yaml

View File

@@ -0,0 +1,15 @@
type: object
properties:
variants:
type: array
items:
$ref: ./ProductVariant.yaml
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

View File

@@ -0,0 +1,4 @@
type: object
properties:
product:
$ref: ./Product.yaml

View File

@@ -0,0 +1,13 @@
type: object
properties:
id:
type: string
description: The ID of the deleted PublishableApiKey.
object:
type: string
description: The type of the object that was deleted.
default: publishable_api_key
deleted:
type: boolean
description: Whether the PublishableApiKeys was deleted.
default: true

View File

@@ -0,0 +1,15 @@
type: object
properties:
publishable_api_keys:
type: array
items:
$ref: ./PublishableApiKey.yaml
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

View File

@@ -0,0 +1,6 @@
type: object
properties:
sales_channels:
type: array
items:
$ref: ./SalesChannel.yaml

View File

@@ -0,0 +1,4 @@
type: object
properties:
publishable_api_key:
$ref: ./PublishableApiKey.yaml

View File

@@ -0,0 +1,4 @@
type: object
properties:
refund:
$ref: ./Refund.yaml

View File

@@ -0,0 +1,13 @@
type: object
properties:
id:
type: string
description: The ID of the deleted Region.
object:
type: string
description: The type of the object that was deleted.
default: region
deleted:
type: boolean
description: Whether or not the items were deleted.
default: true

View File

@@ -0,0 +1,15 @@
type: object
properties:
regions:
type: array
items:
$ref: ./Region.yaml
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

View File

@@ -0,0 +1,4 @@
type: object
properties:
region:
$ref: ./Region.yaml

View File

@@ -0,0 +1,13 @@
type: object
properties:
id:
type: string
description: The ID of the deleted return reason
object:
type: string
description: The type of the object that was deleted.
default: return_reason
deleted:
type: boolean
description: Whether or not the items were deleted.
default: true

View File

@@ -0,0 +1,6 @@
type: object
properties:
return_reasons:
type: array
items:
$ref: ./ReturnReason.yaml

View File

@@ -0,0 +1,4 @@
type: object
properties:
return_reason:
$ref: ./ReturnReason.yaml

View File

@@ -0,0 +1,4 @@
type: object
properties:
order:
$ref: ./Order.yaml

View File

@@ -0,0 +1,15 @@
type: object
properties:
returns:
type: array
items:
$ref: ./Return.yaml
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

View File

@@ -0,0 +1,4 @@
type: object
properties:
return:
$ref: ./Return.yaml

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