Skip to content

STO01 - Import a stock file

Request

Description

Import a .csv file to update stock for offers, either globally or per warehouse.
Returns an import identifier to track the status of the import and retrieve an error report if applicable.

Call Frequency
Maximum usage: Once per minute
Read More
Security
Shop-API-Key(Required scopes: ROLE_SHOP_ADMINROLE_PARTNER_OFFER_STOCK_WRITE)
Query
shop_idinteger, (int64)

Use this parameter when your user has access to several shops. If not specified, the shop_id from your default shop will be used.

Bodymultipart/form-data
filestring, (binary)required

Import CSV file to upload. Use multipart/form-data with name file.
Csv format:

  • "offer-sku";"quantity";"warehouse-code";"update-delete"
    • 1 line = 1 offer quantity
    • List quantities per warehouse for the same offer together
    • If warehouse-code is not provided, the quantity provided for the offer-sku will be considered as a global one
curl -i -X POST \
  https://your-instance.mirakl.net/api/offers/stock/imports \
  -H 'Content-Type: multipart/form-data' \
  -F 'file=@path/to/file'

Responses

Created

Headers
Locationany

Pre-calculated URL to call to get the import status

Bodyapplication/json
import_idstring

Offer stock import identifier

Response
{ "import_id": "string" }