bulkImportProductsGeneric
Requires permission products:import:preview.
Parses a base64 CSV with a named mapping profile and returns a dry-run preview. Writes nothing.
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
query BulkImportProductsGeneric($input: BulkImportProductsGenericInput!) {
bulkImportProductsGeneric(input: $input) {
createCount
currency
importId
moq
variantCount
warnings
sampleRows {
productName
variantName
cost
price
salePrice
sku
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query BulkImportProductsGeneric($input: BulkImportProductsGenericInput!) {\n bulkImportProductsGeneric(input: $input) {\n createCount\n currency\n importId\n moq\n variantCount\n warnings\n sampleRows {\n productName\n variantName\n cost\n price\n salePrice\n sku\n }\n }\n}",
"variables": {
"input": {
"file": "string",
"mappingProfile": "CUSTOM"
}
}
}
EOF
Variables:
{
"input": {
"file": "string",
"mappingProfile": "CUSTOM"
}
}
Response:
{
"data": {
"bulkImportProductsGeneric": {
"createCount": 0,
"currency": "string",
"importId": "string",
"moq": 0,
"variantCount": 0,
"warnings": [
"string"
],
"sampleRows": [
{
"productName": "string",
"variantName": "string",
"cost": 0,
"price": 0,
"salePrice": 0,
"sku": "string"
}
]
}
}
}
bulkImportProductsGeneric(
input: BulkImportProductsGenericInput!
): GenericProductImportPreview!
Arguments
bulkImportProductsGeneric.input ● BulkImportProductsGenericInput! non-null input
The details of the bulk import products generic request.
Type
GenericProductImportPreview object
A dry run of a generic product import: what would be written, and the organization defaults that were applied.