Issue multiple coupons to a customer from a series

Using this API, you can issue multiple coupons from a coupon series to the same customer by defining the quantity of coupons.

👍

Note

  • For detailed information about our APIs and for hands-on testing, refer documentation in API overview and step-by-step guide on making your first API call in Make your first API call .

Prerequisites

  • Authentication: Basic or OAuth authentication
  • Default access group

Resource information

URI/v2/coupon/issue/multiple
HTTP methodPOST
PaginationNA
Rate limitNA
Batch supportYes

API endpoint example

https://eu.api.capillarytech.com/v2/coupon/issue/multiple

Request body parameters

ParameterDatatypeDescription
seriesIds*IntegerSeries ID of coupon. You can get the Series ID from this API. Externally managed/third party coupons are not supported.
count*IntegerNumber of coupons to be issued from the series. NOTE: Maximum coupons that can be issued is 500. If the count is not specified, by default it will take 1.
customer*ObjectThe object containing the details of the customer. You can use mobile, email or external id of the customer.
{
    "seriesId": 415446,
    "count": 2,
    "customer": {
        "mobile": "11223569865"
    }
}
{
    "seriesId": 415446,
    "count": 2,
    "customer": {
        "email": "[email protected]"
    }
}
{
    "seriesId": 18426,
    "count": 2,
    "customer": {
        "externalId": "3873472"
    }
}

Response parameters

ParametersDescription
couponsList of coupons issued.
coupons.codeCode of the coupon.
coupons.couponIdID of the coupon.
couponConfigConfiguration details of the coupon.
couponConfig.customPropertyMapCustom properties of the coupon.
couponConfig.idID of the coupon configuration.
couponConfig.descriptionDescription of the coupon configuration.
couponConfig.discountCodeDiscount code associated with the coupon.
couponConfig.infoInformation about the coupon configuration.
couponConfig.discountUptoMaximum discount value.
couponConfig.discountValueValue of the discount.
couponConfig.issueToLoyaltyIndicates if the coupon is issued to a loyalty program.
couponConfig.numUploadedNonIssuedNumber of non-issued uploaded coupons.
couponConfig.numUploadedTotalTotal number of uploaded coupons.
couponConfig.redemptionValidAfterDaysDays after which the coupon is valid for redemption.
couponConfig.ownerIdID of the coupon owner.
couponConfig.ownerValidityValidity period of the coupon owner.
couponConfig.alphaNumericIndicates if the coupon code is alphanumeric.
couponConfig.shortCodeLengthLength of the short code.
couponConfig.randomCodeLengthLength of the random code.
couponConfig.fixedExpiryDateFixed expiry date of the coupon.
couponConfig.numTotalTotal number of coupons.
couponConfig.latestIssualTimeTimestamp of the latest coupon issuance.
couponConfig.latestRedemptionTimeTimestamp of the latest coupon redemption.
couponConfig.discountOnIndicates what the discount applies to (e.g., BILL).
couponConfig.discountTypeType of discount.
couponConfig.externalIssualIndicates if the coupon is issued externally.
couponConfig.updateProductDataIndicates if product data is updated.
customerCustomer details.
customer.idID of the customer.
customer.profilesList of customer profiles.
customer.profiles.firstNameFirst name of the customer.
customer.profiles.lastNameLast name of the customer.
customer.profiles.fieldsCustom fields of the customer profile.
customer.profiles.allFieldsAll fields of the customer profile.
customer.profiles.identifiersList of customer identifiers.
customer.profiles.identifiers.typeType of the identifier (e.g., email, mobile, external id.etc).
customer.profiles.identifiers.valueValue of the identifier.
customer.profiles.commChannelsCommunication channels of the customer.
customer.profiles.userIdUser ID associated with the customer profile.
customer.profiles.accountIdAccount ID associated with the customer profile.
customer.profiles.autoUpdateTimeTimestamp of the last auto-update of the customer profile.
customer.profiles.identifiersAllList of all identifiers of the customer profile.
customer.profiles.identifiersAll.typeType of the identifier (e.g., email, mobile, external id).
customer.profiles.identifiersAll.valueValue of the identifier.
errorsList of errors.
warningsList of warnings.
{
    "coupons": [
        {
            "code": "3084294818",
            "couponId": 1237263304
        },
        {
            "code": "5686061236",
            "couponId": 1237263305
        }
    ],
    "couponConfig": {
        "customPropertyMap": {},
        "id": 0,
        "description": "IKEA - 500KW Voucher ",
        "discountCode": "NO_VALUE",
        "info": "IKEA - 500KW Voucher ",
        "discountUpto": 0,
        "discountValue": 500,
        "issueToLoyalty": false,
        "numUploadedNonIssued": 0,
        "numUploadedTotal": 0,
        "redemptionValidAfterDays": 0,
        "ownerId": 0,
        "ownerValidity": 0,
        "alphaNumeric": false,
        "shortCodeLength": 0,
        "randomCodeLength": 0,
        "fixedExpiryDate": 0,
        "numTotal": 0,
        "latestIssualTime": 0,
        "latestRedemptionTime": 0,
        "discountOn": "BILL",
        "discountType": "ABS",
        "externalIssual": false,
        "updateProductData": false
    },
    "totalCount": 2,
    "failureCount": 0,
    "successCount": 2,
    "customer": {
        "id": 555567088,
        "profiles": [
            {
                "firstName": "Abijith",
                "lastName": "Gupta",
                "fields": {},
                "allFields": {},
                "identifiers": [
                    {
                        "type": "mobile",
                        "value": "11223569865"
                    },
                    {
                        "type": "externalId",
                        "value": "000003873472"
                    }
                ],
                "commChannels": [],
                "userId": 555567088,
                "accountId": "",
                "autoUpdateTime": "2024-08-20T09:57:15Z",
                "identifiersAll": [
                    {
                        "type": "mobile",
                        "value": "11223569865"
                    },
                    {
                        "type": "externalId",
                        "value": "000003873472"
                    }
                ]
            }
        ]
    },
    "errors": [],
    "warnings": []
}
{
    "coupons": [
        {
            "code": "DECATH10",
            "couponId": 1239821361
        }
    ],
    "couponConfig": {
        "customPropertyMap": {},
        "id": 0,
        "description": "10% off Decathlon Products",
        "discountCode": "NO_VALUE",
        "info": "10% off Decathlon Prodcuts",
        "discountUpto": 0,
        "discountValue": 100,
        "issueToLoyalty": false,
        "numUploadedNonIssued": 0,
        "numUploadedTotal": 0,
        "redemptionValidAfterDays": 0,
        "ownerId": 0,
        "ownerValidity": 0,
        "alphaNumeric": false,
        "shortCodeLength": 0,
        "randomCodeLength": 0,
        "fixedExpiryDate": 0,
        "numTotal": 0,
        "latestIssualTime": 0,
        "latestRedemptionTime": 0,
        "discountOn": "BILL",
        "discountType": "ABS",
        "externalIssual": false,
        "updateProductData": false
    },
    "totalCount": 1,
    "failureCount": 0,
    "successCount": 1,
    "customer": {
        "id": 555567088,
        "profiles": [
            {
                "firstName": "Abijith",
                "lastName": "Gupta",
                "fields": {},
                "allFields": {},
                "identifiers": [
                    {
                        "type": "mobile",
                        "value": "11223569865"
                    },
                    {
                        "type": "externalId",
                        "value": "000003873472"
                    }
                ],
                "commChannels": [],
                "userId": 555567088,
                "accountId": "",
                "autoUpdateTime": "2024-09-03T10:13:55Z",
                "identifiersAll": [
                    {
                        "type": "mobile",
                        "value": "11223569865"
                    },
                    {
                        "type": "externalId",
                        "value": "000003873472"
                    }
                ]
            }
        ]
    },
    "errors": [],
    "warnings": []
}
{
    "errors": [
        {
            "status": false,
            "code": 707,
            "message": "Coupon Series ID is invalid"
        }
    ]
}
{
    "errors": [
        {
            "status": false,
            "code": 677,
            "message": "Invalid coupon count. Minimum 1 and Maximum 500."
        }
    ]
}
{
    "errors": [
        {
            "status": false,
            "code": 701,
            "message": "The customer could not be found. Please check mobile, email, external id passed"
        }
    ]
}
{
    "coupons": [
        {
            "code": "2YQWCWQXZ6NTMTAJLCXNP1T6CYMN",
            "couponId": 96004050
        }
    ],
    "couponConfig": {
        "customPropertyMap": {},
        "id": 0,
        "description": "Only 1 issual",
        "discountCode": "NO_VALUE",
        "info": "Only 1 issual",
        "discountUpto": 0,
        "discountValue": 1,
        "issueToLoyalty": false,
        "numUploadedNonIssued": 0,
        "numUploadedTotal": 0,
        "redemptionValidAfterDays": 0,
        "ownerId": 0,
        "ownerValidity": 0,
        "alphaNumeric": false,
        "shortCodeLength": 0,
        "randomCodeLength": 0,
        "fixedExpiryDate": 0,
        "numTotal": 0,
        "latestIssualTime": 0,
        "latestRedemptionTime": 0,
        "discountOn": "BILL",
        "discountType": "ABS",
        "updateProductData": false,
        "externalIssual": false
    },
    "totalCount": 2,
    "failureCount": 1,
    "successCount": 1,
    "customer": {
        "id": 374658850,
        "profiles": [
            {
                "firstName": "plerthprth",
                "lastName": "gmmlzilbpg",
                "fields": {},
                "allFields": {},
                "identifiers": [
                    {
                        "type": "email",
                        "value": "[email protected]"
                    },
                    {
                        "type": "mobile",
                        "value": "918028464628"
                    },
                    {
                        "type": "externalId",
                        "value": "x918028464628"
                    }
                ],
                "commChannels": [],
                "userId": 374658850,
                "accountId": "",
                "autoUpdateTime": "2024-08-01T12:42:46+05:30",
                "identifiersAll": [
                    {
                        "type": "email",
                        "value": "[email protected]"
                    },
                    {
                        "type": "mobile",
                        "value": "918028464628"
                    },
                    {
                        "type": "externalId",
                        "value": "x918028464628"
                    }
                ]
            }
        ]
    },
    "errors": [
        {
            "status": false,
            "code": 5004,
            "message": "Issue only one coupon. Since isAllowMultipleVouchersPerUser=false."
        }
    ],
    "warnings": []
}

{
    "errors": [
        {
            "status": false,
            "message": "Coupon has expired",
            "code": 713
        }
    ]
}

{
    "errors": [
        {
            "status": false,
            "message": "Coupon processing failed: user already has a coupon",
            "code": 709
        }
    ]
}

{
    "errors": [
        {
            "status": false,
            "code": 756,
            "message": "seriesId is mandatory to set"
        }
    ]
}

    "errors": [
        {
            "status": false,
            "code": 5004,
            "message": "Cannot issue more than one GENERIC coupon code."
        }
    ],
    "warnings": []
}
{
    "errors": [
        {
            "status": false,
            "code": 756,
            "message": "count should be greater than 0"
        }
    ]
}
{
    "seriesId": [415446,535521],
    "count": 2,
    "customer": {
        "mobile": "11223569865"
    }
}
//This is a part of request body.
    "errors": [
        {
            "status": false,
            "code": 5002,
            "message": "max coupon per user exceeded"
        }
    ],
    "warnings": []
}

API-specific error and warning codes

Warning Error Code (Partial Success*)Error codeDescription
-701The customer could not be found. Check if mobile, email, external id entered correctly.
-707Coupon Series ID is invalid.
-709Coupon processing failed as user already has a coupon.
-713Coupon has expired.
-756SeriesId is mandatory.
6795004Cannot issue more than one GENERIC coupon code or Issue only one coupon. This error occurs when the Maximum issuals per customer is set to 1.
6265001Maximum number of series has been created.
6215002Maximum number of coupon issued per user has been exceeded
7025005Queue is empty for series. This error happens on the backend because of system caching issues.
6785006Unable to issue certain number of coupons

*Partial Success - This occurs when only some coupons are issued, while the rest are not issued due to certain reasons.

Language
Authorization
Basic
base64
:
URL
Click Try It! to start a request and see the response here!