docs: generate API reference for 2.12.3 (#14341)

This commit is contained in:
Shahed Nasser
2025-12-17 18:19:46 +02:00
committed by GitHub
parent c0ec54fc15
commit 52e965f411
134 changed files with 7706 additions and 12 deletions

View File

@@ -0,0 +1,78 @@
/**
* @oas [get] /admin/price-lists/{id}/prices
* operationId: GetPriceListsIdPrices
* summary: List Prices in a Price List
* x-sidebar-summary: List Prices
* description: Retrieve a list of prices in a price list. The prices can also be paginated.
* x-authenticated: true
* parameters:
* - name: id
* in: path
* description: The ID of the price list to retrieve prices from.
* required: true
* schema:
* type: string
* - name: fields
* in: query
* description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default
* fields. Without prefix it will replace the entire default fields.
* required: false
* schema:
* type: string
* title: fields
* description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default
* fields. Without prefix it will replace the entire default fields.
* externalDocs:
* url: "#select-fields-and-relations"
* security:
* - api_token: []
* - cookie_auth: []
* - jwt_token: []
* x-codeSamples:
* - lang: JavaScript
* label: JS SDK
* source: |-
* import Medusa from "@medusajs/js-sdk"
*
* export const sdk = new Medusa({
* baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
* debug: import.meta.env.DEV,
* auth: {
* type: "session",
* },
* })
*
* sdk.admin.priceList.prices("plist_123")
* .then(({ prices }) => {
* console.log(prices)
* })
* - lang: Shell
* label: cURL
* source: |-
* curl '{backend_url}/admin/price-lists/{id}/prices' \
* -H 'Authorization: Bearer {access_token}'
* tags:
* - Price Lists
* responses:
* "200":
* description: OK
* content:
* application/json:
* schema:
* $ref: "#/components/schemas/AdminPriceListPriceListResponse"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
* $ref: "#/components/responses/unauthorized"
* "404":
* $ref: "#/components/responses/not_found_error"
* "409":
* $ref: "#/components/responses/invalid_state_error"
* "422":
* $ref: "#/components/responses/invalid_request_error"
* "500":
* $ref: "#/components/responses/500_error"
* x-since: 2.12.3
*
*/

View File

@@ -128,6 +128,23 @@
* - cookie_auth: []
* - jwt_token: []
* x-codeSamples:
* - lang: JavaScript
* label: JS SDK
* source: |-
* import Medusa from "@medusajs/js-sdk"
*
* export const sdk = new Medusa({
* baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
* debug: import.meta.env.DEV,
* auth: {
* type: "session",
* },
* })
*
* sdk.admin.translation.list()
* .then(({ translations, count, limit, offset }) => {
* console.log(translations)
* })
* - lang: Shell
* label: cURL
* source: |-

View File

@@ -5,12 +5,40 @@
* x-sidebar-summary: List Settings
* description: Retrieve the list of translatable fields for all entities, such as products and collections.
* x-authenticated: true
* parameters: []
* parameters:
* - name: entity_type
* in: query
* description: The entity to retrieve translation settings for.
* required: false
* schema:
* type: string
* title: entity_type
* description: The entity to retrieve translation settings for.
* example: product
* security:
* - api_token: []
* - cookie_auth: []
* - jwt_token: []
* x-codeSamples:
* - lang: JavaScript
* label: JS SDK
* source: |-
* import Medusa from "@medusajs/js-sdk"
*
* export const sdk = new Medusa({
* baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
* debug: import.meta.env.DEV,
* auth: {
* type: "session",
* },
* })
*
* sdk.admin.translation.settings({
* entity_type: "product"
* })
* .then(({ translatable_fields }) => {
* console.log(translatable_fields)
* })
* - lang: Shell
* label: cURL
* source: |-

View File

@@ -3,8 +3,7 @@
* operationId: GetTranslationsStatistics
* summary: Retrieve Translation Statistics
* x-sidebar-summary: Get Statistics
* description: Get statistics on translations for specified locales and entity types. This includes overall
* translation progress for each entity type, and statistics for each locale within those entity types.
* description: Get statistics on translations for specified locales and entity types. This includes overall translation progress for each entity type, and statistics for each locale within those entity types.
* x-authenticated: true
* parameters:
* - name: locales
@@ -18,7 +17,7 @@
* type: string
* title: locales
* description: A locale code in [BCP 47](https://gist.github.com/typpo/b2b828a35e683b9bf8db91b5404f1bd1) format.
* example: "fr-FR"
* example: fr-FR
* - name: entity_types
* in: query
* description: The table names of entities to retrieve translation statistics for.
@@ -36,6 +35,25 @@
* - cookie_auth: []
* - jwt_token: []
* x-codeSamples:
* - lang: JavaScript
* label: JS SDK
* source: |-
* import Medusa from "@medusajs/js-sdk"
*
* export const sdk = new Medusa({
* baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
* debug: import.meta.env.DEV,
* auth: {
* type: "session",
* },
* })
*
* sdk.admin.translation.statistics({
* entity_type: "product"
* })
* .then(({ statistics }) => {
* console.log(statistics)
* })
* - lang: Shell
* label: cURL
* source: |-

View File

@@ -0,0 +1,479 @@
/**
* @oas [post] /admin/orders/export
* operationId: PostOrdersExport
* summary: Export Orders
* description: >
* Start an order export process to retrieve a CSV of exported orders.
*
*
* You'll receive in the response the transaction ID of the workflow generating the CSV file. To check the status of the execution, send a GET request to `/admin/workflows-executions/export-orders/:transaction-id`.
*
*
* Once the execution finishes successfully, a notification is created for the export. You can retrieve the notifications using the `/admin/notification` API route to retrieve the file's download URL.
* x-authenticated: true
* parameters:
* - name: id
* in: query
* required: false
* schema:
* oneOf:
* - type: string
* title: id
* description: The ID of the order to export.
* - type: array
* description: The IDs of the orders to export.
* items:
* type: string
* title: id
* description: An order ID.
* - name: sales_channel_id
* in: query
* description: The IDs of the sales channels to export their orders.
* required: false
* schema:
* type: array
* description: The IDs of the sales channels to export their orders.
* items:
* type: string
* title: sales_channel_id
* description: A sales channel ID.
* - name: region_id
* in: query
* required: false
* schema:
* oneOf:
* - type: string
* title: region_id
* description: The ID of a region to export orders in it.
* - type: array
* description: The IDs of regions to export their orders.
* items:
* type: string
* title: region_id
* description: A region ID.
* - name: customer_id
* in: query
* required: false
* schema:
* oneOf:
* - type: string
* title: customer_id
* description: The ID of a customer to export their orders.
* - type: array
* description: The IDs of customers to export their orders.
* items:
* type: string
* title: customer_id
* description: A customer ID.
* - name: q
* in: query
* description: A search query to filter exported orders by.
* required: false
* schema:
* type: string
* title: q
* description: A search query to filter exported orders by.
* - name: created_at
* in: query
* description: Filter by an order's creation date.
* required: false
* schema:
* type: object
* description: Filter by an order's creation date.
* properties:
* $and:
* type: array
* description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters.
* items:
* type: object
* title: $and
* $or:
* type: array
* description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters.
* items:
* type: object
* title: $or
* $eq:
* oneOf:
* - type: string
* title: $eq
* description: Filter by an exact match.
* - type: array
* description: Filter by an exact match.
* items:
* type: string
* title: $eq
* description: Filter by an exact match.
* $ne:
* type: string
* title: $ne
* description: Filter by values not equal to this parameter.
* $in:
* type: array
* description: Filter by values in this array.
* items:
* type: string
* title: $in
* description: Filter by values in this array.
* $nin:
* type: array
* description: Filter by values not in this array.
* items:
* type: string
* title: $nin
* description: Filter by values not in this array.
* $not:
* oneOf:
* - type: string
* title: $not
* description: Filter by values not matching the conditions in this parameter.
* - type: object
* description: Filter by values not matching the conditions in this parameter.
* - type: array
* description: Filter by values not matching the conditions in this parameter.
* items:
* type: string
* title: $not
* description: Filter by values not matching the conditions in this parameter.
* $gt:
* type: string
* title: $gt
* description: Filter by values greater than this parameter. Useful for numbers and dates only.
* $gte:
* type: string
* title: $gte
* description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only.
* $lt:
* type: string
* title: $lt
* description: Filter by values less than this parameter. Useful for numbers and dates only.
* $lte:
* type: string
* title: $lte
* description: Filter by values less than or equal to this parameter. Useful for numbers and dates only.
* $like:
* type: string
* title: $like
* description: Apply a `like` filter. Useful for strings only.
* $re:
* type: string
* title: $re
* description: Apply a regex filter. Useful for strings only.
* $ilike:
* type: string
* title: $ilike
* description: Apply a case-insensitive `like` filter. Useful for strings only.
* $fulltext:
* type: string
* title: $fulltext
* description: Filter to apply on full-text properties.
* $overlap:
* type: array
* description: Filter arrays that have overlapping values with this parameter.
* items:
* type: string
* title: $overlap
* description: Filter arrays that have overlapping values with this parameter.
* $contains:
* type: array
* description: Filter arrays that contain some of the values of this parameter.
* items:
* type: string
* title: $contains
* description: Filter arrays that contain some of the values of this parameter.
* $contained:
* type: array
* description: Filter arrays that contain all values of this parameter.
* items:
* type: string
* title: $contained
* description: Filter arrays that contain all values of this parameter.
* $exists:
* type: boolean
* title: $exists
* description: Filter by whether a value for this parameter exists (not `null`).
* - name: updated_at
* in: query
* description: Filter by an order's update date.
* required: false
* schema:
* type: object
* description: Filter by an order's update date.
* properties:
* $and:
* type: array
* description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters.
* items:
* type: object
* title: $and
* $or:
* type: array
* description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters.
* items:
* type: object
* title: $or
* $eq:
* oneOf:
* - type: string
* title: $eq
* description: Filter by an exact match.
* - type: array
* description: Filter by an exact match.
* items:
* type: string
* title: $eq
* description: Filter by an exact match.
* $ne:
* type: string
* title: $ne
* description: Filter by values not equal to this parameter.
* $in:
* type: array
* description: Filter by values in this array.
* items:
* type: string
* title: $in
* description: Filter by values in this array.
* $nin:
* type: array
* description: Filter by values not in this array.
* items:
* type: string
* title: $nin
* description: Filter by values not in this array.
* $not:
* oneOf:
* - type: string
* title: $not
* description: Filter by values not matching the conditions in this parameter.
* - type: object
* description: Filter by values not matching the conditions in this parameter.
* - type: array
* description: Filter by values not matching the conditions in this parameter.
* items:
* type: string
* title: $not
* description: Filter by values not matching the conditions in this parameter.
* $gt:
* type: string
* title: $gt
* description: Filter by values greater than this parameter. Useful for numbers and dates only.
* $gte:
* type: string
* title: $gte
* description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only.
* $lt:
* type: string
* title: $lt
* description: Filter by values less than this parameter. Useful for numbers and dates only.
* $lte:
* type: string
* title: $lte
* description: Filter by values less than or equal to this parameter. Useful for numbers and dates only.
* $like:
* type: string
* title: $like
* description: Apply a `like` filter. Useful for strings only.
* $re:
* type: string
* title: $re
* description: Apply a regex filter. Useful for strings only.
* $ilike:
* type: string
* title: $ilike
* description: Apply a case-insensitive `like` filter. Useful for strings only.
* $fulltext:
* type: string
* title: $fulltext
* description: Filter to apply on full-text properties.
* $overlap:
* type: array
* description: Filter arrays that have overlapping values with this parameter.
* items:
* type: string
* title: $overlap
* description: Filter arrays that have overlapping values with this parameter.
* $contains:
* type: array
* description: Filter arrays that contain some of the values of this parameter.
* items:
* type: string
* title: $contains
* description: Filter arrays that contain some of the values of this parameter.
* $contained:
* type: array
* description: Filter arrays that contain all values of this parameter.
* items:
* type: string
* title: $contained
* description: Filter arrays that contain all values of this parameter.
* $exists:
* type: boolean
* title: $exists
* description: Filter by whether a value for this parameter exists (not `null`).
* - name: limit
* in: query
* description: Limit the number of items returned in the list.
* required: false
* schema:
* type: number
* title: limit
* description: Limit the number of items returned in the list.
* externalDocs:
* url: "#pagination"
* - name: offset
* in: query
* description: The number of items to skip when retrieving a list.
* required: false
* schema:
* type: number
* title: offset
* description: The number of items to skip when retrieving a list.
* externalDocs:
* url: "#pagination"
* - name: order
* in: query
* description: The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with `-`.
* required: false
* schema:
* type: string
* title: order
* description: The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with `-`.
* externalDocs:
* url: "#pagination"
* - name: with_deleted
* in: query
* description: Whether to include deleted orders in the export.
* required: false
* schema:
* type: boolean
* title: with_deleted
* description: Whether to include deleted orders in the export.
* - name: fields
* in: query
* description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default
* fields. Without prefix it will replace the entire default fields.
* required: false
* schema:
* type: string
* title: fields
* description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default
* fields. Without prefix it will replace the entire default fields.
* externalDocs:
* url: "#select-fields-and-relations"
* - name: status
* in: query
* required: false
* schema:
* oneOf:
* - type: string
* title: status
* description: The status of the orders to export.
* enum:
* - canceled
* - completed
* - pending
* - draft
* - archived
* - requires_action
* - type: array
* description: The statuses of the orders to export.
* items:
* type: string
* description: The order status.
* enum:
* - canceled
* - completed
* - pending
* - draft
* - archived
* - requires_action
* - type: object
* description: The order's status.
* properties:
* $and:
* type: array
* description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters.
* items:
* type: object
* title: $and
* $or:
* type: array
* description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters.
* items:
* type: object
* title: $or
* - name: $and
* in: query
* description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters.
* required: false
* schema:
* type: array
* description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters.
* items:
* type: object
* title: $and
* - name: $or
* in: query
* description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters.
* required: false
* schema:
* type: array
* description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters.
* items:
* type: object
* title: $or
* security:
* - api_token: []
* - cookie_auth: []
* - jwt_token: []
* x-codeSamples:
* - lang: JavaScript
* label: JS SDK
* source: |-
* import Medusa from "@medusajs/js-sdk"
*
* export const sdk = new Medusa({
* baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
* debug: import.meta.env.DEV,
* auth: {
* type: "session",
* },
* })
*
* sdk.admin.order.export()
* .then(({ transaction_id }) => {
* console.log(transaction_id)
* })
* - lang: Shell
* label: cURL
* source: |-
* curl -X POST '{backend_url}/admin/orders/export' \
* -H 'Authorization: Bearer {access_token}'
* tags:
* - Orders
* responses:
* "202":
* description: OK
* content:
* application/json:
* schema:
* $ref: "#/components/schemas/AdminExportOrderResponse"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
* $ref: "#/components/responses/unauthorized"
* "404":
* $ref: "#/components/responses/not_found_error"
* "409":
* $ref: "#/components/responses/invalid_state_error"
* "422":
* $ref: "#/components/responses/invalid_request_error"
* "500":
* $ref: "#/components/responses/500_error"
* x-workflow: exportOrdersWorkflow
* x-events: []
* x-since: 2.12.3
*
*/

View File

@@ -91,6 +91,40 @@
* title: delete
* description: The ID of a translation to delete.
* x-codeSamples:
* - lang: JavaScript
* label: JS SDK
* source: |-
* import Medusa from "@medusajs/js-sdk"
*
* export const sdk = new Medusa({
* baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
* debug: import.meta.env.DEV,
* auth: {
* type: "session",
* },
* })
*
* sdk.admin.translation.batch({
* create: [
* {
* reference_id: "prod_123",
* reference: "product",
* locale_code: "en-US",
* translations: { title: "Shirt" }
* }
* ],
* update: [
* {
* id: "trans_123",
* translations: { title: "Pants" }
* }
* ],
* delete: ["trans_321"]
* })
* .then(({ created, updated, deleted }) => {
* console.log(created, updated, deleted)
* })
* ```
* - lang: Shell
* label: cURL
* source: |-

View File

@@ -50,6 +50,11 @@
* externalDocs:
* url: https://docs.medusajs.com/api/admin#manage-metadata
* description: Learn how to manage metadata
* translations:
* type: array
* description: The collection's translations.
* items:
* $ref: "#/components/schemas/AdminTranslation"
*
*/

View File

@@ -0,0 +1,15 @@
/**
* @schema AdminExportOrderResponse
* type: object
* description: The details of the order export.
* x-schemaName: AdminExportOrderResponse
* required:
* - transaction_id
* properties:
* transaction_id:
* type: string
* title: transaction_id
* description: The ID of the workflow execution's transaction. Use it to check the status of the export by sending a GET request to `/admin/workflows-executions/export-orders/:transaction-id`
*
*/

View File

@@ -0,0 +1,36 @@
/**
* @schema AdminPriceListPriceListResponse
* type: object
* description: The list of prices.
* x-schemaName: AdminPriceListPriceListResponse
* required:
* - limit
* - offset
* - count
* - prices
* properties:
* limit:
* type: number
* title: limit
* description: The maximum number of prices returned.
* offset:
* type: number
* title: offset
* description: The number of items skipped before retrieving the prices.
* count:
* type: number
* title: count
* description: The total number of prices.
* estimate_count:
* type: number
* title: estimate_count
* description: The estimated count retrieved from the PostgreSQL query planner, which may be inaccurate.
* x-featureFlag: index_engine
* prices:
* type: array
* description: The list of prices.
* items:
* $ref: "#/components/schemas/AdminPrice"
*
*/

View File

@@ -173,6 +173,11 @@
* description: The date the product was deleted.
* shipping_profile:
* $ref: "#/components/schemas/AdminShippingProfile"
* translations:
* type: array
* description: The product's translations.
* items:
* $ref: "#/components/schemas/AdminTranslation"
*
*/

View File

@@ -38,6 +38,11 @@
* externalDocs:
* url: https://docs.medusajs.com/api/admin#manage-metadata
* description: Learn how to manage metadata
* translations:
* type: array
* description: The tag's translations.
* items:
* $ref: "#/components/schemas/AdminTranslation"
*
*/

View File

@@ -38,6 +38,11 @@
* externalDocs:
* url: https://docs.medusajs.com/api/admin#manage-metadata
* description: Learn how to manage metadata
* translations:
* type: array
* description: The type's translations.
* items:
* $ref: "#/components/schemas/AdminTranslation"
*
*/

View File

@@ -153,6 +153,11 @@
* type: string
* title: thumbnail
* description: The variant's thumbnail.
* translations:
* type: array
* description: The variant's translations.
* items:
* $ref: "#/components/schemas/AdminTranslation"
*
*/

View File

@@ -10,7 +10,9 @@
* type: object
* description: Key-value pairs of translatable fields for different entities. Each key is an entity type, and the value is an array of fields that can be translated for that entity.
* example:
* product: ["title", "description"]
* product:
* - title
* - description
*
*/

View File

@@ -29,8 +29,7 @@
* properties:
* by_locale:
* type: object
* description: The translation statistics of an entity type broken down by locale. The key is the locale code in BCP 47 format, and
* the value is an object containing the statistics for that locale.
* description: The translation statistics of an entity type broken down by locale. The key is the locale code in BCP 47 format, and the value is an object containing the statistics for that locale.
* example:
* fr-FR:
* expected: 150

View File

@@ -414,7 +414,7 @@
"js-sdk": "sdk.admin.order.updateOrderChange(\n \"ordch_123\",\n {\n carry_over_promotions: true\n }\n)\n.then(({ order_change }) => {\n console.log(order_change)\n})"
},
"POST /admin/orders/export": {
"js-sdk": "sdk.admin.order.export({})\n.then(({ transaction_id }) => {\n console.log(transaction_id)\n})"
"js-sdk": "sdk.admin.order.export()\n.then(({ transaction_id }) => {\n console.log(transaction_id)\n})"
},
"POST /admin/order-edits": {
"js-sdk": "sdk.admin.orderEdit.initiateRequest({\n order_id: \"order_123\"\n})\n.then(({ order_change }) => {\n console.log(order_change)\n})"
@@ -971,6 +971,18 @@
"GET /admin/locales/{code}": {
"js-sdk": "sdk.admin.locale.retrieve(\"en-US\")\n.then(({ locale }) => {\n console.log(locale)\n})"
},
"GET /admin/translations": {
"js-sdk": "sdk.admin.translation.list()\n.then(({ translations, count, limit, offset }) => {\n console.log(translations)\n})"
},
"POST /admin/translations/batch": {
"js-sdk": "sdk.admin.translation.batch({\n create: [\n {\n reference_id: \"prod_123\",\n reference: \"product\",\n locale_code: \"en-US\",\n translations: { title: \"Shirt\" }\n }\n ],\n update: [\n {\n id: \"trans_123\",\n translations: { title: \"Pants\" }\n }\n ],\n delete: [\"trans_321\"]\n})\n.then(({ created, updated, deleted }) => {\n console.log(created, updated, deleted)\n})\n```"
},
"GET /admin/translations/settings": {
"js-sdk": "sdk.admin.translation.settings({\n entity_type: \"product\"\n})\n.then(({ translatable_fields }) => {\n console.log(translatable_fields)\n})"
},
"GET /admin/translations/statistics": {
"js-sdk": "sdk.admin.translation.statistics({\n entity_type: \"product\"\n})\n.then(({ statistics }) => {\n console.log(statistics)\n})"
},
"POST /auth/{actor}/{method}/register": {
"js-sdk": "await sdk.auth.register(\n \"customer\",\n \"emailpass\",\n {\n email: \"customer@gmail.com\",\n password: \"supersecret\"\n }\n)\n\n// all subsequent requests will use the token in the header\nconst { customer } = await sdk.store.customer.create({\n email: \"customer@gmail.com\",\n password: \"supersecret\"\n})"
},