diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_archive/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_archive/post.js new file mode 100644 index 0000000000..1456f49bd4 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_archive/post.js @@ -0,0 +1,14 @@ +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) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_complete/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_complete/post.js new file mode 100644 index 0000000000..cdce8f7c98 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_complete/post.js @@ -0,0 +1,14 @@ +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) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminCreateFulfillment.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminCreateFulfillment.yaml index 6359d75d4c..e315d770d3 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/AdminCreateFulfillment.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminCreateFulfillment.yaml @@ -2,10 +2,10 @@ type: object description: The filfillment's details. x-schemaName: AdminCreateFulfillment required: - - data - items - metadata - order_id + - data - location_id - provider_id - delivery_address diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminCreateFulfillmentSetServiceZones.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminCreateFulfillmentSetServiceZones.yaml new file mode 100644 index 0000000000..438165ffd9 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminCreateFulfillmentSetServiceZones.yaml @@ -0,0 +1,132 @@ +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 diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminCreateInventoryLocationLevel.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminCreateInventoryLocationLevel.yaml new file mode 100644 index 0000000000..6578c122f4 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminCreateInventoryLocationLevel.yaml @@ -0,0 +1,18 @@ +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 diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminCreatePaymentCapture.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminCreatePaymentCapture.yaml new file mode 100644 index 0000000000..0064576c86 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminCreatePaymentCapture.yaml @@ -0,0 +1,8 @@ +type: object +description: The payment's details. +properties: + amount: + type: number + title: amount + description: The amount to capture. +x-schemaName: AdminCreatePaymentCapture diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminCreatePaymentCollection.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminCreatePaymentCollection.yaml new file mode 100644 index 0000000000..9d1f8bef7b --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminCreatePaymentCollection.yaml @@ -0,0 +1,15 @@ +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 diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminCreatePaymentRefund.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminCreatePaymentRefund.yaml new file mode 100644 index 0000000000..b5be8ea589 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminCreatePaymentRefund.yaml @@ -0,0 +1,16 @@ +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 diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminCreateStockLocationFulfillmentSet.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminCreateStockLocationFulfillmentSet.yaml new file mode 100644 index 0000000000..f099300601 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminCreateStockLocationFulfillmentSet.yaml @@ -0,0 +1,15 @@ +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 diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminInviteAccept.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminInviteAccept.yaml new file mode 100644 index 0000000000..9b853e7621 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminInviteAccept.yaml @@ -0,0 +1,17 @@ +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 diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminMarkPaymentCollectionPaid.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminMarkPaymentCollectionPaid.yaml new file mode 100644 index 0000000000..eec1356710 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminMarkPaymentCollectionPaid.yaml @@ -0,0 +1,10 @@ +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 diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateFulfillmentSetServiceZones.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateFulfillmentSetServiceZones.yaml new file mode 100644 index 0000000000..982be2f5eb --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateFulfillmentSetServiceZones.yaml @@ -0,0 +1,146 @@ +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 diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateInventoryItem.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateInventoryItem.yaml new file mode 100644 index 0000000000..34faa57636 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateInventoryItem.yaml @@ -0,0 +1,61 @@ +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 diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateInventoryLocationLevel.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateInventoryLocationLevel.yaml new file mode 100644 index 0000000000..94fba3e700 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateInventoryLocationLevel.yaml @@ -0,0 +1,12 @@ +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 diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminUpdatePaymentRefundReason.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminUpdatePaymentRefundReason.yaml new file mode 100644 index 0000000000..1573aa64b7 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminUpdatePaymentRefundReason.yaml @@ -0,0 +1,12 @@ +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 diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateProductCategory.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateProductCategory.yaml new file mode 100644 index 0000000000..5ce56e3290 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateProductCategory.yaml @@ -0,0 +1,37 @@ +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 diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateProductTag.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateProductTag.yaml new file mode 100644 index 0000000000..674eb56aa6 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateProductTag.yaml @@ -0,0 +1,11 @@ +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 diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateProductType.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateProductType.yaml new file mode 100644 index 0000000000..e086a5129f --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateProductType.yaml @@ -0,0 +1,11 @@ +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 diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateRegion.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateRegion.yaml new file mode 100644 index 0000000000..57633c59f9 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateRegion.yaml @@ -0,0 +1,37 @@ +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 diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateReservation.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateReservation.yaml new file mode 100644 index 0000000000..c274e12d51 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateReservation.yaml @@ -0,0 +1,19 @@ +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 diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateShippingOption.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateShippingOption.yaml new file mode 100644 index 0000000000..8ea9eac5bc --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateShippingOption.yaml @@ -0,0 +1,174 @@ +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 diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateShippingProfile.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateShippingProfile.yaml new file mode 100644 index 0000000000..468cc8ab28 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateShippingProfile.yaml @@ -0,0 +1,15 @@ +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 diff --git a/www/apps/api-reference/specs/admin/components/schemas/StoreAddCartShippingMethods.yaml b/www/apps/api-reference/specs/admin/components/schemas/StoreAddCartShippingMethods.yaml new file mode 100644 index 0000000000..494a059031 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/StoreAddCartShippingMethods.yaml @@ -0,0 +1,19 @@ +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 diff --git a/www/apps/api-reference/specs/admin/components/schemas/StoreCreateCustomerAddress.yaml b/www/apps/api-reference/specs/admin/components/schemas/StoreCreateCustomerAddress.yaml new file mode 100644 index 0000000000..a68cce7bec --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/StoreCreateCustomerAddress.yaml @@ -0,0 +1,63 @@ +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 diff --git a/www/apps/api-reference/specs/admin/components/schemas/StoreUpdateCustomerAddress.yaml b/www/apps/api-reference/specs/admin/components/schemas/StoreUpdateCustomerAddress.yaml new file mode 100644 index 0000000000..83d98b908b --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/StoreUpdateCustomerAddress.yaml @@ -0,0 +1,63 @@ +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 diff --git a/www/apps/api-reference/specs/admin/openapi.full.yaml b/www/apps/api-reference/specs/admin/openapi.full.yaml index 63c69d5cdc..0399d7ed7c 100644 --- a/www/apps/api-reference/specs/admin/openapi.full.yaml +++ b/www/apps/api-reference/specs/admin/openapi.full.yaml @@ -18672,137 +18672,7 @@ paths: 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 @@ -18977,151 +18847,7 @@ paths: 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 @@ -20998,64 +20724,7 @@ paths: 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 @@ -21386,23 +21055,7 @@ paths: 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 @@ -21545,17 +21198,7 @@ paths: 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 @@ -22368,22 +22011,7 @@ paths: 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 @@ -24693,6 +24321,23 @@ paths: - 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: |- @@ -24941,6 +24586,23 @@ paths: 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: |- @@ -26046,20 +25708,7 @@ paths: 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 @@ -26207,15 +25856,7 @@ paths: 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 @@ -27090,13 +26731,7 @@ paths: 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 @@ -27183,21 +26818,7 @@ paths: 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 @@ -29519,40 +29140,7 @@ paths: 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 @@ -30484,16 +30072,7 @@ paths: 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 @@ -31326,16 +30905,7 @@ paths: 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 @@ -38396,17 +37966,7 @@ paths: 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 @@ -39249,42 +38809,7 @@ paths: 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 @@ -40217,24 +39742,7 @@ paths: 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 @@ -45472,172 +44980,7 @@ paths: 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 @@ -46611,20 +45954,7 @@ paths: 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 @@ -47706,20 +47036,7 @@ paths: 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 @@ -56084,10 +55401,10 @@ components: description: The filfillment's details. x-schemaName: AdminCreateFulfillment required: - - data - items - metadata - order_id + - data - location_id - provider_id - delivery_address @@ -56248,6 +55565,139 @@ components: metadata: type: object description: The fulfillment's metadata, used to store custom key-value pairs. + 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 AdminCreateGiftCardParams: type: object description: The details of the gift card to create. @@ -56360,6 +55810,25 @@ components: metadata: type: object description: The inventory item's metadata, used to store custom key-value pairs. + 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 AdminCreateOrderCreditLines: type: object description: The details of a credit line to add to an order. @@ -56387,6 +55856,48 @@ components: metadata: type: object description: The credit line's metadata, can hold custom key-value pairs. + AdminCreatePaymentCapture: + type: object + description: The payment's details. + properties: + amount: + type: number + title: amount + description: The amount to capture. + x-schemaName: AdminCreatePaymentCapture + 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 + 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 AdminCreatePriceList: type: object description: The price list's details. @@ -57262,6 +56773,22 @@ components: metadata: type: object description: The stock location's metadata, used to store custom key-value pairs. + 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 AdminCreateStoreCreditAccount: type: object description: The details of the store credit account to create. @@ -60481,6 +60008,24 @@ components: format: date-time title: updated_at description: The date the invite was updated. + 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 AdminInviteResponse: type: object description: The invite's details. @@ -60502,6 +60047,17 @@ components: title: remove description: The ID of a product. x-schemaName: AdminLinkPriceListProducts + 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 AdminNotification: type: object description: The notification's details. @@ -67190,6 +66746,153 @@ components: type: string title: internal_note description: A note viewed only by admin users about the shipping method. + 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 AdminUpdateGiftCardParams: type: object description: The details to update in the gift card. @@ -67225,6 +66928,79 @@ components: metadata: type: object description: The gift card's metadata. + 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 + 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 AdminUpdateOrder: type: object description: The details to update in the order. @@ -67342,6 +67118,19 @@ components: metadata: type: object description: The order's metadata, can hold custom key-value pairs. + 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 AdminUpdatePriceList: type: object description: the details to update in a price list. @@ -67552,6 +67341,42 @@ components: type: string title: external_id description: The ID of the product in an external or third-party system. + 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 AdminUpdateProductOption: type: object description: The details to update in a product option. @@ -67568,6 +67393,30 @@ components: type: string title: values description: An option value. + 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 + 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 AdminUpdateProductVariant: type: object description: The properties to update of a product variant. @@ -67693,6 +67542,64 @@ components: description: An attribute value. example: prod_123 x-schemaName: AdminUpdatePromotionRule + 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 + 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 AdminUpdateReturnReason: type: object description: The details to update in a return reason. @@ -67736,6 +67643,174 @@ components: metadata: type: object description: The sales channel's metadata, can hold custom key-value pairs. + 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 AdminUpdateShippingOptionRule: type: object description: The properties to update in the shipping option rule. @@ -67780,6 +67855,22 @@ components: description: A value of the attribute that enables this rule. example: cusgroup_123 x-schemaName: AdminUpdateShippingOptionRule + 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 AdminUpdateStockLocation: type: object description: The properties to update in a stock location. @@ -74094,6 +74185,23 @@ components: metadata: type: object description: The item's metadata, can hold custom key-value pairs. + 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 StoreAddGiftCardToCart: type: object description: The details to add a gift card to the cart. @@ -75388,6 +75496,70 @@ components: metadata: type: object description: The customer's metadata, can hold custom key-value pairs. + 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 StoreCreatePaymentCollection: type: object description: The details of the payment collection to create. @@ -83553,6 +83725,70 @@ components: metadata: type: object description: The customer's metadata, can hold custom key-value pairs. + 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 UpdateAddress: type: object description: The details to update in the address. diff --git a/www/apps/api-reference/specs/admin/paths/admin_fulfillment-sets_{id}_service-zones.yaml b/www/apps/api-reference/specs/admin/paths/admin_fulfillment-sets_{id}_service-zones.yaml index 3da6aa1e26..3d99e4647c 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_fulfillment-sets_{id}_service-zones.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_fulfillment-sets_{id}_service-zones.yaml @@ -37,143 +37,7 @@ post: 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.yaml x-codeSamples: - lang: JavaScript label: JS SDK diff --git a/www/apps/api-reference/specs/admin/paths/admin_fulfillment-sets_{id}_service-zones_{zone_id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_fulfillment-sets_{id}_service-zones_{zone_id}.yaml index 019ccd54fd..2bf0c07070 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_fulfillment-sets_{id}_service-zones_{zone_id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_fulfillment-sets_{id}_service-zones_{zone_id}.yaml @@ -116,157 +116,7 @@ post: 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.yaml x-codeSamples: - lang: JavaScript label: JS SDK diff --git a/www/apps/api-reference/specs/admin/paths/admin_inventory-items_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_inventory-items_{id}.yaml index 8d83535eeb..31cae6980c 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_inventory-items_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_inventory-items_{id}.yaml @@ -102,69 +102,7 @@ post: 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.yaml x-codeSamples: - lang: JavaScript label: JS SDK diff --git a/www/apps/api-reference/specs/admin/paths/admin_inventory-items_{id}_location-levels.yaml b/www/apps/api-reference/specs/admin/paths/admin_inventory-items_{id}_location-levels.yaml index 98286d0eb8..515f588c7a 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_inventory-items_{id}_location-levels.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_inventory-items_{id}_location-levels.yaml @@ -200,23 +200,7 @@ post: 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.yaml x-codeSamples: - lang: Shell label: cURL diff --git a/www/apps/api-reference/specs/admin/paths/admin_inventory-items_{id}_location-levels_{location_id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_inventory-items_{id}_location-levels_{location_id}.yaml index bd364f4e45..69ebdf89c3 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_inventory-items_{id}_location-levels_{location_id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_inventory-items_{id}_location-levels_{location_id}.yaml @@ -45,17 +45,7 @@ post: 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.yaml x-codeSamples: - lang: JavaScript label: JS SDK diff --git a/www/apps/api-reference/specs/admin/paths/admin_invites_accept.yaml b/www/apps/api-reference/specs/admin/paths/admin_invites_accept.yaml index 135ff93939..6424a2372e 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_invites_accept.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_invites_accept.yaml @@ -13,22 +13,7 @@ post: 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.yaml x-codeSamples: - lang: JavaScript label: JS SDK diff --git a/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_archive.yaml b/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_archive.yaml index 0c08fae18a..d12e658360 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_archive.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_archive.yaml @@ -33,6 +33,10 @@ post: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_orders_{id}_archive/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_complete.yaml b/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_complete.yaml index 6725b18ee8..a316bd20ef 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_complete.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_complete.yaml @@ -48,6 +48,10 @@ post: passed to the underlying workflow under the `additional_data` parameter. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_orders_{id}_complete/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_payment-collections.yaml b/www/apps/api-reference/specs/admin/paths/admin_payment-collections.yaml index f74971b754..427f23e368 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_payment-collections.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_payment-collections.yaml @@ -30,20 +30,7 @@ post: 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.yaml x-codeSamples: - lang: JavaScript label: JS SDK diff --git a/www/apps/api-reference/specs/admin/paths/admin_payment-collections_{id}_mark-as-paid.yaml b/www/apps/api-reference/specs/admin/paths/admin_payment-collections_{id}_mark-as-paid.yaml index f332a86158..9665f256ff 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_payment-collections_{id}_mark-as-paid.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_payment-collections_{id}_mark-as-paid.yaml @@ -39,15 +39,7 @@ post: 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.yaml x-codeSamples: - lang: JavaScript label: JS SDK diff --git a/www/apps/api-reference/specs/admin/paths/admin_payments_{id}_capture.yaml b/www/apps/api-reference/specs/admin/paths/admin_payments_{id}_capture.yaml index 5453b7d0e4..7bf7b71e8d 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_payments_{id}_capture.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_payments_{id}_capture.yaml @@ -38,13 +38,7 @@ post: 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.yaml x-codeSamples: - lang: JavaScript label: JS SDK diff --git a/www/apps/api-reference/specs/admin/paths/admin_payments_{id}_refund.yaml b/www/apps/api-reference/specs/admin/paths/admin_payments_{id}_refund.yaml index 517a84f586..58c7d685b7 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_payments_{id}_refund.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_payments_{id}_refund.yaml @@ -38,21 +38,7 @@ post: 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.yaml x-codeSamples: - lang: JavaScript label: JS SDK diff --git a/www/apps/api-reference/specs/admin/paths/admin_product-categories_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_product-categories_{id}.yaml index 637ef1e5dc..bc54617716 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_product-categories_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_product-categories_{id}.yaml @@ -158,44 +158,7 @@ post: 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.yaml x-codeSamples: - lang: JavaScript label: JS SDK diff --git a/www/apps/api-reference/specs/admin/paths/admin_product-tags_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_product-tags_{id}.yaml index 2fdce9541e..c09775153b 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_product-tags_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_product-tags_{id}.yaml @@ -102,16 +102,7 @@ post: 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.yaml x-codeSamples: - lang: JavaScript label: JS SDK diff --git a/www/apps/api-reference/specs/admin/paths/admin_product-types_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_product-types_{id}.yaml index ec42e03631..118ff77434 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_product-types_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_product-types_{id}.yaml @@ -102,16 +102,7 @@ post: 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.yaml x-codeSamples: - lang: JavaScript label: JS SDK diff --git a/www/apps/api-reference/specs/admin/paths/admin_refund-reasons_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_refund-reasons_{id}.yaml index d216aa377d..8b6034cd94 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_refund-reasons_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_refund-reasons_{id}.yaml @@ -98,17 +98,7 @@ post: 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.yaml x-codeSamples: - lang: Shell label: cURL diff --git a/www/apps/api-reference/specs/admin/paths/admin_regions_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_regions_{id}.yaml index 6f0c64fd47..1e69b5b7c0 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_regions_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_regions_{id}.yaml @@ -102,44 +102,7 @@ post: 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.yaml x-codeSamples: - lang: JavaScript label: JS SDK diff --git a/www/apps/api-reference/specs/admin/paths/admin_reservations_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_reservations_{id}.yaml index 6d2ae3d7ce..69e108ecef 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_reservations_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_reservations_{id}.yaml @@ -102,24 +102,7 @@ post: 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.yaml x-codeSamples: - lang: JavaScript label: JS SDK diff --git a/www/apps/api-reference/specs/admin/paths/admin_shipping-options_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_shipping-options_{id}.yaml index e7ffa03c09..aed6317bea 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_shipping-options_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_shipping-options_{id}.yaml @@ -104,186 +104,7 @@ post: 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.yaml x-codeSamples: - lang: JavaScript label: JS SDK diff --git a/www/apps/api-reference/specs/admin/paths/admin_shipping-profiles_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_shipping-profiles_{id}.yaml index 41f131b448..555af65a2f 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_shipping-profiles_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_shipping-profiles_{id}.yaml @@ -102,20 +102,7 @@ post: 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.yaml x-codeSamples: - lang: JavaScript label: JS SDK diff --git a/www/apps/api-reference/specs/admin/paths/admin_stock-locations_{id}_fulfillment-sets.yaml b/www/apps/api-reference/specs/admin/paths/admin_stock-locations_{id}_fulfillment-sets.yaml index 0345a07c99..0de25993b6 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_stock-locations_{id}_fulfillment-sets.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_stock-locations_{id}_fulfillment-sets.yaml @@ -37,20 +37,7 @@ post: 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.yaml x-codeSamples: - lang: JavaScript label: JS SDK diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminCreateFulfillment.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminCreateFulfillment.yaml index 6359d75d4c..e315d770d3 100644 --- a/www/apps/api-reference/specs/store/components/schemas/AdminCreateFulfillment.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/AdminCreateFulfillment.yaml @@ -2,10 +2,10 @@ type: object description: The filfillment's details. x-schemaName: AdminCreateFulfillment required: - - data - items - metadata - order_id + - data - location_id - provider_id - delivery_address diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminCreateFulfillmentSetServiceZones.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminCreateFulfillmentSetServiceZones.yaml new file mode 100644 index 0000000000..438165ffd9 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminCreateFulfillmentSetServiceZones.yaml @@ -0,0 +1,132 @@ +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 diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminCreateInventoryLocationLevel.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminCreateInventoryLocationLevel.yaml new file mode 100644 index 0000000000..6578c122f4 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminCreateInventoryLocationLevel.yaml @@ -0,0 +1,18 @@ +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 diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminCreatePaymentCapture.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminCreatePaymentCapture.yaml new file mode 100644 index 0000000000..0064576c86 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminCreatePaymentCapture.yaml @@ -0,0 +1,8 @@ +type: object +description: The payment's details. +properties: + amount: + type: number + title: amount + description: The amount to capture. +x-schemaName: AdminCreatePaymentCapture diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminCreatePaymentCollection.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminCreatePaymentCollection.yaml new file mode 100644 index 0000000000..9d1f8bef7b --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminCreatePaymentCollection.yaml @@ -0,0 +1,15 @@ +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 diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminCreatePaymentRefund.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminCreatePaymentRefund.yaml new file mode 100644 index 0000000000..b5be8ea589 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminCreatePaymentRefund.yaml @@ -0,0 +1,16 @@ +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 diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminCreateStockLocationFulfillmentSet.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminCreateStockLocationFulfillmentSet.yaml new file mode 100644 index 0000000000..f099300601 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminCreateStockLocationFulfillmentSet.yaml @@ -0,0 +1,15 @@ +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 diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminInviteAccept.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminInviteAccept.yaml new file mode 100644 index 0000000000..9b853e7621 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminInviteAccept.yaml @@ -0,0 +1,17 @@ +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 diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminMarkPaymentCollectionPaid.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminMarkPaymentCollectionPaid.yaml new file mode 100644 index 0000000000..eec1356710 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminMarkPaymentCollectionPaid.yaml @@ -0,0 +1,10 @@ +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 diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminUpdateFulfillmentSetServiceZones.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminUpdateFulfillmentSetServiceZones.yaml new file mode 100644 index 0000000000..982be2f5eb --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminUpdateFulfillmentSetServiceZones.yaml @@ -0,0 +1,146 @@ +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 diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminUpdateInventoryItem.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminUpdateInventoryItem.yaml new file mode 100644 index 0000000000..34faa57636 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminUpdateInventoryItem.yaml @@ -0,0 +1,61 @@ +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 diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminUpdateInventoryLocationLevel.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminUpdateInventoryLocationLevel.yaml new file mode 100644 index 0000000000..94fba3e700 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminUpdateInventoryLocationLevel.yaml @@ -0,0 +1,12 @@ +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 diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminUpdatePaymentRefundReason.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminUpdatePaymentRefundReason.yaml new file mode 100644 index 0000000000..1573aa64b7 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminUpdatePaymentRefundReason.yaml @@ -0,0 +1,12 @@ +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 diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminUpdateProductCategory.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminUpdateProductCategory.yaml new file mode 100644 index 0000000000..5ce56e3290 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminUpdateProductCategory.yaml @@ -0,0 +1,37 @@ +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 diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminUpdateProductTag.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminUpdateProductTag.yaml new file mode 100644 index 0000000000..674eb56aa6 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminUpdateProductTag.yaml @@ -0,0 +1,11 @@ +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 diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminUpdateProductType.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminUpdateProductType.yaml new file mode 100644 index 0000000000..e086a5129f --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminUpdateProductType.yaml @@ -0,0 +1,11 @@ +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 diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminUpdateRegion.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminUpdateRegion.yaml new file mode 100644 index 0000000000..57633c59f9 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminUpdateRegion.yaml @@ -0,0 +1,37 @@ +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 diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminUpdateReservation.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminUpdateReservation.yaml new file mode 100644 index 0000000000..c274e12d51 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminUpdateReservation.yaml @@ -0,0 +1,19 @@ +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 diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminUpdateShippingOption.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminUpdateShippingOption.yaml new file mode 100644 index 0000000000..8ea9eac5bc --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminUpdateShippingOption.yaml @@ -0,0 +1,174 @@ +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 diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminUpdateShippingProfile.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminUpdateShippingProfile.yaml new file mode 100644 index 0000000000..468cc8ab28 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminUpdateShippingProfile.yaml @@ -0,0 +1,15 @@ +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 diff --git a/www/apps/api-reference/specs/store/components/schemas/StoreAddCartShippingMethods.yaml b/www/apps/api-reference/specs/store/components/schemas/StoreAddCartShippingMethods.yaml new file mode 100644 index 0000000000..494a059031 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/StoreAddCartShippingMethods.yaml @@ -0,0 +1,19 @@ +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 diff --git a/www/apps/api-reference/specs/store/components/schemas/StoreCreateCustomerAddress.yaml b/www/apps/api-reference/specs/store/components/schemas/StoreCreateCustomerAddress.yaml new file mode 100644 index 0000000000..a68cce7bec --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/StoreCreateCustomerAddress.yaml @@ -0,0 +1,63 @@ +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 diff --git a/www/apps/api-reference/specs/store/components/schemas/StoreUpdateCustomerAddress.yaml b/www/apps/api-reference/specs/store/components/schemas/StoreUpdateCustomerAddress.yaml new file mode 100644 index 0000000000..83d98b908b --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/StoreUpdateCustomerAddress.yaml @@ -0,0 +1,63 @@ +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 diff --git a/www/apps/api-reference/specs/store/openapi.full.yaml b/www/apps/api-reference/specs/store/openapi.full.yaml index 68058fe97e..637397b002 100644 --- a/www/apps/api-reference/specs/store/openapi.full.yaml +++ b/www/apps/api-reference/specs/store/openapi.full.yaml @@ -2037,21 +2037,7 @@ paths: 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 @@ -3693,68 +3679,7 @@ paths: 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 @@ -3950,68 +3875,7 @@ paths: 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 @@ -10913,10 +10777,10 @@ components: description: The filfillment's details. x-schemaName: AdminCreateFulfillment required: - - data - items - metadata - order_id + - data - location_id - provider_id - delivery_address @@ -11077,6 +10941,139 @@ components: metadata: type: object description: The fulfillment's metadata, used to store custom key-value pairs. + 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 AdminCreateGiftCardParams: type: object description: The details of the gift card to create. @@ -11189,6 +11186,25 @@ components: metadata: type: object description: The inventory item's metadata, used to store custom key-value pairs. + 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 AdminCreateOrderCreditLines: type: object description: The details of a credit line to add to an order. @@ -11216,6 +11232,48 @@ components: metadata: type: object description: The credit line's metadata, can hold custom key-value pairs. + AdminCreatePaymentCapture: + type: object + description: The payment's details. + properties: + amount: + type: number + title: amount + description: The amount to capture. + x-schemaName: AdminCreatePaymentCapture + 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 + 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 AdminCreatePriceList: type: object description: The price list's details. @@ -12091,6 +12149,22 @@ components: metadata: type: object description: The stock location's metadata, used to store custom key-value pairs. + 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 AdminCreateStoreCreditAccount: type: object description: The details of the store credit account to create. @@ -15310,6 +15384,24 @@ components: format: date-time title: updated_at description: The date the invite was updated. + 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 AdminInviteResponse: type: object description: The invite's details. @@ -15331,6 +15423,17 @@ components: title: remove description: The ID of a product. x-schemaName: AdminLinkPriceListProducts + 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 AdminNotification: type: object description: The notification's details. @@ -22019,6 +22122,153 @@ components: type: string title: internal_note description: A note viewed only by admin users about the shipping method. + 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 AdminUpdateGiftCardParams: type: object description: The details to update in the gift card. @@ -22054,6 +22304,79 @@ components: metadata: type: object description: The gift card's metadata. + 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 + 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 AdminUpdateOrder: type: object description: The details to update in the order. @@ -22171,6 +22494,19 @@ components: metadata: type: object description: The order's metadata, can hold custom key-value pairs. + 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 AdminUpdatePriceList: type: object description: the details to update in a price list. @@ -22381,6 +22717,42 @@ components: type: string title: external_id description: The ID of the product in an external or third-party system. + 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 AdminUpdateProductOption: type: object description: The details to update in a product option. @@ -22397,6 +22769,30 @@ components: type: string title: values description: An option value. + 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 + 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 AdminUpdateProductVariant: type: object description: The properties to update of a product variant. @@ -22522,6 +22918,64 @@ components: description: An attribute value. example: prod_123 x-schemaName: AdminUpdatePromotionRule + 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 + 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 AdminUpdateReturnReason: type: object description: The details to update in a return reason. @@ -22565,6 +23019,174 @@ components: metadata: type: object description: The sales channel's metadata, can hold custom key-value pairs. + 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 AdminUpdateShippingOptionRule: type: object description: The properties to update in the shipping option rule. @@ -22609,6 +23231,22 @@ components: description: A value of the attribute that enables this rule. example: cusgroup_123 x-schemaName: AdminUpdateShippingOptionRule + 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 AdminUpdateStockLocation: type: object description: The properties to update in a stock location. @@ -28923,6 +29561,23 @@ components: metadata: type: object description: The item's metadata, can hold custom key-value pairs. + 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 StoreAddGiftCardToCart: type: object description: The details to add a gift card to the cart. @@ -30217,6 +30872,70 @@ components: metadata: type: object description: The customer's metadata, can hold custom key-value pairs. + 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 StoreCreatePaymentCollection: type: object description: The details of the payment collection to create. @@ -38382,6 +39101,70 @@ components: metadata: type: object description: The customer's metadata, can hold custom key-value pairs. + 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 UpdateAddress: type: object description: The details to update in the address. diff --git a/www/apps/api-reference/specs/store/paths/store_carts_{id}_shipping-methods.yaml b/www/apps/api-reference/specs/store/paths/store_carts_{id}_shipping-methods.yaml index 441aba7d3f..989c96b301 100644 --- a/www/apps/api-reference/specs/store/paths/store_carts_{id}_shipping-methods.yaml +++ b/www/apps/api-reference/specs/store/paths/store_carts_{id}_shipping-methods.yaml @@ -47,24 +47,7 @@ post: 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.yaml x-codeSamples: - lang: JavaScript label: JS SDK diff --git a/www/apps/api-reference/specs/store/paths/store_customers_me_addresses.yaml b/www/apps/api-reference/specs/store/paths/store_customers_me_addresses.yaml index d49b326f54..908ce119d4 100644 --- a/www/apps/api-reference/specs/store/paths/store_customers_me_addresses.yaml +++ b/www/apps/api-reference/specs/store/paths/store_customers_me_addresses.yaml @@ -225,72 +225,7 @@ post: 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.yaml x-codeSamples: - lang: JavaScript label: JS SDK diff --git a/www/apps/api-reference/specs/store/paths/store_customers_me_addresses_{address_id}.yaml b/www/apps/api-reference/specs/store/paths/store_customers_me_addresses_{address_id}.yaml index dd98c7af31..132070ae47 100644 --- a/www/apps/api-reference/specs/store/paths/store_customers_me_addresses_{address_id}.yaml +++ b/www/apps/api-reference/specs/store/paths/store_customers_me_addresses_{address_id}.yaml @@ -139,72 +139,7 @@ post: 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.yaml x-codeSamples: - lang: JavaScript label: JS SDK diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_fulfillment-sets_[id]_service-zones.ts b/www/utils/generated/oas-output/operations/admin/post_admin_fulfillment-sets_[id]_service-zones.ts index bb0bc95f5a..6a65df73f1 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_fulfillment-sets_[id]_service-zones.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_fulfillment-sets_[id]_service-zones.ts @@ -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 diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_fulfillment-sets_[id]_service-zones_[zone_id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_fulfillment-sets_[id]_service-zones_[zone_id].ts index f5db41e208..d683a02d01 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_fulfillment-sets_[id]_service-zones_[zone_id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_fulfillment-sets_[id]_service-zones_[zone_id].ts @@ -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 diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_inventory-items_[id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_inventory-items_[id].ts index 17c2483d62..12efe8733f 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_inventory-items_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_inventory-items_[id].ts @@ -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 diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_inventory-items_[id]_location-levels.ts b/www/utils/generated/oas-output/operations/admin/post_admin_inventory-items_[id]_location-levels.ts index 43bb548fec..37b370b9c5 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_inventory-items_[id]_location-levels.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_inventory-items_[id]_location-levels.ts @@ -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 diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_inventory-items_[id]_location-levels_[location_id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_inventory-items_[id]_location-levels_[location_id].ts index 2a90b3ca40..91f1a03658 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_inventory-items_[id]_location-levels_[location_id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_inventory-items_[id]_location-levels_[location_id].ts @@ -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 diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_invites_accept.ts b/www/utils/generated/oas-output/operations/admin/post_admin_invites_accept.ts index 105e74ba69..91d21f1e53 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_invites_accept.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_invites_accept.ts @@ -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 diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_order-edits_[id]_items_item_[item_id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_order-edits_[id]_items_item_[item_id].ts index f79a46ce92..d181a85071 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_order-edits_[id]_items_item_[item_id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_order-edits_[id]_items_item_[item_id].ts @@ -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: diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_archive.ts b/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_archive.ts index e2c5e555aa..75cf18031a 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_archive.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_archive.ts @@ -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: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_complete.ts b/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_complete.ts index 1e34513f38..422bbc5d40 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_complete.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_complete.ts @@ -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: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_payment-collections.ts b/www/utils/generated/oas-output/operations/admin/post_admin_payment-collections.ts index 32c83d9fdc..3eae18dc35 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_payment-collections.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_payment-collections.ts @@ -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 diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_payment-collections_[id]_mark-as-paid.ts b/www/utils/generated/oas-output/operations/admin/post_admin_payment-collections_[id]_mark-as-paid.ts index d157790eed..16bb21c86a 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_payment-collections_[id]_mark-as-paid.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_payment-collections_[id]_mark-as-paid.ts @@ -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 diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_payments_[id]_capture.ts b/www/utils/generated/oas-output/operations/admin/post_admin_payments_[id]_capture.ts index ee5817925b..4d9b0fd7b2 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_payments_[id]_capture.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_payments_[id]_capture.ts @@ -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 diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_payments_[id]_refund.ts b/www/utils/generated/oas-output/operations/admin/post_admin_payments_[id]_refund.ts index bb0ce030ea..e511415e53 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_payments_[id]_refund.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_payments_[id]_refund.ts @@ -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 diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_product-categories_[id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_product-categories_[id].ts index fc9b5d760a..f7540d02cb 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_product-categories_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_product-categories_[id].ts @@ -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 diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_product-tags_[id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_product-tags_[id].ts index 94269a1fea..eed0cd8c27 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_product-tags_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_product-tags_[id].ts @@ -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 diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_product-types_[id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_product-types_[id].ts index bb433ddeba..7274b9ed4e 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_product-types_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_product-types_[id].ts @@ -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 diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_refund-reasons_[id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_refund-reasons_[id].ts index 9b8013d148..faa0a991bd 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_refund-reasons_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_refund-reasons_[id].ts @@ -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 diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_regions_[id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_regions_[id].ts index f950abb283..693874f539 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_regions_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_regions_[id].ts @@ -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 diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_reservations_[id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_reservations_[id].ts index 304ecdf4c3..490a318a79 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_reservations_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_reservations_[id].ts @@ -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 diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_shipping-options_[id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_shipping-options_[id].ts index 7ca6c691f6..e4182c6610 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_shipping-options_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_shipping-options_[id].ts @@ -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 diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_shipping-profiles_[id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_shipping-profiles_[id].ts index 2e853535b9..db0ac4b421 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_shipping-profiles_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_shipping-profiles_[id].ts @@ -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 diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_stock-locations_[id]_fulfillment-sets.ts b/www/utils/generated/oas-output/operations/admin/post_admin_stock-locations_[id]_fulfillment-sets.ts index ed00b46fb6..aeb3d5deba 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_stock-locations_[id]_fulfillment-sets.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_stock-locations_[id]_fulfillment-sets.ts @@ -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 diff --git a/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_shipping-methods.ts b/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_shipping-methods.ts index d32dd5a7cc..e68e9792d2 100644 --- a/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_shipping-methods.ts +++ b/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_shipping-methods.ts @@ -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 diff --git a/www/utils/generated/oas-output/operations/store/post_store_customers_me_addresses.ts b/www/utils/generated/oas-output/operations/store/post_store_customers_me_addresses.ts index 48fb60242a..90dde86194 100644 --- a/www/utils/generated/oas-output/operations/store/post_store_customers_me_addresses.ts +++ b/www/utils/generated/oas-output/operations/store/post_store_customers_me_addresses.ts @@ -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 diff --git a/www/utils/generated/oas-output/operations/store/post_store_customers_me_addresses_[address_id].ts b/www/utils/generated/oas-output/operations/store/post_store_customers_me_addresses_[address_id].ts index 7c8cc1e4cf..d6b3c1faf6 100644 --- a/www/utils/generated/oas-output/operations/store/post_store_customers_me_addresses_[address_id].ts +++ b/www/utils/generated/oas-output/operations/store/post_store_customers_me_addresses_[address_id].ts @@ -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 diff --git a/www/utils/generated/oas-output/operations/store/post_store_payment-collections_[id]_payment-sessions.ts b/www/utils/generated/oas-output/operations/store/post_store_payment-collections_[id]_payment-sessions.ts index 42c2b32c37..1507f605c4 100644 --- a/www/utils/generated/oas-output/operations/store/post_store_payment-collections_[id]_payment-sessions.ts +++ b/www/utils/generated/oas-output/operations/store/post_store_payment-collections_[id]_payment-sessions.ts @@ -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: diff --git a/www/utils/generated/oas-output/schemas/AdminCreateFulfillment.ts b/www/utils/generated/oas-output/schemas/AdminCreateFulfillment.ts index c54962ed3f..abe3b756f6 100644 --- a/www/utils/generated/oas-output/schemas/AdminCreateFulfillment.ts +++ b/www/utils/generated/oas-output/schemas/AdminCreateFulfillment.ts @@ -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 diff --git a/www/utils/generated/oas-output/schemas/AdminCreateFulfillmentSetServiceZones.ts b/www/utils/generated/oas-output/schemas/AdminCreateFulfillmentSetServiceZones.ts new file mode 100644 index 0000000000..8427281e74 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminCreateFulfillmentSetServiceZones.ts @@ -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 + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminCreateInventoryLocationLevel.ts b/www/utils/generated/oas-output/schemas/AdminCreateInventoryLocationLevel.ts new file mode 100644 index 0000000000..8a8b865982 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminCreateInventoryLocationLevel.ts @@ -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 + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminCreatePaymentCapture.ts b/www/utils/generated/oas-output/schemas/AdminCreatePaymentCapture.ts new file mode 100644 index 0000000000..52fd075e71 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminCreatePaymentCapture.ts @@ -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 + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminCreatePaymentCollection.ts b/www/utils/generated/oas-output/schemas/AdminCreatePaymentCollection.ts new file mode 100644 index 0000000000..5889582f83 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminCreatePaymentCollection.ts @@ -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 + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminCreatePaymentRefund.ts b/www/utils/generated/oas-output/schemas/AdminCreatePaymentRefund.ts new file mode 100644 index 0000000000..4da6e5ce25 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminCreatePaymentRefund.ts @@ -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 + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminCreateStockLocationFulfillmentSet.ts b/www/utils/generated/oas-output/schemas/AdminCreateStockLocationFulfillmentSet.ts new file mode 100644 index 0000000000..3f9c1a81df --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminCreateStockLocationFulfillmentSet.ts @@ -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 + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminInviteAccept.ts b/www/utils/generated/oas-output/schemas/AdminInviteAccept.ts new file mode 100644 index 0000000000..1b368c398c --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminInviteAccept.ts @@ -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 + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminMarkPaymentCollectionPaid.ts b/www/utils/generated/oas-output/schemas/AdminMarkPaymentCollectionPaid.ts new file mode 100644 index 0000000000..d3f65aee26 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminMarkPaymentCollectionPaid.ts @@ -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 + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminUpdateFulfillmentSetServiceZones.ts b/www/utils/generated/oas-output/schemas/AdminUpdateFulfillmentSetServiceZones.ts new file mode 100644 index 0000000000..f89cbfaf96 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminUpdateFulfillmentSetServiceZones.ts @@ -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 + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminUpdateInventoryItem.ts b/www/utils/generated/oas-output/schemas/AdminUpdateInventoryItem.ts new file mode 100644 index 0000000000..926e2f0486 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminUpdateInventoryItem.ts @@ -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 + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminUpdateInventoryLocationLevel.ts b/www/utils/generated/oas-output/schemas/AdminUpdateInventoryLocationLevel.ts new file mode 100644 index 0000000000..7f055b0dc7 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminUpdateInventoryLocationLevel.ts @@ -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 + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminUpdatePaymentRefundReason.ts b/www/utils/generated/oas-output/schemas/AdminUpdatePaymentRefundReason.ts new file mode 100644 index 0000000000..79f3804d7a --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminUpdatePaymentRefundReason.ts @@ -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 + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminUpdateProductCategory.ts b/www/utils/generated/oas-output/schemas/AdminUpdateProductCategory.ts new file mode 100644 index 0000000000..b6db5026a7 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminUpdateProductCategory.ts @@ -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 + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminUpdateProductTag.ts b/www/utils/generated/oas-output/schemas/AdminUpdateProductTag.ts new file mode 100644 index 0000000000..87305fd350 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminUpdateProductTag.ts @@ -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 + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminUpdateProductType.ts b/www/utils/generated/oas-output/schemas/AdminUpdateProductType.ts new file mode 100644 index 0000000000..c9e7a80a29 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminUpdateProductType.ts @@ -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 + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminUpdateRegion.ts b/www/utils/generated/oas-output/schemas/AdminUpdateRegion.ts new file mode 100644 index 0000000000..9fa41e6d95 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminUpdateRegion.ts @@ -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 + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminUpdateReservation.ts b/www/utils/generated/oas-output/schemas/AdminUpdateReservation.ts new file mode 100644 index 0000000000..6edc39ec7d --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminUpdateReservation.ts @@ -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 + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminUpdateShippingOption.ts b/www/utils/generated/oas-output/schemas/AdminUpdateShippingOption.ts new file mode 100644 index 0000000000..debe4a097d --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminUpdateShippingOption.ts @@ -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 + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminUpdateShippingProfile.ts b/www/utils/generated/oas-output/schemas/AdminUpdateShippingProfile.ts new file mode 100644 index 0000000000..12ebcff94c --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminUpdateShippingProfile.ts @@ -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 + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/StoreAddCartShippingMethods.ts b/www/utils/generated/oas-output/schemas/StoreAddCartShippingMethods.ts new file mode 100644 index 0000000000..9fbd27b533 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/StoreAddCartShippingMethods.ts @@ -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 + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/StoreCreateCustomerAddress.ts b/www/utils/generated/oas-output/schemas/StoreCreateCustomerAddress.ts new file mode 100644 index 0000000000..94f8a8087b --- /dev/null +++ b/www/utils/generated/oas-output/schemas/StoreCreateCustomerAddress.ts @@ -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 + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/StoreUpdateCustomerAddress.ts b/www/utils/generated/oas-output/schemas/StoreUpdateCustomerAddress.ts new file mode 100644 index 0000000000..950ef03d31 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/StoreUpdateCustomerAddress.ts @@ -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 + * +*/ + diff --git a/www/utils/generated/route-examples-output/route-examples.json b/www/utils/generated/route-examples-output/route-examples.json index 8e01e8f902..d5efe1eb9c 100644 --- a/www/utils/generated/route-examples-output/route-examples.json +++ b/www/utils/generated/route-examples-output/route-examples.json @@ -371,9 +371,15 @@ "GET /admin/orders": { "js-sdk": "sdk.admin.order.list()\n.then(({ orders, count, limit, offset }) => {\n console.log(orders)\n})" }, + "POST /admin/orders/{id}/archive": { + "js-sdk": "sdk.admin.order.archive(\"order_123\")\n.then(({ order }) => {\n console.log(order)\n})" + }, "POST /admin/orders/{id}/cancel": { "js-sdk": "sdk.admin.order.cancel(\"order_123\")\n.then(({ order }) => {\n console.log(order)\n})" }, + "POST /admin/orders/{id}/complete": { + "js-sdk": "sdk.admin.order.complete(\"order_123\")\n.then(({ order }) => {\n console.log(order)\n})" + }, "POST /admin/orders/{id}/transfer": { "js-sdk": "sdk.admin.order.requestTransfer(\"order_123\", {\n customer_id: \"cus_123\",\n internal_note: \"Internal note\",\n})\n.then(({ order }) => {\n console.log(order)\n})" }, diff --git a/www/utils/packages/docs-generator/src/classes/helpers/oas-schema.ts b/www/utils/packages/docs-generator/src/classes/helpers/oas-schema.ts index 8108398605..0ad03bed95 100644 --- a/www/utils/packages/docs-generator/src/classes/helpers/oas-schema.ts +++ b/www/utils/packages/docs-generator/src/classes/helpers/oas-schema.ts @@ -364,7 +364,7 @@ class OasSchemaHelper { .replace("DTO", "") .replace(this.schemaRefPrefix, "") .replace( - /(?