Skip to main content
https://.thoughtindustries.com

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.

POSThttps://example.thoughtindustries.com/incoming/v2/coupons/bulkImport

Example 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

NameTypeRequiredLocationDescription
bulkImportAssetPathstringYesbodyThe 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

FieldTypeDescription
dryRunbooleanIndicates whether the import ran in dry-run mode without persisting changes.
validRowsobject[]Array of coupon rows that passed validation and are eligible for import.
invalidRowsobject[]Array of coupon rows that failed validation, each describing the offending data.
backgroundJobBackgroundJobThe background job created to process the coupon import.
backgroundJob.iduuidUnique identifier of the background job.
backgroundJob.typestringThe job type, indicating which processing routine handles the import.
backgroundJob.descriptionstringHuman-readable description of the background job.
backgroundJob.errorMessagestringError message populated if the background job fails.
backgroundJob.createdAtISO 8601 timestampISO 8601 timestamp recording when the background job was created.
backgroundJob.repeatablebooleanIndicates whether the background job can be re-queued and run again.
backgroundJob.statusBackgroundJobStatusCurrent status of the background job (for example, complete).