docs: fix to OAS generator following Zod update + generate API reference (#13030)

This commit is contained in:
Shahed Nasser
2025-07-24 14:36:28 +03:00
committed by GitHub
parent 3921c86e19
commit 9bb4c0306b
126 changed files with 4855 additions and 2689 deletions
@@ -32,137 +32,7 @@
* content:
* application/json:
* schema:
* type: object
* description: The service zone's details.
* required:
* - name
* properties:
* name:
* type: string
* title: name
* description: The service zone's name.
* geo_zones:
* type: array
* description: The service zone's geo zones.
* items:
* oneOf:
* - type: object
* description: A country geo zone.
* required:
* - metadata
* - country_code
* - type
* properties:
* metadata:
* type: object
* description: The geo zone's metadata.
* country_code:
* type: string
* title: country_code
* description: The geo zone's country code.
* type:
* type: string
* title: type
* description: The geo zone's type.
* default: country
* - type: object
* description: A province geo zone.
* required:
* - metadata
* - country_code
* - type
* - province_code
* properties:
* metadata:
* type: object
* description: The geo zone's metadata.
* country_code:
* type: string
* title: country_code
* description: The geo zone's country code.
* type:
* type: string
* title: type
* description: The geo zone's type.
* default: province
* province_code:
* type: string
* title: province_code
* description: The geo zone's ISO 3166-2 province code. Must be lower-case.
* example: us-ca
* externalDocs:
* url: https://en.wikipedia.org/wiki/ISO_3166-2
* description: Learn more about ISO 3166-2
* - type: object
* description: A city geo zone
* required:
* - metadata
* - country_code
* - type
* - province_code
* - city
* properties:
* metadata:
* type: object
* description: The geo zone's metadata.
* country_code:
* type: string
* title: country_code
* description: The geo zone's country code.
* type:
* type: string
* title: type
* description: The geo zone's type.
* default: city
* province_code:
* type: string
* title: province_code
* description: The geo zone's ISO 3166-2 province code. Must be lower-case.
* example: us-ca
* externalDocs:
* url: https://en.wikipedia.org/wiki/ISO_3166-2
* description: Learn more about ISO 3166-2
* city:
* type: string
* title: city
* description: The geo zone's city.
* - type: object
* description: A ZIP geo zone.
* required:
* - metadata
* - country_code
* - type
* - province_code
* - city
* - postal_expression
* properties:
* metadata:
* type: object
* description: The geo zone's metadata.
* country_code:
* type: string
* title: country_code
* description: The geo zone's country code.
* type:
* type: string
* title: type
* description: The geo zone's type.
* default: zip
* province_code:
* type: string
* title: province_code
* description: The geo zone's ISO 3166-2 province code. Must be lower-case.
* example: us-ca
* externalDocs:
* url: https://en.wikipedia.org/wiki/ISO_3166-2
* description: Learn more about ISO 3166-2
* city:
* type: string
* title: city
* description: The geo zone's city.
* postal_expression:
* type: object
* description: The geo zone's postal expression or ZIP code.
* $ref: "#/components/schemas/AdminCreateFulfillmentSetServiceZones"
* x-codeSamples:
* - lang: JavaScript
* label: JS SDK
@@ -38,151 +38,7 @@
* content:
* application/json:
* schema:
* type: object
* description: The service zone's details.
* properties:
* name:
* type: string
* title: name
* description: The service zone's name.
* geo_zones:
* type: array
* description: The service zone's associated geo zones.
* items:
* oneOf:
* - type: object
* description: A country geo zone.
* required:
* - type
* - metadata
* - country_code
* properties:
* type:
* type: string
* title: type
* description: The geo zone's type.
* default: country
* metadata:
* type: object
* description: The geo zone's metadata.
* country_code:
* type: string
* title: country_code
* description: The geo zone's country code.
* id:
* type: string
* title: id
* description: The ID of an existing geo zone.
* - type: object
* description: A province geo zone.
* required:
* - type
* - metadata
* - country_code
* - province_code
* properties:
* type:
* type: string
* title: type
* description: The geo zone's type.
* default: province
* metadata:
* type: object
* description: The geo zone's metadata.
* country_code:
* type: string
* title: country_code
* description: The geo zone's country code.
* province_code:
* type: string
* title: province_code
* description: The geo zone's ISO 3166-2 province code. Must be lower-case.
* example: us-ca
* externalDocs:
* url: https://en.wikipedia.org/wiki/ISO_3166-2
* description: Learn more about ISO 3166-2
* id:
* type: string
* title: id
* description: The ID of an existing geo zone.
* - type: object
* description: A city geo zone
* required:
* - type
* - metadata
* - city
* - country_code
* - province_code
* properties:
* type:
* type: string
* title: type
* description: The geo zone's type.
* default: city
* metadata:
* type: object
* description: The geo zone's metadata.
* city:
* type: string
* title: city
* description: The geo zone's city.
* country_code:
* type: string
* title: country_code
* description: The geo zone's country code.
* province_code:
* type: string
* title: province_code
* description: The geo zone's ISO 3166-2 province code. Must be lower-case.
* example: us-ca
* externalDocs:
* url: https://en.wikipedia.org/wiki/ISO_3166-2
* description: Learn more about ISO 3166-2
* id:
* type: string
* title: id
* description: The ID of an existing geo zone.
* - type: object
* description: A ZIP geo zone.
* required:
* - type
* - metadata
* - city
* - country_code
* - province_code
* - postal_expression
* properties:
* type:
* type: string
* title: type
* description: The geo zone's type.
* default: zip
* metadata:
* type: object
* description: The geo zone's metadata.
* city:
* type: string
* title: city
* description: The geo zone's city.
* country_code:
* type: string
* title: country_code
* description: The geo zone's country code.
* province_code:
* type: string
* title: province_code
* description: The geo zone's ISO 3166-2 province code. Must be lower-case.
* example: us-ca
* externalDocs:
* url: https://en.wikipedia.org/wiki/ISO_3166-2
* description: Learn more about ISO 3166-2
* postal_expression:
* type: object
* description: The geo zone's postal expression or ZIP code.
* id:
* type: string
* title: id
* description: The ID of an existing geo zone.
* $ref: "#/components/schemas/AdminUpdateFulfillmentSetServiceZones"
* x-codeSamples:
* - lang: JavaScript
* label: JS SDK
@@ -31,64 +31,7 @@
* content:
* application/json:
* schema:
* type: object
* description: The properties to update in the inventory item.
* properties:
* sku:
* type: string
* title: sku
* description: The inventory item's SKU.
* hs_code:
* type: string
* title: hs_code
* description: The inventory item's HS code.
* weight:
* type: number
* title: weight
* description: The inventory item's weight.
* length:
* type: number
* title: length
* description: The inventory item's length.
* height:
* type: number
* title: height
* description: The inventory item's height.
* width:
* type: number
* title: width
* description: The inventory item's width.
* origin_country:
* type: string
* title: origin_country
* description: The inventory item's origin country.
* mid_code:
* type: string
* title: mid_code
* description: The inventory item's MID code.
* material:
* type: string
* title: material
* description: The inventory item's material.
* title:
* type: string
* title: title
* description: The inventory item's title.
* description:
* type: string
* title: description
* description: The inventory item's description.
* requires_shipping:
* type: boolean
* title: requires_shipping
* description: Whether the inventory item requires shipping.
* thumbnail:
* type: string
* title: thumbnail
* description: The URL of an image to be used as the inventory item's thumbnail. You can use the Upload API routes to upload an image and get its URL.
* metadata:
* type: object
* description: The inventory item's metadata. Can be custom data in key-value pairs.
* $ref: "#/components/schemas/AdminUpdateInventoryItem"
* x-codeSamples:
* - lang: JavaScript
* label: JS SDK
@@ -32,23 +32,7 @@
* content:
* application/json:
* schema:
* type: object
* description: The inventory level's details.
* required:
* - location_id
* properties:
* location_id:
* type: string
* title: location_id
* description: The ID of the associated location.
* stocked_quantity:
* type: number
* title: stocked_quantity
* description: The inventory level's stocked quantity.
* incoming_quantity:
* type: number
* title: incoming_quantity
* description: The inventory level's incoming quantity.
* $ref: "#/components/schemas/AdminCreateInventoryLocationLevel"
* x-codeSamples:
* - lang: Shell
* label: cURL
@@ -38,17 +38,7 @@
* content:
* application/json:
* schema:
* type: object
* description: The properties to update in the inventory level.
* properties:
* stocked_quantity:
* type: number
* title: stocked_quantity
* description: The inventory level's stocked quantity.
* incoming_quantity:
* type: number
* title: incoming_quantity
* description: The inventory level's incoming quantity.
* $ref: "#/components/schemas/AdminUpdateInventoryLocationLevel"
* x-codeSamples:
* - lang: JavaScript
* label: JS SDK
@@ -11,22 +11,7 @@
* content:
* application/json:
* schema:
* type: object
* description: The details of the user to be created.
* properties:
* email:
* type: string
* title: email
* description: The user's email.
* format: email
* first_name:
* type: string
* title: first_name
* description: The user's first name.
* last_name:
* type: string
* title: last_name
* description: The user's last name.
* $ref: "#/components/schemas/AdminInviteAccept"
* x-codeSamples:
* - lang: JavaScript
* label: JS SDK
@@ -3,9 +3,8 @@
* operationId: PostOrderEditsIdItemsItemItem_id
* summary: Update Order Item Quantity of Order Edit
* x-sidebar-summary: Update Item Quantity
* description: >
* description: |
* Update an existing order item's quantity of an order edit.
*
* You can also use this API route to remove an item from an order by setting its quantity to `0`.
* x-authenticated: true
* parameters:
@@ -28,6 +28,23 @@
* - cookie_auth: []
* - jwt_token: []
* x-codeSamples:
* - lang: JavaScript
* label: JS SDK
* source: |-
* import Medusa from "@medusajs/js-sdk"
*
* export const sdk = new Medusa({
* baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
* debug: import.meta.env.DEV,
* auth: {
* type: "session",
* },
* })
*
* sdk.admin.order.archive("order_123")
* .then(({ order }) => {
* console.log(order)
* })
* - lang: Shell
* label: cURL
* source: |-
@@ -38,6 +38,23 @@
* type: object
* description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter.
* x-codeSamples:
* - lang: JavaScript
* label: JS SDK
* source: |-
* import Medusa from "@medusajs/js-sdk"
*
* export const sdk = new Medusa({
* baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
* debug: import.meta.env.DEV,
* auth: {
* type: "session",
* },
* })
*
* sdk.admin.order.complete("order_123")
* .then(({ order }) => {
* console.log(order)
* })
* - lang: Shell
* label: cURL
* source: |-
@@ -25,20 +25,7 @@
* content:
* application/json:
* schema:
* type: object
* description: The payment collection's details.
* required:
* - order_id
* - amount
* properties:
* order_id:
* type: string
* title: order_id
* description: The ID of the associated order.
* amount:
* type: number
* title: amount
* description: The amount to be paid.
* $ref: "#/components/schemas/AdminCreatePaymentCollection"
* x-codeSamples:
* - lang: JavaScript
* label: JS SDK
@@ -32,15 +32,7 @@
* content:
* application/json:
* schema:
* type: object
* description: The payment details.
* required:
* - order_id
* properties:
* order_id:
* type: string
* title: order_id
* description: The ID of the order associated with the payment collection.
* $ref: "#/components/schemas/AdminMarkPaymentCollectionPaid"
* x-codeSamples:
* - lang: JavaScript
* label: JS SDK
@@ -31,13 +31,7 @@
* content:
* application/json:
* schema:
* type: object
* description: The payment's details.
* properties:
* amount:
* type: number
* title: amount
* description: The amount to capture.
* $ref: "#/components/schemas/AdminCreatePaymentCapture"
* x-codeSamples:
* - lang: JavaScript
* label: JS SDK
@@ -31,21 +31,7 @@
* content:
* application/json:
* schema:
* type: object
* description: The refund's details.
* properties:
* amount:
* type: number
* title: amount
* description: The amount to refund.
* refund_reason_id:
* type: string
* title: refund_reason_id
* description: The ID of a refund reason.
* note:
* type: string
* title: note
* description: A note to attach to the refund.
* $ref: "#/components/schemas/AdminCreatePaymentRefund"
* x-codeSamples:
* - lang: JavaScript
* label: JS SDK
@@ -33,40 +33,7 @@
* content:
* application/json:
* schema:
* type: object
* description: The properties to update in the product category.
* properties:
* name:
* type: string
* title: name
* description: The product category's name.
* description:
* type: string
* title: description
* description: The product category's description.
* handle:
* type: string
* title: handle
* description: The product category's handle. Must be a unique value.
* is_internal:
* type: boolean
* title: is_internal
* description: Whether the product category is only used for internal purposes and shouldn't be shown the customer.
* is_active:
* type: boolean
* title: is_active
* description: Whether the product category is active.
* parent_category_id:
* type: string
* title: parent_category_id
* description: The ID of a parent category.
* metadata:
* type: object
* description: The product category's metadata. Can hold custom key-value pairs.
* rank:
* type: number
* title: rank
* description: The product category's rank among other categories.
* $ref: "#/components/schemas/AdminUpdateProductCategory"
* x-codeSamples:
* - lang: JavaScript
* label: JS SDK
@@ -31,16 +31,7 @@
* content:
* application/json:
* schema:
* type: object
* description: The properties to update in the product tag.
* properties:
* value:
* type: string
* title: value
* description: The product tag's value.
* metadata:
* type: object
* description: The product tag's metadata. Can hold custom key-value pairs.
* $ref: "#/components/schemas/AdminUpdateProductTag"
* x-codeSamples:
* - lang: JavaScript
* label: JS SDK
@@ -31,16 +31,7 @@
* content:
* application/json:
* schema:
* type: object
* description: The properties to update in the product type.
* properties:
* value:
* type: string
* title: value
* description: The product type's value.
* metadata:
* type: object
* description: The product type's metadata. Can hold custom key-value pairs.
* $ref: "#/components/schemas/AdminUpdateProductType"
* x-codeSamples:
* - lang: JavaScript
* label: JS SDK
@@ -31,17 +31,7 @@
* content:
* application/json:
* schema:
* type: object
* description: The properties to update in the refund reason.
* properties:
* label:
* type: string
* title: label
* description: The refund reason's label.
* description:
* type: string
* title: description
* description: The refund reason's description.
* $ref: "#/components/schemas/AdminUpdatePaymentRefundReason"
* x-codeSamples:
* - lang: Shell
* label: cURL
@@ -31,42 +31,7 @@
* content:
* application/json:
* schema:
* type: object
* description: The propeties to update in the region.
* properties:
* name:
* type: string
* title: name
* description: The region's name.
* currency_code:
* type: string
* title: currency_code
* description: The region's currency code.
* countries:
* type: array
* description: The region's countries.
* items:
* type: string
* title: countries
* description: A country code.
* automatic_taxes:
* type: boolean
* title: automatic_taxes
* description: Whether taxes are calculated automatically for carts in the region.
* payment_providers:
* type: array
* description: The payment providers enabled in the region.
* items:
* type: string
* title: payment_providers
* description: A payment provider's ID.
* metadata:
* type: object
* description: The region's metadata. Can hold custom key-value pairs.
* is_tax_inclusive:
* type: boolean
* title: is_tax_inclusive
* description: Whether the prices in the region are tax inclusive.
* $ref: "#/components/schemas/AdminUpdateRegion"
* x-codeSamples:
* - lang: JavaScript
* label: JS SDK
@@ -31,24 +31,7 @@
* content:
* application/json:
* schema:
* type: object
* description: The properties to update in the reservation.
* properties:
* location_id:
* type: string
* title: location_id
* description: The ID of the associated location.
* quantity:
* type: number
* title: quantity
* description: The reserved quantity.
* description:
* type: string
* title: description
* description: The reservation's description.
* metadata:
* type: object
* description: The reservation's metadata. Can hold custom key-value pairs.
* $ref: "#/components/schemas/AdminUpdateReservation"
* x-codeSamples:
* - lang: JavaScript
* label: JS SDK
@@ -31,173 +31,7 @@
* content:
* application/json:
* schema:
* type: object
* description: The properties to update in the shipping option.
* properties:
* name:
* type: string
* title: name
* description: The shipping option's name.
* data:
* type: object
* description: The shipping option's data that is useful for third-party providers.
* externalDocs:
* url: https://docs.medusajs.com/v2/resources/commerce-modules/fulfillment/shipping-option#data-property
* price_type:
* type: string
* description: >
* The type of the shipping option's price. If `calculated`, its price is retrieved by the associated fulfillment provider during checkout. If `flat`, its price is set in the `prices`
* property.
* enum:
* - calculated
* - flat
* provider_id:
* type: string
* title: provider_id
* description: The ID of the associated fulfillment provider that is used to process the option.
* shipping_profile_id:
* type: string
* title: shipping_profile_id
* description: The ID of the shipping profile this shipping option belongs to.
* type:
* type: object
* description: The shipping option's type.
* required:
* - code
* - description
* - label
* properties:
* label:
* type: string
* title: label
* description: The type's label.
* description:
* type: string
* title: description
* description: The type's description.
* code:
* type: string
* title: code
* description: The type's code.
* prices:
* type: array
* description: The shipping option's prices. If the `price_type` is `calculated`, pass an empty array.
* items:
* oneOf:
* - type: object
* description: The shipping option's price for a currency code.
* properties:
* id:
* type: string
* title: id
* description: The ID of an existing price.
* currency_code:
* type: string
* title: currency_code
* description: The price's currency code.
* amount:
* type: number
* title: amount
* description: The price's amount.
* - type: object
* description: The shipping option's price for a region.
* properties:
* id:
* type: string
* title: id
* description: The ID of an existing price.
* region_id:
* type: string
* title: region_id
* description: The ID of the associated region.
* amount:
* type: number
* title: amount
* description: The price's amount.
* rules:
* type: array
* description: The shipping option's rules.
* items:
* oneOf:
* - type: object
* description: The details of a new shipping option rule.
* required:
* - operator
* - attribute
* - value
* properties:
* operator:
* type: string
* description: The operator used to check whether a rule applies.
* enum:
* - in
* - eq
* - ne
* - gt
* - gte
* - lt
* - lte
* - nin
* attribute:
* type: string
* title: attribute
* description: The name of a property or table that the rule applies to.
* example: customer_group
* value:
* oneOf:
* - type: string
* title: value
* description: A value of the attribute that enables this rule.
* example: cusgroup_123
* - type: array
* description: Values of the attribute that enable this rule.
* items:
* type: string
* title: value
* description: A value of the attribute that enables this rule.
* example: cusgroup_123
* - type: object
* description: Update the properties of an existing rule.
* required:
* - id
* - operator
* - attribute
* - value
* properties:
* id:
* type: string
* title: id
* description: The rule's ID.
* operator:
* type: string
* description: The operator used to check whether a rule applies.
* enum:
* - in
* - eq
* - ne
* - gt
* - gte
* - lt
* - lte
* - nin
* attribute:
* type: string
* title: attribute
* description: The name of a property or table that the rule applies to.
* example: customer_group
* value:
* oneOf:
* - type: string
* title: value
* description: A value of the attribute that enables this rule.
* example: cusgroup_123
* - type: array
* description: Values of the attribute that enable this rule.
* items:
* type: string
* title: value
* description: A value of the attribute that enables this rule.
* example: cusgroup_123
* $ref: "#/components/schemas/AdminUpdateShippingOption"
* x-codeSamples:
* - lang: JavaScript
* label: JS SDK
@@ -31,20 +31,7 @@
* content:
* application/json:
* schema:
* type: object
* description: The properties to update in the shipping profile.
* properties:
* name:
* type: string
* title: name
* description: The shipping profile's name.
* type:
* type: string
* title: type
* description: The shipping profile's type.
* metadata:
* type: object
* description: The shipping profile's metadata.
* $ref: "#/components/schemas/AdminUpdateShippingProfile"
* x-codeSamples:
* - lang: JavaScript
* label: JS SDK
@@ -32,20 +32,7 @@
* content:
* application/json:
* schema:
* type: object
* description: The fulfillment set to create.
* required:
* - type
* - name
* properties:
* name:
* type: string
* title: name
* description: The fulfillment set's name.
* type:
* type: string
* title: type
* description: The fulfillment set's type.
* $ref: "#/components/schemas/AdminCreateStockLocationFulfillmentSet"
* x-codeSamples:
* - lang: JavaScript
* label: JS SDK
@@ -39,21 +39,7 @@
* content:
* application/json:
* schema:
* type: object
* description: The shipping method's details.
* required:
* - option_id
* properties:
* option_id:
* type: string
* title: option_id
* description: The ID of the shipping option this method is created from.
* data:
* type: object
* description: Any additional data relevant for the third-party fulfillment provider to process the shipment.
* externalDocs:
* url: https://docs.medusajs.com/v2/resources/storefront-development/checkout/shipping#data-request-body-parameter
* description: Learn more about the data parameter.
* $ref: "#/components/schemas/StoreAddCartShippingMethods"
* x-codeSamples:
* - lang: JavaScript
* label: JS SDK
@@ -38,68 +38,7 @@
* content:
* application/json:
* schema:
* type: object
* description: The address's details.
* properties:
* first_name:
* type: string
* title: first_name
* description: The customer's first name.
* last_name:
* type: string
* title: last_name
* description: The customer's last name.
* phone:
* type: string
* title: phone
* description: The customer's phone.
* company:
* type: string
* title: company
* description: The address's company.
* address_1:
* type: string
* title: address_1
* description: The address's first line.
* address_2:
* type: string
* title: address_2
* description: The address's second line.
* city:
* type: string
* title: city
* description: The address's city.
* country_code:
* type: string
* title: country_code
* description: The address's country code.
* province:
* type: string
* title: province
* description: The address's ISO 3166-2 province code. Must be lower-case.
* example: us-ca
* externalDocs:
* url: https://en.wikipedia.org/wiki/ISO_3166-2
* description: Learn more about ISO 3166-2
* postal_code:
* type: string
* title: postal_code
* description: The address's postal code.
* address_name:
* type: string
* title: address_name
* description: The address's name.
* is_default_shipping:
* type: boolean
* title: is_default_shipping
* description: Whether the address is used by default for shipping during checkout.
* is_default_billing:
* type: boolean
* title: is_default_billing
* description: Whether the address is used by default for billing during checkout.
* metadata:
* type: object
* description: Holds custom key-value pairs.
* $ref: "#/components/schemas/StoreCreateCustomerAddress"
* x-codeSamples:
* - lang: JavaScript
* label: JS SDK
@@ -44,68 +44,7 @@
* content:
* application/json:
* schema:
* type: object
* description: The properties to update in the address.
* properties:
* first_name:
* type: string
* title: first_name
* description: The customer's first name.
* last_name:
* type: string
* title: last_name
* description: The customer's last name.
* phone:
* type: string
* title: phone
* description: The customer's phone.
* company:
* type: string
* title: company
* description: The address's company.
* address_1:
* type: string
* title: address_1
* description: The address's first line.
* address_2:
* type: string
* title: address_2
* description: The address's second line.
* city:
* type: string
* title: city
* description: The address's city.
* country_code:
* type: string
* title: country_code
* description: The address's country code.
* province:
* type: string
* title: province
* description: The address's ISO 3166-2 province code. Must be lower-case.
* example: us-ca
* externalDocs:
* url: https://en.wikipedia.org/wiki/ISO_3166-2
* description: Learn more about ISO 3166-2
* postal_code:
* type: string
* title: postal_code
* description: The address's postal code.
* address_name:
* type: string
* title: address_name
* description: The address's name.
* is_default_shipping:
* type: boolean
* title: is_default_shipping
* description: Whether the address is used by default for shipping during checkout.
* is_default_billing:
* type: boolean
* title: is_default_billing
* description: Whether the address is used by default for billing during checkout.
* metadata:
* type: object
* description: Holds custom key-value pairs.
* $ref: "#/components/schemas/StoreUpdateCustomerAddress"
* x-codeSamples:
* - lang: JavaScript
* label: JS SDK
@@ -4,14 +4,12 @@
* summary: Initialize Payment Session of a Payment Collection
* x-sidebar-summary: Initialize Payment Session
* description: >
* Initialize and add a payment session to a payment collection. This is used during checkout, where you create a payment collection for the cart, then initialize a payment session for the
* payment provider that the customer chooses.
* Initialize and add a payment session to a payment collection. This is used during checkout, where you create a payment collection for the cart, then initialize a payment session for the payment
* provider that the customer chooses.
*
* It's highly recommended to have an amount greater than `0` in the payment collection, as some payment providers, such as Stripe, require a non-zero amount to create a payment session. Otherwise,
* an error will be thrown on the payment provider's side.
* It's highly recommended to have an amount greater than `0` in the payment collection, as some payment providers, such as Stripe, require a non-zero amount to create a payment session. Otherwise, an error will be thrown on the payment provider's side.
*
* In cases where you want to create a payment session for a payment collection with an amount of `0`, you can use the Manual System Payment Provider instead of third-party payment providers.
* The Manual System Payment Provider is built into Medusa and allows you to create payment sessions without interacting with an external payment provider.
* In cases where you want to create a payment session for a payment collection with an amount of `0`, you can use the Manual System Payment Provider instead of third-party payment providers. The Manual System Payment Provider is built into Medusa and allows you to create payment sessions without interacting with an external payment provider.
*
* Make sure to configure the Manual System Payment Provider in your store's region. Learn more in the [Manage Region](https://docs.medusajs.com/user-guide/settings/regions#edit-region-details) user guide.
* externalDocs:
@@ -4,10 +4,10 @@
* description: The filfillment's details.
* x-schemaName: AdminCreateFulfillment
* required:
* - data
* - items
* - metadata
* - order_id
* - data
* - location_id
* - provider_id
* - delivery_address
@@ -0,0 +1,137 @@
/**
* @schema AdminCreateFulfillmentSetServiceZones
* type: object
* description: The service zone's details.
* required:
* - name
* properties:
* name:
* type: string
* title: name
* description: The service zone's name.
* geo_zones:
* type: array
* description: The service zone's geo zones.
* items:
* oneOf:
* - type: object
* description: A country geo zone.
* required:
* - metadata
* - country_code
* - type
* properties:
* metadata:
* type: object
* description: The geo zone's metadata.
* country_code:
* type: string
* title: country_code
* description: The geo zone's country code.
* type:
* type: string
* title: type
* description: The geo zone's type.
* default: country
* - type: object
* description: A province geo zone.
* required:
* - metadata
* - country_code
* - type
* - province_code
* properties:
* metadata:
* type: object
* description: The geo zone's metadata.
* country_code:
* type: string
* title: country_code
* description: The geo zone's country code.
* type:
* type: string
* title: type
* description: The geo zone's type.
* default: province
* province_code:
* type: string
* title: province_code
* description: The geo zone's ISO 3166-2 province code. Must be lower-case.
* example: us-ca
* externalDocs:
* url: https://en.wikipedia.org/wiki/ISO_3166-2
* description: Learn more about ISO 3166-2
* - type: object
* description: A city geo zone
* required:
* - metadata
* - country_code
* - type
* - province_code
* - city
* properties:
* metadata:
* type: object
* description: The geo zone's metadata.
* country_code:
* type: string
* title: country_code
* description: The geo zone's country code.
* type:
* type: string
* title: type
* description: The geo zone's type.
* default: city
* province_code:
* type: string
* title: province_code
* description: The geo zone's ISO 3166-2 province code. Must be lower-case.
* example: us-ca
* externalDocs:
* url: https://en.wikipedia.org/wiki/ISO_3166-2
* description: Learn more about ISO 3166-2
* city:
* type: string
* title: city
* description: The geo zone's city.
* - type: object
* description: A ZIP geo zone.
* required:
* - metadata
* - country_code
* - type
* - province_code
* - city
* - postal_expression
* properties:
* metadata:
* type: object
* description: The geo zone's metadata.
* country_code:
* type: string
* title: country_code
* description: The geo zone's country code.
* type:
* type: string
* title: type
* description: The geo zone's type.
* default: zip
* province_code:
* type: string
* title: province_code
* description: The geo zone's ISO 3166-2 province code. Must be lower-case.
* example: us-ca
* externalDocs:
* url: https://en.wikipedia.org/wiki/ISO_3166-2
* description: Learn more about ISO 3166-2
* city:
* type: string
* title: city
* description: The geo zone's city.
* postal_expression:
* type: object
* description: The geo zone's postal expression or ZIP code.
* x-schemaName: AdminCreateFulfillmentSetServiceZones
*
*/
@@ -0,0 +1,23 @@
/**
* @schema AdminCreateInventoryLocationLevel
* type: object
* description: The inventory level's details.
* required:
* - location_id
* properties:
* location_id:
* type: string
* title: location_id
* description: The ID of the associated location.
* stocked_quantity:
* type: number
* title: stocked_quantity
* description: The inventory level's stocked quantity.
* incoming_quantity:
* type: number
* title: incoming_quantity
* description: The inventory level's incoming quantity.
* x-schemaName: AdminCreateInventoryLocationLevel
*
*/
@@ -0,0 +1,13 @@
/**
* @schema AdminCreatePaymentCapture
* type: object
* description: The payment's details.
* properties:
* amount:
* type: number
* title: amount
* description: The amount to capture.
* x-schemaName: AdminCreatePaymentCapture
*
*/
@@ -0,0 +1,20 @@
/**
* @schema AdminCreatePaymentCollection
* type: object
* description: The payment collection's details.
* required:
* - order_id
* - amount
* properties:
* order_id:
* type: string
* title: order_id
* description: The ID of the associated order.
* amount:
* type: number
* title: amount
* description: The amount to be paid.
* x-schemaName: AdminCreatePaymentCollection
*
*/
@@ -0,0 +1,21 @@
/**
* @schema AdminCreatePaymentRefund
* type: object
* description: The refund's details.
* properties:
* amount:
* type: number
* title: amount
* description: The amount to refund.
* refund_reason_id:
* type: string
* title: refund_reason_id
* description: The ID of a refund reason.
* note:
* type: string
* title: note
* description: A note to attach to the refund.
* x-schemaName: AdminCreatePaymentRefund
*
*/
@@ -0,0 +1,20 @@
/**
* @schema AdminCreateStockLocationFulfillmentSet
* type: object
* description: The fulfillment set to create.
* required:
* - type
* - name
* properties:
* name:
* type: string
* title: name
* description: The fulfillment set's name.
* type:
* type: string
* title: type
* description: The fulfillment set's type.
* x-schemaName: AdminCreateStockLocationFulfillmentSet
*
*/
@@ -0,0 +1,22 @@
/**
* @schema AdminInviteAccept
* type: object
* description: The details of the user to be created.
* properties:
* email:
* type: string
* title: email
* description: The user's email.
* format: email
* first_name:
* type: string
* title: first_name
* description: The user's first name.
* last_name:
* type: string
* title: last_name
* description: The user's last name.
* x-schemaName: AdminInviteAccept
*
*/
@@ -0,0 +1,15 @@
/**
* @schema AdminMarkPaymentCollectionPaid
* type: object
* description: The payment details.
* required:
* - order_id
* properties:
* order_id:
* type: string
* title: order_id
* description: The ID of the order associated with the payment collection.
* x-schemaName: AdminMarkPaymentCollectionPaid
*
*/
@@ -0,0 +1,151 @@
/**
* @schema AdminUpdateFulfillmentSetServiceZones
* type: object
* description: The service zone's details.
* properties:
* name:
* type: string
* title: name
* description: The service zone's name.
* geo_zones:
* type: array
* description: The service zone's associated geo zones.
* items:
* oneOf:
* - type: object
* description: A country geo zone.
* required:
* - type
* - metadata
* - country_code
* properties:
* type:
* type: string
* title: type
* description: The geo zone's type.
* default: country
* metadata:
* type: object
* description: The geo zone's metadata.
* country_code:
* type: string
* title: country_code
* description: The geo zone's country code.
* id:
* type: string
* title: id
* description: The ID of an existing geo zone.
* - type: object
* description: A province geo zone.
* required:
* - type
* - metadata
* - country_code
* - province_code
* properties:
* type:
* type: string
* title: type
* description: The geo zone's type.
* default: province
* metadata:
* type: object
* description: The geo zone's metadata.
* country_code:
* type: string
* title: country_code
* description: The geo zone's country code.
* province_code:
* type: string
* title: province_code
* description: The geo zone's ISO 3166-2 province code. Must be lower-case.
* example: us-ca
* externalDocs:
* url: https://en.wikipedia.org/wiki/ISO_3166-2
* description: Learn more about ISO 3166-2
* id:
* type: string
* title: id
* description: The ID of an existing geo zone.
* - type: object
* description: A city geo zone
* required:
* - type
* - metadata
* - city
* - country_code
* - province_code
* properties:
* type:
* type: string
* title: type
* description: The geo zone's type.
* default: city
* metadata:
* type: object
* description: The geo zone's metadata.
* city:
* type: string
* title: city
* description: The geo zone's city.
* country_code:
* type: string
* title: country_code
* description: The geo zone's country code.
* province_code:
* type: string
* title: province_code
* description: The geo zone's ISO 3166-2 province code. Must be lower-case.
* example: us-ca
* externalDocs:
* url: https://en.wikipedia.org/wiki/ISO_3166-2
* description: Learn more about ISO 3166-2
* id:
* type: string
* title: id
* description: The ID of an existing geo zone.
* - type: object
* description: A ZIP geo zone.
* required:
* - type
* - metadata
* - city
* - country_code
* - province_code
* - postal_expression
* properties:
* type:
* type: string
* title: type
* description: The geo zone's type.
* default: zip
* metadata:
* type: object
* description: The geo zone's metadata.
* city:
* type: string
* title: city
* description: The geo zone's city.
* country_code:
* type: string
* title: country_code
* description: The geo zone's country code.
* province_code:
* type: string
* title: province_code
* description: The geo zone's ISO 3166-2 province code. Must be lower-case.
* example: us-ca
* externalDocs:
* url: https://en.wikipedia.org/wiki/ISO_3166-2
* description: Learn more about ISO 3166-2
* postal_expression:
* type: object
* description: The geo zone's postal expression or ZIP code.
* id:
* type: string
* title: id
* description: The ID of an existing geo zone.
* x-schemaName: AdminUpdateFulfillmentSetServiceZones
*
*/
@@ -0,0 +1,64 @@
/**
* @schema AdminUpdateInventoryItem
* type: object
* description: The properties to update in the inventory item.
* properties:
* sku:
* type: string
* title: sku
* description: The inventory item's SKU.
* hs_code:
* type: string
* title: hs_code
* description: The inventory item's HS code.
* weight:
* type: number
* title: weight
* description: The inventory item's weight.
* length:
* type: number
* title: length
* description: The inventory item's length.
* height:
* type: number
* title: height
* description: The inventory item's height.
* width:
* type: number
* title: width
* description: The inventory item's width.
* origin_country:
* type: string
* title: origin_country
* description: The inventory item's origin country.
* mid_code:
* type: string
* title: mid_code
* description: The inventory item's MID code.
* material:
* type: string
* title: material
* description: The inventory item's material.
* title:
* type: string
* title: title
* description: The inventory item's title.
* description:
* type: string
* title: description
* description: The inventory item's description.
* requires_shipping:
* type: boolean
* title: requires_shipping
* description: Whether the inventory item requires shipping.
* thumbnail:
* type: string
* title: thumbnail
* description: The URL of an image to be used as the inventory item's thumbnail. You can use the Upload API routes to upload an image and get its URL.
* metadata:
* type: object
* description: The inventory item's metadata. Can be custom data in key-value pairs.
* x-schemaName: AdminUpdateInventoryItem
*
*/
@@ -0,0 +1,17 @@
/**
* @schema AdminUpdateInventoryLocationLevel
* type: object
* description: The properties to update in the inventory level.
* properties:
* stocked_quantity:
* type: number
* title: stocked_quantity
* description: The inventory level's stocked quantity.
* incoming_quantity:
* type: number
* title: incoming_quantity
* description: The inventory level's incoming quantity.
* x-schemaName: AdminUpdateInventoryLocationLevel
*
*/
@@ -0,0 +1,17 @@
/**
* @schema AdminUpdatePaymentRefundReason
* type: object
* description: The properties to update in the refund reason.
* properties:
* label:
* type: string
* title: label
* description: The refund reason's label.
* description:
* type: string
* title: description
* description: The refund reason's description.
* x-schemaName: AdminUpdatePaymentRefundReason
*
*/
@@ -0,0 +1,40 @@
/**
* @schema AdminUpdateProductCategory
* type: object
* description: The properties to update in the product category.
* properties:
* name:
* type: string
* title: name
* description: The product category's name.
* description:
* type: string
* title: description
* description: The product category's description.
* handle:
* type: string
* title: handle
* description: The product category's handle. Must be a unique value.
* is_internal:
* type: boolean
* title: is_internal
* description: Whether the product category is only used for internal purposes and shouldn't be shown the customer.
* is_active:
* type: boolean
* title: is_active
* description: Whether the product category is active.
* parent_category_id:
* type: string
* title: parent_category_id
* description: The ID of a parent category.
* metadata:
* type: object
* description: The product category's metadata. Can hold custom key-value pairs.
* rank:
* type: number
* title: rank
* description: The product category's rank among other categories.
* x-schemaName: AdminUpdateProductCategory
*
*/
@@ -0,0 +1,16 @@
/**
* @schema AdminUpdateProductTag
* type: object
* description: The properties to update in the product tag.
* properties:
* value:
* type: string
* title: value
* description: The product tag's value.
* metadata:
* type: object
* description: The product tag's metadata. Can hold custom key-value pairs.
* x-schemaName: AdminUpdateProductTag
*
*/
@@ -0,0 +1,16 @@
/**
* @schema AdminUpdateProductType
* type: object
* description: The properties to update in the product type.
* properties:
* value:
* type: string
* title: value
* description: The product type's value.
* metadata:
* type: object
* description: The product type's metadata. Can hold custom key-value pairs.
* x-schemaName: AdminUpdateProductType
*
*/
@@ -0,0 +1,42 @@
/**
* @schema AdminUpdateRegion
* type: object
* description: The propeties to update in the region.
* properties:
* name:
* type: string
* title: name
* description: The region's name.
* currency_code:
* type: string
* title: currency_code
* description: The region's currency code.
* countries:
* type: array
* description: The region's countries.
* items:
* type: string
* title: countries
* description: A country code.
* automatic_taxes:
* type: boolean
* title: automatic_taxes
* description: Whether taxes are calculated automatically for carts in the region.
* payment_providers:
* type: array
* description: The payment providers enabled in the region.
* items:
* type: string
* title: payment_providers
* description: A payment provider's ID.
* metadata:
* type: object
* description: The region's metadata. Can hold custom key-value pairs.
* is_tax_inclusive:
* type: boolean
* title: is_tax_inclusive
* description: Whether the prices in the region are tax inclusive.
* x-schemaName: AdminUpdateRegion
*
*/
@@ -0,0 +1,24 @@
/**
* @schema AdminUpdateReservation
* type: object
* description: The properties to update in the reservation.
* properties:
* location_id:
* type: string
* title: location_id
* description: The ID of the associated location.
* quantity:
* type: number
* title: quantity
* description: The reserved quantity.
* description:
* type: string
* title: description
* description: The reservation's description.
* metadata:
* type: object
* description: The reservation's metadata. Can hold custom key-value pairs.
* x-schemaName: AdminUpdateReservation
*
*/
@@ -0,0 +1,172 @@
/**
* @schema AdminUpdateShippingOption
* type: object
* description: The properties to update in the shipping option.
* properties:
* name:
* type: string
* title: name
* description: The shipping option's name.
* data:
* type: object
* description: The shipping option's data that is useful for third-party providers.
* externalDocs:
* url: https://docs.medusajs.com/v2/resources/commerce-modules/fulfillment/shipping-option#data-property
* price_type:
* type: string
* description: |
* The type of the shipping option's price. If `calculated`, its price is retrieved by the associated fulfillment provider during checkout. If `flat`, its price is set in the `prices` property.
* enum:
* - calculated
* - flat
* provider_id:
* type: string
* title: provider_id
* description: The ID of the associated fulfillment provider that is used to process the option.
* shipping_profile_id:
* type: string
* title: shipping_profile_id
* description: The ID of the shipping profile this shipping option belongs to.
* type:
* type: object
* description: The shipping option's type.
* required:
* - code
* - description
* - label
* properties:
* label:
* type: string
* title: label
* description: The type's label.
* description:
* type: string
* title: description
* description: The type's description.
* code:
* type: string
* title: code
* description: The type's code.
* prices:
* type: array
* description: The shipping option's prices. If the `price_type` is `calculated`, pass an empty array.
* items:
* oneOf:
* - type: object
* description: The shipping option's price for a currency code.
* properties:
* id:
* type: string
* title: id
* description: The ID of an existing price.
* currency_code:
* type: string
* title: currency_code
* description: The price's currency code.
* amount:
* type: number
* title: amount
* description: The price's amount.
* - type: object
* description: The shipping option's price for a region.
* properties:
* id:
* type: string
* title: id
* description: The ID of an existing price.
* region_id:
* type: string
* title: region_id
* description: The ID of the associated region.
* amount:
* type: number
* title: amount
* description: The price's amount.
* rules:
* type: array
* description: The shipping option's rules.
* items:
* oneOf:
* - type: object
* description: The details of a new shipping option rule.
* required:
* - operator
* - attribute
* - value
* properties:
* operator:
* type: string
* description: The operator used to check whether a rule applies.
* enum:
* - in
* - eq
* - ne
* - gt
* - gte
* - lt
* - lte
* - nin
* attribute:
* type: string
* title: attribute
* description: The name of a property or table that the rule applies to.
* example: customer_group
* value:
* oneOf:
* - type: string
* title: value
* description: A value of the attribute that enables this rule.
* example: cusgroup_123
* - type: array
* description: Values of the attribute that enable this rule.
* items:
* type: string
* title: value
* description: A value of the attribute that enables this rule.
* example: cusgroup_123
* - type: object
* description: Update the properties of an existing rule.
* required:
* - id
* - operator
* - attribute
* - value
* properties:
* id:
* type: string
* title: id
* description: The rule's ID.
* operator:
* type: string
* description: The operator used to check whether a rule applies.
* enum:
* - in
* - eq
* - ne
* - gt
* - gte
* - lt
* - lte
* - nin
* attribute:
* type: string
* title: attribute
* description: The name of a property or table that the rule applies to.
* example: customer_group
* value:
* oneOf:
* - type: string
* title: value
* description: A value of the attribute that enables this rule.
* example: cusgroup_123
* - type: array
* description: Values of the attribute that enable this rule.
* items:
* type: string
* title: value
* description: A value of the attribute that enables this rule.
* example: cusgroup_123
* x-schemaName: AdminUpdateShippingOption
*
*/
@@ -0,0 +1,20 @@
/**
* @schema AdminUpdateShippingProfile
* type: object
* description: The properties to update in the shipping profile.
* properties:
* name:
* type: string
* title: name
* description: The shipping profile's name.
* type:
* type: string
* title: type
* description: The shipping profile's type.
* metadata:
* type: object
* description: The shipping profile's metadata.
* x-schemaName: AdminUpdateShippingProfile
*
*/
@@ -0,0 +1,21 @@
/**
* @schema StoreAddCartShippingMethods
* type: object
* description: The shipping method's details.
* required:
* - option_id
* properties:
* option_id:
* type: string
* title: option_id
* description: The ID of the shipping option this method is created from.
* data:
* type: object
* description: Any additional data relevant for the third-party fulfillment provider to process the shipment.
* externalDocs:
* url: https://docs.medusajs.com/v2/resources/storefront-development/checkout/shipping#data-request-body-parameter
* description: Learn more about the data parameter.
* x-schemaName: StoreAddCartShippingMethods
*
*/
@@ -0,0 +1,68 @@
/**
* @schema StoreCreateCustomerAddress
* type: object
* description: The address's details.
* properties:
* first_name:
* type: string
* title: first_name
* description: The customer's first name.
* last_name:
* type: string
* title: last_name
* description: The customer's last name.
* phone:
* type: string
* title: phone
* description: The customer's phone.
* company:
* type: string
* title: company
* description: The address's company.
* address_1:
* type: string
* title: address_1
* description: The address's first line.
* address_2:
* type: string
* title: address_2
* description: The address's second line.
* city:
* type: string
* title: city
* description: The address's city.
* country_code:
* type: string
* title: country_code
* description: The address's country code.
* province:
* type: string
* title: province
* description: The address's ISO 3166-2 province code. Must be lower-case.
* example: us-ca
* externalDocs:
* url: https://en.wikipedia.org/wiki/ISO_3166-2
* description: Learn more about ISO 3166-2
* postal_code:
* type: string
* title: postal_code
* description: The address's postal code.
* address_name:
* type: string
* title: address_name
* description: The address's name.
* is_default_shipping:
* type: boolean
* title: is_default_shipping
* description: Whether the address is used by default for shipping during checkout.
* is_default_billing:
* type: boolean
* title: is_default_billing
* description: Whether the address is used by default for billing during checkout.
* metadata:
* type: object
* description: Holds custom key-value pairs.
* x-schemaName: StoreCreateCustomerAddress
*
*/
@@ -0,0 +1,68 @@
/**
* @schema StoreUpdateCustomerAddress
* type: object
* description: The properties to update in the address.
* properties:
* first_name:
* type: string
* title: first_name
* description: The customer's first name.
* last_name:
* type: string
* title: last_name
* description: The customer's last name.
* phone:
* type: string
* title: phone
* description: The customer's phone.
* company:
* type: string
* title: company
* description: The address's company.
* address_1:
* type: string
* title: address_1
* description: The address's first line.
* address_2:
* type: string
* title: address_2
* description: The address's second line.
* city:
* type: string
* title: city
* description: The address's city.
* country_code:
* type: string
* title: country_code
* description: The address's country code.
* province:
* type: string
* title: province
* description: The address's ISO 3166-2 province code. Must be lower-case.
* example: us-ca
* externalDocs:
* url: https://en.wikipedia.org/wiki/ISO_3166-2
* description: Learn more about ISO 3166-2
* postal_code:
* type: string
* title: postal_code
* description: The address's postal code.
* address_name:
* type: string
* title: address_name
* description: The address's name.
* is_default_shipping:
* type: boolean
* title: is_default_shipping
* description: Whether the address is used by default for shipping during checkout.
* is_default_billing:
* type: boolean
* title: is_default_billing
* description: Whether the address is used by default for billing during checkout.
* metadata:
* type: object
* description: Holds custom key-value pairs.
* x-schemaName: StoreUpdateCustomerAddress
*
*/