Bulk Import Coupon
Bulk-imports coupons from an uploaded asset file. Submit the asset path to validate each row and enqueue a background job that processes the import
Bulk-imports coupons from an uploaded asset file. Submit the asset path to validate each row and enqueue a background job that processes the import.
POST
https://example.thoughtindustries.com/incoming/v2/coupons/bulkImportExample request
curl -X POST "https://example.thoughtindustries.com/incoming/v2/coupons/bulkImport" \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"bulkImportAssetPath": "string"
}'Parameters
| Name | Type | Required | Location | Description |
|---|---|---|---|---|
bulkImportAssetPath | string | Yes | body | The storage path of the uploaded asset file containing the coupon rows to import. |
Example response
{
"data": {
"APIBulkImportCoupon": {
"dryRun": true,
"validRows": [
{}
],
"invalidRows": [
{}
],
"backgroundJob": {
"id": "00000000-0000-0000-0000-000000000000",
"type": "string",
"description": "string",
"errorMessage": "string",
"createdAt": "2024-01-01T00:00:00.000Z",
"repeatable": true,
"status": "complete"
}
}
}
}Response fields
| Field | Type | Description |
|---|---|---|
dryRun | boolean | Indicates whether the import ran in dry-run mode without persisting changes. |
validRows | object[] | Array of coupon rows that passed validation and are eligible for import. |
invalidRows | object[] | Array of coupon rows that failed validation, each describing the offending data. |
backgroundJob | BackgroundJob | The background job created to process the coupon import. |
backgroundJob.id | uuid | Unique identifier of the background job. |
backgroundJob.type | string | The job type, indicating which processing routine handles the import. |
backgroundJob.description | string | Human-readable description of the background job. |
backgroundJob.errorMessage | string | Error message populated if the background job fails. |
backgroundJob.createdAt | ISO 8601 timestamp | ISO 8601 timestamp recording when the background job was created. |
backgroundJob.repeatable | boolean | Indicates whether the background job can be re-queued and run again. |
backgroundJob.status | BackgroundJobStatus | Current status of the background job (for example, complete). |