createProductImport
Requires permission products:import:stage.
Requests a presigned upload URL and creates the UPLOADED import ledger row. No file bytes cross GraphQL.
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 CreateProductImport($input: CreateProductImportInput!) {
createProductImport(input: $input) {
fileRef
importId
uploadUrl
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation CreateProductImport($input: CreateProductImportInput!) {\n createProductImport(input: $input) {\n fileRef\n importId\n uploadUrl\n }\n}",
"variables": {
"input": {
"filename": "string"
}
}
}
EOF
Variables:
{
"input": {
"filename": "string"
}
}
Response:
{
"data": {
"createProductImport": {
"fileRef": "string",
"importId": "string",
"uploadUrl": "string"
}
}
}
createProductImport(
input: CreateProductImportInput!
): CreateProductImportResult!
Arguments
createProductImport.input ● CreateProductImportInput! non-null input
The details of the product import to create.
Type
CreateProductImportResult object
A started import and where to upload its file.