From 52e965f41103e85c6ca817c6813ac95dfc0fb77d Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Wed, 17 Dec 2025 18:19:46 +0200 Subject: [PATCH] docs: generate API reference for 2.12.3 (#14341) --- .../generated/generated-admin-sidebar.mjs | 36 + .../generated/generated-store-sidebar.mjs | 18 + .../JavaScript/admin_locales/get.js | 14 + .../JavaScript/admin_locales_{code}/get.js | 14 + .../JavaScript/admin_orders_export/post.js | 14 + .../admin_price-lists_{id}_prices/get.js | 14 + .../JavaScript/admin_translations/get.js | 14 + .../admin_translations_batch/post.js | 31 + .../admin_translations_settings/get.js | 16 + .../admin_translations_statistics/get.js | 16 + .../code_samples/Shell/admin_locales/get.sh | 2 + .../Shell/admin_locales_{code}/get.sh | 2 + .../Shell/admin_orders_export/post.sh | 2 + .../admin_price-lists_{id}_prices/get.sh | 2 + .../Shell/admin_translations/get.sh | 2 + .../Shell/admin_translations_batch/post.sh | 16 + .../Shell/admin_translations_settings/get.sh | 2 + .../admin_translations_statistics/get.sh | 2 + .../components/schemas/AdminCollection.yaml | 5 + .../schemas/AdminExportOrderResponse.yaml | 13 + .../admin/components/schemas/AdminLocale.yaml | 34 + .../schemas/AdminLocaleListResponse.yaml | 33 + .../schemas/AdminLocaleResponse.yaml | 8 + .../AdminPriceListPriceListResponse.yaml | 33 + .../components/schemas/AdminProduct.yaml | 5 + .../components/schemas/AdminProductTag.yaml | 5 + .../components/schemas/AdminProductType.yaml | 5 + .../schemas/AdminProductVariant.yaml | 5 + .../admin/components/schemas/AdminStore.yaml | 6 + .../components/schemas/AdminStoreLocale.yaml | 41 + .../components/schemas/AdminTranslation.yaml | 57 + .../AdminTranslationSettingsResponse.yaml | 16 + .../AdminTranslationStatisticsResponse.yaml | 74 + .../AdminTranslationsBatchResponse.yaml | 42 + .../components/schemas/AdminUpdateOrder.yaml | 8 + .../components/schemas/AdminUpdateStore.yaml | 5 + .../AdminUpdateStoreSupportedLocale.yaml | 13 + .../specs/admin/components/schemas/Order.yaml | 8 + .../admin/components/schemas/StoreLocale.yaml | 19 + .../schemas/StoreLocaleListResponse.yaml | 11 + .../specs/admin/openapi.full.yaml | 1772 +++++++++++++++++ .../api-reference/specs/admin/openapi.yaml | 41 + .../specs/admin/paths/admin_locales.yaml | 155 ++ .../admin/paths/admin_locales_{code}.yaml | 72 + .../admin/paths/admin_orders_export.yaml | 528 +++++ .../paths/admin_price-lists_{id}_prices.yaml | 66 + .../specs/admin/paths/admin_translations.yaml | 228 +++ .../admin/paths/admin_translations_batch.yaml | 165 ++ .../paths/admin_translations_settings.yaml | 54 + .../paths/admin_translations_statistics.yaml | 77 + .../JavaScript/store_locales/get.js | 18 + .../code_samples/Shell/store_locales/get.sh | 2 + .../components/schemas/AdminCollection.yaml | 5 + .../schemas/AdminExportOrderResponse.yaml | 13 + .../store/components/schemas/AdminLocale.yaml | 34 + .../schemas/AdminLocaleListResponse.yaml | 33 + .../schemas/AdminLocaleResponse.yaml | 8 + .../AdminPriceListPriceListResponse.yaml | 33 + .../components/schemas/AdminProduct.yaml | 5 + .../components/schemas/AdminProductTag.yaml | 5 + .../components/schemas/AdminProductType.yaml | 5 + .../schemas/AdminProductVariant.yaml | 5 + .../store/components/schemas/AdminStore.yaml | 6 + .../components/schemas/AdminStoreLocale.yaml | 41 + .../components/schemas/AdminTranslation.yaml | 57 + .../AdminTranslationSettingsResponse.yaml | 16 + .../AdminTranslationStatisticsResponse.yaml | 74 + .../AdminTranslationsBatchResponse.yaml | 42 + .../components/schemas/AdminUpdateOrder.yaml | 8 + .../components/schemas/AdminUpdateStore.yaml | 5 + .../AdminUpdateStoreSupportedLocale.yaml | 13 + .../specs/store/components/schemas/Order.yaml | 8 + .../store/components/schemas/StoreLocale.yaml | 19 + .../schemas/StoreLocaleListResponse.yaml | 11 + .../specs/store/openapi.full.yaml | 1498 +++++++++++++- .../api-reference/specs/store/openapi.yaml | 15 + .../specs/store/paths/store_carts.yaml | 22 + .../specs/store/paths/store_carts_{id}.yaml | 44 + .../paths/store_carts_{id}_complete.yaml | 22 + .../paths/store_carts_{id}_customer.yaml | 22 + .../paths/store_carts_{id}_line-items.yaml | 22 + ...store_carts_{id}_line-items_{line_id}.yaml | 44 + .../paths/store_carts_{id}_promotions.yaml | 44 + .../store_carts_{id}_shipping-methods.yaml | 22 + .../store/paths/store_carts_{id}_taxes.yaml | 22 + .../specs/store/paths/store_collections.yaml | 22 + .../store/paths/store_collections_{id}.yaml | 22 + .../specs/store/paths/store_currencies.yaml | 22 + .../store/paths/store_currencies_{code}.yaml | 22 + .../specs/store/paths/store_customers.yaml | 22 + .../specs/store/paths/store_customers_me.yaml | 44 + .../paths/store_customers_me_addresses.yaml | 44 + ...e_customers_me_addresses_{address_id}.yaml | 66 + .../specs/store/paths/store_locales.yaml | 73 + .../specs/store/paths/store_orders.yaml | 22 + .../specs/store/paths/store_orders_{id}.yaml | 22 + .../store_orders_{id}_transfer_accept.yaml | 22 + .../store_orders_{id}_transfer_cancel.yaml | 22 + .../store_orders_{id}_transfer_decline.yaml | 22 + .../store_orders_{id}_transfer_request.yaml | 22 + .../paths/store_payment-collections.yaml | 22 + ...ent-collections_{id}_payment-sessions.yaml | 22 + .../store/paths/store_payment-providers.yaml | 22 + .../store/paths/store_product-categories.yaml | 22 + .../paths/store_product-categories_{id}.yaml | 22 + .../specs/store/paths/store_product-tags.yaml | 22 + .../store/paths/store_product-tags_{id}.yaml | 22 + .../store/paths/store_product-types.yaml | 22 + .../store/paths/store_product-types_{id}.yaml | 22 + .../specs/store/paths/store_products.yaml | 37 +- .../store/paths/store_products_{id}.yaml | 37 +- .../specs/store/paths/store_regions.yaml | 22 + .../specs/store/paths/store_regions_{id}.yaml | 22 + .../store/paths/store_return-reasons.yaml | 22 + .../paths/store_return-reasons_{id}.yaml | 22 + .../specs/store/paths/store_returns.yaml | 22 + .../store/paths/store_shipping-options.yaml | 22 + ...store_shipping-options_{id}_calculate.yaml | 22 + .../get_admin_price-lists_[id]_prices.ts | 78 + .../admin/get_admin_translations.ts | 17 + .../admin/get_admin_translations_settings.ts | 30 +- .../get_admin_translations_statistics.ts | 24 +- .../admin/post_admin_orders_export.ts | 479 +++++ .../admin/post_admin_translations_batch.ts | 34 + .../oas-output/schemas/AdminCollection.ts | 5 + .../schemas/AdminExportOrderResponse.ts | 15 + .../AdminPriceListPriceListResponse.ts | 36 + .../oas-output/schemas/AdminProduct.ts | 5 + .../oas-output/schemas/AdminProductTag.ts | 5 + .../oas-output/schemas/AdminProductType.ts | 5 + .../oas-output/schemas/AdminProductVariant.ts | 5 + .../AdminTranslationSettingsResponse.ts | 4 +- .../AdminTranslationStatisticsResponse.ts | 3 +- .../route-examples-output/route-examples.json | 14 +- 134 files changed, 7706 insertions(+), 12 deletions(-) create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_locales/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_locales_{code}/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_export/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-lists_{id}_prices/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_translations/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_translations_batch/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_translations_settings/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_translations_statistics/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/Shell/admin_locales/get.sh create mode 100644 www/apps/api-reference/specs/admin/code_samples/Shell/admin_locales_{code}/get.sh create mode 100644 www/apps/api-reference/specs/admin/code_samples/Shell/admin_orders_export/post.sh create mode 100644 www/apps/api-reference/specs/admin/code_samples/Shell/admin_price-lists_{id}_prices/get.sh create mode 100644 www/apps/api-reference/specs/admin/code_samples/Shell/admin_translations/get.sh create mode 100644 www/apps/api-reference/specs/admin/code_samples/Shell/admin_translations_batch/post.sh create mode 100644 www/apps/api-reference/specs/admin/code_samples/Shell/admin_translations_settings/get.sh create mode 100644 www/apps/api-reference/specs/admin/code_samples/Shell/admin_translations_statistics/get.sh create mode 100644 www/apps/api-reference/specs/admin/components/schemas/AdminExportOrderResponse.yaml create mode 100644 www/apps/api-reference/specs/admin/components/schemas/AdminLocale.yaml create mode 100644 www/apps/api-reference/specs/admin/components/schemas/AdminLocaleListResponse.yaml create mode 100644 www/apps/api-reference/specs/admin/components/schemas/AdminLocaleResponse.yaml create mode 100644 www/apps/api-reference/specs/admin/components/schemas/AdminPriceListPriceListResponse.yaml create mode 100644 www/apps/api-reference/specs/admin/components/schemas/AdminStoreLocale.yaml create mode 100644 www/apps/api-reference/specs/admin/components/schemas/AdminTranslation.yaml create mode 100644 www/apps/api-reference/specs/admin/components/schemas/AdminTranslationSettingsResponse.yaml create mode 100644 www/apps/api-reference/specs/admin/components/schemas/AdminTranslationStatisticsResponse.yaml create mode 100644 www/apps/api-reference/specs/admin/components/schemas/AdminTranslationsBatchResponse.yaml create mode 100644 www/apps/api-reference/specs/admin/components/schemas/AdminUpdateStoreSupportedLocale.yaml create mode 100644 www/apps/api-reference/specs/admin/components/schemas/StoreLocale.yaml create mode 100644 www/apps/api-reference/specs/admin/components/schemas/StoreLocaleListResponse.yaml create mode 100644 www/apps/api-reference/specs/admin/paths/admin_locales.yaml create mode 100644 www/apps/api-reference/specs/admin/paths/admin_locales_{code}.yaml create mode 100644 www/apps/api-reference/specs/admin/paths/admin_orders_export.yaml create mode 100644 www/apps/api-reference/specs/admin/paths/admin_price-lists_{id}_prices.yaml create mode 100644 www/apps/api-reference/specs/admin/paths/admin_translations.yaml create mode 100644 www/apps/api-reference/specs/admin/paths/admin_translations_batch.yaml create mode 100644 www/apps/api-reference/specs/admin/paths/admin_translations_settings.yaml create mode 100644 www/apps/api-reference/specs/admin/paths/admin_translations_statistics.yaml create mode 100644 www/apps/api-reference/specs/store/code_samples/JavaScript/store_locales/get.js create mode 100644 www/apps/api-reference/specs/store/code_samples/Shell/store_locales/get.sh create mode 100644 www/apps/api-reference/specs/store/components/schemas/AdminExportOrderResponse.yaml create mode 100644 www/apps/api-reference/specs/store/components/schemas/AdminLocale.yaml create mode 100644 www/apps/api-reference/specs/store/components/schemas/AdminLocaleListResponse.yaml create mode 100644 www/apps/api-reference/specs/store/components/schemas/AdminLocaleResponse.yaml create mode 100644 www/apps/api-reference/specs/store/components/schemas/AdminPriceListPriceListResponse.yaml create mode 100644 www/apps/api-reference/specs/store/components/schemas/AdminStoreLocale.yaml create mode 100644 www/apps/api-reference/specs/store/components/schemas/AdminTranslation.yaml create mode 100644 www/apps/api-reference/specs/store/components/schemas/AdminTranslationSettingsResponse.yaml create mode 100644 www/apps/api-reference/specs/store/components/schemas/AdminTranslationStatisticsResponse.yaml create mode 100644 www/apps/api-reference/specs/store/components/schemas/AdminTranslationsBatchResponse.yaml create mode 100644 www/apps/api-reference/specs/store/components/schemas/AdminUpdateStoreSupportedLocale.yaml create mode 100644 www/apps/api-reference/specs/store/components/schemas/StoreLocale.yaml create mode 100644 www/apps/api-reference/specs/store/components/schemas/StoreLocaleListResponse.yaml create mode 100644 www/apps/api-reference/specs/store/paths/store_locales.yaml create mode 100644 www/utils/generated/oas-output/operations/admin/get_admin_price-lists_[id]_prices.ts create mode 100644 www/utils/generated/oas-output/operations/admin/post_admin_orders_export.ts create mode 100644 www/utils/generated/oas-output/schemas/AdminExportOrderResponse.ts create mode 100644 www/utils/generated/oas-output/schemas/AdminPriceListPriceListResponse.ts diff --git a/www/apps/api-reference/generated/generated-admin-sidebar.mjs b/www/apps/api-reference/generated/generated-admin-sidebar.mjs index 3081847c49..27043da8df 100644 --- a/www/apps/api-reference/generated/generated-admin-sidebar.mjs +++ b/www/apps/api-reference/generated/generated-admin-sidebar.mjs @@ -344,6 +344,24 @@ const generatedgeneratedAdminSidebarSidebar = { "loaded": false, "showLoadingIfEmpty": true }, + { + "type": "category", + "title": "Locales", + "children": [ + { + "type": "link", + "path": "locales_locale_schema", + "title": "Locale Object", + "loaded": true, + "badge": { + "variant": "neutral", + "text": "Schema" + } + } + ], + "loaded": false, + "showLoadingIfEmpty": true + }, { "type": "category", "title": "Notifications", @@ -891,6 +909,24 @@ const generatedgeneratedAdminSidebarSidebar = { "loaded": false, "showLoadingIfEmpty": true }, + { + "type": "category", + "title": "Translations", + "children": [ + { + "type": "link", + "path": "translations_translation_schema", + "title": "Translation Object", + "loaded": true, + "badge": { + "variant": "neutral", + "text": "Schema" + } + } + ], + "loaded": false, + "showLoadingIfEmpty": true + }, { "type": "category", "title": "Uploads", diff --git a/www/apps/api-reference/generated/generated-store-sidebar.mjs b/www/apps/api-reference/generated/generated-store-sidebar.mjs index b4f6e739aa..85b757bee5 100644 --- a/www/apps/api-reference/generated/generated-store-sidebar.mjs +++ b/www/apps/api-reference/generated/generated-store-sidebar.mjs @@ -162,6 +162,24 @@ const generatedgeneratedStoreSidebarSidebar = { "loaded": false, "showLoadingIfEmpty": true }, + { + "type": "category", + "title": "Locales", + "children": [ + { + "type": "link", + "path": "locales_locale_schema", + "title": "Locale Object", + "loaded": true, + "badge": { + "variant": "neutral", + "text": "Schema" + } + } + ], + "loaded": false, + "showLoadingIfEmpty": true + }, { "type": "category", "title": "Orders", diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_locales/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_locales/get.js new file mode 100644 index 0000000000..0dc772fa4b --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_locales/get.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.locale.list() +.then(({ locales, count, limit, offset }) => { + console.log(locales) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_locales_{code}/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_locales_{code}/get.js new file mode 100644 index 0000000000..034aa79d90 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_locales_{code}/get.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.locale.retrieve("en-US") +.then(({ locale }) => { + console.log(locale) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_export/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_export/post.js new file mode 100644 index 0000000000..d9ae3f681f --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_export/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.export() +.then(({ transaction_id }) => { + console.log(transaction_id) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-lists_{id}_prices/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-lists_{id}_prices/get.js new file mode 100644 index 0000000000..80816f0afc --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-lists_{id}_prices/get.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.priceList.prices("plist_123") +.then(({ prices }) => { + console.log(prices) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_translations/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_translations/get.js new file mode 100644 index 0000000000..b488731bfe --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_translations/get.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.translation.list() +.then(({ translations, count, limit, offset }) => { + console.log(translations) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_translations_batch/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_translations_batch/post.js new file mode 100644 index 0000000000..59559113b1 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_translations_batch/post.js @@ -0,0 +1,31 @@ +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.translation.batch({ + create: [ + { + reference_id: "prod_123", + reference: "product", + locale_code: "en-US", + translations: { title: "Shirt" } + } + ], + update: [ + { + id: "trans_123", + translations: { title: "Pants" } + } + ], + delete: ["trans_321"] +}) +.then(({ created, updated, deleted }) => { + console.log(created, updated, deleted) +}) +``` \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_translations_settings/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_translations_settings/get.js new file mode 100644 index 0000000000..376419f637 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_translations_settings/get.js @@ -0,0 +1,16 @@ +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.translation.settings({ + entity_type: "product" +}) +.then(({ translatable_fields }) => { + console.log(translatable_fields) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_translations_statistics/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_translations_statistics/get.js new file mode 100644 index 0000000000..8bee4deadb --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_translations_statistics/get.js @@ -0,0 +1,16 @@ +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.translation.statistics({ + entity_type: "product" +}) +.then(({ statistics }) => { + console.log(statistics) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_locales/get.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_locales/get.sh new file mode 100644 index 0000000000..58b86ea6b7 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_locales/get.sh @@ -0,0 +1,2 @@ +curl '{backend_url}/admin/locales' \ +-H 'Authorization: Bearer {access_token}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_locales_{code}/get.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_locales_{code}/get.sh new file mode 100644 index 0000000000..08ddd473f9 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_locales_{code}/get.sh @@ -0,0 +1,2 @@ +curl '{backend_url}/admin/locales/fr-FR' \ +-H 'Authorization: Bearer {access_token}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_orders_export/post.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_orders_export/post.sh new file mode 100644 index 0000000000..93298777a2 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_orders_export/post.sh @@ -0,0 +1,2 @@ +curl -X POST '{backend_url}/admin/orders/export' \ +-H 'Authorization: Bearer {access_token}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_price-lists_{id}_prices/get.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_price-lists_{id}_prices/get.sh new file mode 100644 index 0000000000..a8c6d32972 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_price-lists_{id}_prices/get.sh @@ -0,0 +1,2 @@ +curl '{backend_url}/admin/price-lists/{id}/prices' \ +-H 'Authorization: Bearer {access_token}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_translations/get.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_translations/get.sh new file mode 100644 index 0000000000..441b9fcd89 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_translations/get.sh @@ -0,0 +1,2 @@ +curl '{backend_url}/admin/translations' \ +-H 'Authorization: Bearer {access_token}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_translations_batch/post.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_translations_batch/post.sh new file mode 100644 index 0000000000..c97612f6e0 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_translations_batch/post.sh @@ -0,0 +1,16 @@ +curl -X POST '{backend_url}/admin/translations/batch' \ +-H 'Authorization: Bearer {access_token}' \ +-H 'Content-Type: application/json' \ +-d '{ + "create": [ + { + "reference": "product", + "reference_id": "prod_123", + "locale_code": "fr-FR", + "translations": { + "title": "Chaussures", + "description": "Des chaussures élégantes." + } + } + ] +}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_translations_settings/get.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_translations_settings/get.sh new file mode 100644 index 0000000000..8e6178afce --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_translations_settings/get.sh @@ -0,0 +1,2 @@ +curl '{backend_url}/admin/translations/settings' \ +-H 'Authorization: Bearer {access_token}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_translations_statistics/get.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_translations_statistics/get.sh new file mode 100644 index 0000000000..a84ca24f49 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_translations_statistics/get.sh @@ -0,0 +1,2 @@ +curl '{backend_url}/admin/translations/statistics' \ +-H 'Authorization: Bearer {access_token}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminCollection.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminCollection.yaml index 68b150b1ba..e6fb6b460a 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/AdminCollection.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminCollection.yaml @@ -48,3 +48,8 @@ properties: externalDocs: url: https://docs.medusajs.com/api/admin#manage-metadata description: Learn how to manage metadata + translations: + type: array + description: The collection's translations. + items: + $ref: ./AdminTranslation.yaml diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminExportOrderResponse.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminExportOrderResponse.yaml new file mode 100644 index 0000000000..0b810f0d24 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminExportOrderResponse.yaml @@ -0,0 +1,13 @@ +type: object +description: The details of the order export. +x-schemaName: AdminExportOrderResponse +required: + - transaction_id +properties: + transaction_id: + type: string + title: transaction_id + description: >- + The ID of the workflow execution's transaction. Use it to check the status + of the export by sending a GET request to + `/admin/workflows-executions/export-orders/:transaction-id` diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminLocale.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminLocale.yaml new file mode 100644 index 0000000000..c70fc69e43 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminLocale.yaml @@ -0,0 +1,34 @@ +type: object +description: The locale's details. +x-schemaName: AdminLocale +required: + - code + - name + - created_at + - updated_at + - deleted_at +properties: + code: + type: string + title: code + description: The locale's code in BCP 47 format. + example: fr-FR + name: + type: string + title: name + description: The locale's display name. + created_at: + type: string + format: date-time + title: created_at + description: The date and time at which the locale was created. + updated_at: + type: string + format: date-time + title: updated_at + description: The date and time at which the locale was last updated. + deleted_at: + type: string + format: date-time + title: deleted_at + description: The date and time at which the locale was deleted. diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminLocaleListResponse.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminLocaleListResponse.yaml new file mode 100644 index 0000000000..a76b4bf49a --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminLocaleListResponse.yaml @@ -0,0 +1,33 @@ +type: object +description: The list of locales with pagination details. +x-schemaName: AdminLocaleListResponse +required: + - limit + - offset + - count + - locales +properties: + limit: + type: number + title: limit + description: The maximum number of locales returned. + offset: + type: number + title: offset + description: The number of locales skipped before retrieving the returned locales. + count: + type: number + title: count + description: The total number of locales matching the query. + estimate_count: + type: number + title: estimate_count + description: >- + The estimated count retrieved from the PostgreSQL query planner, which may + be inaccurate. + x-featureFlag: index_engine + locales: + type: array + description: The list of locales. + items: + $ref: ./AdminLocale.yaml diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminLocaleResponse.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminLocaleResponse.yaml new file mode 100644 index 0000000000..af012797bd --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminLocaleResponse.yaml @@ -0,0 +1,8 @@ +type: object +description: The locale's details. +x-schemaName: AdminLocaleResponse +required: + - locale +properties: + locale: + $ref: ./AdminLocale.yaml diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminPriceListPriceListResponse.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminPriceListPriceListResponse.yaml new file mode 100644 index 0000000000..4221f97427 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminPriceListPriceListResponse.yaml @@ -0,0 +1,33 @@ +type: object +description: The list of prices. +x-schemaName: AdminPriceListPriceListResponse +required: + - limit + - offset + - count + - prices +properties: + limit: + type: number + title: limit + description: The maximum number of prices returned. + offset: + type: number + title: offset + description: The number of items skipped before retrieving the prices. + count: + type: number + title: count + description: The total number of prices. + estimate_count: + type: number + title: estimate_count + description: >- + The estimated count retrieved from the PostgreSQL query planner, which may + be inaccurate. + x-featureFlag: index_engine + prices: + type: array + description: The list of prices. + items: + $ref: ./AdminPrice.yaml diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminProduct.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminProduct.yaml index 13ff822552..4410442f35 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/AdminProduct.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminProduct.yaml @@ -171,3 +171,8 @@ properties: description: The date the product was deleted. shipping_profile: $ref: ./AdminShippingProfile.yaml + translations: + type: array + description: The product's translations. + items: + $ref: ./AdminTranslation.yaml diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminProductTag.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminProductTag.yaml index 8fb2c7567e..b78463254e 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/AdminProductTag.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminProductTag.yaml @@ -36,3 +36,8 @@ properties: externalDocs: url: https://docs.medusajs.com/api/admin#manage-metadata description: Learn how to manage metadata + translations: + type: array + description: The tag's translations. + items: + $ref: ./AdminTranslation.yaml diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminProductType.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminProductType.yaml index 6cef7208c7..74332070d8 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/AdminProductType.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminProductType.yaml @@ -36,3 +36,8 @@ properties: externalDocs: url: https://docs.medusajs.com/api/admin#manage-metadata description: Learn how to manage metadata + translations: + type: array + description: The type's translations. + items: + $ref: ./AdminTranslation.yaml diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminProductVariant.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminProductVariant.yaml index dbe5464485..52a815867d 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/AdminProductVariant.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminProductVariant.yaml @@ -155,3 +155,8 @@ properties: type: string title: thumbnail description: The variant's thumbnail. + translations: + type: array + description: The variant's translations. + items: + $ref: ./AdminTranslation.yaml diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminStore.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminStore.yaml index 7dbecee439..dfbf0d0e3b 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/AdminStore.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminStore.yaml @@ -5,6 +5,7 @@ required: - id - name - supported_currencies + - supported_locales - default_sales_channel_id - default_region_id - default_location_id @@ -53,3 +54,8 @@ properties: format: date-time title: updated_at description: The date the store was updated. + supported_locales: + type: array + description: The store's supported locales. + items: + $ref: ./AdminStoreLocale.yaml diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminStoreLocale.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminStoreLocale.yaml new file mode 100644 index 0000000000..f696762f09 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminStoreLocale.yaml @@ -0,0 +1,41 @@ +type: object +description: The details of a store's locale. +x-schemaName: AdminStoreLocale +required: + - id + - locale_code + - store_id + - locale + - created_at + - updated_at + - deleted_at +properties: + id: + type: string + title: id + description: The locale's ID. + locale_code: + type: string + title: locale_code + description: The locale's code in BCP 47 format. + store_id: + type: string + title: store_id + description: The ID of the store to which the locale belongs. + locale: + $ref: ./AdminLocale.yaml + created_at: + type: string + format: date-time + title: created_at + description: The date the locale was created. + updated_at: + type: string + format: date-time + title: updated_at + description: The date the locale was updated. + deleted_at: + type: string + format: date-time + title: deleted_at + description: The date the locale was deleted. diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminTranslation.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminTranslation.yaml new file mode 100644 index 0000000000..f3616e2ff2 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminTranslation.yaml @@ -0,0 +1,57 @@ +type: object +description: The translation's details. +x-schemaName: AdminTranslation +required: + - id + - reference_id + - reference + - locale_code + - translations + - created_at + - updated_at + - deleted_at +properties: + id: + type: string + title: id + description: The translation's ID. + reference_id: + type: string + title: reference_id + description: >- + The ID of the resource that the translation belongs to. For example, the + ID of a product. + example: prod_123 + reference: + type: string + title: reference + description: The resource that the translation belongs to. + example: product + locale_code: + type: string + title: locale_code + description: The translation's locale code in BCP 47 format. + example: fr-FR + translations: + type: object + description: >- + The translation key-value pairs. Each key is a field in the resource, and + the value is the translated text. + example: + title: Chaussures + description: Des chaussures élégantes. + created_at: + type: string + format: date-time + title: created_at + description: The date that the translation was created. + updated_at: + type: string + format: date-time + title: updated_at + description: The date that the translation was updated. + deleted_at: + type: string + format: date-time + title: deleted_at + description: The date that the translation was deleted. diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminTranslationSettingsResponse.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminTranslationSettingsResponse.yaml new file mode 100644 index 0000000000..5c1ad9f98d --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminTranslationSettingsResponse.yaml @@ -0,0 +1,16 @@ +type: object +description: The translation settings' details. +x-schemaName: AdminTranslationSettingsResponse +required: + - translatable_fields +properties: + translatable_fields: + type: object + description: >- + Key-value pairs of translatable fields for different entities. Each key is + an entity type, and the value is an array of fields that can be translated + for that entity. + example: + product: + - title + - description diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminTranslationStatisticsResponse.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminTranslationStatisticsResponse.yaml new file mode 100644 index 0000000000..97190bd390 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminTranslationStatisticsResponse.yaml @@ -0,0 +1,74 @@ +type: object +description: The translation statistics details. +x-schemaName: AdminTranslationStatisticsResponse +required: + - statistics +properties: + statistics: + type: object + description: >- + The translation statistics for different entity types. The key is the + entity type, and the value is an object containing the statistics for that + entity type. + example: + product: + expected: 150 + translated: 120 + missing: 30 + by_locale: + fr-FR: + expected: 150 + translated: 120 + missing: 30 + required: + - by_locale + - expected + - translated + - missing + additionalProperties: + type: object + properties: + by_locale: + type: object + description: >- + The translation statistics of an entity type broken down by locale. + The key is the locale code in BCP 47 format, and the value is an + object containing the statistics for that locale. + example: + fr-FR: + expected: 150 + translated: 120 + missing: 30 + required: + - expected + - translated + - missing + additionalProperties: + type: object + properties: + expected: + type: number + title: expected + description: The total number of translatable fields. + translated: + type: number + title: translated + description: The number of translated fields. + missing: + type: number + title: missing + description: The number of fields that are yet to be translated. + expected: + type: number + title: expected + description: The total number of translatable fields across specified locales. + translated: + type: number + title: translated + description: The number of translated fields across specified locales. + missing: + type: number + title: missing + description: >- + The number of fields that are yet to be translated across specified + locales. diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminTranslationsBatchResponse.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminTranslationsBatchResponse.yaml new file mode 100644 index 0000000000..cd4caa4ecb --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminTranslationsBatchResponse.yaml @@ -0,0 +1,42 @@ +type: object +description: The batch response for managing translations. +x-schemaName: AdminTranslationsBatchResponse +required: + - created + - updated + - deleted +properties: + created: + type: array + description: The created translations. + items: + $ref: ./AdminTranslation.yaml + updated: + type: array + description: The updated translations. + items: + $ref: ./AdminTranslation.yaml + deleted: + type: object + description: Summary of the deleted translations. + required: + - ids + - object + - deleted + properties: + ids: + type: array + description: The IDs of the deleted translations. + items: + type: string + title: ids + description: A translation ID. + object: + type: string + title: object + description: The type of object deleted. + default: translation + deleted: + type: boolean + title: deleted + description: Whether the translations were successfully deleted. diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateOrder.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateOrder.yaml index 99ef76b0ce..38a45e081d 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateOrder.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateOrder.yaml @@ -17,3 +17,11 @@ properties: externalDocs: url: https://docs.medusajs.com/api/admin#manage-metadata description: Learn how to manage metadata + locale: + type: string + title: locale + description: >- + The order's locale in [BCP + 47](https://gist.github.com/typpo/b2b828a35e683b9bf8db91b5404f1bd1) + format. + example: en-US diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateStore.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateStore.yaml index 53b1467a8b..60690ab0e5 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateStore.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateStore.yaml @@ -29,3 +29,8 @@ properties: externalDocs: url: https://docs.medusajs.com/api/admin#manage-metadata description: Learn how to manage metadata + supported_locales: + type: array + description: The store's supported locales. + items: + $ref: ./AdminUpdateStoreSupportedLocale.yaml diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateStoreSupportedLocale.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateStoreSupportedLocale.yaml new file mode 100644 index 0000000000..925020b2d3 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateStoreSupportedLocale.yaml @@ -0,0 +1,13 @@ +type: object +description: The payload to update a store's supported locale. +x-schemaName: AdminUpdateStoreSupportedLocale +required: + - locale_code +properties: + locale_code: + type: string + title: locale_code + description: >- + The locale's code in [BCP 47 + format](https://gist.github.com/typpo/b2b828a35e683b9bf8db91b5404f1bd1). + example: fr-FR diff --git a/www/apps/api-reference/specs/admin/components/schemas/Order.yaml b/www/apps/api-reference/specs/admin/components/schemas/Order.yaml index b8dfdaab66..e4dc4ed977 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/Order.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/Order.yaml @@ -328,3 +328,11 @@ properties: externalDocs: url: >- https://docs.medusajs.com/resources/commerce-modules/order/custom-display-id + locale: + type: string + title: locale + description: >- + The order's locale in [BCP + 47](https://gist.github.com/typpo/b2b828a35e683b9bf8db91b5404f1bd1) + format. + example: en-US diff --git a/www/apps/api-reference/specs/admin/components/schemas/StoreLocale.yaml b/www/apps/api-reference/specs/admin/components/schemas/StoreLocale.yaml new file mode 100644 index 0000000000..ce26ef2d04 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/StoreLocale.yaml @@ -0,0 +1,19 @@ +type: object +description: The store locale's details. +x-schemaName: StoreLocale +required: + - code + - name +properties: + code: + type: string + title: code + description: >- + The locale's code in [BCP 47 + format](https://gist.github.com/typpo/b2b828a35e683b9bf8db91b5404f1bd1). + example: en-US + name: + type: string + title: name + description: The locale's display name. + example: English (United States) diff --git a/www/apps/api-reference/specs/admin/components/schemas/StoreLocaleListResponse.yaml b/www/apps/api-reference/specs/admin/components/schemas/StoreLocaleListResponse.yaml new file mode 100644 index 0000000000..5314a2b98c --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/StoreLocaleListResponse.yaml @@ -0,0 +1,11 @@ +type: object +description: The list of supported locales in the store. +x-schemaName: StoreLocaleListResponse +required: + - locales +properties: + locales: + type: array + description: The list of supported locales in the store. + items: + $ref: ./StoreLocale.yaml diff --git a/www/apps/api-reference/specs/admin/openapi.full.yaml b/www/apps/api-reference/specs/admin/openapi.full.yaml index 6ac4bd006a..7b7d4f4c61 100644 --- a/www/apps/api-reference/specs/admin/openapi.full.yaml +++ b/www/apps/api-reference/specs/admin/openapi.full.yaml @@ -173,6 +173,15 @@ tags: url: https://docs.medusajs.com/resources/commerce-modules/user x-associatedSchema: $ref: '#/components/schemas/AdminInvite' + - name: Locales + description: | + A locale is a language that content is translated into for customers to view in a storefront. + Medusa installs locales by default. These API routes allow admin users to retrieve and view locales. + externalDocs: + description: Learn more about locales and translations. + url: https://docs.medusajs.com/resources/commerce-modules/translation/concepts + x-associatedSchema: + $ref: '#/components/schemas/AdminLocale' - name: Notifications description: | A notification informs an admin user of store changes or status changes of background tasks. @@ -518,6 +527,15 @@ tags: x-associatedSchema: $ref: '#/components/schemas/AdminTransactionGroup' + - name: Translations + description: | + A translation is a localized version of content in a specific locale. For example, a product description in French. + These API routes allow admin users to manage translations for different locales and resources. + externalDocs: + description: Learn more about the Translation Module. + url: https://docs.medusajs.com/resources/commerce-modules/translation + x-associatedSchema: + $ref: '#/components/schemas/AdminTranslation' - name: Uploads description: | Use these API routes to upload files to your Medusa application using the installed file module provider. @@ -25979,6 +25997,228 @@ paths: refreshed. You can listen to this event to send an email to the invited users, for example. deprecated: false + /admin/locales: + get: + operationId: GetLocales + summary: List Locales + description: Retrieve a list of locales. The locales can be filtered by fields such as `code`. The locales can also be sorted or paginated. + x-authenticated: true + parameters: + - name: q + in: query + description: Search query to filter locales by code or other fields. + required: false + schema: + type: string + title: q + description: Search query to filter locales by code or other fields. + - name: code + in: query + required: false + schema: + oneOf: + - type: string + title: code + description: Filter locales by a code. + - type: array + description: Filter locales by multiple codes. + items: + type: string + title: code + description: A locale code. + - name: limit + in: query + description: Limit the number of items returned in the list. + required: false + schema: + type: number + title: limit + description: Limit the number of items returned in the list. + externalDocs: + url: '#pagination' + - name: offset + in: query + description: The number of items to skip when retrieving a list. + required: false + schema: + type: number + title: offset + description: The number of items to skip when retrieving a list. + externalDocs: + url: '#pagination' + - name: order + in: query + description: The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with `-`. + required: false + schema: + type: string + title: order + description: The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with `-`. + externalDocs: + url: '#pagination' + - name: with_deleted + in: query + description: The locale's with deleted. + required: false + schema: + type: boolean + title: with_deleted + description: The locale's with deleted. + - name: fields + in: query + description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. Without prefix it will replace the entire default fields. + required: false + schema: + type: string + title: fields + description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. Without prefix it will replace the entire default fields. + externalDocs: + url: '#select-fields-and-relations' + - name: $and + in: query + description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters. + required: false + schema: + type: array + description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters. + items: + type: object + title: $and + - name: $or + in: query + description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters. + required: false + schema: + type: array + description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters. + items: + type: object + title: $or + security: + - api_token: [] + - 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.locale.list() + .then(({ locales, count, limit, offset }) => { + console.log(locales) + }) + - lang: Shell + label: cURL + source: |- + curl '{backend_url}/admin/locales' \ + -H 'Authorization: Bearer {access_token}' + tags: + - Locales + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminLocaleListResponse' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + x-since: 2.12.3 + x-featureFlag: translation + /admin/locales/{code}: + get: + operationId: GetLocalesCode + summary: Get a Locale + x-sidebar-summary: Get Locale + description: Retrieve a locale by its code. You can expand the locale's relations or select the fields that should be returned. + x-authenticated: true + parameters: + - name: code + in: path + description: The locale's code in [BCP 47 format](https://gist.github.com/typpo/b2b828a35e683b9bf8db91b5404f1bd1). + example: fr-FR + required: true + schema: + type: string + - name: fields + in: query + description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. Without prefix it will replace the entire default fields. + required: false + schema: + type: string + title: fields + description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. Without prefix it will replace the entire default fields. + externalDocs: + url: '#select-fields-and-relations' + security: + - api_token: [] + - 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.locale.retrieve("en-US") + .then(({ locale }) => { + console.log(locale) + }) + - lang: Shell + label: cURL + source: |- + curl '{backend_url}/admin/locales/fr-FR' \ + -H 'Authorization: Bearer {access_token}' + tags: + - Locales + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminLocaleResponse' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + x-since: 2.12.3 + x-featureFlag: translation /admin/notifications: get: operationId: GetNotifications @@ -28589,6 +28829,478 @@ paths: $ref: '#/components/responses/500_error' x-workflow: getOrdersListWorkflow x-events: [] + /admin/orders/export: + post: + operationId: PostOrdersExport + summary: Export Orders + description: | + Start an order export process to retrieve a CSV of exported orders. + + You'll receive in the response the transaction ID of the workflow generating the CSV file. To check the status of the execution, send a GET request to `/admin/workflows-executions/export-orders/:transaction-id`. + + Once the execution finishes successfully, a notification is created for the export. You can retrieve the notifications using the `/admin/notification` API route to retrieve the file's download URL. + x-authenticated: true + parameters: + - name: id + in: query + required: false + schema: + oneOf: + - type: string + title: id + description: The ID of the order to export. + - type: array + description: The IDs of the orders to export. + items: + type: string + title: id + description: An order ID. + - name: sales_channel_id + in: query + description: The IDs of the sales channels to export their orders. + required: false + schema: + type: array + description: The IDs of the sales channels to export their orders. + items: + type: string + title: sales_channel_id + description: A sales channel ID. + - name: region_id + in: query + required: false + schema: + oneOf: + - type: string + title: region_id + description: The ID of a region to export orders in it. + - type: array + description: The IDs of regions to export their orders. + items: + type: string + title: region_id + description: A region ID. + - name: customer_id + in: query + required: false + schema: + oneOf: + - type: string + title: customer_id + description: The ID of a customer to export their orders. + - type: array + description: The IDs of customers to export their orders. + items: + type: string + title: customer_id + description: A customer ID. + - name: q + in: query + description: A search query to filter exported orders by. + required: false + schema: + type: string + title: q + description: A search query to filter exported orders by. + - name: created_at + in: query + description: Filter by an order's creation date. + required: false + schema: + type: object + description: Filter by an order's creation date. + properties: + $and: + type: array + description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters. + items: + type: object + title: $and + $or: + type: array + description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters. + items: + type: object + title: $or + $eq: + oneOf: + - type: string + title: $eq + description: Filter by an exact match. + - type: array + description: Filter by an exact match. + items: + type: string + title: $eq + description: Filter by an exact match. + $ne: + type: string + title: $ne + description: Filter by values not equal to this parameter. + $in: + type: array + description: Filter by values in this array. + items: + type: string + title: $in + description: Filter by values in this array. + $nin: + type: array + description: Filter by values not in this array. + items: + type: string + title: $nin + description: Filter by values not in this array. + $not: + oneOf: + - type: string + title: $not + description: Filter by values not matching the conditions in this parameter. + - type: object + description: Filter by values not matching the conditions in this parameter. + - type: array + description: Filter by values not matching the conditions in this parameter. + items: + type: string + title: $not + description: Filter by values not matching the conditions in this parameter. + $gt: + type: string + title: $gt + description: Filter by values greater than this parameter. Useful for numbers and dates only. + $gte: + type: string + title: $gte + description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only. + $lt: + type: string + title: $lt + description: Filter by values less than this parameter. Useful for numbers and dates only. + $lte: + type: string + title: $lte + description: Filter by values less than or equal to this parameter. Useful for numbers and dates only. + $like: + type: string + title: $like + description: Apply a `like` filter. Useful for strings only. + $re: + type: string + title: $re + description: Apply a regex filter. Useful for strings only. + $ilike: + type: string + title: $ilike + description: Apply a case-insensitive `like` filter. Useful for strings only. + $fulltext: + type: string + title: $fulltext + description: Filter to apply on full-text properties. + $overlap: + type: array + description: Filter arrays that have overlapping values with this parameter. + items: + type: string + title: $overlap + description: Filter arrays that have overlapping values with this parameter. + $contains: + type: array + description: Filter arrays that contain some of the values of this parameter. + items: + type: string + title: $contains + description: Filter arrays that contain some of the values of this parameter. + $contained: + type: array + description: Filter arrays that contain all values of this parameter. + items: + type: string + title: $contained + description: Filter arrays that contain all values of this parameter. + $exists: + type: boolean + title: $exists + description: Filter by whether a value for this parameter exists (not `null`). + - name: updated_at + in: query + description: Filter by an order's update date. + required: false + schema: + type: object + description: Filter by an order's update date. + properties: + $and: + type: array + description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters. + items: + type: object + title: $and + $or: + type: array + description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters. + items: + type: object + title: $or + $eq: + oneOf: + - type: string + title: $eq + description: Filter by an exact match. + - type: array + description: Filter by an exact match. + items: + type: string + title: $eq + description: Filter by an exact match. + $ne: + type: string + title: $ne + description: Filter by values not equal to this parameter. + $in: + type: array + description: Filter by values in this array. + items: + type: string + title: $in + description: Filter by values in this array. + $nin: + type: array + description: Filter by values not in this array. + items: + type: string + title: $nin + description: Filter by values not in this array. + $not: + oneOf: + - type: string + title: $not + description: Filter by values not matching the conditions in this parameter. + - type: object + description: Filter by values not matching the conditions in this parameter. + - type: array + description: Filter by values not matching the conditions in this parameter. + items: + type: string + title: $not + description: Filter by values not matching the conditions in this parameter. + $gt: + type: string + title: $gt + description: Filter by values greater than this parameter. Useful for numbers and dates only. + $gte: + type: string + title: $gte + description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only. + $lt: + type: string + title: $lt + description: Filter by values less than this parameter. Useful for numbers and dates only. + $lte: + type: string + title: $lte + description: Filter by values less than or equal to this parameter. Useful for numbers and dates only. + $like: + type: string + title: $like + description: Apply a `like` filter. Useful for strings only. + $re: + type: string + title: $re + description: Apply a regex filter. Useful for strings only. + $ilike: + type: string + title: $ilike + description: Apply a case-insensitive `like` filter. Useful for strings only. + $fulltext: + type: string + title: $fulltext + description: Filter to apply on full-text properties. + $overlap: + type: array + description: Filter arrays that have overlapping values with this parameter. + items: + type: string + title: $overlap + description: Filter arrays that have overlapping values with this parameter. + $contains: + type: array + description: Filter arrays that contain some of the values of this parameter. + items: + type: string + title: $contains + description: Filter arrays that contain some of the values of this parameter. + $contained: + type: array + description: Filter arrays that contain all values of this parameter. + items: + type: string + title: $contained + description: Filter arrays that contain all values of this parameter. + $exists: + type: boolean + title: $exists + description: Filter by whether a value for this parameter exists (not `null`). + - name: limit + in: query + description: Limit the number of items returned in the list. + required: false + schema: + type: number + title: limit + description: Limit the number of items returned in the list. + externalDocs: + url: '#pagination' + - name: offset + in: query + description: The number of items to skip when retrieving a list. + required: false + schema: + type: number + title: offset + description: The number of items to skip when retrieving a list. + externalDocs: + url: '#pagination' + - name: order + in: query + description: The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with `-`. + required: false + schema: + type: string + title: order + description: The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with `-`. + externalDocs: + url: '#pagination' + - name: with_deleted + in: query + description: Whether to include deleted orders in the export. + required: false + schema: + type: boolean + title: with_deleted + description: Whether to include deleted orders in the export. + - name: fields + in: query + description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. Without prefix it will replace the entire default fields. + required: false + schema: + type: string + title: fields + description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. Without prefix it will replace the entire default fields. + externalDocs: + url: '#select-fields-and-relations' + - name: status + in: query + required: false + schema: + oneOf: + - type: string + title: status + description: The status of the orders to export. + enum: + - canceled + - completed + - pending + - draft + - archived + - requires_action + - type: array + description: The statuses of the orders to export. + items: + type: string + description: The order status. + enum: + - canceled + - completed + - pending + - draft + - archived + - requires_action + - type: object + description: The order's status. + properties: + $and: + type: array + description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters. + items: + type: object + title: $and + $or: + type: array + description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters. + items: + type: object + title: $or + - name: $and + in: query + description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters. + required: false + schema: + type: array + description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters. + items: + type: object + title: $and + - name: $or + in: query + description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters. + required: false + schema: + type: array + description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters. + items: + type: object + title: $or + security: + - api_token: [] + - 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.export() + .then(({ transaction_id }) => { + console.log(transaction_id) + }) + - lang: Shell + label: cURL + source: |- + curl -X POST '{backend_url}/admin/orders/export' \ + -H 'Authorization: Bearer {access_token}' + tags: + - Orders + responses: + '202': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminExportOrderResponse' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + x-workflow: exportOrdersWorkflow + x-events: [] + x-since: 2.12.3 /admin/orders/{id}: get: operationId: GetOrdersId @@ -33291,6 +34003,79 @@ paths: $ref: '#/components/responses/500_error' x-workflow: deletePriceListsWorkflow x-events: [] + /admin/price-lists/{id}/prices: + get: + operationId: GetPriceListsIdPrices + summary: List Prices in a Price List + x-sidebar-summary: List Prices + description: Retrieve a list of prices in a price list. The prices can also be paginated. + x-authenticated: true + parameters: + - name: id + in: path + description: The ID of the price list to retrieve prices from. + required: true + schema: + type: string + - name: fields + in: query + description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. Without prefix it will replace the entire default fields. + required: false + schema: + type: string + title: fields + description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. Without prefix it will replace the entire default fields. + externalDocs: + url: '#select-fields-and-relations' + security: + - api_token: [] + - 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.priceList.prices("plist_123") + .then(({ prices }) => { + console.log(prices) + }) + - lang: Shell + label: cURL + source: |- + curl '{backend_url}/admin/price-lists/{id}/prices' \ + -H 'Authorization: Bearer {access_token}' + tags: + - Price Lists + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPriceListPriceListResponse' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + x-since: 2.12.3 /admin/price-lists/{id}/prices/batch: post: operationId: PostPriceListsIdPricesBatch @@ -63025,6 +63810,566 @@ paths: - text: Cloud description: | This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin). + /admin/translations: + get: + operationId: GetTranslations + summary: List Translations + description: Retrieve a list of translations. The translations can be filtered by fields such as `reference_id` (For example, the ID of a product). The translations can also be sorted or paginated. + x-authenticated: true + parameters: + - name: q + in: query + description: Search query to filter translations by their fields. + required: false + schema: + type: string + title: q + description: Search query to filter translations by their fields. + - name: reference_id + in: query + required: false + schema: + oneOf: + - type: string + title: reference_id + description: Filter translations by a reference ID. For example, the ID of a product. + example: prod_123 + - type: array + description: Filter translations by multiple reference IDs. For example, the IDs of products. + items: + type: string + title: reference_id + description: The reference ID's details. For example, the ID of a product. + example: prod_123 + - name: reference + in: query + description: Filter translations by the resource they belong to. For example, `product` or `product_variant`. + required: false + schema: + type: string + title: reference + description: Filter translations by the resource they belong to. For example, `product` or `product_variant`. + - name: locale_code + in: query + required: false + schema: + oneOf: + - type: string + title: locale_code + description: Filter translations by a locale code in BCP 47 format. + example: fr-FR + - type: array + description: Filter translations by multiple locale codes in BCP 47 format. + items: + type: string + title: locale_code + description: A locale code in BCP 47 format. + example: fr-FR + - name: limit + in: query + description: Limit the number of items returned in the list. + required: false + schema: + type: number + title: limit + description: Limit the number of items returned in the list. + externalDocs: + url: '#pagination' + - name: offset + in: query + description: The number of items to skip when retrieving a list. + required: false + schema: + type: number + title: offset + description: The number of items to skip when retrieving a list. + externalDocs: + url: '#pagination' + - name: order + in: query + description: The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with `-`. + required: false + schema: + type: string + title: order + description: The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with `-`. + externalDocs: + url: '#pagination' + - name: with_deleted + in: query + description: The translation's with deleted. + required: false + schema: + type: boolean + title: with_deleted + description: The translation's with deleted. + - name: fields + in: query + description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. Without prefix it will replace the entire default fields. + required: false + schema: + type: string + title: fields + description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. Without prefix it will replace the entire default fields. + externalDocs: + url: '#select-fields-and-relations' + - name: $and + in: query + description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters. + required: false + schema: + type: array + description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters. + items: + type: object + title: $and + - name: $or + in: query + description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters. + required: false + schema: + type: array + description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters. + items: + type: object + title: $or + security: + - api_token: [] + - 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.translation.list() + .then(({ translations, count, limit, offset }) => { + console.log(translations) + }) + - lang: Shell + label: cURL + source: |- + curl '{backend_url}/admin/translations' \ + -H 'Authorization: Bearer {access_token}' + tags: + - Translations + responses: + '200': + description: OK + content: + application/json: + schema: + allOf: + - type: object + description: The list of translations with pagination. + required: + - limit + - offset + - count + properties: + limit: + type: number + title: limit + description: The maximum number of translations returned. + offset: + type: number + title: offset + description: The number of translations skipped before retrieving the returned translations. + count: + type: number + title: count + description: The total number of translations matching the query. + estimate_count: + type: number + title: estimate_count + description: The estimated count retrieved from the PostgreSQL query planner, which may be inaccurate. + x-featureFlag: index_engine + - type: object + description: SUMMARY + required: + - translations + properties: + translations: + type: array + description: The list of translations. + items: + $ref: '#/components/schemas/AdminTranslation' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + x-since: 2.12.3 + x-featureFlag: translation + /admin/translations/batch: + post: + operationId: PostTranslationsBatch + summary: Manage Translations + description: Manage translations in bulk by creating, updating, or deleting multiple translations in a single request. You can manage translations for various resources such as products, product variants, categories, and more. + x-authenticated: true + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + requestBody: + content: + application/json: + schema: + type: object + description: The translations to be created, updated, or deleted in bulk. + properties: + create: + type: array + description: The translations to create. + items: + type: object + description: The translation's details. + required: + - reference + - reference_id + - locale_code + - translations + properties: + reference: + type: string + title: reference + description: The resource that the translation belongs to. + example: product + reference_id: + type: string + title: reference_id + description: The ID of the resource that the translation belongs to. For example, the ID of a product. + example: prod_123 + locale_code: + type: string + title: locale_code + description: The translation's locale code in BCP 47 format. + example: fr-FR + translations: + type: object + description: The translation key-value pairs. Each key is a field in the resource, and the value is the translated text. + example: + title: Chaussures + description: Des chaussures élégantes. + update: + type: array + description: The translations to update. + items: + type: object + description: The data for updating a translation. + required: + - id + properties: + id: + type: string + title: id + description: The ID of the translation to update. + reference: + type: string + title: reference + description: The resource that the translation belongs to. + example: product + reference_id: + type: string + title: reference_id + description: The ID of the resource that the translation belongs to. For example, the ID of a product. + example: prod_123 + locale_code: + type: string + title: locale_code + description: The translation's locale code in BCP 47 format. + example: fr-FR + translations: + type: object + description: The translation key-value pairs. Each key is a field in the resource, and the value is the translated text. + example: + title: Chaussures Modifiées + description: Des chaussures élégantes et modifiées. + delete: + type: array + description: The translations to delete. + items: + type: string + title: delete + description: The ID of a translation to delete. + 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.translation.batch({ + create: [ + { + reference_id: "prod_123", + reference: "product", + locale_code: "en-US", + translations: { title: "Shirt" } + } + ], + update: [ + { + id: "trans_123", + translations: { title: "Pants" } + } + ], + delete: ["trans_321"] + }) + .then(({ created, updated, deleted }) => { + console.log(created, updated, deleted) + }) + ``` + - lang: Shell + label: cURL + source: |- + curl -X POST '{backend_url}/admin/translations/batch' \ + -H 'Authorization: Bearer {access_token}' \ + -H 'Content-Type: application/json' \ + -d '{ + "create": [ + { + "reference": "product", + "reference_id": "prod_123", + "locale_code": "fr-FR", + "translations": { + "title": "Chaussures", + "description": "Des chaussures élégantes." + } + } + ] + }' + tags: + - Translations + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTranslationsBatchResponse' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + x-workflow: batchTranslationsWorkflow + x-events: + - name: translation.created + payload: |- + ```ts + { + id, // The ID of the translation + } + ``` + description: Emitted when translations are created. + deprecated: false + since: 2.12.3 + - name: translation.updated + payload: |- + ```ts + { + id, // The ID of the translation + } + ``` + description: Emitted when translations are updated. + deprecated: false + since: 2.12.3 + - name: translation.deleted + payload: |- + ```ts + { + id, // The ID of the translation + } + ``` + description: Emitted when translations are deleted. + deprecated: false + since: 2.12.3 + x-since: 2.12.3 + x-featureFlag: translation + /admin/translations/settings: + get: + operationId: GetTranslationsSettings + summary: List Translation Settings + x-sidebar-summary: List Settings + description: Retrieve the list of translatable fields for all entities, such as products and collections. + x-authenticated: true + parameters: + - name: entity_type + in: query + description: The entity to retrieve translation settings for. + required: false + schema: + type: string + title: entity_type + description: The entity to retrieve translation settings for. + example: product + security: + - api_token: [] + - 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.translation.settings({ + entity_type: "product" + }) + .then(({ translatable_fields }) => { + console.log(translatable_fields) + }) + - lang: Shell + label: cURL + source: |- + curl '{backend_url}/admin/translations/settings' \ + -H 'Authorization: Bearer {access_token}' + tags: + - Translations + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTranslationSettingsResponse' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + x-since: 2.12.3 + x-featureFlag: translation + /admin/translations/statistics: + get: + operationId: GetTranslationsStatistics + summary: Retrieve Translation Statistics + x-sidebar-summary: Get Statistics + description: Get statistics on translations for specified locales and entity types. This includes overall translation progress for each entity type, and statistics for each locale within those entity types. + x-authenticated: true + parameters: + - name: locales + in: query + description: The locale codes to retrieve translation statistics for. Locale codes are in [BCP 47](https://gist.github.com/typpo/b2b828a35e683b9bf8db91b5404f1bd1) format. + required: true + schema: + type: array + description: The locale codes to retrieve translation statistics for. + items: + type: string + title: locales + description: A locale code in [BCP 47](https://gist.github.com/typpo/b2b828a35e683b9bf8db91b5404f1bd1) format. + example: fr-FR + - name: entity_types + in: query + description: The table names of entities to retrieve translation statistics for. + required: true + schema: + type: array + description: The table names of entities to retrieve translation statistics for. + items: + type: string + title: entity_types + description: The table name of an entity. + example: products + security: + - api_token: [] + - 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.translation.statistics({ + entity_type: "product" + }) + .then(({ statistics }) => { + console.log(statistics) + }) + - lang: Shell + label: cURL + source: |- + curl '{backend_url}/admin/translations/statistics' \ + -H 'Authorization: Bearer {access_token}' + tags: + - Translations + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTranslationStatisticsResponse' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + x-since: 2.12.3 + x-featureFlag: translation /admin/uploads: post: operationId: PostUploads @@ -67898,6 +69243,11 @@ components: externalDocs: url: https://docs.medusajs.com/api/admin#manage-metadata description: Learn how to manage metadata + translations: + type: array + description: The collection's translations. + items: + $ref: '#/components/schemas/AdminTranslation' AdminCollectionDeleteResponse: type: object description: The details of the deleted collection. @@ -72137,6 +73487,17 @@ components: externalDocs: url: https://docs.medusajs.com/api/admin#manage-metadata description: Learn how to manage metadata + AdminExportOrderResponse: + type: object + description: The details of the order export. + x-schemaName: AdminExportOrderResponse + required: + - transaction_id + properties: + transaction_id: + type: string + title: transaction_id + description: The ID of the workflow execution's transaction. Use it to check the status of the export by sending a GET request to `/admin/workflows-executions/export-orders/:transaction-id` AdminExportProductResponse: type: object description: The details of the product export. @@ -73296,6 +74657,82 @@ components: title: remove description: The ID of a product. x-schemaName: AdminLinkPriceListProducts + AdminLocale: + type: object + description: The locale's details. + x-schemaName: AdminLocale + required: + - code + - name + - created_at + - updated_at + - deleted_at + properties: + code: + type: string + title: code + description: The locale's code in BCP 47 format. + example: fr-FR + name: + type: string + title: name + description: The locale's display name. + created_at: + type: string + format: date-time + title: created_at + description: The date and time at which the locale was created. + updated_at: + type: string + format: date-time + title: updated_at + description: The date and time at which the locale was last updated. + deleted_at: + type: string + format: date-time + title: deleted_at + description: The date and time at which the locale was deleted. + AdminLocaleListResponse: + type: object + description: The list of locales with pagination details. + x-schemaName: AdminLocaleListResponse + required: + - limit + - offset + - count + - locales + properties: + limit: + type: number + title: limit + description: The maximum number of locales returned. + offset: + type: number + title: offset + description: The number of locales skipped before retrieving the returned locales. + count: + type: number + title: count + description: The total number of locales matching the query. + estimate_count: + type: number + title: estimate_count + description: The estimated count retrieved from the PostgreSQL query planner, which may be inaccurate. + x-featureFlag: index_engine + locales: + type: array + description: The list of locales. + items: + $ref: '#/components/schemas/AdminLocale' + AdminLocaleResponse: + type: object + description: The locale's details. + x-schemaName: AdminLocaleResponse + required: + - locale + properties: + locale: + $ref: '#/components/schemas/AdminLocale' AdminMarkPaymentCollectionAsPaid: type: object description: The payment details. @@ -76125,6 +77562,38 @@ components: format: date-time title: deleted_at description: The date the price was deleted. + AdminPriceListPriceListResponse: + type: object + description: The list of prices. + x-schemaName: AdminPriceListPriceListResponse + required: + - limit + - offset + - count + - prices + properties: + limit: + type: number + title: limit + description: The maximum number of prices returned. + offset: + type: number + title: offset + description: The number of items skipped before retrieving the prices. + count: + type: number + title: count + description: The total number of prices. + estimate_count: + type: number + title: estimate_count + description: The estimated count retrieved from the PostgreSQL query planner, which may be inaccurate. + x-featureFlag: index_engine + prices: + type: array + description: The list of prices. + items: + $ref: '#/components/schemas/AdminPrice' AdminPriceListResponse: type: object description: The price list's details. @@ -76417,6 +77886,11 @@ components: description: The date the product was deleted. shipping_profile: $ref: '#/components/schemas/AdminShippingProfile' + translations: + type: array + description: The product's translations. + items: + $ref: '#/components/schemas/AdminTranslation' AdminProductCategory: type: object description: The product category's details. @@ -76807,6 +78281,11 @@ components: externalDocs: url: https://docs.medusajs.com/api/admin#manage-metadata description: Learn how to manage metadata + translations: + type: array + description: The tag's translations. + items: + $ref: '#/components/schemas/AdminTranslation' AdminProductTagDeleteResponse: type: object description: The details of the product tag deletion. @@ -76909,6 +78388,11 @@ components: externalDocs: url: https://docs.medusajs.com/api/admin#manage-metadata description: Learn how to manage metadata + translations: + type: array + description: The type's translations. + items: + $ref: '#/components/schemas/AdminTranslation' AdminProductTypeDeleteResponse: type: object description: The details of the product type deletion. @@ -77126,6 +78610,11 @@ components: type: string title: thumbnail description: The variant's thumbnail. + translations: + type: array + description: The variant's translations. + items: + $ref: '#/components/schemas/AdminTranslation' AdminProductVariantDeleteResponse: type: object description: The details of the product variant's deletion. @@ -79022,6 +80511,7 @@ components: - id - name - supported_currencies + - supported_locales - default_sales_channel_id - default_region_id - default_location_id @@ -79070,6 +80560,11 @@ components: format: date-time title: updated_at description: The date the store was updated. + supported_locales: + type: array + description: The store's supported locales. + items: + $ref: '#/components/schemas/AdminStoreLocale' AdminStoreCreditAccount: type: object description: The store credit account's details. @@ -79256,6 +80751,48 @@ components: title: estimate_count description: The estimated count retrieved from the PostgreSQL query planner, which may be inaccurate. x-featureFlag: index_engine + AdminStoreLocale: + type: object + description: The details of a store's locale. + x-schemaName: AdminStoreLocale + required: + - id + - locale_code + - store_id + - locale + - created_at + - updated_at + - deleted_at + properties: + id: + type: string + title: id + description: The locale's ID. + locale_code: + type: string + title: locale_code + description: The locale's code in BCP 47 format. + store_id: + type: string + title: store_id + description: The ID of the store to which the locale belongs. + locale: + $ref: '#/components/schemas/AdminLocale' + created_at: + type: string + format: date-time + title: created_at + description: The date the locale was created. + updated_at: + type: string + format: date-time + title: updated_at + description: The date the locale was updated. + deleted_at: + type: string + format: date-time + title: deleted_at + description: The date the locale was deleted. AdminStoreResponse: type: object description: The store's details. @@ -79693,6 +81230,184 @@ components: title: estimate_count description: The store credit account's estimate count. x-featureFlag: index_engine + AdminTranslation: + type: object + description: The translation's details. + x-schemaName: AdminTranslation + required: + - id + - reference_id + - reference + - locale_code + - translations + - created_at + - updated_at + - deleted_at + properties: + id: + type: string + title: id + description: The translation's ID. + reference_id: + type: string + title: reference_id + description: The ID of the resource that the translation belongs to. For example, the ID of a product. + example: prod_123 + reference: + type: string + title: reference + description: The resource that the translation belongs to. + example: product + locale_code: + type: string + title: locale_code + description: The translation's locale code in BCP 47 format. + example: fr-FR + translations: + type: object + description: The translation key-value pairs. Each key is a field in the resource, and the value is the translated text. + example: + title: Chaussures + description: Des chaussures élégantes. + created_at: + type: string + format: date-time + title: created_at + description: The date that the translation was created. + updated_at: + type: string + format: date-time + title: updated_at + description: The date that the translation was updated. + deleted_at: + type: string + format: date-time + title: deleted_at + description: The date that the translation was deleted. + AdminTranslationSettingsResponse: + type: object + description: The translation settings' details. + x-schemaName: AdminTranslationSettingsResponse + required: + - translatable_fields + properties: + translatable_fields: + type: object + description: Key-value pairs of translatable fields for different entities. Each key is an entity type, and the value is an array of fields that can be translated for that entity. + example: + product: + - title + - description + AdminTranslationStatisticsResponse: + type: object + description: The translation statistics details. + x-schemaName: AdminTranslationStatisticsResponse + required: + - statistics + properties: + statistics: + type: object + description: The translation statistics for different entity types. The key is the entity type, and the value is an object containing the statistics for that entity type. + example: + product: + expected: 150 + translated: 120 + missing: 30 + by_locale: + fr-FR: + expected: 150 + translated: 120 + missing: 30 + required: + - by_locale + - expected + - translated + - missing + additionalProperties: + type: object + properties: + by_locale: + type: object + description: The translation statistics of an entity type broken down by locale. The key is the locale code in BCP 47 format, and the value is an object containing the statistics for that locale. + example: + fr-FR: + expected: 150 + translated: 120 + missing: 30 + required: + - expected + - translated + - missing + additionalProperties: + type: object + properties: + expected: + type: number + title: expected + description: The total number of translatable fields. + translated: + type: number + title: translated + description: The number of translated fields. + missing: + type: number + title: missing + description: The number of fields that are yet to be translated. + expected: + type: number + title: expected + description: The total number of translatable fields across specified locales. + translated: + type: number + title: translated + description: The number of translated fields across specified locales. + missing: + type: number + title: missing + description: The number of fields that are yet to be translated across specified locales. + AdminTranslationsBatchResponse: + type: object + description: The batch response for managing translations. + x-schemaName: AdminTranslationsBatchResponse + required: + - created + - updated + - deleted + properties: + created: + type: array + description: The created translations. + items: + $ref: '#/components/schemas/AdminTranslation' + updated: + type: array + description: The updated translations. + items: + $ref: '#/components/schemas/AdminTranslation' + deleted: + type: object + description: Summary of the deleted translations. + required: + - ids + - object + - deleted + properties: + ids: + type: array + description: The IDs of the deleted translations. + items: + type: string + title: ids + description: A translation ID. + object: + type: string + title: object + description: The type of object deleted. + default: translation + deleted: + type: boolean + title: deleted + description: Whether the translations were successfully deleted. AdminUpdateApiKey: type: object description: The details to update in an API key. @@ -80156,6 +81871,11 @@ components: externalDocs: url: https://docs.medusajs.com/api/admin#manage-metadata description: Learn how to manage metadata + locale: + type: string + title: locale + description: The order's locale in [BCP 47](https://gist.github.com/typpo/b2b828a35e683b9bf8db91b5404f1bd1) format. + example: en-US AdminUpdateOrderChange: type: object description: The data to update in the order change. @@ -81131,6 +82851,11 @@ components: externalDocs: url: https://docs.medusajs.com/api/admin#manage-metadata description: Learn how to manage metadata + supported_locales: + type: array + description: The store's supported locales. + items: + $ref: '#/components/schemas/AdminUpdateStoreSupportedLocale' AdminUpdateStoreSupportedCurrency: type: object description: The details to update in a supported currency of the store. @@ -81151,6 +82876,18 @@ components: title: is_tax_inclusive description: Whether prices using this currency are tax inclusive. x-schemaName: AdminUpdateStoreSupportedCurrency + AdminUpdateStoreSupportedLocale: + type: object + description: The payload to update a store's supported locale. + x-schemaName: AdminUpdateStoreSupportedLocale + required: + - locale_code + properties: + locale_code: + type: string + title: locale_code + description: The locale's code in [BCP 47 format](https://gist.github.com/typpo/b2b828a35e683b9bf8db91b5404f1bd1). + example: fr-FR AdminUpdateTaxRate: type: object description: The properties to update in the tax rate. @@ -86190,6 +87927,11 @@ components: description: The custom display ID of the order. externalDocs: url: https://docs.medusajs.com/resources/commerce-modules/order/custom-display-id + locale: + type: string + title: locale + description: The order's locale in [BCP 47](https://gist.github.com/typpo/b2b828a35e683b9bf8db91b5404f1bd1) format. + example: en-US OrderAddress: type: object description: The address's details. @@ -89591,6 +91333,36 @@ components: url: https://docs.medusajs.com/resources/commerce-modules/payment/payment-session#data-property description: Learn more about the payment session's data property x-schemaName: StoreInitializePaymentSession + StoreLocale: + type: object + description: The store locale's details. + x-schemaName: StoreLocale + required: + - code + - name + properties: + code: + type: string + title: code + description: The locale's code in [BCP 47 format](https://gist.github.com/typpo/b2b828a35e683b9bf8db91b5404f1bd1). + example: en-US + name: + type: string + title: name + description: The locale's display name. + example: English (United States) + StoreLocaleListResponse: + type: object + description: The list of supported locales in the store. + x-schemaName: StoreLocaleListResponse + required: + - locales + properties: + locales: + type: array + description: The list of supported locales in the store. + items: + $ref: '#/components/schemas/StoreLocale' StoreOrder: type: object description: The order's details. diff --git a/www/apps/api-reference/specs/admin/openapi.yaml b/www/apps/api-reference/specs/admin/openapi.yaml index 81ca3a8c38..a656f6d051 100644 --- a/www/apps/api-reference/specs/admin/openapi.yaml +++ b/www/apps/api-reference/specs/admin/openapi.yaml @@ -231,6 +231,19 @@ tags: url: https://docs.medusajs.com/resources/commerce-modules/user x-associatedSchema: $ref: ./components/schemas/AdminInvite.yaml + - name: Locales + description: > + A locale is a language that content is translated into for customers to + view in a storefront. + + Medusa installs locales by default. These API routes allow admin users to + retrieve and view locales. + externalDocs: + description: Learn more about locales and translations. + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/concepts + x-associatedSchema: + $ref: ./components/schemas/AdminLocale.yaml - name: Notifications description: > A notification informs an admin user of store changes or status changes of @@ -708,6 +721,18 @@ tags: x-associatedSchema: $ref: ./components/schemas/AdminTransactionGroup.yaml + - name: Translations + description: > + A translation is a localized version of content in a specific locale. For + example, a product description in French. + + These API routes allow admin users to manage translations for different + locales and resources. + externalDocs: + description: Learn more about the Translation Module. + url: https://docs.medusajs.com/resources/commerce-modules/translation + x-associatedSchema: + $ref: ./components/schemas/AdminTranslation.yaml - name: Uploads description: > Use these API routes to upload files to your Medusa application using the @@ -918,6 +943,10 @@ paths: $ref: paths/admin_invites_{id}.yaml /admin/invites/{id}/resend: $ref: paths/admin_invites_{id}_resend.yaml + /admin/locales: + $ref: paths/admin_locales.yaml + /admin/locales/{code}: + $ref: paths/admin_locales_{code}.yaml /admin/notifications: $ref: paths/admin_notifications.yaml /admin/notifications/{id}: @@ -944,6 +973,8 @@ paths: $ref: paths/admin_order-edits_{id}_shipping-method_{action_id}.yaml /admin/orders: $ref: paths/admin_orders.yaml + /admin/orders/export: + $ref: paths/admin_orders_export.yaml /admin/orders/{id}: $ref: paths/admin_orders_{id}.yaml /admin/orders/{id}/archive: @@ -997,6 +1028,8 @@ paths: $ref: paths/admin_price-lists.yaml /admin/price-lists/{id}: $ref: paths/admin_price-lists_{id}.yaml + /admin/price-lists/{id}/prices: + $ref: paths/admin_price-lists_{id}_prices.yaml /admin/price-lists/{id}/prices/batch: $ref: paths/admin_price-lists_{id}_prices_batch.yaml /admin/price-lists/{id}/products: @@ -1175,6 +1208,14 @@ paths: $ref: paths/admin_tax-regions_{id}.yaml /admin/transaction-groups: $ref: paths/admin_transaction-groups.yaml + /admin/translations: + $ref: paths/admin_translations.yaml + /admin/translations/batch: + $ref: paths/admin_translations_batch.yaml + /admin/translations/settings: + $ref: paths/admin_translations_settings.yaml + /admin/translations/statistics: + $ref: paths/admin_translations_statistics.yaml /admin/uploads: $ref: paths/admin_uploads.yaml /admin/uploads/presigned-urls: diff --git a/www/apps/api-reference/specs/admin/paths/admin_locales.yaml b/www/apps/api-reference/specs/admin/paths/admin_locales.yaml new file mode 100644 index 0000000000..ac362a7069 --- /dev/null +++ b/www/apps/api-reference/specs/admin/paths/admin_locales.yaml @@ -0,0 +1,155 @@ +get: + operationId: GetLocales + summary: List Locales + description: >- + Retrieve a list of locales. The locales can be filtered by fields such as + `code`. The locales can also be sorted or paginated. + x-authenticated: true + parameters: + - name: q + in: query + description: Search query to filter locales by code or other fields. + required: false + schema: + type: string + title: q + description: Search query to filter locales by code or other fields. + - name: code + in: query + required: false + schema: + oneOf: + - type: string + title: code + description: Filter locales by a code. + - type: array + description: Filter locales by multiple codes. + items: + type: string + title: code + description: A locale code. + - name: limit + in: query + description: Limit the number of items returned in the list. + required: false + schema: + type: number + title: limit + description: Limit the number of items returned in the list. + externalDocs: + url: '#pagination' + - name: offset + in: query + description: The number of items to skip when retrieving a list. + required: false + schema: + type: number + title: offset + description: The number of items to skip when retrieving a list. + externalDocs: + url: '#pagination' + - name: order + in: query + description: >- + The field to sort the data by. By default, the sort order is ascending. + To change the order to descending, prefix the field name with `-`. + required: false + schema: + type: string + title: order + description: >- + The field to sort the data by. By default, the sort order is + ascending. To change the order to descending, prefix the field name + with `-`. + externalDocs: + url: '#pagination' + - name: with_deleted + in: query + description: The locale's with deleted. + required: false + schema: + type: boolean + title: with_deleted + description: The locale's with deleted. + - name: fields + in: query + description: >- + Comma-separated fields that should be included in the returned data. If + a field is prefixed with `+` it will be added to the default fields, + using `-` will remove it from the default fields. Without prefix it will + replace the entire default fields. + required: false + schema: + type: string + title: fields + description: >- + Comma-separated fields that should be included in the returned data. + If a field is prefixed with `+` it will be added to the default + fields, using `-` will remove it from the default fields. Without + prefix it will replace the entire default fields. + externalDocs: + url: '#select-fields-and-relations' + - name: $and + in: query + description: >- + Join query parameters with an AND condition. Each object's content is + the same type as the expected query parameters. + required: false + schema: + type: array + description: >- + Join query parameters with an AND condition. Each object's content is + the same type as the expected query parameters. + items: + type: object + title: $and + - name: $or + in: query + description: >- + Join query parameters with an OR condition. Each object's content is the + same type as the expected query parameters. + required: false + schema: + type: array + description: >- + Join query parameters with an OR condition. Each object's content is + the same type as the expected query parameters. + items: + type: object + title: $or + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_locales/get.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_locales/get.sh + tags: + - Locales + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminLocaleListResponse.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-since: 2.12.3 + x-featureFlag: translation diff --git a/www/apps/api-reference/specs/admin/paths/admin_locales_{code}.yaml b/www/apps/api-reference/specs/admin/paths/admin_locales_{code}.yaml new file mode 100644 index 0000000000..adf6fb89b5 --- /dev/null +++ b/www/apps/api-reference/specs/admin/paths/admin_locales_{code}.yaml @@ -0,0 +1,72 @@ +get: + operationId: GetLocalesCode + summary: Get a Locale + x-sidebar-summary: Get Locale + description: >- + Retrieve a locale by its code. You can expand the locale's relations or + select the fields that should be returned. + x-authenticated: true + parameters: + - name: code + in: path + description: >- + The locale's code in [BCP 47 + format](https://gist.github.com/typpo/b2b828a35e683b9bf8db91b5404f1bd1). + example: fr-FR + required: true + schema: + type: string + - name: fields + in: query + description: >- + Comma-separated fields that should be included in the returned data. If + a field is prefixed with `+` it will be added to the default fields, + using `-` will remove it from the default fields. Without prefix it will + replace the entire default fields. + required: false + schema: + type: string + title: fields + description: >- + Comma-separated fields that should be included in the returned data. + If a field is prefixed with `+` it will be added to the default + fields, using `-` will remove it from the default fields. Without + prefix it will replace the entire default fields. + externalDocs: + url: '#select-fields-and-relations' + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_locales_{code}/get.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_locales_{code}/get.sh + tags: + - Locales + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminLocaleResponse.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-since: 2.12.3 + x-featureFlag: translation diff --git a/www/apps/api-reference/specs/admin/paths/admin_orders_export.yaml b/www/apps/api-reference/specs/admin/paths/admin_orders_export.yaml new file mode 100644 index 0000000000..f0dd3b6053 --- /dev/null +++ b/www/apps/api-reference/specs/admin/paths/admin_orders_export.yaml @@ -0,0 +1,528 @@ +post: + operationId: PostOrdersExport + summary: Export Orders + description: > + Start an order export process to retrieve a CSV of exported orders. + + + You'll receive in the response the transaction ID of the workflow generating + the CSV file. To check the status of the execution, send a GET request to + `/admin/workflows-executions/export-orders/:transaction-id`. + + + Once the execution finishes successfully, a notification is created for the + export. You can retrieve the notifications using the `/admin/notification` + API route to retrieve the file's download URL. + x-authenticated: true + parameters: + - name: id + in: query + required: false + schema: + oneOf: + - type: string + title: id + description: The ID of the order to export. + - type: array + description: The IDs of the orders to export. + items: + type: string + title: id + description: An order ID. + - name: sales_channel_id + in: query + description: The IDs of the sales channels to export their orders. + required: false + schema: + type: array + description: The IDs of the sales channels to export their orders. + items: + type: string + title: sales_channel_id + description: A sales channel ID. + - name: region_id + in: query + required: false + schema: + oneOf: + - type: string + title: region_id + description: The ID of a region to export orders in it. + - type: array + description: The IDs of regions to export their orders. + items: + type: string + title: region_id + description: A region ID. + - name: customer_id + in: query + required: false + schema: + oneOf: + - type: string + title: customer_id + description: The ID of a customer to export their orders. + - type: array + description: The IDs of customers to export their orders. + items: + type: string + title: customer_id + description: A customer ID. + - name: q + in: query + description: A search query to filter exported orders by. + required: false + schema: + type: string + title: q + description: A search query to filter exported orders by. + - name: created_at + in: query + description: Filter by an order's creation date. + required: false + schema: + type: object + description: Filter by an order's creation date. + properties: + $and: + type: array + description: >- + Join query parameters with an AND condition. Each object's content + is the same type as the expected query parameters. + items: + type: object + title: $and + $or: + type: array + description: >- + Join query parameters with an OR condition. Each object's content + is the same type as the expected query parameters. + items: + type: object + title: $or + $eq: + oneOf: + - type: string + title: $eq + description: Filter by an exact match. + - type: array + description: Filter by an exact match. + items: + type: string + title: $eq + description: Filter by an exact match. + $ne: + type: string + title: $ne + description: Filter by values not equal to this parameter. + $in: + type: array + description: Filter by values in this array. + items: + type: string + title: $in + description: Filter by values in this array. + $nin: + type: array + description: Filter by values not in this array. + items: + type: string + title: $nin + description: Filter by values not in this array. + $not: + oneOf: + - type: string + title: $not + description: >- + Filter by values not matching the conditions in this + parameter. + - type: object + description: >- + Filter by values not matching the conditions in this + parameter. + - type: array + description: >- + Filter by values not matching the conditions in this + parameter. + items: + type: string + title: $not + description: >- + Filter by values not matching the conditions in this + parameter. + $gt: + type: string + title: $gt + description: >- + Filter by values greater than this parameter. Useful for numbers + and dates only. + $gte: + type: string + title: $gte + description: >- + Filter by values greater than or equal to this parameter. Useful + for numbers and dates only. + $lt: + type: string + title: $lt + description: >- + Filter by values less than this parameter. Useful for numbers and + dates only. + $lte: + type: string + title: $lte + description: >- + Filter by values less than or equal to this parameter. Useful for + numbers and dates only. + $like: + type: string + title: $like + description: Apply a `like` filter. Useful for strings only. + $re: + type: string + title: $re + description: Apply a regex filter. Useful for strings only. + $ilike: + type: string + title: $ilike + description: Apply a case-insensitive `like` filter. Useful for strings only. + $fulltext: + type: string + title: $fulltext + description: Filter to apply on full-text properties. + $overlap: + type: array + description: Filter arrays that have overlapping values with this parameter. + items: + type: string + title: $overlap + description: Filter arrays that have overlapping values with this parameter. + $contains: + type: array + description: Filter arrays that contain some of the values of this parameter. + items: + type: string + title: $contains + description: Filter arrays that contain some of the values of this parameter. + $contained: + type: array + description: Filter arrays that contain all values of this parameter. + items: + type: string + title: $contained + description: Filter arrays that contain all values of this parameter. + $exists: + type: boolean + title: $exists + description: Filter by whether a value for this parameter exists (not `null`). + - name: updated_at + in: query + description: Filter by an order's update date. + required: false + schema: + type: object + description: Filter by an order's update date. + properties: + $and: + type: array + description: >- + Join query parameters with an AND condition. Each object's content + is the same type as the expected query parameters. + items: + type: object + title: $and + $or: + type: array + description: >- + Join query parameters with an OR condition. Each object's content + is the same type as the expected query parameters. + items: + type: object + title: $or + $eq: + oneOf: + - type: string + title: $eq + description: Filter by an exact match. + - type: array + description: Filter by an exact match. + items: + type: string + title: $eq + description: Filter by an exact match. + $ne: + type: string + title: $ne + description: Filter by values not equal to this parameter. + $in: + type: array + description: Filter by values in this array. + items: + type: string + title: $in + description: Filter by values in this array. + $nin: + type: array + description: Filter by values not in this array. + items: + type: string + title: $nin + description: Filter by values not in this array. + $not: + oneOf: + - type: string + title: $not + description: >- + Filter by values not matching the conditions in this + parameter. + - type: object + description: >- + Filter by values not matching the conditions in this + parameter. + - type: array + description: >- + Filter by values not matching the conditions in this + parameter. + items: + type: string + title: $not + description: >- + Filter by values not matching the conditions in this + parameter. + $gt: + type: string + title: $gt + description: >- + Filter by values greater than this parameter. Useful for numbers + and dates only. + $gte: + type: string + title: $gte + description: >- + Filter by values greater than or equal to this parameter. Useful + for numbers and dates only. + $lt: + type: string + title: $lt + description: >- + Filter by values less than this parameter. Useful for numbers and + dates only. + $lte: + type: string + title: $lte + description: >- + Filter by values less than or equal to this parameter. Useful for + numbers and dates only. + $like: + type: string + title: $like + description: Apply a `like` filter. Useful for strings only. + $re: + type: string + title: $re + description: Apply a regex filter. Useful for strings only. + $ilike: + type: string + title: $ilike + description: Apply a case-insensitive `like` filter. Useful for strings only. + $fulltext: + type: string + title: $fulltext + description: Filter to apply on full-text properties. + $overlap: + type: array + description: Filter arrays that have overlapping values with this parameter. + items: + type: string + title: $overlap + description: Filter arrays that have overlapping values with this parameter. + $contains: + type: array + description: Filter arrays that contain some of the values of this parameter. + items: + type: string + title: $contains + description: Filter arrays that contain some of the values of this parameter. + $contained: + type: array + description: Filter arrays that contain all values of this parameter. + items: + type: string + title: $contained + description: Filter arrays that contain all values of this parameter. + $exists: + type: boolean + title: $exists + description: Filter by whether a value for this parameter exists (not `null`). + - name: limit + in: query + description: Limit the number of items returned in the list. + required: false + schema: + type: number + title: limit + description: Limit the number of items returned in the list. + externalDocs: + url: '#pagination' + - name: offset + in: query + description: The number of items to skip when retrieving a list. + required: false + schema: + type: number + title: offset + description: The number of items to skip when retrieving a list. + externalDocs: + url: '#pagination' + - name: order + in: query + description: >- + The field to sort the data by. By default, the sort order is ascending. + To change the order to descending, prefix the field name with `-`. + required: false + schema: + type: string + title: order + description: >- + The field to sort the data by. By default, the sort order is + ascending. To change the order to descending, prefix the field name + with `-`. + externalDocs: + url: '#pagination' + - name: with_deleted + in: query + description: Whether to include deleted orders in the export. + required: false + schema: + type: boolean + title: with_deleted + description: Whether to include deleted orders in the export. + - name: fields + in: query + description: >- + Comma-separated fields that should be included in the returned data. If + a field is prefixed with `+` it will be added to the default fields, + using `-` will remove it from the default fields. Without prefix it will + replace the entire default fields. + required: false + schema: + type: string + title: fields + description: >- + Comma-separated fields that should be included in the returned data. + If a field is prefixed with `+` it will be added to the default + fields, using `-` will remove it from the default fields. Without + prefix it will replace the entire default fields. + externalDocs: + url: '#select-fields-and-relations' + - name: status + in: query + required: false + schema: + oneOf: + - type: string + title: status + description: The status of the orders to export. + enum: + - canceled + - completed + - pending + - draft + - archived + - requires_action + - type: array + description: The statuses of the orders to export. + items: + type: string + description: The order status. + enum: + - canceled + - completed + - pending + - draft + - archived + - requires_action + - type: object + description: The order's status. + properties: + $and: + type: array + description: >- + Join query parameters with an AND condition. Each object's + content is the same type as the expected query parameters. + items: + type: object + title: $and + $or: + type: array + description: >- + Join query parameters with an OR condition. Each object's + content is the same type as the expected query parameters. + items: + type: object + title: $or + - name: $and + in: query + description: >- + Join query parameters with an AND condition. Each object's content is + the same type as the expected query parameters. + required: false + schema: + type: array + description: >- + Join query parameters with an AND condition. Each object's content is + the same type as the expected query parameters. + items: + type: object + title: $and + - name: $or + in: query + description: >- + Join query parameters with an OR condition. Each object's content is the + same type as the expected query parameters. + required: false + schema: + type: array + description: >- + Join query parameters with an OR condition. Each object's content is + the same type as the expected query parameters. + items: + type: object + title: $or + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_orders_export/post.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_orders_export/post.sh + tags: + - Orders + responses: + '202': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminExportOrderResponse.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-workflow: exportOrdersWorkflow + x-events: [] + x-since: 2.12.3 diff --git a/www/apps/api-reference/specs/admin/paths/admin_price-lists_{id}_prices.yaml b/www/apps/api-reference/specs/admin/paths/admin_price-lists_{id}_prices.yaml new file mode 100644 index 0000000000..49af24b721 --- /dev/null +++ b/www/apps/api-reference/specs/admin/paths/admin_price-lists_{id}_prices.yaml @@ -0,0 +1,66 @@ +get: + operationId: GetPriceListsIdPrices + summary: List Prices in a Price List + x-sidebar-summary: List Prices + description: Retrieve a list of prices in a price list. The prices can also be paginated. + x-authenticated: true + parameters: + - name: id + in: path + description: The ID of the price list to retrieve prices from. + required: true + schema: + type: string + - name: fields + in: query + description: >- + Comma-separated fields that should be included in the returned data. If + a field is prefixed with `+` it will be added to the default fields, + using `-` will remove it from the default fields. Without prefix it will + replace the entire default fields. + required: false + schema: + type: string + title: fields + description: >- + Comma-separated fields that should be included in the returned data. + If a field is prefixed with `+` it will be added to the default + fields, using `-` will remove it from the default fields. Without + prefix it will replace the entire default fields. + externalDocs: + url: '#select-fields-and-relations' + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_price-lists_{id}_prices/get.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_price-lists_{id}_prices/get.sh + tags: + - Price Lists + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminPriceListPriceListResponse.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-since: 2.12.3 diff --git a/www/apps/api-reference/specs/admin/paths/admin_translations.yaml b/www/apps/api-reference/specs/admin/paths/admin_translations.yaml new file mode 100644 index 0000000000..cb250346d0 --- /dev/null +++ b/www/apps/api-reference/specs/admin/paths/admin_translations.yaml @@ -0,0 +1,228 @@ +get: + operationId: GetTranslations + summary: List Translations + description: >- + Retrieve a list of translations. The translations can be filtered by fields + such as `reference_id` (For example, the ID of a product). The translations + can also be sorted or paginated. + x-authenticated: true + parameters: + - name: q + in: query + description: Search query to filter translations by their fields. + required: false + schema: + type: string + title: q + description: Search query to filter translations by their fields. + - name: reference_id + in: query + required: false + schema: + oneOf: + - type: string + title: reference_id + description: >- + Filter translations by a reference ID. For example, the ID of a + product. + example: prod_123 + - type: array + description: >- + Filter translations by multiple reference IDs. For example, the + IDs of products. + items: + type: string + title: reference_id + description: The reference ID's details. For example, the ID of a product. + example: prod_123 + - name: reference + in: query + description: >- + Filter translations by the resource they belong to. For example, + `product` or `product_variant`. + required: false + schema: + type: string + title: reference + description: >- + Filter translations by the resource they belong to. For example, + `product` or `product_variant`. + - name: locale_code + in: query + required: false + schema: + oneOf: + - type: string + title: locale_code + description: Filter translations by a locale code in BCP 47 format. + example: fr-FR + - type: array + description: Filter translations by multiple locale codes in BCP 47 format. + items: + type: string + title: locale_code + description: A locale code in BCP 47 format. + example: fr-FR + - name: limit + in: query + description: Limit the number of items returned in the list. + required: false + schema: + type: number + title: limit + description: Limit the number of items returned in the list. + externalDocs: + url: '#pagination' + - name: offset + in: query + description: The number of items to skip when retrieving a list. + required: false + schema: + type: number + title: offset + description: The number of items to skip when retrieving a list. + externalDocs: + url: '#pagination' + - name: order + in: query + description: >- + The field to sort the data by. By default, the sort order is ascending. + To change the order to descending, prefix the field name with `-`. + required: false + schema: + type: string + title: order + description: >- + The field to sort the data by. By default, the sort order is + ascending. To change the order to descending, prefix the field name + with `-`. + externalDocs: + url: '#pagination' + - name: with_deleted + in: query + description: The translation's with deleted. + required: false + schema: + type: boolean + title: with_deleted + description: The translation's with deleted. + - name: fields + in: query + description: >- + Comma-separated fields that should be included in the returned data. If + a field is prefixed with `+` it will be added to the default fields, + using `-` will remove it from the default fields. Without prefix it will + replace the entire default fields. + required: false + schema: + type: string + title: fields + description: >- + Comma-separated fields that should be included in the returned data. + If a field is prefixed with `+` it will be added to the default + fields, using `-` will remove it from the default fields. Without + prefix it will replace the entire default fields. + externalDocs: + url: '#select-fields-and-relations' + - name: $and + in: query + description: >- + Join query parameters with an AND condition. Each object's content is + the same type as the expected query parameters. + required: false + schema: + type: array + description: >- + Join query parameters with an AND condition. Each object's content is + the same type as the expected query parameters. + items: + type: object + title: $and + - name: $or + in: query + description: >- + Join query parameters with an OR condition. Each object's content is the + same type as the expected query parameters. + required: false + schema: + type: array + description: >- + Join query parameters with an OR condition. Each object's content is + the same type as the expected query parameters. + items: + type: object + title: $or + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_translations/get.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_translations/get.sh + tags: + - Translations + responses: + '200': + description: OK + content: + application/json: + schema: + allOf: + - type: object + description: The list of translations with pagination. + required: + - limit + - offset + - count + properties: + limit: + type: number + title: limit + description: The maximum number of translations returned. + offset: + type: number + title: offset + description: >- + The number of translations skipped before retrieving the + returned translations. + count: + type: number + title: count + description: The total number of translations matching the query. + estimate_count: + type: number + title: estimate_count + description: >- + The estimated count retrieved from the PostgreSQL query + planner, which may be inaccurate. + x-featureFlag: index_engine + - type: object + description: SUMMARY + required: + - translations + properties: + translations: + type: array + description: The list of translations. + items: + $ref: ../components/schemas/AdminTranslation.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-since: 2.12.3 + x-featureFlag: translation diff --git a/www/apps/api-reference/specs/admin/paths/admin_translations_batch.yaml b/www/apps/api-reference/specs/admin/paths/admin_translations_batch.yaml new file mode 100644 index 0000000000..0594f3bbb6 --- /dev/null +++ b/www/apps/api-reference/specs/admin/paths/admin_translations_batch.yaml @@ -0,0 +1,165 @@ +post: + operationId: PostTranslationsBatch + summary: Manage Translations + description: >- + Manage translations in bulk by creating, updating, or deleting multiple + translations in a single request. You can manage translations for various + resources such as products, product variants, categories, and more. + x-authenticated: true + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + requestBody: + content: + application/json: + schema: + type: object + description: The translations to be created, updated, or deleted in bulk. + properties: + create: + type: array + description: The translations to create. + items: + type: object + description: The translation's details. + required: + - reference + - reference_id + - locale_code + - translations + properties: + reference: + type: string + title: reference + description: The resource that the translation belongs to. + example: product + reference_id: + type: string + title: reference_id + description: >- + The ID of the resource that the translation belongs to. + For example, the ID of a product. + example: prod_123 + locale_code: + type: string + title: locale_code + description: The translation's locale code in BCP 47 format. + example: fr-FR + translations: + type: object + description: >- + The translation key-value pairs. Each key is a field in + the resource, and the value is the translated text. + example: + title: Chaussures + description: Des chaussures élégantes. + update: + type: array + description: The translations to update. + items: + type: object + description: The data for updating a translation. + required: + - id + properties: + id: + type: string + title: id + description: The ID of the translation to update. + reference: + type: string + title: reference + description: The resource that the translation belongs to. + example: product + reference_id: + type: string + title: reference_id + description: >- + The ID of the resource that the translation belongs to. + For example, the ID of a product. + example: prod_123 + locale_code: + type: string + title: locale_code + description: The translation's locale code in BCP 47 format. + example: fr-FR + translations: + type: object + description: >- + The translation key-value pairs. Each key is a field in + the resource, and the value is the translated text. + example: + title: Chaussures Modifiées + description: Des chaussures élégantes et modifiées. + delete: + type: array + description: The translations to delete. + items: + type: string + title: delete + description: The ID of a translation to delete. + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_translations_batch/post.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_translations_batch/post.sh + tags: + - Translations + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminTranslationsBatchResponse.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-workflow: batchTranslationsWorkflow + x-events: + - name: translation.created + payload: |- + ```ts + { + id, // The ID of the translation + } + ``` + description: Emitted when translations are created. + deprecated: false + since: 2.12.3 + - name: translation.updated + payload: |- + ```ts + { + id, // The ID of the translation + } + ``` + description: Emitted when translations are updated. + deprecated: false + since: 2.12.3 + - name: translation.deleted + payload: |- + ```ts + { + id, // The ID of the translation + } + ``` + description: Emitted when translations are deleted. + deprecated: false + since: 2.12.3 + x-since: 2.12.3 + x-featureFlag: translation diff --git a/www/apps/api-reference/specs/admin/paths/admin_translations_settings.yaml b/www/apps/api-reference/specs/admin/paths/admin_translations_settings.yaml new file mode 100644 index 0000000000..2e441b2104 --- /dev/null +++ b/www/apps/api-reference/specs/admin/paths/admin_translations_settings.yaml @@ -0,0 +1,54 @@ +get: + operationId: GetTranslationsSettings + summary: List Translation Settings + x-sidebar-summary: List Settings + description: >- + Retrieve the list of translatable fields for all entities, such as products + and collections. + x-authenticated: true + parameters: + - name: entity_type + in: query + description: The entity to retrieve translation settings for. + required: false + schema: + type: string + title: entity_type + description: The entity to retrieve translation settings for. + example: product + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_translations_settings/get.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_translations_settings/get.sh + tags: + - Translations + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminTranslationSettingsResponse.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-since: 2.12.3 + x-featureFlag: translation diff --git a/www/apps/api-reference/specs/admin/paths/admin_translations_statistics.yaml b/www/apps/api-reference/specs/admin/paths/admin_translations_statistics.yaml new file mode 100644 index 0000000000..8f2a60a6a0 --- /dev/null +++ b/www/apps/api-reference/specs/admin/paths/admin_translations_statistics.yaml @@ -0,0 +1,77 @@ +get: + operationId: GetTranslationsStatistics + summary: Retrieve Translation Statistics + x-sidebar-summary: Get Statistics + description: >- + Get statistics on translations for specified locales and entity types. This + includes overall translation progress for each entity type, and statistics + for each locale within those entity types. + x-authenticated: true + parameters: + - name: locales + in: query + description: >- + The locale codes to retrieve translation statistics for. Locale codes + are in [BCP + 47](https://gist.github.com/typpo/b2b828a35e683b9bf8db91b5404f1bd1) + format. + required: true + schema: + type: array + description: The locale codes to retrieve translation statistics for. + items: + type: string + title: locales + description: >- + A locale code in [BCP + 47](https://gist.github.com/typpo/b2b828a35e683b9bf8db91b5404f1bd1) + format. + example: fr-FR + - name: entity_types + in: query + description: The table names of entities to retrieve translation statistics for. + required: true + schema: + type: array + description: The table names of entities to retrieve translation statistics for. + items: + type: string + title: entity_types + description: The table name of an entity. + example: products + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_translations_statistics/get.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_translations_statistics/get.sh + tags: + - Translations + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminTranslationStatisticsResponse.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-since: 2.12.3 + x-featureFlag: translation diff --git a/www/apps/api-reference/specs/store/code_samples/JavaScript/store_locales/get.js b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_locales/get.js new file mode 100644 index 0000000000..3bc3e97c4e --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_locales/get.js @@ -0,0 +1,18 @@ +import Medusa from "@medusajs/js-sdk" + +let MEDUSA_BACKEND_URL = "http://localhost:9000" + +if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL +} + +export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, +}) + +sdk.store.locale.list() +.then(({ locales }) => { + console.log(locales) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/Shell/store_locales/get.sh b/www/apps/api-reference/specs/store/code_samples/Shell/store_locales/get.sh new file mode 100644 index 0000000000..c63e25d2c3 --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/Shell/store_locales/get.sh @@ -0,0 +1,2 @@ +curl '{backend_url}/store/locales' \ +-H 'x-publishable-api-key: {your_publishable_api_key}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminCollection.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminCollection.yaml index 68b150b1ba..e6fb6b460a 100644 --- a/www/apps/api-reference/specs/store/components/schemas/AdminCollection.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/AdminCollection.yaml @@ -48,3 +48,8 @@ properties: externalDocs: url: https://docs.medusajs.com/api/admin#manage-metadata description: Learn how to manage metadata + translations: + type: array + description: The collection's translations. + items: + $ref: ./AdminTranslation.yaml diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminExportOrderResponse.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminExportOrderResponse.yaml new file mode 100644 index 0000000000..0b810f0d24 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminExportOrderResponse.yaml @@ -0,0 +1,13 @@ +type: object +description: The details of the order export. +x-schemaName: AdminExportOrderResponse +required: + - transaction_id +properties: + transaction_id: + type: string + title: transaction_id + description: >- + The ID of the workflow execution's transaction. Use it to check the status + of the export by sending a GET request to + `/admin/workflows-executions/export-orders/:transaction-id` diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminLocale.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminLocale.yaml new file mode 100644 index 0000000000..c70fc69e43 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminLocale.yaml @@ -0,0 +1,34 @@ +type: object +description: The locale's details. +x-schemaName: AdminLocale +required: + - code + - name + - created_at + - updated_at + - deleted_at +properties: + code: + type: string + title: code + description: The locale's code in BCP 47 format. + example: fr-FR + name: + type: string + title: name + description: The locale's display name. + created_at: + type: string + format: date-time + title: created_at + description: The date and time at which the locale was created. + updated_at: + type: string + format: date-time + title: updated_at + description: The date and time at which the locale was last updated. + deleted_at: + type: string + format: date-time + title: deleted_at + description: The date and time at which the locale was deleted. diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminLocaleListResponse.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminLocaleListResponse.yaml new file mode 100644 index 0000000000..a76b4bf49a --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminLocaleListResponse.yaml @@ -0,0 +1,33 @@ +type: object +description: The list of locales with pagination details. +x-schemaName: AdminLocaleListResponse +required: + - limit + - offset + - count + - locales +properties: + limit: + type: number + title: limit + description: The maximum number of locales returned. + offset: + type: number + title: offset + description: The number of locales skipped before retrieving the returned locales. + count: + type: number + title: count + description: The total number of locales matching the query. + estimate_count: + type: number + title: estimate_count + description: >- + The estimated count retrieved from the PostgreSQL query planner, which may + be inaccurate. + x-featureFlag: index_engine + locales: + type: array + description: The list of locales. + items: + $ref: ./AdminLocale.yaml diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminLocaleResponse.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminLocaleResponse.yaml new file mode 100644 index 0000000000..af012797bd --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminLocaleResponse.yaml @@ -0,0 +1,8 @@ +type: object +description: The locale's details. +x-schemaName: AdminLocaleResponse +required: + - locale +properties: + locale: + $ref: ./AdminLocale.yaml diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminPriceListPriceListResponse.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminPriceListPriceListResponse.yaml new file mode 100644 index 0000000000..4221f97427 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminPriceListPriceListResponse.yaml @@ -0,0 +1,33 @@ +type: object +description: The list of prices. +x-schemaName: AdminPriceListPriceListResponse +required: + - limit + - offset + - count + - prices +properties: + limit: + type: number + title: limit + description: The maximum number of prices returned. + offset: + type: number + title: offset + description: The number of items skipped before retrieving the prices. + count: + type: number + title: count + description: The total number of prices. + estimate_count: + type: number + title: estimate_count + description: >- + The estimated count retrieved from the PostgreSQL query planner, which may + be inaccurate. + x-featureFlag: index_engine + prices: + type: array + description: The list of prices. + items: + $ref: ./AdminPrice.yaml diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminProduct.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminProduct.yaml index 13ff822552..4410442f35 100644 --- a/www/apps/api-reference/specs/store/components/schemas/AdminProduct.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/AdminProduct.yaml @@ -171,3 +171,8 @@ properties: description: The date the product was deleted. shipping_profile: $ref: ./AdminShippingProfile.yaml + translations: + type: array + description: The product's translations. + items: + $ref: ./AdminTranslation.yaml diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminProductTag.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminProductTag.yaml index 8fb2c7567e..b78463254e 100644 --- a/www/apps/api-reference/specs/store/components/schemas/AdminProductTag.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/AdminProductTag.yaml @@ -36,3 +36,8 @@ properties: externalDocs: url: https://docs.medusajs.com/api/admin#manage-metadata description: Learn how to manage metadata + translations: + type: array + description: The tag's translations. + items: + $ref: ./AdminTranslation.yaml diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminProductType.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminProductType.yaml index 6cef7208c7..74332070d8 100644 --- a/www/apps/api-reference/specs/store/components/schemas/AdminProductType.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/AdminProductType.yaml @@ -36,3 +36,8 @@ properties: externalDocs: url: https://docs.medusajs.com/api/admin#manage-metadata description: Learn how to manage metadata + translations: + type: array + description: The type's translations. + items: + $ref: ./AdminTranslation.yaml diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminProductVariant.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminProductVariant.yaml index dbe5464485..52a815867d 100644 --- a/www/apps/api-reference/specs/store/components/schemas/AdminProductVariant.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/AdminProductVariant.yaml @@ -155,3 +155,8 @@ properties: type: string title: thumbnail description: The variant's thumbnail. + translations: + type: array + description: The variant's translations. + items: + $ref: ./AdminTranslation.yaml diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminStore.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminStore.yaml index 7dbecee439..dfbf0d0e3b 100644 --- a/www/apps/api-reference/specs/store/components/schemas/AdminStore.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/AdminStore.yaml @@ -5,6 +5,7 @@ required: - id - name - supported_currencies + - supported_locales - default_sales_channel_id - default_region_id - default_location_id @@ -53,3 +54,8 @@ properties: format: date-time title: updated_at description: The date the store was updated. + supported_locales: + type: array + description: The store's supported locales. + items: + $ref: ./AdminStoreLocale.yaml diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminStoreLocale.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminStoreLocale.yaml new file mode 100644 index 0000000000..f696762f09 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminStoreLocale.yaml @@ -0,0 +1,41 @@ +type: object +description: The details of a store's locale. +x-schemaName: AdminStoreLocale +required: + - id + - locale_code + - store_id + - locale + - created_at + - updated_at + - deleted_at +properties: + id: + type: string + title: id + description: The locale's ID. + locale_code: + type: string + title: locale_code + description: The locale's code in BCP 47 format. + store_id: + type: string + title: store_id + description: The ID of the store to which the locale belongs. + locale: + $ref: ./AdminLocale.yaml + created_at: + type: string + format: date-time + title: created_at + description: The date the locale was created. + updated_at: + type: string + format: date-time + title: updated_at + description: The date the locale was updated. + deleted_at: + type: string + format: date-time + title: deleted_at + description: The date the locale was deleted. diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminTranslation.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminTranslation.yaml new file mode 100644 index 0000000000..f3616e2ff2 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminTranslation.yaml @@ -0,0 +1,57 @@ +type: object +description: The translation's details. +x-schemaName: AdminTranslation +required: + - id + - reference_id + - reference + - locale_code + - translations + - created_at + - updated_at + - deleted_at +properties: + id: + type: string + title: id + description: The translation's ID. + reference_id: + type: string + title: reference_id + description: >- + The ID of the resource that the translation belongs to. For example, the + ID of a product. + example: prod_123 + reference: + type: string + title: reference + description: The resource that the translation belongs to. + example: product + locale_code: + type: string + title: locale_code + description: The translation's locale code in BCP 47 format. + example: fr-FR + translations: + type: object + description: >- + The translation key-value pairs. Each key is a field in the resource, and + the value is the translated text. + example: + title: Chaussures + description: Des chaussures élégantes. + created_at: + type: string + format: date-time + title: created_at + description: The date that the translation was created. + updated_at: + type: string + format: date-time + title: updated_at + description: The date that the translation was updated. + deleted_at: + type: string + format: date-time + title: deleted_at + description: The date that the translation was deleted. diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminTranslationSettingsResponse.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminTranslationSettingsResponse.yaml new file mode 100644 index 0000000000..5c1ad9f98d --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminTranslationSettingsResponse.yaml @@ -0,0 +1,16 @@ +type: object +description: The translation settings' details. +x-schemaName: AdminTranslationSettingsResponse +required: + - translatable_fields +properties: + translatable_fields: + type: object + description: >- + Key-value pairs of translatable fields for different entities. Each key is + an entity type, and the value is an array of fields that can be translated + for that entity. + example: + product: + - title + - description diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminTranslationStatisticsResponse.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminTranslationStatisticsResponse.yaml new file mode 100644 index 0000000000..97190bd390 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminTranslationStatisticsResponse.yaml @@ -0,0 +1,74 @@ +type: object +description: The translation statistics details. +x-schemaName: AdminTranslationStatisticsResponse +required: + - statistics +properties: + statistics: + type: object + description: >- + The translation statistics for different entity types. The key is the + entity type, and the value is an object containing the statistics for that + entity type. + example: + product: + expected: 150 + translated: 120 + missing: 30 + by_locale: + fr-FR: + expected: 150 + translated: 120 + missing: 30 + required: + - by_locale + - expected + - translated + - missing + additionalProperties: + type: object + properties: + by_locale: + type: object + description: >- + The translation statistics of an entity type broken down by locale. + The key is the locale code in BCP 47 format, and the value is an + object containing the statistics for that locale. + example: + fr-FR: + expected: 150 + translated: 120 + missing: 30 + required: + - expected + - translated + - missing + additionalProperties: + type: object + properties: + expected: + type: number + title: expected + description: The total number of translatable fields. + translated: + type: number + title: translated + description: The number of translated fields. + missing: + type: number + title: missing + description: The number of fields that are yet to be translated. + expected: + type: number + title: expected + description: The total number of translatable fields across specified locales. + translated: + type: number + title: translated + description: The number of translated fields across specified locales. + missing: + type: number + title: missing + description: >- + The number of fields that are yet to be translated across specified + locales. diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminTranslationsBatchResponse.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminTranslationsBatchResponse.yaml new file mode 100644 index 0000000000..cd4caa4ecb --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminTranslationsBatchResponse.yaml @@ -0,0 +1,42 @@ +type: object +description: The batch response for managing translations. +x-schemaName: AdminTranslationsBatchResponse +required: + - created + - updated + - deleted +properties: + created: + type: array + description: The created translations. + items: + $ref: ./AdminTranslation.yaml + updated: + type: array + description: The updated translations. + items: + $ref: ./AdminTranslation.yaml + deleted: + type: object + description: Summary of the deleted translations. + required: + - ids + - object + - deleted + properties: + ids: + type: array + description: The IDs of the deleted translations. + items: + type: string + title: ids + description: A translation ID. + object: + type: string + title: object + description: The type of object deleted. + default: translation + deleted: + type: boolean + title: deleted + description: Whether the translations were successfully deleted. diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminUpdateOrder.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminUpdateOrder.yaml index 99ef76b0ce..38a45e081d 100644 --- a/www/apps/api-reference/specs/store/components/schemas/AdminUpdateOrder.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/AdminUpdateOrder.yaml @@ -17,3 +17,11 @@ properties: externalDocs: url: https://docs.medusajs.com/api/admin#manage-metadata description: Learn how to manage metadata + locale: + type: string + title: locale + description: >- + The order's locale in [BCP + 47](https://gist.github.com/typpo/b2b828a35e683b9bf8db91b5404f1bd1) + format. + example: en-US diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminUpdateStore.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminUpdateStore.yaml index 53b1467a8b..60690ab0e5 100644 --- a/www/apps/api-reference/specs/store/components/schemas/AdminUpdateStore.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/AdminUpdateStore.yaml @@ -29,3 +29,8 @@ properties: externalDocs: url: https://docs.medusajs.com/api/admin#manage-metadata description: Learn how to manage metadata + supported_locales: + type: array + description: The store's supported locales. + items: + $ref: ./AdminUpdateStoreSupportedLocale.yaml diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminUpdateStoreSupportedLocale.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminUpdateStoreSupportedLocale.yaml new file mode 100644 index 0000000000..925020b2d3 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminUpdateStoreSupportedLocale.yaml @@ -0,0 +1,13 @@ +type: object +description: The payload to update a store's supported locale. +x-schemaName: AdminUpdateStoreSupportedLocale +required: + - locale_code +properties: + locale_code: + type: string + title: locale_code + description: >- + The locale's code in [BCP 47 + format](https://gist.github.com/typpo/b2b828a35e683b9bf8db91b5404f1bd1). + example: fr-FR diff --git a/www/apps/api-reference/specs/store/components/schemas/Order.yaml b/www/apps/api-reference/specs/store/components/schemas/Order.yaml index b8dfdaab66..e4dc4ed977 100644 --- a/www/apps/api-reference/specs/store/components/schemas/Order.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/Order.yaml @@ -328,3 +328,11 @@ properties: externalDocs: url: >- https://docs.medusajs.com/resources/commerce-modules/order/custom-display-id + locale: + type: string + title: locale + description: >- + The order's locale in [BCP + 47](https://gist.github.com/typpo/b2b828a35e683b9bf8db91b5404f1bd1) + format. + example: en-US diff --git a/www/apps/api-reference/specs/store/components/schemas/StoreLocale.yaml b/www/apps/api-reference/specs/store/components/schemas/StoreLocale.yaml new file mode 100644 index 0000000000..ce26ef2d04 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/StoreLocale.yaml @@ -0,0 +1,19 @@ +type: object +description: The store locale's details. +x-schemaName: StoreLocale +required: + - code + - name +properties: + code: + type: string + title: code + description: >- + The locale's code in [BCP 47 + format](https://gist.github.com/typpo/b2b828a35e683b9bf8db91b5404f1bd1). + example: en-US + name: + type: string + title: name + description: The locale's display name. + example: English (United States) diff --git a/www/apps/api-reference/specs/store/components/schemas/StoreLocaleListResponse.yaml b/www/apps/api-reference/specs/store/components/schemas/StoreLocaleListResponse.yaml new file mode 100644 index 0000000000..5314a2b98c --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/StoreLocaleListResponse.yaml @@ -0,0 +1,11 @@ +type: object +description: The list of supported locales in the store. +x-schemaName: StoreLocaleListResponse +required: + - locales +properties: + locales: + type: array + description: The list of supported locales in the store. + items: + $ref: ./StoreLocale.yaml diff --git a/www/apps/api-reference/specs/store/openapi.full.yaml b/www/apps/api-reference/specs/store/openapi.full.yaml index 2d88e157b1..19b4d30820 100644 --- a/www/apps/api-reference/specs/store/openapi.full.yaml +++ b/www/apps/api-reference/specs/store/openapi.full.yaml @@ -68,6 +68,15 @@ tags: x-associatedSchema: $ref: '#/components/schemas/StoreGiftCard' + - name: Locales + description: | + A locale is a language that content is translated into for customers to view in a storefront. + Medusa installs locales by default. These API routes allow you to retrieve supported locales in the store. + externalDocs: + description: Learn more about locales and translations. + url: https://docs.medusajs.com/resources/commerce-modules/translation/concepts + x-associatedSchema: + $ref: '#/components/schemas/StoreLocale' - name: Orders description: | Guest and registered customers can view orders they placed. @@ -849,6 +858,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. @@ -859,6 +878,16 @@ paths: description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. requestBody: content: application/json: @@ -958,6 +987,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. @@ -968,6 +1007,16 @@ paths: description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: JavaScript label: JS SDK @@ -1036,6 +1085,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. @@ -1046,6 +1105,16 @@ paths: description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. requestBody: content: application/json: @@ -1161,6 +1230,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. @@ -1171,6 +1250,16 @@ paths: description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: JavaScript label: JS SDK @@ -1311,6 +1400,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: |- @@ -1324,6 +1423,16 @@ paths: description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. Without prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. security: - cookie_auth: [] - jwt_token: [] @@ -1576,6 +1685,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. @@ -1586,6 +1705,16 @@ paths: description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. requestBody: content: application/json: @@ -1714,6 +1843,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. @@ -1724,6 +1863,16 @@ paths: description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. requestBody: content: application/json: @@ -1848,6 +1997,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. @@ -1858,6 +2017,16 @@ paths: description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: JavaScript label: JS SDK @@ -1963,6 +2132,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. @@ -1973,6 +2152,16 @@ paths: description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. requestBody: content: application/json: @@ -2036,6 +2225,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. @@ -2046,6 +2245,16 @@ paths: description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: Shell label: cURL @@ -2115,6 +2324,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. @@ -2125,6 +2344,16 @@ paths: description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. requestBody: content: application/json: @@ -2318,6 +2547,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. @@ -2328,6 +2567,16 @@ paths: description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: Shell label: cURL @@ -2375,6 +2624,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. @@ -2953,6 +3212,16 @@ paths: type: string title: id description: The collection's ID. + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: JavaScript label: JS SDK @@ -3054,6 +3323,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. @@ -3064,6 +3343,16 @@ paths: description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: JavaScript label: JS SDK @@ -3127,6 +3416,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. @@ -3215,6 +3514,16 @@ paths: type: boolean title: with_deleted description: Whether to include deleted records in the result. + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: Shell label: cURL @@ -3263,6 +3572,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. @@ -3273,6 +3592,16 @@ paths: description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: Shell label: cURL @@ -3318,6 +3647,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. @@ -3328,6 +3667,16 @@ paths: description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. This API route restricts the fields that can be selected. Learn how to override the retrievable fields in the [Retrieve Custom Links](https://docs.medusajs.com/learn/fundamentals/api-routes/retrieve-custom-links) documentation. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. requestBody: content: application/json: @@ -3436,6 +3785,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. This API route restricts the fields that can be selected. Learn how to override the retrievable fields in the [Retrieve Custom Links](https://docs.medusajs.com/learn/fundamentals/api-routes/retrieve-custom-links) documentation. @@ -3446,6 +3805,16 @@ paths: description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. This API route restricts the fields that can be selected. Learn how to override the retrievable fields in the [Retrieve Custom Links](https://docs.medusajs.com/learn/fundamentals/api-routes/retrieve-custom-links) documentation. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. security: - cookie_auth: [] - jwt_token: [] @@ -3516,6 +3885,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. @@ -3526,6 +3905,16 @@ paths: description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. This API route restricts the fields that can be selected. Learn how to override the retrievable fields in the [Retrieve Custom Links](https://docs.medusajs.com/learn/fundamentals/api-routes/retrieve-custom-links) documentation. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. security: - cookie_auth: [] - jwt_token: [] @@ -3623,6 +4012,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: city in: query description: Filter by the address's city. @@ -3724,6 +4123,16 @@ paths: items: type: object title: $or + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. security: - cookie_auth: [] - jwt_token: [] @@ -3795,6 +4204,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. This API route restricts the fields that can be selected. Learn how to override the retrievable fields in the [Retrieve Custom Links](https://docs.medusajs.com/learn/fundamentals/api-routes/retrieve-custom-links) documentation. @@ -3805,6 +4224,16 @@ paths: description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. This API route restricts the fields that can be selected. Learn how to override the retrievable fields in the [Retrieve Custom Links](https://docs.medusajs.com/learn/fundamentals/api-routes/retrieve-custom-links) documentation. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. security: - cookie_auth: [] - jwt_token: [] @@ -3904,6 +4333,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. This API route restricts the fields that can be selected. Learn how to override the retrievable fields in the [Retrieve Custom Links](https://docs.medusajs.com/learn/fundamentals/api-routes/retrieve-custom-links) documentation. @@ -3914,6 +4353,16 @@ paths: description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. This API route restricts the fields that can be selected. Learn how to override the retrievable fields in the [Retrieve Custom Links](https://docs.medusajs.com/learn/fundamentals/api-routes/retrieve-custom-links) documentation. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. security: - cookie_auth: [] - jwt_token: [] @@ -3993,6 +4442,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. This API route restricts the fields that can be selected. Learn how to override the retrievable fields in the [Retrieve Custom Links](https://docs.medusajs.com/learn/fundamentals/api-routes/retrieve-custom-links) documentation. @@ -4003,6 +4462,16 @@ paths: description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. This API route restricts the fields that can be selected. Learn how to override the retrievable fields in the [Retrieve Custom Links](https://docs.medusajs.com/learn/fundamentals/api-routes/retrieve-custom-links) documentation. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. security: - cookie_auth: [] - jwt_token: [] @@ -4096,6 +4565,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. This API route restricts the fields that can be selected. Learn how to override the retrievable fields in the [Retrieve Custom Links](https://docs.medusajs.com/learn/fundamentals/api-routes/retrieve-custom-links) documentation. @@ -4106,6 +4585,16 @@ paths: description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. This API route restricts the fields that can be selected. Learn how to override the retrievable fields in the [Retrieve Custom Links](https://docs.medusajs.com/learn/fundamentals/api-routes/retrieve-custom-links) documentation. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. security: - cookie_auth: [] - jwt_token: [] @@ -4323,6 +4812,94 @@ paths: - text: Cloud description: | This API route is only available in [Medusa Cloud](https://docs.medusajs.com/cloud/loyalty-plugin). + /store/locales: + get: + operationId: GetLocales + summary: List Locales + description: Retrieve the list of supported locales. You can use this list to allow customers to select their preferred locale in your storefront. + externalDocs: + url: https://docs.medusajs.com/resources/storefront-development/localization + description: Learn how to serve localized content in your storefront. + x-authenticated: false + parameters: + - name: x-publishable-api-key + in: header + description: Publishable API Key created in the Medusa Admin. + required: true + schema: + type: string + externalDocs: + url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + let MEDUSA_BACKEND_URL = "http://localhost:9000" + + if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + } + + export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + }) + + sdk.store.locale.list() + .then(({ locales }) => { + console.log(locales) + }) + - lang: Shell + label: cURL + source: |- + curl '{backend_url}/store/locales' \ + -H 'x-publishable-api-key: {your_publishable_api_key}' + tags: + - Locales + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreLocaleListResponse' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + x-since: 2.12.3 + x-featureFlag: translation /store/orders: get: operationId: GetOrders @@ -4339,6 +4916,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. @@ -4452,6 +5039,16 @@ paths: type: boolean title: with_deleted description: Whether to include deleted records in the result. + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: JavaScript label: JS SDK @@ -4557,6 +5154,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. @@ -4567,6 +5174,16 @@ paths: description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: JavaScript label: JS SDK @@ -4639,6 +5256,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: |- @@ -4652,6 +5279,16 @@ paths: description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. Without prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. requestBody: content: application/json: @@ -4741,6 +5378,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: |- @@ -4754,6 +5401,16 @@ paths: description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. Without prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: JavaScript label: JS SDK @@ -4837,6 +5494,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: |- @@ -4850,6 +5517,16 @@ paths: description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. Without prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. requestBody: content: application/json: @@ -4939,6 +5616,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: |- @@ -4952,6 +5639,16 @@ paths: description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. Without prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. requestBody: content: application/json: @@ -5039,6 +5736,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. @@ -5049,6 +5756,16 @@ paths: description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. requestBody: content: application/json: @@ -5145,6 +5862,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. @@ -5155,6 +5882,16 @@ paths: description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. requestBody: content: application/json: @@ -5211,6 +5948,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. @@ -5265,6 +6012,16 @@ paths: type: boolean title: with_deleted description: Whether to include deleted records in the result. + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: JavaScript label: JS SDK @@ -5362,6 +6119,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. @@ -5982,6 +6749,16 @@ paths: type: boolean title: with_deleted description: Whether to include deleted records in the result. + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: JavaScript label: JS SDK @@ -6054,6 +6831,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. @@ -6080,6 +6867,16 @@ paths: type: boolean title: include_descendants_tree description: Whether to retrieve a list of child categories. If you enable this, add to the `fields` query parameter `category_children` to set the children of a category in this field. You can either pass `*category_children` to retreieve the fields of all child categories, or select specific fields to make the response size smaller. For example, `fields=category_children.id,category_children.name`. + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: JavaScript label: JS SDK @@ -6143,6 +6940,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: |- @@ -6712,6 +7519,16 @@ paths: type: boolean title: with_deleted description: Whether to include deleted records in the result. + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: Shell label: cURL @@ -6760,6 +7577,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: |- @@ -6773,6 +7600,16 @@ paths: description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. Without prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: Shell label: cURL @@ -6815,6 +7652,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: |- @@ -7384,6 +8231,16 @@ paths: type: boolean title: with_deleted description: Whether to include deleted records in the result. + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: Shell label: cURL @@ -7432,6 +8289,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: |- @@ -7445,6 +8312,16 @@ paths: description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. Without prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: Shell label: cURL @@ -7476,7 +8353,12 @@ paths: get: operationId: GetProducts summary: List Products - description: Retrieve a list of products. The products can be filtered by fields such as `id`. The products can also be sorted or paginated. + description: | + Retrieve a list of products. The products can be filtered by fields such as `id`. The products can also be sorted or paginated. + + You can retrieve the content of the products translated to a specific locale either by passing the `locale` query parameter or by setting the `Content-Language` header to the desired locale code in BCP 47 format. If you don't pass a locale, and your store has a default locale, the default locale will be used. + + With localization, the products' content like title and description will be in the specified locale if a translation is available, and fallback to the original content otherwise. Learn more in the [Localization](#localization) section. x-authenticated: false externalDocs: url: https://docs.medusajs.com/resources/storefront-development/products/price @@ -7490,6 +8372,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. @@ -8204,6 +9096,16 @@ paths: type: string title: cart_id description: The product's cart id. + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: JavaScript label: JS SDK @@ -8285,7 +9187,12 @@ paths: get: operationId: GetProductsId summary: Get a Product - description: Retrieve a product by its ID. You can expand the product's relations or select the fields that should be returned. + description: | + Retrieve a product by its ID. You can expand the product's relations or select the fields that should be returned. + + You can retrieve the content of the product translated to a specific locale either by passing the `locale` query parameter or by setting the `Content-Language` header to the desired locale code in BCP 47 format. If you don't pass a locale, and your store has a default locale, the default locale will be used. + + With localization, the product's content like title and description will be in the specified locale if a translation is available, and fallback to the original content otherwise. Learn more in the [Localization](#localization) section. x-authenticated: false externalDocs: url: https://docs.medusajs.com/resources/storefront-development/products/price @@ -8305,6 +9212,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. @@ -8354,6 +9271,16 @@ paths: type: string title: cart_id description: The ID of the customer's cart. If set, the cart's region and shipping address's country code and province are used instead of the `region_id`, `country_code`, and `province` properties. + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: JavaScript label: JS SDK @@ -8420,6 +9347,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. @@ -8536,6 +9473,16 @@ paths: type: boolean title: with_deleted description: Whether to include deleted records in the result. + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: JavaScript label: JS SDK @@ -8634,6 +9581,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. @@ -8644,6 +9601,16 @@ paths: description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: JavaScript label: JS SDK @@ -8711,6 +9678,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. @@ -8757,6 +9734,16 @@ paths: type: boolean title: with_deleted description: Whether to include deleted records in the result. + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: Shell label: cURL @@ -8834,6 +9821,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. @@ -8844,6 +9841,16 @@ paths: description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: Shell label: cURL @@ -8886,6 +9893,26 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. requestBody: content: application/json: @@ -8980,6 +10007,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. @@ -9054,6 +10091,16 @@ paths: type: boolean title: is_return description: Whether the shipping option can be used for returns. + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: JavaScript label: JS SDK @@ -9127,6 +10174,16 @@ paths: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: |- @@ -9140,6 +10197,16 @@ paths: description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. Without prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. requestBody: content: application/json: @@ -11254,6 +12321,11 @@ components: externalDocs: url: https://docs.medusajs.com/api/admin#manage-metadata description: Learn how to manage metadata + translations: + type: array + description: The collection's translations. + items: + $ref: '#/components/schemas/AdminTranslation' AdminCollectionDeleteResponse: type: object description: The details of the deleted collection. @@ -15493,6 +16565,17 @@ components: externalDocs: url: https://docs.medusajs.com/api/admin#manage-metadata description: Learn how to manage metadata + AdminExportOrderResponse: + type: object + description: The details of the order export. + x-schemaName: AdminExportOrderResponse + required: + - transaction_id + properties: + transaction_id: + type: string + title: transaction_id + description: The ID of the workflow execution's transaction. Use it to check the status of the export by sending a GET request to `/admin/workflows-executions/export-orders/:transaction-id` AdminExportProductResponse: type: object description: The details of the product export. @@ -16652,6 +17735,82 @@ components: title: remove description: The ID of a product. x-schemaName: AdminLinkPriceListProducts + AdminLocale: + type: object + description: The locale's details. + x-schemaName: AdminLocale + required: + - code + - name + - created_at + - updated_at + - deleted_at + properties: + code: + type: string + title: code + description: The locale's code in BCP 47 format. + example: fr-FR + name: + type: string + title: name + description: The locale's display name. + created_at: + type: string + format: date-time + title: created_at + description: The date and time at which the locale was created. + updated_at: + type: string + format: date-time + title: updated_at + description: The date and time at which the locale was last updated. + deleted_at: + type: string + format: date-time + title: deleted_at + description: The date and time at which the locale was deleted. + AdminLocaleListResponse: + type: object + description: The list of locales with pagination details. + x-schemaName: AdminLocaleListResponse + required: + - limit + - offset + - count + - locales + properties: + limit: + type: number + title: limit + description: The maximum number of locales returned. + offset: + type: number + title: offset + description: The number of locales skipped before retrieving the returned locales. + count: + type: number + title: count + description: The total number of locales matching the query. + estimate_count: + type: number + title: estimate_count + description: The estimated count retrieved from the PostgreSQL query planner, which may be inaccurate. + x-featureFlag: index_engine + locales: + type: array + description: The list of locales. + items: + $ref: '#/components/schemas/AdminLocale' + AdminLocaleResponse: + type: object + description: The locale's details. + x-schemaName: AdminLocaleResponse + required: + - locale + properties: + locale: + $ref: '#/components/schemas/AdminLocale' AdminMarkPaymentCollectionAsPaid: type: object description: The payment details. @@ -19481,6 +20640,38 @@ components: format: date-time title: deleted_at description: The date the price was deleted. + AdminPriceListPriceListResponse: + type: object + description: The list of prices. + x-schemaName: AdminPriceListPriceListResponse + required: + - limit + - offset + - count + - prices + properties: + limit: + type: number + title: limit + description: The maximum number of prices returned. + offset: + type: number + title: offset + description: The number of items skipped before retrieving the prices. + count: + type: number + title: count + description: The total number of prices. + estimate_count: + type: number + title: estimate_count + description: The estimated count retrieved from the PostgreSQL query planner, which may be inaccurate. + x-featureFlag: index_engine + prices: + type: array + description: The list of prices. + items: + $ref: '#/components/schemas/AdminPrice' AdminPriceListResponse: type: object description: The price list's details. @@ -19773,6 +20964,11 @@ components: description: The date the product was deleted. shipping_profile: $ref: '#/components/schemas/AdminShippingProfile' + translations: + type: array + description: The product's translations. + items: + $ref: '#/components/schemas/AdminTranslation' AdminProductCategory: type: object description: The product category's details. @@ -20163,6 +21359,11 @@ components: externalDocs: url: https://docs.medusajs.com/api/admin#manage-metadata description: Learn how to manage metadata + translations: + type: array + description: The tag's translations. + items: + $ref: '#/components/schemas/AdminTranslation' AdminProductTagDeleteResponse: type: object description: The details of the product tag deletion. @@ -20265,6 +21466,11 @@ components: externalDocs: url: https://docs.medusajs.com/api/admin#manage-metadata description: Learn how to manage metadata + translations: + type: array + description: The type's translations. + items: + $ref: '#/components/schemas/AdminTranslation' AdminProductTypeDeleteResponse: type: object description: The details of the product type deletion. @@ -20482,6 +21688,11 @@ components: type: string title: thumbnail description: The variant's thumbnail. + translations: + type: array + description: The variant's translations. + items: + $ref: '#/components/schemas/AdminTranslation' AdminProductVariantDeleteResponse: type: object description: The details of the product variant's deletion. @@ -22378,6 +23589,7 @@ components: - id - name - supported_currencies + - supported_locales - default_sales_channel_id - default_region_id - default_location_id @@ -22426,6 +23638,11 @@ components: format: date-time title: updated_at description: The date the store was updated. + supported_locales: + type: array + description: The store's supported locales. + items: + $ref: '#/components/schemas/AdminStoreLocale' AdminStoreCreditAccount: type: object description: The store credit account's details. @@ -22612,6 +23829,48 @@ components: title: estimate_count description: The estimated count retrieved from the PostgreSQL query planner, which may be inaccurate. x-featureFlag: index_engine + AdminStoreLocale: + type: object + description: The details of a store's locale. + x-schemaName: AdminStoreLocale + required: + - id + - locale_code + - store_id + - locale + - created_at + - updated_at + - deleted_at + properties: + id: + type: string + title: id + description: The locale's ID. + locale_code: + type: string + title: locale_code + description: The locale's code in BCP 47 format. + store_id: + type: string + title: store_id + description: The ID of the store to which the locale belongs. + locale: + $ref: '#/components/schemas/AdminLocale' + created_at: + type: string + format: date-time + title: created_at + description: The date the locale was created. + updated_at: + type: string + format: date-time + title: updated_at + description: The date the locale was updated. + deleted_at: + type: string + format: date-time + title: deleted_at + description: The date the locale was deleted. AdminStoreResponse: type: object description: The store's details. @@ -23049,6 +24308,184 @@ components: title: estimate_count description: The store credit account's estimate count. x-featureFlag: index_engine + AdminTranslation: + type: object + description: The translation's details. + x-schemaName: AdminTranslation + required: + - id + - reference_id + - reference + - locale_code + - translations + - created_at + - updated_at + - deleted_at + properties: + id: + type: string + title: id + description: The translation's ID. + reference_id: + type: string + title: reference_id + description: The ID of the resource that the translation belongs to. For example, the ID of a product. + example: prod_123 + reference: + type: string + title: reference + description: The resource that the translation belongs to. + example: product + locale_code: + type: string + title: locale_code + description: The translation's locale code in BCP 47 format. + example: fr-FR + translations: + type: object + description: The translation key-value pairs. Each key is a field in the resource, and the value is the translated text. + example: + title: Chaussures + description: Des chaussures élégantes. + created_at: + type: string + format: date-time + title: created_at + description: The date that the translation was created. + updated_at: + type: string + format: date-time + title: updated_at + description: The date that the translation was updated. + deleted_at: + type: string + format: date-time + title: deleted_at + description: The date that the translation was deleted. + AdminTranslationSettingsResponse: + type: object + description: The translation settings' details. + x-schemaName: AdminTranslationSettingsResponse + required: + - translatable_fields + properties: + translatable_fields: + type: object + description: Key-value pairs of translatable fields for different entities. Each key is an entity type, and the value is an array of fields that can be translated for that entity. + example: + product: + - title + - description + AdminTranslationStatisticsResponse: + type: object + description: The translation statistics details. + x-schemaName: AdminTranslationStatisticsResponse + required: + - statistics + properties: + statistics: + type: object + description: The translation statistics for different entity types. The key is the entity type, and the value is an object containing the statistics for that entity type. + example: + product: + expected: 150 + translated: 120 + missing: 30 + by_locale: + fr-FR: + expected: 150 + translated: 120 + missing: 30 + required: + - by_locale + - expected + - translated + - missing + additionalProperties: + type: object + properties: + by_locale: + type: object + description: The translation statistics of an entity type broken down by locale. The key is the locale code in BCP 47 format, and the value is an object containing the statistics for that locale. + example: + fr-FR: + expected: 150 + translated: 120 + missing: 30 + required: + - expected + - translated + - missing + additionalProperties: + type: object + properties: + expected: + type: number + title: expected + description: The total number of translatable fields. + translated: + type: number + title: translated + description: The number of translated fields. + missing: + type: number + title: missing + description: The number of fields that are yet to be translated. + expected: + type: number + title: expected + description: The total number of translatable fields across specified locales. + translated: + type: number + title: translated + description: The number of translated fields across specified locales. + missing: + type: number + title: missing + description: The number of fields that are yet to be translated across specified locales. + AdminTranslationsBatchResponse: + type: object + description: The batch response for managing translations. + x-schemaName: AdminTranslationsBatchResponse + required: + - created + - updated + - deleted + properties: + created: + type: array + description: The created translations. + items: + $ref: '#/components/schemas/AdminTranslation' + updated: + type: array + description: The updated translations. + items: + $ref: '#/components/schemas/AdminTranslation' + deleted: + type: object + description: Summary of the deleted translations. + required: + - ids + - object + - deleted + properties: + ids: + type: array + description: The IDs of the deleted translations. + items: + type: string + title: ids + description: A translation ID. + object: + type: string + title: object + description: The type of object deleted. + default: translation + deleted: + type: boolean + title: deleted + description: Whether the translations were successfully deleted. AdminUpdateApiKey: type: object description: The details to update in an API key. @@ -23512,6 +24949,11 @@ components: externalDocs: url: https://docs.medusajs.com/api/admin#manage-metadata description: Learn how to manage metadata + locale: + type: string + title: locale + description: The order's locale in [BCP 47](https://gist.github.com/typpo/b2b828a35e683b9bf8db91b5404f1bd1) format. + example: en-US AdminUpdateOrderChange: type: object description: The data to update in the order change. @@ -24487,6 +25929,11 @@ components: externalDocs: url: https://docs.medusajs.com/api/admin#manage-metadata description: Learn how to manage metadata + supported_locales: + type: array + description: The store's supported locales. + items: + $ref: '#/components/schemas/AdminUpdateStoreSupportedLocale' AdminUpdateStoreSupportedCurrency: type: object description: The details to update in a supported currency of the store. @@ -24507,6 +25954,18 @@ components: title: is_tax_inclusive description: Whether prices using this currency are tax inclusive. x-schemaName: AdminUpdateStoreSupportedCurrency + AdminUpdateStoreSupportedLocale: + type: object + description: The payload to update a store's supported locale. + x-schemaName: AdminUpdateStoreSupportedLocale + required: + - locale_code + properties: + locale_code: + type: string + title: locale_code + description: The locale's code in [BCP 47 format](https://gist.github.com/typpo/b2b828a35e683b9bf8db91b5404f1bd1). + example: fr-FR AdminUpdateTaxRate: type: object description: The properties to update in the tax rate. @@ -29546,6 +31005,11 @@ components: description: The custom display ID of the order. externalDocs: url: https://docs.medusajs.com/resources/commerce-modules/order/custom-display-id + locale: + type: string + title: locale + description: The order's locale in [BCP 47](https://gist.github.com/typpo/b2b828a35e683b9bf8db91b5404f1bd1) format. + example: en-US OrderAddress: type: object description: The address's details. @@ -32947,6 +34411,36 @@ components: url: https://docs.medusajs.com/resources/commerce-modules/payment/payment-session#data-property description: Learn more about the payment session's data property x-schemaName: StoreInitializePaymentSession + StoreLocale: + type: object + description: The store locale's details. + x-schemaName: StoreLocale + required: + - code + - name + properties: + code: + type: string + title: code + description: The locale's code in [BCP 47 format](https://gist.github.com/typpo/b2b828a35e683b9bf8db91b5404f1bd1). + example: en-US + name: + type: string + title: name + description: The locale's display name. + example: English (United States) + StoreLocaleListResponse: + type: object + description: The list of supported locales in the store. + x-schemaName: StoreLocaleListResponse + required: + - locales + properties: + locales: + type: array + description: The list of supported locales in the store. + items: + $ref: '#/components/schemas/StoreLocale' StoreOrder: type: object description: The order's details. diff --git a/www/apps/api-reference/specs/store/openapi.yaml b/www/apps/api-reference/specs/store/openapi.yaml index e390ed1d69..97d9a80701 100644 --- a/www/apps/api-reference/specs/store/openapi.yaml +++ b/www/apps/api-reference/specs/store/openapi.yaml @@ -92,6 +92,19 @@ tags: x-associatedSchema: $ref: ./components/schemas/StoreGiftCard.yaml + - name: Locales + description: > + A locale is a language that content is translated into for customers to + view in a storefront. + + Medusa installs locales by default. These API routes allow you to retrieve + supported locales in the store. + externalDocs: + description: Learn more about locales and translations. + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/concepts + x-associatedSchema: + $ref: ./components/schemas/StoreLocale.yaml - name: Orders description: | Guest and registered customers can view orders they placed. @@ -286,6 +299,8 @@ paths: $ref: paths/store_gift-cards_{idOrCode}.yaml /store/gift-cards/{idOrCode}/redeem: $ref: paths/store_gift-cards_{idOrCode}_redeem.yaml + /store/locales: + $ref: paths/store_locales.yaml /store/orders: $ref: paths/store_orders.yaml /store/orders/{id}: diff --git a/www/apps/api-reference/specs/store/paths/store_carts.yaml b/www/apps/api-reference/specs/store/paths/store_carts.yaml index 287367a2ed..c5d6def290 100644 --- a/www/apps/api-reference/specs/store/paths/store_carts.yaml +++ b/www/apps/api-reference/specs/store/paths/store_carts.yaml @@ -12,6 +12,17 @@ post: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: >- @@ -30,6 +41,17 @@ post: prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. requestBody: content: application/json: diff --git a/www/apps/api-reference/specs/store/paths/store_carts_{id}.yaml b/www/apps/api-reference/specs/store/paths/store_carts_{id}.yaml index 4717168018..747e9beeaf 100644 --- a/www/apps/api-reference/specs/store/paths/store_carts_{id}.yaml +++ b/www/apps/api-reference/specs/store/paths/store_carts_{id}.yaml @@ -20,6 +20,17 @@ get: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: >- @@ -38,6 +49,17 @@ get: prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: JavaScript label: JS SDK @@ -94,6 +116,17 @@ post: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: >- @@ -112,6 +145,17 @@ post: prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. requestBody: content: application/json: diff --git a/www/apps/api-reference/specs/store/paths/store_carts_{id}_complete.yaml b/www/apps/api-reference/specs/store/paths/store_carts_{id}_complete.yaml index 10307ce962..0f46ee1318 100644 --- a/www/apps/api-reference/specs/store/paths/store_carts_{id}_complete.yaml +++ b/www/apps/api-reference/specs/store/paths/store_carts_{id}_complete.yaml @@ -22,6 +22,17 @@ post: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: >- @@ -40,6 +51,17 @@ post: prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: JavaScript label: JS SDK diff --git a/www/apps/api-reference/specs/store/paths/store_carts_{id}_customer.yaml b/www/apps/api-reference/specs/store/paths/store_carts_{id}_customer.yaml index b68b07e132..faa3edb497 100644 --- a/www/apps/api-reference/specs/store/paths/store_carts_{id}_customer.yaml +++ b/www/apps/api-reference/specs/store/paths/store_carts_{id}_customer.yaml @@ -26,6 +26,17 @@ post: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: >- @@ -46,6 +57,17 @@ post: prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. security: - cookie_auth: [] - jwt_token: [] diff --git a/www/apps/api-reference/specs/store/paths/store_carts_{id}_line-items.yaml b/www/apps/api-reference/specs/store/paths/store_carts_{id}_line-items.yaml index a84a687d60..e41fdee510 100644 --- a/www/apps/api-reference/specs/store/paths/store_carts_{id}_line-items.yaml +++ b/www/apps/api-reference/specs/store/paths/store_carts_{id}_line-items.yaml @@ -23,6 +23,17 @@ post: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: >- @@ -41,6 +52,17 @@ post: prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. requestBody: content: application/json: diff --git a/www/apps/api-reference/specs/store/paths/store_carts_{id}_line-items_{line_id}.yaml b/www/apps/api-reference/specs/store/paths/store_carts_{id}_line-items_{line_id}.yaml index fd322f890f..a57f7d72eb 100644 --- a/www/apps/api-reference/specs/store/paths/store_carts_{id}_line-items_{line_id}.yaml +++ b/www/apps/api-reference/specs/store/paths/store_carts_{id}_line-items_{line_id}.yaml @@ -29,6 +29,17 @@ post: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: >- @@ -47,6 +58,17 @@ post: prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. requestBody: content: application/json: @@ -147,6 +169,17 @@ delete: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: >- @@ -165,6 +198,17 @@ delete: prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: JavaScript label: JS SDK diff --git a/www/apps/api-reference/specs/store/paths/store_carts_{id}_promotions.yaml b/www/apps/api-reference/specs/store/paths/store_carts_{id}_promotions.yaml index 55f118cc92..12218472bb 100644 --- a/www/apps/api-reference/specs/store/paths/store_carts_{id}_promotions.yaml +++ b/www/apps/api-reference/specs/store/paths/store_carts_{id}_promotions.yaml @@ -23,6 +23,17 @@ post: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: >- @@ -41,6 +52,17 @@ post: prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. requestBody: content: application/json: @@ -98,6 +120,17 @@ delete: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: >- @@ -116,6 +149,17 @@ delete: prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: Shell label: cURL 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 1aa6d869f4..20e53e60e8 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 @@ -25,6 +25,17 @@ post: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: >- @@ -43,6 +54,17 @@ post: prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. requestBody: content: application/json: diff --git a/www/apps/api-reference/specs/store/paths/store_carts_{id}_taxes.yaml b/www/apps/api-reference/specs/store/paths/store_carts_{id}_taxes.yaml index f124b8d2fb..ec81d6379c 100644 --- a/www/apps/api-reference/specs/store/paths/store_carts_{id}_taxes.yaml +++ b/www/apps/api-reference/specs/store/paths/store_carts_{id}_taxes.yaml @@ -19,6 +19,17 @@ post: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: >- @@ -37,6 +48,17 @@ post: prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: Shell label: cURL diff --git a/www/apps/api-reference/specs/store/paths/store_collections.yaml b/www/apps/api-reference/specs/store/paths/store_collections.yaml index 1469db4c93..6177f5a350 100644 --- a/www/apps/api-reference/specs/store/paths/store_collections.yaml +++ b/www/apps/api-reference/specs/store/paths/store_collections.yaml @@ -18,6 +18,17 @@ get: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: >- @@ -693,6 +704,17 @@ get: type: string title: id description: The collection's ID. + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: JavaScript label: JS SDK diff --git a/www/apps/api-reference/specs/store/paths/store_collections_{id}.yaml b/www/apps/api-reference/specs/store/paths/store_collections_{id}.yaml index 4a67d524c9..d30136fc24 100644 --- a/www/apps/api-reference/specs/store/paths/store_collections_{id}.yaml +++ b/www/apps/api-reference/specs/store/paths/store_collections_{id}.yaml @@ -24,6 +24,17 @@ get: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: >- @@ -42,6 +53,17 @@ get: prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: JavaScript label: JS SDK diff --git a/www/apps/api-reference/specs/store/paths/store_currencies.yaml b/www/apps/api-reference/specs/store/paths/store_currencies.yaml index 2a4afa1d20..6d93c6d76b 100644 --- a/www/apps/api-reference/specs/store/paths/store_currencies.yaml +++ b/www/apps/api-reference/specs/store/paths/store_currencies.yaml @@ -14,6 +14,17 @@ get: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: >- @@ -123,6 +134,17 @@ get: type: boolean title: with_deleted description: Whether to include deleted records in the result. + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: Shell label: cURL diff --git a/www/apps/api-reference/specs/store/paths/store_currencies_{code}.yaml b/www/apps/api-reference/specs/store/paths/store_currencies_{code}.yaml index 9be0e0170a..ff32f70375 100644 --- a/www/apps/api-reference/specs/store/paths/store_currencies_{code}.yaml +++ b/www/apps/api-reference/specs/store/paths/store_currencies_{code}.yaml @@ -20,6 +20,17 @@ get: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: >- @@ -38,6 +49,17 @@ get: prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: Shell label: cURL diff --git a/www/apps/api-reference/specs/store/paths/store_customers.yaml b/www/apps/api-reference/specs/store/paths/store_customers.yaml index 92c691f97d..6cc035e7ac 100644 --- a/www/apps/api-reference/specs/store/paths/store_customers.yaml +++ b/www/apps/api-reference/specs/store/paths/store_customers.yaml @@ -19,6 +19,17 @@ post: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: >- @@ -41,6 +52,17 @@ post: documentation. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. requestBody: content: application/json: diff --git a/www/apps/api-reference/specs/store/paths/store_customers_me.yaml b/www/apps/api-reference/specs/store/paths/store_customers_me.yaml index 90cbfa3bb7..ea9ad54c9a 100644 --- a/www/apps/api-reference/specs/store/paths/store_customers_me.yaml +++ b/www/apps/api-reference/specs/store/paths/store_customers_me.yaml @@ -19,6 +19,17 @@ get: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: >- @@ -45,6 +56,17 @@ get: documentation. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. security: - cookie_auth: [] - jwt_token: [] @@ -96,6 +118,17 @@ post: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: >- @@ -118,6 +151,17 @@ post: documentation. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. security: - cookie_auth: [] - jwt_token: [] 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 97c131af4b..c2e37baec5 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 @@ -20,6 +20,17 @@ get: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: city in: query description: Filter by the address's city. @@ -129,6 +140,17 @@ get: items: type: object title: $or + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. security: - cookie_auth: [] - jwt_token: [] @@ -181,6 +203,17 @@ post: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: >- @@ -207,6 +240,17 @@ post: documentation. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. security: - cookie_auth: [] - jwt_token: [] 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 5f05c3b37e..62fd93d8af 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 @@ -21,6 +21,17 @@ get: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: >- @@ -47,6 +58,17 @@ get: documentation. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. security: - cookie_auth: [] - jwt_token: [] @@ -106,6 +128,17 @@ post: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: >- @@ -132,6 +165,17 @@ post: documentation. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. security: - cookie_auth: [] - jwt_token: [] @@ -199,6 +243,17 @@ delete: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: >- @@ -225,6 +280,17 @@ delete: documentation. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. security: - cookie_auth: [] - jwt_token: [] diff --git a/www/apps/api-reference/specs/store/paths/store_locales.yaml b/www/apps/api-reference/specs/store/paths/store_locales.yaml new file mode 100644 index 0000000000..42e34fd278 --- /dev/null +++ b/www/apps/api-reference/specs/store/paths/store_locales.yaml @@ -0,0 +1,73 @@ +get: + operationId: GetLocales + summary: List Locales + description: >- + Retrieve the list of supported locales. You can use this list to allow + customers to select their preferred locale in your storefront. + externalDocs: + url: https://docs.medusajs.com/resources/storefront-development/localization + description: Learn how to serve localized content in your storefront. + x-authenticated: false + parameters: + - name: x-publishable-api-key + in: header + description: Publishable API Key created in the Medusa Admin. + required: true + schema: + type: string + externalDocs: + url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/store_locales/get.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/store_locales/get.sh + tags: + - Locales + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/StoreLocaleListResponse.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-since: 2.12.3 + x-featureFlag: translation diff --git a/www/apps/api-reference/specs/store/paths/store_orders.yaml b/www/apps/api-reference/specs/store/paths/store_orders.yaml index aefbee7af9..18cd495bfa 100644 --- a/www/apps/api-reference/specs/store/paths/store_orders.yaml +++ b/www/apps/api-reference/specs/store/paths/store_orders.yaml @@ -15,6 +15,17 @@ get: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: >- @@ -141,6 +152,17 @@ get: type: boolean title: with_deleted description: Whether to include deleted records in the result. + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: JavaScript label: JS SDK diff --git a/www/apps/api-reference/specs/store/paths/store_orders_{id}.yaml b/www/apps/api-reference/specs/store/paths/store_orders_{id}.yaml index b96900469a..c2a3f1ef28 100644 --- a/www/apps/api-reference/specs/store/paths/store_orders_{id}.yaml +++ b/www/apps/api-reference/specs/store/paths/store_orders_{id}.yaml @@ -20,6 +20,17 @@ get: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: >- @@ -38,6 +49,17 @@ get: prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: JavaScript label: JS SDK diff --git a/www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_accept.yaml b/www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_accept.yaml index a71d02b31e..fc213da30a 100644 --- a/www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_accept.yaml +++ b/www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_accept.yaml @@ -26,6 +26,17 @@ post: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: >- @@ -46,6 +57,17 @@ post: prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. requestBody: content: application/json: diff --git a/www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_cancel.yaml b/www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_cancel.yaml index 117867da36..5af96b2200 100644 --- a/www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_cancel.yaml +++ b/www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_cancel.yaml @@ -23,6 +23,17 @@ post: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: >- @@ -43,6 +54,17 @@ post: prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: JavaScript label: JS SDK diff --git a/www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_decline.yaml b/www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_decline.yaml index dd474a4704..7b1b2c5f97 100644 --- a/www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_decline.yaml +++ b/www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_decline.yaml @@ -22,6 +22,17 @@ post: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: >- @@ -42,6 +53,17 @@ post: prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. requestBody: content: application/json: diff --git a/www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_request.yaml b/www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_request.yaml index 184e39efb8..68d2f0d947 100644 --- a/www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_request.yaml +++ b/www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_request.yaml @@ -23,6 +23,17 @@ post: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: >- @@ -43,6 +54,17 @@ post: prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. requestBody: content: application/json: diff --git a/www/apps/api-reference/specs/store/paths/store_payment-collections.yaml b/www/apps/api-reference/specs/store/paths/store_payment-collections.yaml index 9b8eadc33c..ecbdaace26 100644 --- a/www/apps/api-reference/specs/store/paths/store_payment-collections.yaml +++ b/www/apps/api-reference/specs/store/paths/store_payment-collections.yaml @@ -18,6 +18,17 @@ post: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: >- @@ -36,6 +47,17 @@ post: prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. requestBody: content: application/json: diff --git a/www/apps/api-reference/specs/store/paths/store_payment-collections_{id}_payment-sessions.yaml b/www/apps/api-reference/specs/store/paths/store_payment-collections_{id}_payment-sessions.yaml index 78cb2f3a9c..428069db61 100644 --- a/www/apps/api-reference/specs/store/paths/store_payment-collections_{id}_payment-sessions.yaml +++ b/www/apps/api-reference/specs/store/paths/store_payment-collections_{id}_payment-sessions.yaml @@ -43,6 +43,17 @@ post: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: >- @@ -61,6 +72,17 @@ post: prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. requestBody: content: application/json: diff --git a/www/apps/api-reference/specs/store/paths/store_payment-providers.yaml b/www/apps/api-reference/specs/store/paths/store_payment-providers.yaml index ec8f7bf901..34b0f28f3c 100644 --- a/www/apps/api-reference/specs/store/paths/store_payment-providers.yaml +++ b/www/apps/api-reference/specs/store/paths/store_payment-providers.yaml @@ -18,6 +18,17 @@ get: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: >- @@ -87,6 +98,17 @@ get: type: boolean title: with_deleted description: Whether to include deleted records in the result. + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: JavaScript label: JS SDK diff --git a/www/apps/api-reference/specs/store/paths/store_product-categories.yaml b/www/apps/api-reference/specs/store/paths/store_product-categories.yaml index 9975bdd954..35ea036f35 100644 --- a/www/apps/api-reference/specs/store/paths/store_product-categories.yaml +++ b/www/apps/api-reference/specs/store/paths/store_product-categories.yaml @@ -19,6 +19,17 @@ get: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: >- @@ -760,6 +771,17 @@ get: type: boolean title: with_deleted description: Whether to include deleted records in the result. + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: JavaScript label: JS SDK diff --git a/www/apps/api-reference/specs/store/paths/store_product-categories_{id}.yaml b/www/apps/api-reference/specs/store/paths/store_product-categories_{id}.yaml index e58f2f308f..fb1cc2c630 100644 --- a/www/apps/api-reference/specs/store/paths/store_product-categories_{id}.yaml +++ b/www/apps/api-reference/specs/store/paths/store_product-categories_{id}.yaml @@ -24,6 +24,17 @@ get: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: >- @@ -82,6 +93,17 @@ get: `*category_children` to retreieve the fields of all child categories, or select specific fields to make the response size smaller. For example, `fields=category_children.id,category_children.name`. + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: JavaScript label: JS SDK diff --git a/www/apps/api-reference/specs/store/paths/store_product-tags.yaml b/www/apps/api-reference/specs/store/paths/store_product-tags.yaml index 4cbfef7159..7c622614a3 100644 --- a/www/apps/api-reference/specs/store/paths/store_product-tags.yaml +++ b/www/apps/api-reference/specs/store/paths/store_product-tags.yaml @@ -14,6 +14,17 @@ get: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: >- @@ -679,6 +690,17 @@ get: type: boolean title: with_deleted description: Whether to include deleted records in the result. + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: Shell label: cURL diff --git a/www/apps/api-reference/specs/store/paths/store_product-tags_{id}.yaml b/www/apps/api-reference/specs/store/paths/store_product-tags_{id}.yaml index e00f236211..d1b8d6d71f 100644 --- a/www/apps/api-reference/specs/store/paths/store_product-tags_{id}.yaml +++ b/www/apps/api-reference/specs/store/paths/store_product-tags_{id}.yaml @@ -20,6 +20,17 @@ get: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: >- @@ -40,6 +51,17 @@ get: prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: Shell label: cURL diff --git a/www/apps/api-reference/specs/store/paths/store_product-types.yaml b/www/apps/api-reference/specs/store/paths/store_product-types.yaml index 577a6bd697..4d3d032247 100644 --- a/www/apps/api-reference/specs/store/paths/store_product-types.yaml +++ b/www/apps/api-reference/specs/store/paths/store_product-types.yaml @@ -14,6 +14,17 @@ get: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: |- @@ -676,6 +687,17 @@ get: type: boolean title: with_deleted description: Whether to include deleted records in the result. + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: Shell label: cURL diff --git a/www/apps/api-reference/specs/store/paths/store_product-types_{id}.yaml b/www/apps/api-reference/specs/store/paths/store_product-types_{id}.yaml index 40fb82c0cf..06c72d1c78 100644 --- a/www/apps/api-reference/specs/store/paths/store_product-types_{id}.yaml +++ b/www/apps/api-reference/specs/store/paths/store_product-types_{id}.yaml @@ -20,6 +20,17 @@ get: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: |- @@ -37,6 +48,17 @@ get: prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: Shell label: cURL diff --git a/www/apps/api-reference/specs/store/paths/store_products.yaml b/www/apps/api-reference/specs/store/paths/store_products.yaml index 8dfe1dbe1d..9f159d5d79 100644 --- a/www/apps/api-reference/specs/store/paths/store_products.yaml +++ b/www/apps/api-reference/specs/store/paths/store_products.yaml @@ -1,9 +1,22 @@ get: operationId: GetProducts summary: List Products - description: >- + description: > Retrieve a list of products. The products can be filtered by fields such as `id`. The products can also be sorted or paginated. + + + You can retrieve the content of the products translated to a specific locale + either by passing the `locale` query parameter or by setting the + `Content-Language` header to the desired locale code in BCP 47 format. If + you don't pass a locale, and your store has a default locale, the default + locale will be used. + + + With localization, the products' content like title and description will be + in the specified locale if a translation is available, and fallback to the + original content otherwise. Learn more in the [Localization](#localization) + section. x-authenticated: false externalDocs: url: https://docs.medusajs.com/resources/storefront-development/products/price @@ -17,6 +30,17 @@ get: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: >- @@ -840,6 +864,17 @@ get: type: string title: cart_id description: The product's cart id. + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: JavaScript label: JS SDK diff --git a/www/apps/api-reference/specs/store/paths/store_products_{id}.yaml b/www/apps/api-reference/specs/store/paths/store_products_{id}.yaml index 9bf83afeb5..1957f16c3c 100644 --- a/www/apps/api-reference/specs/store/paths/store_products_{id}.yaml +++ b/www/apps/api-reference/specs/store/paths/store_products_{id}.yaml @@ -1,9 +1,22 @@ get: operationId: GetProductsId summary: Get a Product - description: >- + description: > Retrieve a product by its ID. You can expand the product's relations or select the fields that should be returned. + + + You can retrieve the content of the product translated to a specific locale + either by passing the `locale` query parameter or by setting the + `Content-Language` header to the desired locale code in BCP 47 format. If + you don't pass a locale, and your store has a default locale, the default + locale will be used. + + + With localization, the product's content like title and description will be + in the specified locale if a translation is available, and fallback to the + original content otherwise. Learn more in the [Localization](#localization) + section. x-authenticated: false externalDocs: url: https://docs.medusajs.com/resources/storefront-development/products/price @@ -23,6 +36,17 @@ get: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: >- @@ -101,6 +125,17 @@ get: The ID of the customer's cart. If set, the cart's region and shipping address's country code and province are used instead of the `region_id`, `country_code`, and `province` properties. + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: JavaScript label: JS SDK diff --git a/www/apps/api-reference/specs/store/paths/store_regions.yaml b/www/apps/api-reference/specs/store/paths/store_regions.yaml index a50953bea3..68b13114ec 100644 --- a/www/apps/api-reference/specs/store/paths/store_regions.yaml +++ b/www/apps/api-reference/specs/store/paths/store_regions.yaml @@ -17,6 +17,17 @@ get: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: >- @@ -156,6 +167,17 @@ get: type: boolean title: with_deleted description: Whether to include deleted records in the result. + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: JavaScript label: JS SDK diff --git a/www/apps/api-reference/specs/store/paths/store_regions_{id}.yaml b/www/apps/api-reference/specs/store/paths/store_regions_{id}.yaml index 00cf426dc6..32fa2e8dcb 100644 --- a/www/apps/api-reference/specs/store/paths/store_regions_{id}.yaml +++ b/www/apps/api-reference/specs/store/paths/store_regions_{id}.yaml @@ -20,6 +20,17 @@ get: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: >- @@ -38,6 +49,17 @@ get: prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: JavaScript label: JS SDK diff --git a/www/apps/api-reference/specs/store/paths/store_return-reasons.yaml b/www/apps/api-reference/specs/store/paths/store_return-reasons.yaml index 76311e5dc0..93439b413e 100644 --- a/www/apps/api-reference/specs/store/paths/store_return-reasons.yaml +++ b/www/apps/api-reference/specs/store/paths/store_return-reasons.yaml @@ -14,6 +14,17 @@ get: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: >- @@ -73,6 +84,17 @@ get: type: boolean title: with_deleted description: Whether to include deleted records in the result. + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: Shell label: cURL diff --git a/www/apps/api-reference/specs/store/paths/store_return-reasons_{id}.yaml b/www/apps/api-reference/specs/store/paths/store_return-reasons_{id}.yaml index 7147b284e8..13b565c5a6 100644 --- a/www/apps/api-reference/specs/store/paths/store_return-reasons_{id}.yaml +++ b/www/apps/api-reference/specs/store/paths/store_return-reasons_{id}.yaml @@ -20,6 +20,17 @@ get: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: >- @@ -38,6 +49,17 @@ get: prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: Shell label: cURL diff --git a/www/apps/api-reference/specs/store/paths/store_returns.yaml b/www/apps/api-reference/specs/store/paths/store_returns.yaml index 8f37d060d9..7aefcc7c15 100644 --- a/www/apps/api-reference/specs/store/paths/store_returns.yaml +++ b/www/apps/api-reference/specs/store/paths/store_returns.yaml @@ -14,6 +14,28 @@ post: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. requestBody: content: application/json: diff --git a/www/apps/api-reference/specs/store/paths/store_shipping-options.yaml b/www/apps/api-reference/specs/store/paths/store_shipping-options.yaml index 7fdff06a7f..29c0fd11b1 100644 --- a/www/apps/api-reference/specs/store/paths/store_shipping-options.yaml +++ b/www/apps/api-reference/specs/store/paths/store_shipping-options.yaml @@ -21,6 +21,17 @@ get: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: >- @@ -116,6 +127,17 @@ get: type: boolean title: is_return description: Whether the shipping option can be used for returns. + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. x-codeSamples: - lang: JavaScript label: JS SDK diff --git a/www/apps/api-reference/specs/store/paths/store_shipping-options_{id}_calculate.yaml b/www/apps/api-reference/specs/store/paths/store_shipping-options_{id}_calculate.yaml index 082b7bf319..0bf296d52c 100644 --- a/www/apps/api-reference/specs/store/paths/store_shipping-options_{id}_calculate.yaml +++ b/www/apps/api-reference/specs/store/paths/store_shipping-options_{id}_calculate.yaml @@ -18,6 +18,17 @@ post: type: string externalDocs: url: https://docs.medusajs.com/api/store#publishable-api-key + - name: Content-Language + in: header + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. - name: fields in: query description: >- @@ -38,6 +49,17 @@ post: prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + - name: locale + in: query + description: The locale in BCP 47 format to retrieve localized content. + required: false + schema: + type: string + example: en-US + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/translation/storefront + description: Learn more in the Serve Translations in Storefront guide. requestBody: content: application/json: diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_price-lists_[id]_prices.ts b/www/utils/generated/oas-output/operations/admin/get_admin_price-lists_[id]_prices.ts new file mode 100644 index 0000000000..530bbaf0b8 --- /dev/null +++ b/www/utils/generated/oas-output/operations/admin/get_admin_price-lists_[id]_prices.ts @@ -0,0 +1,78 @@ +/** + * @oas [get] /admin/price-lists/{id}/prices + * operationId: GetPriceListsIdPrices + * summary: List Prices in a Price List + * x-sidebar-summary: List Prices + * description: Retrieve a list of prices in a price list. The prices can also be paginated. + * x-authenticated: true + * parameters: + * - name: id + * in: path + * description: The ID of the price list to retrieve prices from. + * required: true + * schema: + * type: string + * - name: fields + * in: query + * description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default + * fields. Without prefix it will replace the entire default fields. + * required: false + * schema: + * type: string + * title: fields + * description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default + * fields. Without prefix it will replace the entire default fields. + * externalDocs: + * url: "#select-fields-and-relations" + * security: + * - api_token: [] + * - 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.priceList.prices("plist_123") + * .then(({ prices }) => { + * console.log(prices) + * }) + * - lang: Shell + * label: cURL + * source: |- + * curl '{backend_url}/admin/price-lists/{id}/prices' \ + * -H 'Authorization: Bearer {access_token}' + * tags: + * - Price Lists + * responses: + * "200": + * description: OK + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/AdminPriceListPriceListResponse" + * "400": + * $ref: "#/components/responses/400_error" + * "401": + * $ref: "#/components/responses/unauthorized" + * "404": + * $ref: "#/components/responses/not_found_error" + * "409": + * $ref: "#/components/responses/invalid_state_error" + * "422": + * $ref: "#/components/responses/invalid_request_error" + * "500": + * $ref: "#/components/responses/500_error" + * x-since: 2.12.3 + * +*/ + diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_translations.ts b/www/utils/generated/oas-output/operations/admin/get_admin_translations.ts index 2cdfc1c3c7..2e8e3f2ea0 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_translations.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_translations.ts @@ -128,6 +128,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.translation.list() + * .then(({ translations, count, limit, offset }) => { + * console.log(translations) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_translations_settings.ts b/www/utils/generated/oas-output/operations/admin/get_admin_translations_settings.ts index 38aee870cb..511eab4b5c 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_translations_settings.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_translations_settings.ts @@ -5,12 +5,40 @@ * x-sidebar-summary: List Settings * description: Retrieve the list of translatable fields for all entities, such as products and collections. * x-authenticated: true - * parameters: [] + * parameters: + * - name: entity_type + * in: query + * description: The entity to retrieve translation settings for. + * required: false + * schema: + * type: string + * title: entity_type + * description: The entity to retrieve translation settings for. + * example: product * security: * - api_token: [] * - 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.translation.settings({ + * entity_type: "product" + * }) + * .then(({ translatable_fields }) => { + * console.log(translatable_fields) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_translations_statistics.ts b/www/utils/generated/oas-output/operations/admin/get_admin_translations_statistics.ts index 1e76063e00..74bcea39f6 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_translations_statistics.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_translations_statistics.ts @@ -3,8 +3,7 @@ * operationId: GetTranslationsStatistics * summary: Retrieve Translation Statistics * x-sidebar-summary: Get Statistics - * description: Get statistics on translations for specified locales and entity types. This includes overall - * translation progress for each entity type, and statistics for each locale within those entity types. + * description: Get statistics on translations for specified locales and entity types. This includes overall translation progress for each entity type, and statistics for each locale within those entity types. * x-authenticated: true * parameters: * - name: locales @@ -18,7 +17,7 @@ * type: string * title: locales * description: A locale code in [BCP 47](https://gist.github.com/typpo/b2b828a35e683b9bf8db91b5404f1bd1) format. - * example: "fr-FR" + * example: fr-FR * - name: entity_types * in: query * description: The table names of entities to retrieve translation statistics for. @@ -36,6 +35,25 @@ * - 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.translation.statistics({ + * entity_type: "product" + * }) + * .then(({ statistics }) => { + * console.log(statistics) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_orders_export.ts b/www/utils/generated/oas-output/operations/admin/post_admin_orders_export.ts new file mode 100644 index 0000000000..db0ac7004d --- /dev/null +++ b/www/utils/generated/oas-output/operations/admin/post_admin_orders_export.ts @@ -0,0 +1,479 @@ +/** + * @oas [post] /admin/orders/export + * operationId: PostOrdersExport + * summary: Export Orders + * description: > + * Start an order export process to retrieve a CSV of exported orders. + * + * + * You'll receive in the response the transaction ID of the workflow generating the CSV file. To check the status of the execution, send a GET request to `/admin/workflows-executions/export-orders/:transaction-id`. + * + * + * Once the execution finishes successfully, a notification is created for the export. You can retrieve the notifications using the `/admin/notification` API route to retrieve the file's download URL. + * x-authenticated: true + * parameters: + * - name: id + * in: query + * required: false + * schema: + * oneOf: + * - type: string + * title: id + * description: The ID of the order to export. + * - type: array + * description: The IDs of the orders to export. + * items: + * type: string + * title: id + * description: An order ID. + * - name: sales_channel_id + * in: query + * description: The IDs of the sales channels to export their orders. + * required: false + * schema: + * type: array + * description: The IDs of the sales channels to export their orders. + * items: + * type: string + * title: sales_channel_id + * description: A sales channel ID. + * - name: region_id + * in: query + * required: false + * schema: + * oneOf: + * - type: string + * title: region_id + * description: The ID of a region to export orders in it. + * - type: array + * description: The IDs of regions to export their orders. + * items: + * type: string + * title: region_id + * description: A region ID. + * - name: customer_id + * in: query + * required: false + * schema: + * oneOf: + * - type: string + * title: customer_id + * description: The ID of a customer to export their orders. + * - type: array + * description: The IDs of customers to export their orders. + * items: + * type: string + * title: customer_id + * description: A customer ID. + * - name: q + * in: query + * description: A search query to filter exported orders by. + * required: false + * schema: + * type: string + * title: q + * description: A search query to filter exported orders by. + * - name: created_at + * in: query + * description: Filter by an order's creation date. + * required: false + * schema: + * type: object + * description: Filter by an order's creation date. + * properties: + * $and: + * type: array + * description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters. + * items: + * type: object + * title: $and + * $or: + * type: array + * description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters. + * items: + * type: object + * title: $or + * $eq: + * oneOf: + * - type: string + * title: $eq + * description: Filter by an exact match. + * - type: array + * description: Filter by an exact match. + * items: + * type: string + * title: $eq + * description: Filter by an exact match. + * $ne: + * type: string + * title: $ne + * description: Filter by values not equal to this parameter. + * $in: + * type: array + * description: Filter by values in this array. + * items: + * type: string + * title: $in + * description: Filter by values in this array. + * $nin: + * type: array + * description: Filter by values not in this array. + * items: + * type: string + * title: $nin + * description: Filter by values not in this array. + * $not: + * oneOf: + * - type: string + * title: $not + * description: Filter by values not matching the conditions in this parameter. + * - type: object + * description: Filter by values not matching the conditions in this parameter. + * - type: array + * description: Filter by values not matching the conditions in this parameter. + * items: + * type: string + * title: $not + * description: Filter by values not matching the conditions in this parameter. + * $gt: + * type: string + * title: $gt + * description: Filter by values greater than this parameter. Useful for numbers and dates only. + * $gte: + * type: string + * title: $gte + * description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only. + * $lt: + * type: string + * title: $lt + * description: Filter by values less than this parameter. Useful for numbers and dates only. + * $lte: + * type: string + * title: $lte + * description: Filter by values less than or equal to this parameter. Useful for numbers and dates only. + * $like: + * type: string + * title: $like + * description: Apply a `like` filter. Useful for strings only. + * $re: + * type: string + * title: $re + * description: Apply a regex filter. Useful for strings only. + * $ilike: + * type: string + * title: $ilike + * description: Apply a case-insensitive `like` filter. Useful for strings only. + * $fulltext: + * type: string + * title: $fulltext + * description: Filter to apply on full-text properties. + * $overlap: + * type: array + * description: Filter arrays that have overlapping values with this parameter. + * items: + * type: string + * title: $overlap + * description: Filter arrays that have overlapping values with this parameter. + * $contains: + * type: array + * description: Filter arrays that contain some of the values of this parameter. + * items: + * type: string + * title: $contains + * description: Filter arrays that contain some of the values of this parameter. + * $contained: + * type: array + * description: Filter arrays that contain all values of this parameter. + * items: + * type: string + * title: $contained + * description: Filter arrays that contain all values of this parameter. + * $exists: + * type: boolean + * title: $exists + * description: Filter by whether a value for this parameter exists (not `null`). + * - name: updated_at + * in: query + * description: Filter by an order's update date. + * required: false + * schema: + * type: object + * description: Filter by an order's update date. + * properties: + * $and: + * type: array + * description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters. + * items: + * type: object + * title: $and + * $or: + * type: array + * description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters. + * items: + * type: object + * title: $or + * $eq: + * oneOf: + * - type: string + * title: $eq + * description: Filter by an exact match. + * - type: array + * description: Filter by an exact match. + * items: + * type: string + * title: $eq + * description: Filter by an exact match. + * $ne: + * type: string + * title: $ne + * description: Filter by values not equal to this parameter. + * $in: + * type: array + * description: Filter by values in this array. + * items: + * type: string + * title: $in + * description: Filter by values in this array. + * $nin: + * type: array + * description: Filter by values not in this array. + * items: + * type: string + * title: $nin + * description: Filter by values not in this array. + * $not: + * oneOf: + * - type: string + * title: $not + * description: Filter by values not matching the conditions in this parameter. + * - type: object + * description: Filter by values not matching the conditions in this parameter. + * - type: array + * description: Filter by values not matching the conditions in this parameter. + * items: + * type: string + * title: $not + * description: Filter by values not matching the conditions in this parameter. + * $gt: + * type: string + * title: $gt + * description: Filter by values greater than this parameter. Useful for numbers and dates only. + * $gte: + * type: string + * title: $gte + * description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only. + * $lt: + * type: string + * title: $lt + * description: Filter by values less than this parameter. Useful for numbers and dates only. + * $lte: + * type: string + * title: $lte + * description: Filter by values less than or equal to this parameter. Useful for numbers and dates only. + * $like: + * type: string + * title: $like + * description: Apply a `like` filter. Useful for strings only. + * $re: + * type: string + * title: $re + * description: Apply a regex filter. Useful for strings only. + * $ilike: + * type: string + * title: $ilike + * description: Apply a case-insensitive `like` filter. Useful for strings only. + * $fulltext: + * type: string + * title: $fulltext + * description: Filter to apply on full-text properties. + * $overlap: + * type: array + * description: Filter arrays that have overlapping values with this parameter. + * items: + * type: string + * title: $overlap + * description: Filter arrays that have overlapping values with this parameter. + * $contains: + * type: array + * description: Filter arrays that contain some of the values of this parameter. + * items: + * type: string + * title: $contains + * description: Filter arrays that contain some of the values of this parameter. + * $contained: + * type: array + * description: Filter arrays that contain all values of this parameter. + * items: + * type: string + * title: $contained + * description: Filter arrays that contain all values of this parameter. + * $exists: + * type: boolean + * title: $exists + * description: Filter by whether a value for this parameter exists (not `null`). + * - name: limit + * in: query + * description: Limit the number of items returned in the list. + * required: false + * schema: + * type: number + * title: limit + * description: Limit the number of items returned in the list. + * externalDocs: + * url: "#pagination" + * - name: offset + * in: query + * description: The number of items to skip when retrieving a list. + * required: false + * schema: + * type: number + * title: offset + * description: The number of items to skip when retrieving a list. + * externalDocs: + * url: "#pagination" + * - name: order + * in: query + * description: The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with `-`. + * required: false + * schema: + * type: string + * title: order + * description: The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with `-`. + * externalDocs: + * url: "#pagination" + * - name: with_deleted + * in: query + * description: Whether to include deleted orders in the export. + * required: false + * schema: + * type: boolean + * title: with_deleted + * description: Whether to include deleted orders in the export. + * - name: fields + * in: query + * description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default + * fields. Without prefix it will replace the entire default fields. + * required: false + * schema: + * type: string + * title: fields + * description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default + * fields. Without prefix it will replace the entire default fields. + * externalDocs: + * url: "#select-fields-and-relations" + * - name: status + * in: query + * required: false + * schema: + * oneOf: + * - type: string + * title: status + * description: The status of the orders to export. + * enum: + * - canceled + * - completed + * - pending + * - draft + * - archived + * - requires_action + * - type: array + * description: The statuses of the orders to export. + * items: + * type: string + * description: The order status. + * enum: + * - canceled + * - completed + * - pending + * - draft + * - archived + * - requires_action + * - type: object + * description: The order's status. + * properties: + * $and: + * type: array + * description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters. + * items: + * type: object + * title: $and + * $or: + * type: array + * description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters. + * items: + * type: object + * title: $or + * - name: $and + * in: query + * description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters. + * required: false + * schema: + * type: array + * description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters. + * items: + * type: object + * title: $and + * - name: $or + * in: query + * description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters. + * required: false + * schema: + * type: array + * description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters. + * items: + * type: object + * title: $or + * security: + * - api_token: [] + * - 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.export() + * .then(({ transaction_id }) => { + * console.log(transaction_id) + * }) + * - lang: Shell + * label: cURL + * source: |- + * curl -X POST '{backend_url}/admin/orders/export' \ + * -H 'Authorization: Bearer {access_token}' + * tags: + * - Orders + * responses: + * "202": + * description: OK + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/AdminExportOrderResponse" + * "400": + * $ref: "#/components/responses/400_error" + * "401": + * $ref: "#/components/responses/unauthorized" + * "404": + * $ref: "#/components/responses/not_found_error" + * "409": + * $ref: "#/components/responses/invalid_state_error" + * "422": + * $ref: "#/components/responses/invalid_request_error" + * "500": + * $ref: "#/components/responses/500_error" + * x-workflow: exportOrdersWorkflow + * x-events: [] + * x-since: 2.12.3 + * +*/ + diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_translations_batch.ts b/www/utils/generated/oas-output/operations/admin/post_admin_translations_batch.ts index d835a383d7..667dfa4c46 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_translations_batch.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_translations_batch.ts @@ -91,6 +91,40 @@ * title: delete * description: The ID of a translation to delete. * 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.translation.batch({ + * create: [ + * { + * reference_id: "prod_123", + * reference: "product", + * locale_code: "en-US", + * translations: { title: "Shirt" } + * } + * ], + * update: [ + * { + * id: "trans_123", + * translations: { title: "Pants" } + * } + * ], + * delete: ["trans_321"] + * }) + * .then(({ created, updated, deleted }) => { + * console.log(created, updated, deleted) + * }) + * ``` * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/schemas/AdminCollection.ts b/www/utils/generated/oas-output/schemas/AdminCollection.ts index b5a2569ce5..b924185a3b 100644 --- a/www/utils/generated/oas-output/schemas/AdminCollection.ts +++ b/www/utils/generated/oas-output/schemas/AdminCollection.ts @@ -50,6 +50,11 @@ * externalDocs: * url: https://docs.medusajs.com/api/admin#manage-metadata * description: Learn how to manage metadata + * translations: + * type: array + * description: The collection's translations. + * items: + * $ref: "#/components/schemas/AdminTranslation" * */ diff --git a/www/utils/generated/oas-output/schemas/AdminExportOrderResponse.ts b/www/utils/generated/oas-output/schemas/AdminExportOrderResponse.ts new file mode 100644 index 0000000000..26cec1cc7f --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminExportOrderResponse.ts @@ -0,0 +1,15 @@ +/** + * @schema AdminExportOrderResponse + * type: object + * description: The details of the order export. + * x-schemaName: AdminExportOrderResponse + * required: + * - transaction_id + * properties: + * transaction_id: + * type: string + * title: transaction_id + * description: The ID of the workflow execution's transaction. Use it to check the status of the export by sending a GET request to `/admin/workflows-executions/export-orders/:transaction-id` + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminPriceListPriceListResponse.ts b/www/utils/generated/oas-output/schemas/AdminPriceListPriceListResponse.ts new file mode 100644 index 0000000000..68ff6c8f7d --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminPriceListPriceListResponse.ts @@ -0,0 +1,36 @@ +/** + * @schema AdminPriceListPriceListResponse + * type: object + * description: The list of prices. + * x-schemaName: AdminPriceListPriceListResponse + * required: + * - limit + * - offset + * - count + * - prices + * properties: + * limit: + * type: number + * title: limit + * description: The maximum number of prices returned. + * offset: + * type: number + * title: offset + * description: The number of items skipped before retrieving the prices. + * count: + * type: number + * title: count + * description: The total number of prices. + * estimate_count: + * type: number + * title: estimate_count + * description: The estimated count retrieved from the PostgreSQL query planner, which may be inaccurate. + * x-featureFlag: index_engine + * prices: + * type: array + * description: The list of prices. + * items: + * $ref: "#/components/schemas/AdminPrice" + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminProduct.ts b/www/utils/generated/oas-output/schemas/AdminProduct.ts index d1c4ae519a..26975afb06 100644 --- a/www/utils/generated/oas-output/schemas/AdminProduct.ts +++ b/www/utils/generated/oas-output/schemas/AdminProduct.ts @@ -173,6 +173,11 @@ * description: The date the product was deleted. * shipping_profile: * $ref: "#/components/schemas/AdminShippingProfile" + * translations: + * type: array + * description: The product's translations. + * items: + * $ref: "#/components/schemas/AdminTranslation" * */ diff --git a/www/utils/generated/oas-output/schemas/AdminProductTag.ts b/www/utils/generated/oas-output/schemas/AdminProductTag.ts index 33ed3bf2d3..05d552feff 100644 --- a/www/utils/generated/oas-output/schemas/AdminProductTag.ts +++ b/www/utils/generated/oas-output/schemas/AdminProductTag.ts @@ -38,6 +38,11 @@ * externalDocs: * url: https://docs.medusajs.com/api/admin#manage-metadata * description: Learn how to manage metadata + * translations: + * type: array + * description: The tag's translations. + * items: + * $ref: "#/components/schemas/AdminTranslation" * */ diff --git a/www/utils/generated/oas-output/schemas/AdminProductType.ts b/www/utils/generated/oas-output/schemas/AdminProductType.ts index e72e7bd9e2..142455a353 100644 --- a/www/utils/generated/oas-output/schemas/AdminProductType.ts +++ b/www/utils/generated/oas-output/schemas/AdminProductType.ts @@ -38,6 +38,11 @@ * externalDocs: * url: https://docs.medusajs.com/api/admin#manage-metadata * description: Learn how to manage metadata + * translations: + * type: array + * description: The type's translations. + * items: + * $ref: "#/components/schemas/AdminTranslation" * */ diff --git a/www/utils/generated/oas-output/schemas/AdminProductVariant.ts b/www/utils/generated/oas-output/schemas/AdminProductVariant.ts index 9b3d0c1fa8..dffa0e43d6 100644 --- a/www/utils/generated/oas-output/schemas/AdminProductVariant.ts +++ b/www/utils/generated/oas-output/schemas/AdminProductVariant.ts @@ -153,6 +153,11 @@ * type: string * title: thumbnail * description: The variant's thumbnail. + * translations: + * type: array + * description: The variant's translations. + * items: + * $ref: "#/components/schemas/AdminTranslation" * */ diff --git a/www/utils/generated/oas-output/schemas/AdminTranslationSettingsResponse.ts b/www/utils/generated/oas-output/schemas/AdminTranslationSettingsResponse.ts index 90f621d579..40ee30c058 100644 --- a/www/utils/generated/oas-output/schemas/AdminTranslationSettingsResponse.ts +++ b/www/utils/generated/oas-output/schemas/AdminTranslationSettingsResponse.ts @@ -10,7 +10,9 @@ * type: object * description: Key-value pairs of translatable fields for different entities. Each key is an entity type, and the value is an array of fields that can be translated for that entity. * example: - * product: ["title", "description"] + * product: + * - title + * - description * */ diff --git a/www/utils/generated/oas-output/schemas/AdminTranslationStatisticsResponse.ts b/www/utils/generated/oas-output/schemas/AdminTranslationStatisticsResponse.ts index d26efcd066..e15a8084ff 100644 --- a/www/utils/generated/oas-output/schemas/AdminTranslationStatisticsResponse.ts +++ b/www/utils/generated/oas-output/schemas/AdminTranslationStatisticsResponse.ts @@ -29,8 +29,7 @@ * properties: * by_locale: * type: object - * description: The translation statistics of an entity type broken down by locale. The key is the locale code in BCP 47 format, and - * the value is an object containing the statistics for that locale. + * description: The translation statistics of an entity type broken down by locale. The key is the locale code in BCP 47 format, and the value is an object containing the statistics for that locale. * example: * fr-FR: * expected: 150 diff --git a/www/utils/generated/route-examples-output/route-examples.json b/www/utils/generated/route-examples-output/route-examples.json index a07136621d..bf1de2d14a 100644 --- a/www/utils/generated/route-examples-output/route-examples.json +++ b/www/utils/generated/route-examples-output/route-examples.json @@ -414,7 +414,7 @@ "js-sdk": "sdk.admin.order.updateOrderChange(\n \"ordch_123\",\n {\n carry_over_promotions: true\n }\n)\n.then(({ order_change }) => {\n console.log(order_change)\n})" }, "POST /admin/orders/export": { - "js-sdk": "sdk.admin.order.export({})\n.then(({ transaction_id }) => {\n console.log(transaction_id)\n})" + "js-sdk": "sdk.admin.order.export()\n.then(({ transaction_id }) => {\n console.log(transaction_id)\n})" }, "POST /admin/order-edits": { "js-sdk": "sdk.admin.orderEdit.initiateRequest({\n order_id: \"order_123\"\n})\n.then(({ order_change }) => {\n console.log(order_change)\n})" @@ -971,6 +971,18 @@ "GET /admin/locales/{code}": { "js-sdk": "sdk.admin.locale.retrieve(\"en-US\")\n.then(({ locale }) => {\n console.log(locale)\n})" }, + "GET /admin/translations": { + "js-sdk": "sdk.admin.translation.list()\n.then(({ translations, count, limit, offset }) => {\n console.log(translations)\n})" + }, + "POST /admin/translations/batch": { + "js-sdk": "sdk.admin.translation.batch({\n create: [\n {\n reference_id: \"prod_123\",\n reference: \"product\",\n locale_code: \"en-US\",\n translations: { title: \"Shirt\" }\n }\n ],\n update: [\n {\n id: \"trans_123\",\n translations: { title: \"Pants\" }\n }\n ],\n delete: [\"trans_321\"]\n})\n.then(({ created, updated, deleted }) => {\n console.log(created, updated, deleted)\n})\n```" + }, + "GET /admin/translations/settings": { + "js-sdk": "sdk.admin.translation.settings({\n entity_type: \"product\"\n})\n.then(({ translatable_fields }) => {\n console.log(translatable_fields)\n})" + }, + "GET /admin/translations/statistics": { + "js-sdk": "sdk.admin.translation.statistics({\n entity_type: \"product\"\n})\n.then(({ statistics }) => {\n console.log(statistics)\n})" + }, "POST /auth/{actor}/{method}/register": { "js-sdk": "await sdk.auth.register(\n \"customer\",\n \"emailpass\",\n {\n email: \"customer@gmail.com\",\n password: \"supersecret\"\n }\n)\n\n// all subsequent requests will use the token in the header\nconst { customer } = await sdk.store.customer.create({\n email: \"customer@gmail.com\",\n password: \"supersecret\"\n})" },