productImportCancel
Requires permission products:import:stage.
Cancels an import before its rows are saved.
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 ProductImportCancel($importId: ID!) {
productImportCancel(importId: $importId) {
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 ProductImportCancel($importId: ID!) {\n productImportCancel(importId: $importId) {\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": {
"importId": "id"
}
}
EOF
Variables:
{
"importId": "id"
}
Response:
{
"data": {
"productImportCancel": {
"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
}
}
}
}
productImportCancel(
importId: ID!
): ProductImportEntity!
Arguments
productImportCancel.importId ● ID! non-null scalar
The import's id.
Type
ProductImportEntity object
A product import and how far it has got.