import Switchyard from "@switchyard/js-sdk"
export const sdk = new Medusa({
baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
debug: import.meta.env.DEV,
auth: {
type: "session",
},
})
sdk.admin.product.export({})
.then(({ transaction_id }) => {
console.log(transaction_id)
}){
"transaction_id": "<string>"
}Start a product export process to retrieve a CSV of exported products.
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-products/: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.
import Switchyard from "@switchyard/js-sdk"
export const sdk = new Medusa({
baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
debug: import.meta.env.DEV,
auth: {
type: "session",
},
})
sdk.admin.product.export({})
.then(({ transaction_id }) => {
console.log(transaction_id)
}){
"transaction_id": "<string>"
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
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.
Filter products by their title.
Filter products by their status.
draft, proposed, published, rejected Filter products by their ID.
Filter products by their sales channel ID.
Filter by a product's creation date.
Show child attributes
Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters.
Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters.
Filter by an exact match.
Filter by values not equal to this parameter.
Filter by values in this array.
Filter by values in this array.
Filter by values not in this array.
Filter by values not in this array.
Filter by values not matching the conditions in this parameter.
Filter by values greater than this parameter. Useful for numbers and dates only.
Filter by values greater than or equal to this parameter. Useful for numbers and dates only.
Filter by values less than this parameter. Useful for numbers and dates only.
Filter by values less than or equal to this parameter. Useful for numbers and dates only.
Apply a like filter. Useful for strings only.
Apply a regex filter. Useful for strings only.
Apply a case-insensitive like filter. Useful for strings only.
Filter to apply on full-text properties.
Filter arrays that have overlapping values with this parameter.
Filter arrays that have overlapping values with this parameter.
Filter arrays that contain some of the values of this parameter.
Filter arrays that contain some of the values of this parameter.
Filter arrays that contain all values of this parameter.
Filter arrays that contain all values of this parameter.
Filter by whether a value for this parameter exists (not null).
Filter by a product's update date.
Show child attributes
Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters.
Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters.
Filter by an exact match.
Filter by values not equal to this parameter.
Filter by values in this array.
Filter by values in this array.
Filter by values not in this array.
Filter by values not in this array.
Filter by values not matching the conditions in this parameter.
Filter by values greater than this parameter. Useful for numbers and dates only.
Filter by values greater than or equal to this parameter. Useful for numbers and dates only.
Filter by values less than this parameter. Useful for numbers and dates only.
Filter by values less than or equal to this parameter. Useful for numbers and dates only.
Apply a like filter. Useful for strings only.
Apply a regex filter. Useful for strings only.
Apply a case-insensitive like filter. Useful for strings only.
Filter to apply on full-text properties.
Filter arrays that have overlapping values with this parameter.
Filter arrays that have overlapping values with this parameter.
Filter arrays that contain some of the values of this parameter.
Filter arrays that contain some of the values of this parameter.
Filter arrays that contain all values of this parameter.
Filter arrays that contain all values of this parameter.
Filter by whether a value for this parameter exists (not null).
Filter products by their handle.
Filter products by whether they are gift cards. Whether the product is a gift card.
Filter products by their collection ID.
Filter products by their type ID.
Filter by a product's deletion date.
Show child attributes
Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters.
Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters.
Filter by an exact match.
Filter by values not equal to this parameter.
Filter by values in this array.
Filter by values in this array.
Filter by values not in this array.
Filter by values not in this array.
Filter by values not matching the conditions in this parameter.
Filter by values greater than this parameter. Useful for numbers and dates only.
Filter by values greater than or equal to this parameter. Useful for numbers and dates only.
Filter by values less than this parameter. Useful for numbers and dates only.
Filter by values less than or equal to this parameter. Useful for numbers and dates only.
Apply a like filter. Useful for strings only.
Apply a regex filter. Useful for strings only.
Apply a case-insensitive like filter. Useful for strings only.
Filter to apply on full-text properties.
Filter arrays that have overlapping values with this parameter.
Filter arrays that have overlapping values with this parameter.
Filter arrays that contain some of the values of this parameter.
Filter arrays that contain some of the values of this parameter.
Filter arrays that contain all values of this parameter.
Filter arrays that contain all values of this parameter.
Filter by whether a value for this parameter exists (not null).
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 -.
The product's q.
Filter products by their category ID.
Limit the number of items returned in the list.
The number of items to skip when retrieving a list.
The product's with deleted.
Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters.
Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters.
Filter products by the ID of a price list they belong to.
OK
The details of the product export.
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-products/:transaction-id