Upload Coupons (Batch)

This API helps to upload a batch of coupons to a coupon series. It provides the status of the upload process, organization ID, coupon series ID, job status, timestamps for creation and updates, and file information related to the upload.

Prerequisites

  • Authentication: OAuth authentication details
  • Access group: Write access to coupon group resource

Resource information

URIcoupon/api/v1/upload/file/{couponSeriedId}
HTTP methodPOST
PaginationNA
Rate limitNA
Batch supportYes

API endpoint example

https://eu.intouch.capillarytech.com/coupon/api/v1/upload/file/541854

Path parameter

ParameterDescription
couponSeriedId*Unique ID of the coupon series for which you need to upload coupons.

Body parameter

ParameterDescription
file*Name of the CSV file with customer and coupon details.
customerIdentifier*Customer identifier type used in the CSV file. Use NOT_TAGGED as the identifier to upload only coupon codes.
customerIdentifierColumnColumn ID of the customer identifier in the uploaded CSV file.

Header Required

HeaderDescription
Content-Type*multipart/form-data
x-cap-api-oauth-token*Generated authentication token

Response parameter

ParameterData TypeDescription
successBooleanIndicates whether the API call was successful.
statusIntegerHTTP status code of the API response.
resultObjectContains the result data of the API call.
result.orgIdIntegerOrganization ID associated with the result.
result.couponSeriesIdIntegerID of the coupon series.
result.uploadJobStatusesArray of ObjectsList of upload job statuses related to the coupon series.
result.uploadJobStatuses.jobIdIntegerJob ID of the upload status.
result.uploadJobStatuses.uploadStatusStringStatus of the upload (e.g., STARTED).
result.uploadJobStatuses.createdOnStringTimestamp when the upload job was created.
result.uploadJobStatuses.updatedOnStringTimestamp when the upload job was last updated.
result.uploadJobStatuses.errorFileUrlString or nullURL for the error file if any errors occurred during upload.
result.uploadJobStatuses.successFileUrlString or nullURL for the success file if the upload was successful.
result.uploadJobStatuses.uploadedFileUrlStringURL of the uploaded file.
result.uploadJobStatuses.totalUploadedCountIntegerTotal number of uploaded rows.
result.uploadJobStatuses.actualRowCountIntegerActual number of rows in the uploaded file.
result.uploadJobStatuses.errorCountIntegerNumber of errors encountered during upload.
result.uploadJobStatuses.uploadTableNameString or nullName of the table where uploaded data is stored.
result.uploadJobStatuses.uploadedFileNameStringName of the uploaded file.
result.uploadJobStatuses.audienceGroupIdIntegerID of the audience group.
result.uploadJobStatuses.audienceGroupVersionIdIntegerVersion ID of the audience group.
result.fileNameStringName of the file associated with the result.
{
    "success": true,
    "status": 200,
    "result": {
        "orgId": 100458,
        "couponSeriesId": 541854,
        "uploadJobStatuses": [
            {
                "jobId": 222696,
                "uploadStatus": "STARTED",
                "createdOn": "1717651325445",
                "updatedOn": "1717651325445",
                "errorFileUrl": null,
                "successFileUrl": null,
                "uploadedFileUrl": "couponbatchupload_1717651325326_541854.csv",
                "totalUploadedCount": 0,
                "actualRowCount": 0,
                "errorCount": 0,
                "uploadTableName": null,
                "uploadedFileName": "couponbatchupload.csv",
                "audienceGroupId": 0,
                "audienceGroupVersionId": 0
            }
        ],
        "fileName": "couponbatchupload_1717651325326_541854.csv"
    }
}
Language
Authorization
Basic
base64
:
URL
Click Try It! to start a request and see the response here!