productImportCreate
Requires permission products:import:stage.
Creates a product import from a staged CSV or Excel file (purpose PRODUCT_IMPORT). Then call productImportStage, read productImportPreview, and call productImportApprove. An import writes no stock. Image columns must hold the app's own PRODUCT_IMAGE staged keys; a row with a URL is an error.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
mutation ProductImportCreate($input: ProductImportCreateInput!) {
productImportCreate(input: $input) {
id
status
createdAt
chunkCheckpoint
createCount
errorRows
progress {
done
heartbeatAt
imagesFailed
phase
total
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation ProductImportCreate($input: ProductImportCreateInput!) {\n productImportCreate(input: $input) {\n id\n status\n createdAt\n chunkCheckpoint\n createCount\n errorRows\n progress {\n done\n heartbeatAt\n imagesFailed\n phase\n total\n }\n }\n}",
"variables": {
"input": {
"stagedUploadKey": "string"
}
}
}
EOF
Variables:
{
"input": {
"stagedUploadKey": "string"
}
}
Response:
{
"data": {
"productImportCreate": {
"id": "string",
"status": "COMMITTING",
"createdAt": "2025-01-15T00:00:00Z",
"chunkCheckpoint": 0,
"createCount": 0,
"errorRows": 0,
"progress": {
"done": 0,
"heartbeatAt": "2025-01-15T00:00:00Z",
"imagesFailed": 0,
"phase": "string",
"total": 0
}
}
}
}
productImportCreate(
input: ProductImportCreateInput!
): ProductImportEntity!
Arguments
productImportCreate.input ● ProductImportCreateInput! non-null input
The staged file and the import mode.
Type
ProductImportEntity object
A product import and how far it has got.