CSV Import
Import products, customers, and other data via CSV files.
The CSV Import API lets you bulk-import data into CloudCart programmatically via the GraphQL Admin API.
Workflow
- Discover fields — Call
csvImportMetato get available mapping fields - Upload file — Call
csvImportUploadwith base64-encoded CSV or a URL - Preview columns — Call
csvImportPreviewto see the first row - Start import — Call
csvImportStartwith column-to-field mapping
Import Types
| Type | Description |
|---|---|
products | Products with variants, images, categories |
customers | Customer accounts |
redirects | URL redirects (301) |
blog | Blog posts |
Step 1: Get Available Fields
query {
csvImportMeta(type: products) {
import_fields
required_fields
multiple_fields
default_settings
}
}Step 2: Upload CSV
mutation {
csvImportUpload(input: {
type: products
file_data: "base64_encoded_csv_content_here"
has_header_line: true
product_settings: {
publish_as_active: true
quantity_tracking: true
}
}) {
id
first_row
}
}Step 3: Map Columns and Start
mutation {
csvImportStart(id: "task_id", input: {
binds: {
"product.id": "0",
"product.name": "1",
"product.price": "3",
"variant.parent_id": "0"
}
}) {
success
total
message
}
}Step 4: Monitor Progress
query {
csvImportProgress {
is_importing
total
progress
percentage
}
}