Export stock levels as CSV
const url = 'https://apibase.ecomweb.app/api/v1/stores/example/inventory/export?limit=20&offset=0&sort_by=product_name&sort_order=asc&filters=%5B%7B%22field%22%3A%22available%22%2C%22operator%22%3A%22lte%22%2C%22values%22%3A%5B%220%22%5D%7D%5D';const options = {method: 'GET', headers: {'x-api-key': '<x-api-key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://apibase.ecomweb.app/api/v1/stores/example/inventory/export?limit=20&offset=0&sort_by=product_name&sort_order=asc&filters=%5B%7B%22field%22%3A%22available%22%2C%22operator%22%3A%22lte%22%2C%22values%22%3A%5B%220%22%5D%7D%5D' \ --header 'x-api-key: <x-api-key>'Downloads the stock levels as a UTF-8 CSV file with a byte order mark, named inventory_<date>.csv. It takes the same filters and sort as the list, but limit and offset are ignored: the file holds every matching row. Fill in the On hand (new) column and send the file to the import route to set stock in bulk.
Required scopes: read:inventory
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The store’s ref, as returned by GET /stores.
Query Parameters
Section titled “Query Parameters”Maximum number of rows to return, 1 to 100. Ignored by the export.
Number of rows to skip. Ignored by the export.
Matches product name or SKU
Field to sort by.
Sort direction.
Example
[{"field":"available","operator":"lte","values":["0"]}]List-view filters: a JSON array of {field, operator, values}.
Responses
Section titled “Responses”The CSV file.
The request is malformed or failed validation.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}The key is missing, invalid, revoked or expired.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}The key may not do this: a missing scope, a readonly key, a publishable key on a Store API route, or a disallowed origin.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}