Issue bulk reward

This API is used to issue multiple rewards to the user based on mobile number/ email Id.

While issuing bulk rewards,

  1. The intouch points required to purchase the rewards are summed up and isRedeemable call checks if the customer has enough points or not.

    1. If the customer has enough points, then all the rewards in the issue bulk call are issued in a single shot
    2. If the customer doesn't have enough points, then the issue bulk call is failed and no reward is issued.
  2. If the isRedeemable call is successful, then the system will issue the rewards to the user.

    1. Let's say, one reward is coupon, another is cart promotion in the request payload. Coupon is issued but cart promotion issual failed, this can happen and the coupon will be issued. Here in this case, partial issual will be successful.

❗️

Issuing a reward created for a customer segment

If you want to issue a reward created for a specific customer segment, the user receiving the reward must belong to the segment or partition to which the reward is attached.

👍

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 .
  • If either of the user_group2_primary_user_id or user_group2_id or user_group2_external_id is not null, the transaction will be treated as group loyalty redemption and GROUP_LOYALTY_REDEMPTION will be set to true for transaction
  • Rewards can be issued to a customer:
    1. If they are linked to any cards or labels associated with the customer. The status for the cards and labels need to be ACTIVE as well here.
    2. If they have no cards or labels linked.
  • The Rewards system (Marvel/Rewards Catalogue) only deducts points from the customer if the vendor reward issue is successful. As a result, the need to reverse redeemed points does not arise, as points are deducted only upon a confirmed successful reward issue. The success of the vendor reward issue is determined based on the following configuration criteria:
    1. HTTP Status Code:The API response must return a status code of 200.
    2. Context Map Validation:The context map in the vendor redemption configuration must include a keyword "voucher". The "voucher" must have a valid value, such as a coupon code or reference ID.

Prerequisites

  • Authentication: Basic or OAuth authentication
  • Default access group

Resource information

URI/api_gateway/rewards/core/v1/user/rewards/issue?username={store}&skip_validation=true
HTTP MethodPOST
PaginationNo
Batch supportNo
Rate limit informationNone

API endpoint example

https://eu.api.capillarytech.com/api_gateway/rewards/core/v1/user/rewards/issue?username=swati&skip_validation=true

Request query parameters

ParameterData TypeDescription
Username*StringUsername name of the store.
skip_validationBooleanA validation code is used to redeem points for the transaction. skip_validation is set to true to bypass the validation code.

Request body parameters

ParameterData TypeDescription
mobile*StringMobile phone number of the customer. Any of the identifiers is mandatory.
email ID*StringEmail ID of the customer. Any of the identifiers is mandatory.
external ID*StringExternal ID of the customer. Any of the identifiers is mandatory.
brandStringBrand associated with the transaction.
transactionNumberStringUnique identifier for the transaction.
programIdIntegerThe ID of the program associated with the promotion.
notesStringA string used to store or represent additional information.
eventLogIdStringA plain string identifier used to identify the transaction associated with a reward issual. There is no character limit for this parameter.
quantity*IntegerQuantity of the specified reward. This is applicable for rewards with payment config CONV_RATIO only and should have a value greater than one. For more information and various examples, refer to the documentation here.
Note: If the quantity is entered with decimals, the system will not consider the decimal part. For example, if you enter the value 1.56, the system will disregard the .56, and the value will be treated as 1.
The maximum allowed quantity is 5 for rewards of type CONV_RATIO if either redemptionValue or points are not provided.
rewardsArrayArray of rewards associated with the transaction.
rewardIdIntegerUnique identifier for a reward.
paramsStringParams acts as a key that holds additional information or configuration details as a JSON object.
requestIdStringA plain string identifier for the request that initiated this reward issuance attempt. Each request ID must be unique for each reward. This is used for Idempotency check. There is no character limit for this parameter.
paymentConfigObjectPayment configuration details for the reward.
Note: The payment config ID is mandatory if rewards are created with a payment configuration block. This applies when multiple payment configurations are defined for a single reward.. It is not recommended to use Payment Config for single payment config as it will break the flow when rewards need to be issued from loyalty workflows/ loyalty promotions/ journeys/ campaigns.
-idIntegerUnique identifier for the payment configuration. (id can be obtained from this API)
-redemptionValueIntegerThe Redemption Value is the amount needed to claim a reward. It applies only to rewards with a CONV_RATIO payment configuration.
customFieldsObjectThe list of custom fields associated with the reward issued to the customer. A custom field allows you to add extra information related to the reward.
You can add the custom field in the issue reward call once the custom field is created using the create custom field API .
fulfillmentDetailsObjectThe list of fulfillment details associated with the reward. There can be multiple stages that the reward undergoes, such as BOOKED, ON THE WAY, DELIVERED.
For example, A brand can have a fulfillment status as the Reward is SHIPPED before delivering the reward to the customer.
You can create a fulfillment status using the Create fulfillment status API and use it in the issue reward call.
user_group2_primary_user_idStringUnique user ID of the primary member of the group associated with the rewards to be issued. Customer ID (user_group2_id) or User ID (user_group2_primary_user_id) or External ID (user_group2_external_id) ,any one of these three can be used. If any one of these is null, the transaction won't be considered a Group Loyalty Redemption.
{
    "mobile": "11223569865",
    "brand": "BUKL",
    "transactionNumber": 107,
    "programId": "626",
    "notes": "This is notes",
    "rewards": [
        {
            "rewardId": 239433,
            "quantity": 1,
            "customFields": {
                "issue-reward-1": "issue-reward-values"
            },
            "paymentConfig": {
                "id": 700
            },
            "fulfillmentDetails": {
                "status": "Order confirmed"
            }
        },
        {
            "rewardId": 239434,
            "quantity": 1,
            "paymentConfig": {
                "id": 701
            },
            "fulfillmentDetails": {
                "status": "Order confirmed"
            }
        }
    ],
    "userGroup2PrimaryUserId": 890
}
{
  "mobile": "919886022338",
  "brand": "marvel_automation",
  "transactionNumber": "Transaction-1716621508000",
  "rewards": [
    {
      "rewardId": 13649,
      "quantity": 40,
      "paymentConfig": {
            "id": 307,
            "points": 500
     }
    }
  ]
}
{
    "brand": "lekhanaBrand",
    "transactionNumber": "123456789",
    "rewards": [
        {
            "rewardId": 9252,
            "quantity": 1,
            "customFields": {
                "issue-reward-1": "issue-reward-values"
            },
            "fulfillmentDetails": {
                "status": "SHIPPED"
            }
        }
    ],
    "mobile": "916677777777"
}
{
    "mobile": "11223569865",
    "brand": "BUKL",
    "transactionNumber": "107",
    "rewards": [
        {
            "rewardId": 221441,
            "quantity": 2,
            "paymentConfig": {
                "id": 456
            }
        }
    ],
    "user_group2_primary_user_id":"11223569865"
}
{
    "mobile": "162651476021",
    "brand": "BUKL",
    "transactionNumber": 1719466915,
    "rewards": [
        {
            "rewardId": 153873,
            "quantity": 1,
            "paymentConfig": {
                "id": 34
            },
            "params": {
                "test": "test"
            }
        },
        {
            "rewardId": 225087,
            "quantity": 1
        }
    ]
}
{
    "mobile": "9988776655",
    "brand": "BUKL",
    "transactionNumber": "NeeTesttr11",
    "params": {
        "denomination": 100,
        "quantity": 1
    },
    "rewards": [
        {
            "rewardId": 225086,
            "quantity": 1
        },
        {
            "rewardId": 225087,
            "quantity": 1
        }
    ]
}
{
    "mobile": "9988776655",
    "brand": "BUKL",
    "transactionNumber": "NeeTesttr11",
    "rewards": [
        {
            "rewardId": 225086,
            "quantity": 1,
            "paymentConfig": {
                "redemptionValue": 500
            }
        },
        {
            "rewardId": 225087,
            "quantity": 1,
            "paymentConfig": {
                "redemptionValue": 100
            }
        }
    ]
}
{
    "mobile": "919825752814",
    "brand": "testOrg_marvel_20230822_147",
    "transactionNumber": "2344s4",
    "notes": "This is test",
    "eventLogId":"eventLogId124",
    "rewards": [
        {
            "rewardId": 125099,
            "quantity": 2,
            "requestId":"req3"
        },
        {
            "rewardId": 125101,
            "quantity": 2,
            "requestId":"req4"
        }
    ]
}

Response parameters

ParameterDescription
statusRepresents the overall status of the reward issuance request.
successIndicates if the overall operation was successful or not.
codeA unique code representing the overall status of the operation.
messageA message providing additional information about the status of the operation.
rewardsA list of individual reward issuance results.
statusRepresents the status of an individual reward issuance attempt.
successIndicates if the reward issuance for this specific reward was successful or not.
codeA unique code representing the status of this reward issuance attempt.
messageA message providing more details about the status of this reward issuance attempt.
transactionIdA unique identifier for the transaction associated with this reward issuance attempt.
rewardIdA unique identifier for the reward that was attempted to be issued.
requestedQuantityThe Requested Quantity is the original number of items you asked for when making a reward request. Even if this number is later changed, for example, reduced from two to one, the Requested Quantity will still show the number you originally requested, which in this case is two.
quantityThe number of rewards that were successfully issued in this transaction.
pointsReferenceIdA unique identifier generated each time rewards are issued. This field stores identifier, allowing you to track points redemption transaction.
pointsReferenceIdsA unique identifier generated each time rewards are issued. This field stores a list of these identifiers, allowing you to track multiple points redemption transactions.
eventLogIdA plain string identifier used to identify the transaction associated with a reward issual.
requestIdA unique identifier for the request that is used for Idempotency check.
intouchDetails of the rewards issued, including points redeemed, coupon codes, and expiration dates.
pointsRedeemedThe number of points that were redeemed for this reward.
couponCodeThe unique code for the issued coupon.
codeExpiryThe expiration date and time for the issued coupon code in the format YYYY-MM-DD HH:MM:SS.
promotionsA list of promotional offers associated with the reward.
vendorVendor-related details associated with the reward issuance.
restrictionsRestrictions or limitations that apply to the reward.
paymentConfigPayment configuration details related to the reward.
fulfillmentDetailsFulfillment-related information for the reward.
customFieldsCustom fields defined for the reward.
redemptionDetailsRedemption-specific details associated with the reward.
redemptionTypeSpecifies the category of reward redemption available, that indicate how users can redeem the reward.
redemptionValueRedemption Value is the value of a reward, showing how much is needed to claim it.
{
    "status": {
        "success": false,
        "code": 8010,
        "message": "Reward issued successfully"
    },
    "rewards": [
        {
            "status": {
                "success": true,
                "code": 200,
                "message": "Reward issued successfully"
            },
            "transactionId": 177831,
            "rewardId": 125099,
            "requestedQuantity": 2,
            "quantity": 2,
            "pointsReferenceId": null,
            "pointsReferenceIds": [
                "eiEWkQ"
            ],
            "eventLogId": "eventLogId124",
            "requestId": "req3",
            "intouch": [
                {
                    "pointsRedeemed": "10",
                    "couponCode": "32213631321782942853",
                    "codeExpiry": "2024-12-27 00:00:00"
                },
                {
                    "pointsRedeemed": "10",
                    "couponCode": "05544786382604497680",
                    "codeExpiry": "2024-12-27 00:00:00"
                }
            ],
            "redemptionDetails": {
                "redemptionType": "MILES",
                "redemptionValue": 2
            },
            "promotions": [],
            "vendor": [],
            "restrictions": null,
            "paymentConfig": null,
            "fulfillmentDetails": null,
            "customFields": null
        },
        {
            "status": {
                "success": true,
                "code": 200,
                "message": "Reward issued successfully"
            },
            "transactionId": 177831,
            "rewardId": 126100,
            "requestedQuantity": 2,
            "quantity": 2,
            "pointsReferenceId": null,
            "pointsReferenceIds": [
                "eiEWkQ"
            ],
            "eventLogId": "eventLogId125",
            "requestId": "req4",
            "intouch": [
                {
                    "pointsRedeemed": "15",
                    "couponCode": "3221363134382942853",
                    "codeExpiry": "2024-12-27 00:00:00"
                },
                {
                    "pointsRedeemed": "20",
                    "couponCode": "055447842352604497680",
                    "codeExpiry": "2024-12-27 00:00:00"
                }
            ],
            "redemptionDetails": {
                "redemptionType": "MILES",
                "redemptionValue": 2
            },
            "promotions": [],
            "vendor": [],
            "restrictions": null,
            "paymentConfig": null,
            "fulfillmentDetails": null,
            "customFields": null
        }
    ]
}
{
    "status": {
        "success": false,
        "code": 8010,
        "message": "Reward issued partially"
    },
    "rewards": [
        {
            "status": {
                "success": true,
                "code": 200,
                "message": "Reward issued successfully"
            },
            "transactionId": 177831,
            "rewardId": 125099,
            "requestedQuantity": 2,
            "quantity": 2,
            "pointsReferenceId": null,
            "pointsReferenceIds": [
                "eiEWkQ"
            ],
            "eventLogId": "eventLogId124",
            "requestId": "req3",
            "intouch": [
                {
                    "pointsRedeemed": "10",
                    "couponCode": "32213631321782942853",
                    "codeExpiry": "2024-12-27 00:00:00"
                },
                {
                    "pointsRedeemed": "10",
                    "couponCode": "05544786382604497680",
                    "codeExpiry": "2024-12-27 00:00:00"
                }
            ],
            "promotions": [],
            "vendor": [],
            "restrictions": null,
            "paymentConfig": null,
            "fulfillmentDetails": null,
            "customFields": null,
            "redemptionDetails": null
        },
        {
            "status": {
                "success": false,
                "code": 8004,
                "message": "fail to issue reward as  Coupon Series ID is invalid"
            },
            "transactionId": 177832,
            "rewardId": 125101,
            "requestedQuantity": 2,
            "quantity": 0,
            "pointsReferenceId": null,
            "pointsReferenceIds": [],
            "eventLogId": "eventLogId124",
            "requestId": "req4",
            "intouch": null,
            "promotions": [],
            "vendor": [],
            "restrictions": null,
            "paymentConfig": null,
            "fulfillmentDetails": null,
            "customFields": null,
            "redemptionDetails": null
        }
    ]
}
{
    "status": {
        "success": false,
        "code": 12016,
        "message": "Invalid payment mode passed."
    },
    "intouch": null,
    "promotion": null,
    "vendor": null,
    "paymentConfig": null,
    "fulfillmentDetails": null,
    "customFields": null
}
{
    "status": {
        "success": false,
        "code": 400,
        "message": "Invalid payment mode passed.,Payment configuration id is mandatory"
    }
}
{
    "status": {
        "success": false,
        "code": 8004,
        "message": "fail to issue reward as user 373971337 does not belong to group 124",
        "partnerError": {
            "codes": [
                "1620"
            ],
            "messages": [
                "user 373971337 does not belong to group 124"
            ]
        }
    },
    "rewards":null
    
}
{
    "status": {
        "success": false,
        "code": 8004,
        "message": "fail to issue reward as  points are not redeemable",
        "partnerError": {
            "codes": [
                "828"
            ],
            "messages": [
                "points redemption rules/configuration not allowing redemption"
            ]
        }
    },
    "intouch": null,
    "promotion": null,
    "vendor": null
}
{
    "status": {
        "success": false,
        "code": 8004,
        "message": "fail to issue reward as  points are not redeemable",
        "partnerError": {
            "codes": [
                "1632"
            ],
            "messages": [
                "group id/externalId/primary userId 381751178 passed is not valid"
            ]
        }
    },
    "intouch": null,
    "promotion": null,
    "vendor": null
}
{
    "status": {
        "success": false,
        "code": 10003,
        "message": "Request payload is not matching for the passed requestId/s"
    }
}
{
    "status": {
        "success": false,
        "code": 400,
        "message": "Duplicate requestId"
    }
}

Example: Issuing reward created for customer segment

Consider the following scenario:

RewardSegments and Partitions
r1{s1, p1}, {s2, p2}
r2{s1, p2}, {s2, p1}
r3{s1, p1}, {s3, p1}
r4No segments or partitions

User Segments and Partitions:

UserBelongs to Segments and PartitionsReward details
user1{s2, p1}, {s3, p2}Does not contain r1, r3; contains r2, r4
user2{s1, p1}Contains r1, r3, r4; does not contain r2
user3No segments or partitionsContains r4

Bulk Issuance Results:

UserBulk Issuance (r1, r2, r3, r4)Success/Failure
user1r1, r2, r3, r4r1 and r3 fail; r2 and r4 are issued
user2r1, r2, r3, r4r2 fails; r1, r3, and r4 pass
user3r1, r2, r3, r4r1, r2, and r3 fail; r4 passes

API-specific error codes

Error codeDescription
400Invalid payment mode passed. Payment configuration ID is mandatory. Invalid payment mode passed. Payment configuration ID is mandatory. if the paymentConfig block is defined in the body, then paymentId is mandatory.
400Duplicate requestId
3004Brand not found
8003fail to issue reward as Reward is disabled or not started yet or expired
8004fail to issue reward as points are not redeemable
8010Reward issued partially. This occurs when one of the rewards has multiple payment configurations mapped to it. For more information, refer to the documentation here.
10003Invalid Request ID
12005Reward constraint evaluation failed. Request failed. Max limit for the DAYS is reached. Allowed limit is 15 For Level CUSTOMER
12016Invalid payment mode passed. Invalid payment mode passed. Whatever paymentId is passed in this API, the same should be mapped for the reward created.
12034User Doesn't Belong To Segment Partition Defined For Reward Segment
Language
Credentials
Basic
base64
:
URL
Click Try It! to start a request and see the response here!