chore: generate and update OAS for translations (#14281)

* chore: generate and update OAS for translations

* support localization header

* add locale to all store routes

* fixes

* small fix
This commit is contained in:
Shahed Nasser
2025-12-16 15:52:33 +02:00
committed by GitHub
parent 6815b3d7db
commit 53cdbaa069
75 changed files with 2322 additions and 6 deletions

View File

@@ -735,5 +735,44 @@
"refundPaymentWorkflow"
],
"deprecated": false
},
{
"name": "translation.created",
"parentName": "TranslationWorkflowEvents",
"propertyName": "CREATED",
"payload": "```ts\n{\n id, // The ID of the translation\n}\n```",
"description": "Emitted when translations are created.",
"workflows": [
"createTranslationsWorkflow",
"batchTranslationsWorkflow"
],
"since": "2.12.3",
"deprecated": false
},
{
"name": "translation.updated",
"parentName": "TranslationWorkflowEvents",
"propertyName": "UPDATED",
"payload": "```ts\n{\n id, // The ID of the translation\n}\n```",
"description": "Emitted when translations are updated.",
"workflows": [
"updateTranslationsWorkflow",
"batchTranslationsWorkflow"
],
"since": "2.12.3",
"deprecated": false
},
{
"name": "translation.deleted",
"parentName": "TranslationWorkflowEvents",
"propertyName": "DELETED",
"payload": "```ts\n{\n id, // The ID of the translation\n}\n```",
"description": "Emitted when translations are deleted.",
"workflows": [
"deleteTranslationsWorkflow",
"batchTranslationsWorkflow"
],
"since": "2.12.3",
"deprecated": false
}
]

View File

@@ -209,6 +209,18 @@ 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
@@ -221,8 +233,8 @@ tags:
- name: Order Changes
description: >
An order change is a proposed change to an order, such as adding or
removing items, changing shipping methods, and more. They can be associated
with order edits, claims, or exchanges.
removing items, changing shipping methods, and more. They can be
associated with order edits, claims, or exchanges.
These API routes allow admin users to manage order changes.
externalDocs:
@@ -642,6 +654,18 @@ tags:
</Note>
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

View File

@@ -81,6 +81,18 @@ tags:
</Note>
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.
@@ -192,8 +204,9 @@ tags:
- name: Store Credit Accounts
x-associatedSchema:
description: >
A store credit account is a way for customers to manage their store credit balance.
Customers can use their store credit to pay for orders, and view their store credit balance.
A store credit account is a way for customers to manage their store
credit balance. Customers can use their store credit to pay for orders,
and view their store credit balance.
These API routes allow customers to view their store credit accounts.

View File

@@ -0,0 +1,152 @@
/**
* @oas [get] /admin/locales
* 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
*
*/

View File

@@ -0,0 +1,80 @@
/**
* @oas [get] /admin/locales/{code}
* 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
*
*/

View File

@@ -0,0 +1,195 @@
/**
* @oas [get] /admin/translations
* 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: 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
*
*/

View File

@@ -0,0 +1,44 @@
/**
* @oas [get] /admin/translations/settings
* 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: []
* security:
* - api_token: []
* - cookie_auth: []
* - jwt_token: []
* x-codeSamples:
* - 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
*
*/

View File

@@ -0,0 +1,69 @@
/**
* @oas [get] /admin/translations/statistics
* 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: 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
*
*/

View File

@@ -0,0 +1,170 @@
/**
* @oas [post] /admin/translations/batch
* 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: 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
*
*/

View File

@@ -29,6 +29,16 @@
* 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
@@ -41,6 +51,16 @@
* 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

View File

@@ -22,6 +22,16 @@
* 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
@@ -34,6 +44,16 @@
* 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

View File

@@ -23,6 +23,16 @@
* 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
@@ -37,6 +47,16 @@
* 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: []

View File

@@ -19,6 +19,16 @@
* 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
@@ -31,6 +41,16 @@
* 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

View File

@@ -16,6 +16,16 @@
* 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
@@ -596,6 +606,16 @@
* 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

View File

@@ -22,6 +22,16 @@
* 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
@@ -34,6 +44,16 @@
* 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

View File

@@ -13,6 +13,16 @@
* 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
@@ -103,6 +113,16 @@
* 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

View File

@@ -19,6 +19,16 @@
* 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
@@ -31,6 +41,16 @@
* 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

View File

@@ -17,6 +17,16 @@
* 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
@@ -31,6 +41,16 @@
* 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: []

View File

@@ -17,6 +17,16 @@
* 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.
@@ -118,6 +128,16 @@
* 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: []

View File

@@ -20,6 +20,16 @@
* 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
@@ -34,6 +44,16 @@
* 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: []

View File

@@ -0,0 +1,91 @@
/**
* @oas [get] /store/locales
* 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
*
*/

View File

@@ -14,6 +14,16 @@
* 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
@@ -129,6 +139,16 @@
* 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

View File

@@ -19,6 +19,16 @@
* 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
@@ -31,6 +41,16 @@
* 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

View File

@@ -16,6 +16,16 @@
* 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
@@ -72,6 +82,16 @@
* 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

View File

@@ -16,6 +16,16 @@
* 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
@@ -644,6 +654,16 @@
* 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

View File

@@ -22,6 +22,16 @@
* 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
@@ -56,6 +66,16 @@
* 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

View File

@@ -13,6 +13,16 @@
* 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: |-
@@ -583,6 +593,16 @@
* 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

View File

@@ -19,6 +19,16 @@
* 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: |-
@@ -33,6 +43,16 @@
* 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

View File

@@ -13,6 +13,16 @@
* 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: |-
@@ -583,6 +593,16 @@
* 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

View File

@@ -19,6 +19,16 @@
* 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: |-
@@ -33,6 +43,16 @@
* 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

View File

@@ -2,7 +2,14 @@
* @oas [get] /store/products
* 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
@@ -16,6 +23,16 @@
* 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
@@ -732,6 +749,16 @@
* 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

View File

@@ -2,7 +2,14 @@
* @oas [get] /store/products/{id}
* 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
@@ -22,6 +29,16 @@
* 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
@@ -73,6 +90,16 @@
* 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

View File

@@ -16,6 +16,16 @@
* 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
@@ -134,6 +144,16 @@
* 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

View File

@@ -19,6 +19,16 @@
* 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
@@ -31,6 +41,16 @@
* 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

View File

@@ -13,6 +13,16 @@
* 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
@@ -61,6 +71,16 @@
* 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

View File

@@ -19,6 +19,16 @@
* 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
@@ -31,6 +41,16 @@
* 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

View File

@@ -19,6 +19,16 @@
* 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
@@ -95,6 +105,16 @@
* 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

View File

@@ -13,6 +13,16 @@
* 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
@@ -25,6 +35,16 @@
* 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:

View File

@@ -21,6 +21,16 @@
* 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
@@ -33,6 +43,16 @@
* 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:

View File

@@ -22,6 +22,16 @@
* 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
@@ -34,6 +44,16 @@
* 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

View File

@@ -23,6 +23,16 @@
* 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 +47,16 @@
* 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: []

View File

@@ -23,6 +23,16 @@
* 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
@@ -35,6 +45,16 @@
* 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:

View File

@@ -29,6 +29,16 @@
* 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
@@ -41,6 +51,16 @@
* 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:

View File

@@ -23,6 +23,16 @@
* 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
@@ -35,6 +45,16 @@
* 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:

View File

@@ -23,6 +23,16 @@
* 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
@@ -35,6 +45,16 @@
* 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:

View File

@@ -20,6 +20,16 @@
* 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
@@ -32,6 +42,16 @@
* 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

View File

@@ -16,6 +16,16 @@
* 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
@@ -29,6 +39,16 @@
* 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:

View File

@@ -16,6 +16,16 @@
* 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
@@ -29,6 +39,16 @@
* 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: []

View File

@@ -17,6 +17,16 @@
* 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
@@ -31,6 +41,16 @@
* 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: []

View File

@@ -23,6 +23,16 @@
* 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
@@ -37,6 +47,16 @@
* 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: []

View File

@@ -22,6 +22,16 @@
* 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 +46,16 @@
* 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:

View File

@@ -20,6 +20,16 @@
* 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: |-
@@ -34,6 +44,16 @@
* 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

View File

@@ -20,6 +20,16 @@
* 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: |-
@@ -34,6 +44,16 @@
* 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:

View File

@@ -21,6 +21,16 @@
* 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: |-
@@ -35,6 +45,16 @@
* 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:

View File

@@ -16,6 +16,16 @@
* 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
@@ -28,6 +38,16 @@
* 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:

View File

@@ -31,6 +31,16 @@
* 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
@@ -43,6 +53,16 @@
* 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:

View File

@@ -13,6 +13,26 @@
* 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:

View File

@@ -19,6 +19,16 @@
* 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: |-
@@ -33,6 +43,16 @@
* 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:

View File

@@ -0,0 +1,39 @@
/**
* @schema 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.
*
*/

View File

@@ -0,0 +1,36 @@
/**
* @schema 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"
*
*/

View File

@@ -0,0 +1,13 @@
/**
* @schema AdminLocaleResponse
* type: object
* description: The locale's details.
* x-schemaName: AdminLocaleResponse
* required:
* - locale
* properties:
* locale:
* $ref: "#/components/schemas/AdminLocale"
*
*/

View File

@@ -7,6 +7,7 @@
* - id
* - name
* - supported_currencies
* - supported_locales
* - default_sales_channel_id
* - default_region_id
* - default_location_id
@@ -55,6 +56,11 @@
* 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"
*
*/

View File

@@ -0,0 +1,46 @@
/**
* @schema 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.
*
*/

View File

@@ -0,0 +1,58 @@
/**
* @schema 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.
*
*/

View File

@@ -0,0 +1,16 @@
/**
* @schema 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"]
*
*/

View File

@@ -0,0 +1,72 @@
/**
* @schema 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.
*
*/

View File

@@ -0,0 +1,47 @@
/**
* @schema 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.
*
*/

View File

@@ -19,6 +19,11 @@
* 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
*
*/

View File

@@ -31,6 +31,11 @@
* 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"
*
*/

View File

@@ -0,0 +1,16 @@
/**
* @schema 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
*
*/

View File

@@ -325,6 +325,11 @@
* 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
*
*/

View File

@@ -0,0 +1,22 @@
/**
* @schema 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)
*
*/

View File

@@ -0,0 +1,16 @@
/**
* @schema 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"
*
*/

View File

@@ -413,6 +413,9 @@
"POST /admin/order-changes/{id}": {
"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})"
},
"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})"
},
@@ -482,6 +485,9 @@
"POST /admin/price-lists/{id}/prices/batch": {
"js-sdk": "sdk.admin.priceList.batchPrices(\"plist_123\", {\n create: [{\n variant_id: \"variant_123\",\n currency_code: \"usd\",\n amount: 10,\n rules: {\n region_id: \"reg_123\"\n }\n }],\n update: [{\n id: \"price_123\",\n variant_id: \"variant_123\",\n amount: 20,\n }],\n delete: [\"price_123\"]\n})\n.then(({ created, updated, deleted }) => {\n console.log(created, updated, deleted)\n})"
},
"GET /admin/price-lists/{id}/prices": {
"js-sdk": "sdk.admin.priceList.prices(\"plist_123\")\n.then(({ prices }) => {\n console.log(prices)\n})"
},
"POST /admin/price-lists/{id}/products": {
"js-sdk": "sdk.admin.priceList.linkProducts(\"plist_123\", {\n remove: [\"prod_123\"]\n})\n.then(({ price_list }) => {\n console.log(price_list)\n})"
},
@@ -959,6 +965,12 @@
"DELETE /admin/shipping-option-types/{id}": {
"js-sdk": "sdk.admin.shippingOptionType.delete(\"sotype_123\")\n.then(({ deleted }) => {\n console.log(deleted)\n})"
},
"GET /admin/locales": {
"js-sdk": "sdk.admin.locale.list()\n.then(({ locales, count, limit, offset }) => {\n console.log(locales)\n})"
},
"GET /admin/locales/{code}": {
"js-sdk": "sdk.admin.locale.retrieve(\"en-US\")\n.then(({ locale }) => {\n console.log(locale)\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})"
},
@@ -1084,5 +1096,8 @@
},
"DELETE /store/customers/me/addresses/{addressid}": {
"js-sdk": "// TODO must be authenticated as the customer to delete their address\nsdk.store.customer.deleteAddress(\"caddr_123\")\n.then(({ deleted, parent: customer }) => {\n console.log(customer)\n})"
},
"GET /store/locales": {
"js-sdk": "sdk.store.locale.list()\n.then(({ locales }) => {\n console.log(locales)\n})"
}
}

View File

@@ -135,6 +135,7 @@ class OasKindGenerator extends FunctionKindGenerator {
},
]
readonly RESPONSE_TYPE_NAMES = ["MedusaResponse"]
readonly LOCALIZED_ROUTES = ["store/"]
/**
* This map collects tags of all the generated OAS, then, once the generation process finishes,
@@ -348,6 +349,7 @@ class OasKindGenerator extends FunctionKindGenerator {
node,
tagName,
methodName,
oasPath,
})
oas.parameters?.push(...queryParameters)
@@ -582,6 +584,7 @@ class OasKindGenerator extends FunctionKindGenerator {
node,
tagName,
methodName,
oasPath,
forUpdate: true,
})
@@ -1170,6 +1173,7 @@ class OasKindGenerator extends FunctionKindGenerator {
node,
tagName,
methodName,
oasPath,
forUpdate = false,
}: {
/**
@@ -1184,6 +1188,10 @@ class OasKindGenerator extends FunctionKindGenerator {
* The tag's name.
*/
tagName?: string
/**
* The OAS path.
*/
oasPath: string
/**
* Whether the request parameters are retrieved for update purposes only.
*/
@@ -1200,6 +1208,30 @@ class OasKindGenerator extends FunctionKindGenerator {
} {
const queryParameters: OpenAPIV3.ParameterObject[] = []
let requestSchema: OpenApiSchema | undefined
const isLocalizedRoute = this.LOCALIZED_ROUTES.some((route) =>
oasPath.startsWith(route)
)
if (isLocalizedRoute) {
queryParameters.push(
this.getParameterObject({
type: "query",
name: "locale",
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.",
},
},
})
)
}
if (
!node.parameters[0].type ||
@@ -1343,6 +1375,22 @@ class OasKindGenerator extends FunctionKindGenerator {
},
},
}),
this.getParameterObject({
type: "header",
name: "Content-Language",
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.",
},
},
}),
]
}