Skip to content

Export stock levels as CSV

GET
/stores/{storeRef}/inventory/export
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

storeRef
required
string

The store’s ref, as returned by GET /stores.

limit
number
default: 20 >= 1 <= 100

Maximum number of rows to return, 1 to 100. Ignored by the export.

offset
number
0

Number of rows to skip. Ignored by the export.

search
string
<= 200 characters

Matches product name or SKU

sort_by
string
default: product_name
Allowed values: product_name sku available committed unavailable on_hand incoming

Field to sort by.

sort_order
string
default: asc
Allowed values: asc desc

Sort direction.

filters
string

Example

[{"field":"available","operator":"lte","values":["0"]}]

List-view filters: a JSON array of {field, operator, values}.

The CSV file.

Media typetext/csv
string format: binary

The request is malformed or failed validation.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The key is missing, invalid, revoked or expired.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

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.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}