Issue single reward

This API is used to issue a reward to the user based on mobile number/ email ID/ external ID.

❗️

Issuing reward that was 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

  • ALLOW SKIPPING VALIDATION configuration needs to be enabled to redeem the points without OTP/validation code.

Resource information

URI/api_gateway/rewards/core/v1/user/reward/{reward Id}/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/reward/{reward Id}/issue?username={store}&skip_validation=true

Request path parameters

Parameter NameData TypeDescription
Reward ID*StringUnique identifier of the reward. It can be obtained by creating the Reward.

Request query parameters

Parameter NameData TypeDescription
username*StringTill username
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
mobileStringThe mobile phone number associated with the transaction.
email*StringThe email ID of the customer.
external ID*StringThe external ID of the customer.
brandStringName of brand associated with the transaction.
transactionNumberStringUnique identifier for the transaction.
notesStringAdditional notes or comments related to the transaction.
programIdIntegerThe ID of the program associated with the promotion.
rewardOwnershipROObjectOwner validation for issuance of rewards only when the owner's details are provided.
ownerTypeEnumModule for which the reward was created. Supported values: Loyalty program, Milestones, Campaigns, Journeys, Goodwill.
ownerIdStringUnique identifier of the owner to claim the reward. For Example:12345678
rewardsArrayA list of rewards associated with the transaction.
rewardIdIntegerThe unique identifier of a specific reward.
quantityIntegerThe quantity or redemption value of the specific reward issued. This applies only to rewards with the payment configuration CONV_RATIO. By default, the quantity is set to 1. 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.
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 .)
tenderObjectThe tender details contain the customer transaction details used to purchase the reward. For example, if the customer has opted for a CASH+POINTS payment mode and uses the card to pay for the reward, then the card information is captured here.
totalAmountIntegerThe total amount the customer is required to pay to purchase the reward.
methodOfPaymentEnumThe method the customer uses to pay for the reward. For example: If a customer is using a card as the payment method, you can enter the method of payment as "card".
methodOfPaymentIdStringA unique identifier for the payment method used.
tenderIdIntegerA unique identifier for the tender.
amountIntegerThe amount paid from the payment mode.
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.
eventLogIdStringA plain string identifier used to identify the transaction associated with a reward issual. There is no character limit for this parameter.
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.
{
  "mobile": "919456430850",
  "brand": "BUKL",
  "transactionNumber": "23444",
  "notes": "test"
}
{
  "externalId": "919456430850",
  "brand": "BUKL",
  "transactionNumber": "01987"
}
{
  "emailId": "[email protected]",
  "brand": "BUKL",
  "transactionNumber": "23444",
  "notes": "test"
}
{
    "mobile": "917411982768",
    "brand": "SAHANA_TEST",
    "rewardOwnershipRO": {
        "ownerType": "CAMPAIGNS",
        "ownerId": "abc7"
    }
}
{
    "mobile": "919825752814",
    "brand": "testOrg_marvel_20230822_147",
    "transactionNumber": "2344s4",
    "paymentConfig":{
        "id":55
    },"tender":{
        "totalAmount":100,
        "tenders":[
            {
                "methodOfPayment":"CARD",
                "methodOfPaymentId":"HDFC",
                "tenderId":"123",
                "amount":40
            },
            {
                "methodOfPayment":"CARD",
                "methodOfPaymentId":"ICICI",
                "tenderId":"123456",
                "amount":60
            }
        ]
    }
}
{
    "brand": "brand",
    "transactionNumber": "123456789",
    "mobile": "916677777777",
    "customFields":{
        "issue-reward-3":"issue-reward-values"
    },
    "fulfillmentDetails":{
        "status":"DELIVERED"
    }
}
{
  "mobile": "mobile",
  "brand": "brand",
  "transactionNumber": "23444",
  "user_group2_primary_user_id":"ieuiw",
}
{
  "mobile": "919456430850",
  "brand": "BUKL",
  "transactionNumber": "23444",
  "notes": "test",
  "programId": "626",
}

Response parameters

ParameterDescription
successIndicates whether the operation to issue a reward was successful.
codeThe HTTP status code related to the reward issuance operation.
messageDescriptive message about the reward issuance outcome.
pointsRedeemedThe number of points redeemed in the transaction.
couponCodeA unique code representing the coupon issued.
codeExpiryThe expiration date and time of the coupon code.
transactionIdA unique identifier for the transaction associated with this reward issuance.
promotionInformation about any promotion associated with the transaction.
vendorDetails about the vendor involved in the transaction, if any.
paymentModeThe mode of payment used in the transaction For example "POINTS").
idUnique identifier for the payment configuration.
pointsThe exact number of points used in the payment configuration.
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.
fulfillmentDetailsDetails about the fulfillment process of the transaction, if any.
customFieldsAny additional custom fields associated with the transaction.
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.
{
    "status": {
        "success": true,
        "code": 200,
        "message": "Reward issued successfully"
    },
    "intouch": {
        "pointsRedeemed": "10",
        "couponCode": "9632782882",
        "codeExpiry": "2024-12-13 00:00:00"
    },
    "transactionId": 303095,
    "promotion": null,
    "vendor": null,
    "paymentConfig": {
        "paymentMode": "POINTS",
        "id": 55,
        "points": 50.0000
    },
    "redemptionDetails": {
        "redemptionType": "MILES",
        "redemptionValue": 2
    },
    "fulfillmentDetails": null,
    "customFields": null,
    "eventLogId": "eventLogId124",
    "requestId": "req3"
}
{
    "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
}

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

Single Reward Issuance Results

UserIssued RewardBelongs to Segments and PartitionsSuccess/Failure
user1r1{s2, p1}, {s3, p2}Fails
user1r2{s2, p1}, {s3, p2}Passes
user3r4No segments or partitionsPasses

API-specific error codes

Error codeDescription
400Invalid payment mode passed. Payment configuration ID is mandatory. if the paymentConfig block is defined in the body, then paymentId is mandatory.
3004Brand not found
8003fail to issue reward as Reward is disabled or not started yet or expired/fail to issue reward as voucher is not present - This can be due to issues in the vendor flow configuration.
8004fail to issue reward as points are not redeemable
8010Reward issued partially
12005Reward constraint evaluation failed. Request failed. Max limit for the DAYS is reached. Allowed limit is 15 For Level CUSTOMER
12016Invalid 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!