Create Vendor Redemption

Vendor Redemption API enables a brand to interact with third-party vendor systems for redeeming rewards.
Example: The brand wants to issue a gift card through a third-party vendor, ABC. This API provides the necessary details to the ABC vendor to process the reward redemption.

👍

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

URIapi_gateway/rewards/core/v1/vendor/redemption/create
HTTP MethodPOST
PaginationNo
Batch supportNo
Rate limit informationNone

API endpoint example

https://eucrm.cc.capillarytech.com/api_gateway/rewards/core/v1/vendor/redemption/create

Request body parameters

ParameterData TypeDescription
brandId*IntegerUnique ID of the brand.
vendorId*StringUnique ID of the vendor.
name*StringName defined by the brand for the vendor reward.
redemptionType*EnumSpecifies the method by which the customer can redeem rewards.

Supported values: GAMES, AUCTION, CART_PROMOTION, CASH_WALLET, VENDOR_ONLY_REWARD, VOUCHER, CASH_BACK, INTOUCH_REWARD, PHYSICAL_REWARD, CHARITY, MILES, GIFT_CARD, SWEEPSTAKES, VENDOR_INTOUCH_REWARD, CARD_DISC.
VENDOR_ONLY_REWARD: These are either points or coupons created at the vendor end.
VENDOR_INTOUCH_REWARD: These are vendor rewards created at the Capillary end.
It is not recommended to use the Vendor Intouch reward redemption type. Instead, you can use the Vendor only reward redemption type to issue coupons directly through the vendor API. You can find more information here.
For example, "MILES" indicates that the customer can use miles accumulated through the loyalty program for redemption against payment or points.
actionObjectSpecifies the Name, Endpoint URL, API Type, API Headers and the API Body of the internal API that executes a specific action.
nameStringThe name of the action to be executed.
execOrderIntegerThe execution order of the action.
apiUrlStringThe URL to which the API request is made. For example, "apiUrl": "https://partial.com/reward/issue" specifies the endpoint where the request to issue a reward will be made.
apiTypeStringThe HTTP method to be used for the API request.
apiHeadersObjectAn object containing the headers to be sent with the API request.
acceptStringThe accept header indicating the expected response format .
Content-TypeStringThe content type header indicating the format of the request body.
AuthorizationStringThe authorization header containing the authentication credentials.
apiBodyStringThe API body for the external API endpoint specified in “apiUrl”. You can also include custom fields, fulfilment status and reward transactions. The fulfilment status and the reward transaction ID are variables resolved in the backend according to the associated transaction.

- Custom Field: Enables brands to add additional data in the API request. Use the format customfield_customFieldName. For example, a custom field named "Address: Bangalore" should be written as customfield_Address then it will replace the value of custom field with Bangalore.
- Fulfillment Status: Enables to update the fulfilment status. Use the parameter fulfillmentStatus_, formatted in camelCase.
- Reward Transaction ID: Enables to add the reward transaction ID. This helps the vendor to identify the transaction associated with the issued reward. Use the parameter rewardTransactionId, formatted in camelCase.
NOTE:
- The API body supports other parameters that can be included based on the brand's specific requirements or integration needs.
- Internal Capillary APIs can also be used.
rootObjectThe root object of the JSON body.
requestArray of ObjectsAn array of request objects.
customerObjectAn object containing customer details.
mobileStringThe mobile number of the customer.
commentsStringComments or notes related to the API service request.
reasonStringThe reason for issuing goodwill points.
typeStringThe type of the request.
base_typeStringThe base type of the points.
pointsStringThe number of points to be awarded.
contextKeysObjectAn object containing context keys for extracting values from the response.
voucherStringThe context key for extracting the voucher ID from the response.
{
    "brandId": 1,
    "vendorId": 36,
    "name": "Miles",
    "redemptionType": "MILES",
    "actions": [
        {
            "name": "add good will points",
            "execOrder": 1,
            "apiUrl": "https://eu.api.capillarytech.com/v1.1/request/add?program_id=2851",
            "apiType": "POST",
            "apiHeaders": {
                "accept": "application/json",
                "Content-Type": "application/json",
                "Authorization": "Basic bHVjaWF1dG9fdGlsbF8blahblahkwNzViOTY0YjA3MTUyZDIzNGI3MA=="
            },
            "apiBody": "{\"root\":{\"request\":[{\"customer\":{\"mobile\":\"${mobile}\"},\"comments\":\"APIServicerequest-Awarding200points.\",\"reason\":\"IssueGoodwillpoints\",\"type\":\"GOODWILL\",\"base_type\":\"POINTS\",\"points\":\"${redemptionValue}\"transactionId_property\":\"${rewardTransactionId}\",\"customFields_property\":{\"customField_1_property\":\"${customfield_CF1}\"},\"fulfillmentStatus_property\":\"${fulfillmentStatus}\"}",
            "contextKeys": {
                "voucher": "response.requests.request.get(0).id"
            }
        }
    ],
    "responseKeys": [
        "voucher"
    ]
}
{
  "vendorId" : 1,
  "brandId" : 1,
  "enabled" : true,
  "redemptionType" : "VENDOR_ONLY_REWARD",
  "name" : "Vendor Redemption",
  "responseKeys" : [ "status", "voucher" ],
  "actions" : [ {
    "name" : "Action",
    "enabled" : true,
    "apiType" : "POST",
    "apiUrl" : "https://partial.com/coupon/issue",
    "apiBody" : "{\"transactionId_property\": \"${rewardTransactionId}\",\"customFields_property\": {\"customField_1_property\": \"${customfield_CF1}\"}, \"fulfillmentStatus_property\": \"${fulfillmentStatus}\"}",
    "execOrder" : 1,
    "retryAction" : false,
    "contextKeys" : {
      "voucher" : "response.coupon.code",
      "status" : "response.status"
    },
    "apiHeaders" : {
      "accept" : "application/json"
    }
  } ]
}

Response parameters

ParameterDatatypeDescription
successBooleanIndicates whether the API call was successful or not.
codeIntegerThe code associated with the response.
messageStringA message providing details about the response.
idIntegerThe unique identifier for the redemption object.
nameStringThe name associated with the redemption object.
redemptionTypeEnumThe type of redemption.
enabledBooleanIndicates whether the redemption is currently enabled.
lastUpdatedOnNullThe last update timestamp of the redemption object.
actionCountIntegerThe count of the number of redemptions.
{
    "status": {
        "success": true,
        "code": 5012,
        "message": "Vendor redemption created successfully"
    },
    "redemption": {
        "id": 5666,
        "name": "Miles",
        "redemptionType": "MILES",
        "enabled": true,
        "lastUpdatedOn": null,
        "actionCount": 1
    }
}
Language
Credentials
Basic
base64
:
URL
Click Try It! to start a request and see the response here!