This API allows you to manually issue reward currency to a customer or user group.
This API allows you to manually issue points or alternate currencies to a customer or user group. You can issue reward currency for up to 10 users in bulk.
Notes
- For detailed information about our APIs and for hands-on testing, refer to the documentation on API Overview and a step-by-step guide in Make Your First API Call.
- This API adheres to reward currency limits for points and alternate currencies. If a limit is set, the system will not issue points beyond that limit to the customer.
- If a user returns the entire bill, the system revokes the reward currency (Loyalty program issued and manually issued) earned by the customer.
- If a user returns a partial bill, the system automatically revokes the entire manually issued currency. It then re-evaluates the points earned from the Loyalty program based on the updated bill amount.
Prerequisites
- Authentication: Basic Authentication
- Access group resource: N/A
Resource information
Field | Value |
---|---|
URI | /v2/customers/bulk/manualCurrencyAllocate |
HTTP Method | POST |
Pagination | N/A |
Batch support | Yes. Supports processing up to 10 reward currency issue requests in a single call. |
Rate limit information | N/A |
cURL example
curl --location 'https://eu.api.capillarytech.com/v2/customers/bulk/manualCurrencyAllocate' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Basic ****************************' \
--data '[
{
"orgId": 51135,
"programId": 2568,
"awardStrategyId": 108865,
"expiryStrategyId": 109345,
"promotionId": -1,
"sourceValue": 1000,
"eventName": "TransactionAdd",
"eventSourceId": "2152328861",
"currencyType": "PROMISED",
"identifierType": "mobile",
"identifierValue": "971249123481",
"source":"INSTORE",
"entityType":"CUSTOMER"
}
]'
Request body parameters
Parameter | Data type | Description | Required |
---|---|---|---|
|
| Unique identifier of the organisation. To retrieve the orgId, use the Get Org Details API. | Yes |
|
| Type of entity to issue the reward currency. Supported values: | No |
|
| Type of identifier for the customer. Required if Supported values: | No |
|
| Source of the user's account. Supported values: | No |
|
| ID of source. Provide this ID if the source is not | No |
|
| Unique ID of the user group, required if | No |
|
| Value of the customer identifier. Required if | No |
|
| Unique identifier of the program for which points are issued. | Yes |
|
| Unique identifier of the award strategy to be used, which defines how the issued reward currency is calculated. To get the | Yes |
|
| Unique identifier of the expiry strategy to be used, which defines when the issued reward currency expires. To get the | Yes |
|
| Transaction amount on which points are calculated. | Yes |
|
| Type of event triggering the issual. Supported values: | Yes |
|
| Unique ID of a loyalty promotion. To associate the reward currency issual with a promotion, provide the | No |
|
| Type of currency to be issued. Supported values: | No |
|
| Unique ID of the alternate currency that is generated when created. | No |
|
| Identifier for the event source. Provide the identifier based on the
| Yes |
|
| Identifier for the specific bill line item, if applicable. Provide this value when | No |
|
| Strategy for rounding the source value. Supported values: | No |
|
| Strategy for rounding the calculated points. Supported values: | No |
Request body
[
{
"eventName": "TransactionAdd",
"currencyType": "REGULAR",
"sourceValueRoundingStrategy": "FLOOR",
"pointsRoundingStrategy": "FLOOR",
"lookupParams": {
"identifierType": "id",
"entityType": "CUSTOMER",
"source": "INSTORE",
"identifierValue": "{{customerId}}"
},
"orgId": 100737,
"programId": 973,
"awardStrategyId": 13167,
"expiryStrategyId": 11833,
"sourceValue": -1,
"eventSourceId": "888812915"
}
]
[
{
"eventName": "TransactionAdd",
"currencyType": "REGULAR",
"sourceValueRoundingStrategy": "FLOOR",
"pointsRoundingStrategy": "FLOOR",
"lookupParams": {
"identifierType": "id",
"entityType": "CUSTOMER",
"source": "INSTORE",
"identifierValue": "{{customerId}}"
},
"orgId": 100737,
"programId": 973,
"awardStrategyId": 13167,
"expiryStrategyId": 11833,
"sourceValue": -1,
"eventSourceId": "888812915",
"alternateCurrencyIdentifier": "9DxGBP"
}
]
[
{
"orgId": 100737,
"programId": 973,
"awardStrategyId": 12311,
"expiryStrategyId": 11833,
"sourceValue": -1,
"eventName": "TransactionAdd",
"eventSourceId": "888812915",
"currencyType": "PROMISED",
"lookupParams": {
"identifierType": "id",
"identifierValue": "{{customerId}}",
"source": "INSTORE",
"entityType": "CUSTOMER"
}
}
]
[
{
"eventName": "TransactionAdd",
"currencyType": "PROMISED",
"sourceValueRoundingStrategy": "FLOOR",
"pointsRoundingStrategy": "FLOOR",
"lookupParams": {
"identifierType": "id",
"entityType": "CUSTOMER",
"source": "INSTORE",
"identifierValue": "{{customerId}}"
},
"orgId": 100737,
"programId": 973,
"awardStrategyId": 12311,
"expiryStrategyId": 11833,
"sourceValue": -1,
"eventSourceId": "888812915",
"alternateCurrencyIdentifier": "9DxGBP"
}
]
[
{
"eventName": "TransactionAdd",
"currencyType": "REGULAR",
"sourceValueRoundingStrategy": "FLOOR",
"pointsRoundingStrategy": "FLOOR",
"lookupParams": {
"identifierType": "id",
"entityType": "CUSTOMER",
"source": "INSTORE",
"identifierValue": "{{customerId}}"
},
"orgId": 100737,
"programId": 973,
"awardStrategyId": 11879,
"expiryStrategyId": 11833,
"sourceValue": 100,
"eventSourceId": "888812915",
"alternateCurrencyIdentifier": "9DxGBP"
},
{
"orgId": 100737,
"programId": 973,
"awardStrategyId": 11879,
"expiryStrategyId": 11833,
"sourceValue": 100,
"eventName": "TransactionAdd",
"eventSourceId": "888853513",
"currencyType": "REGULAR",
"alternateCurrencyIdentifier": "9DxGBP",
"lookupParams": {
"identifierType": "id",
"identifierValue": "564671435",
"source": "INSTORE",
"entityType": "CUSTOMER"
}
}
]
[
{
"orgId": 51186,
"programId": 2649,
"awardStrategyId": 111523,
"expiryStrategyId": 111581,
"promotionId": -1,
"sourceValue": 5000,
"eventName": "TransactionAdd",
"eventSourceId": "2152312071",
"currencyType": "REGULAR",
"lookupParams": {
"identifierType": "mobile",
"identifierValue": "919300000019",
"entityType":"USERGROUP2",
"groupId":61450
}
}
]
Response body parameters
Parameter | Datatype | Description |
---|---|---|
total | Integer | Total number of requests processed in the batch. |
success | Integer | Number of successfully processed requests. |
failures | Integer | Number of failed requests. |
data | Object | An object containing detailed results for each processed request. |
-status | String | Status of the individual request. Possible values: SUCCESS or FAILED . |
-entityId | Integer | ID of the customer/entity for which points were allocated. |
-sideEffects | Object | Details of the currency issual. |
-- entityType | String | Type of entity the points are issued. |
-- rawAwardedPoints | Double | Points awarded before rounding. |
-- awardedPoints | Integer | Final points awarded after rounding. |
-- rawAwardedValue | ||
-- awardedValue | ||
-- alternateCurrencyIdentifier | ||
-- alternateCurrencyName | ||
-- type | String | Type of reward currency issued. Possible values: points , alternate_currency |
warnings | Object | Warnings encountered when processing, if any. |
Response body
{
"total": 1,
"success": 1,
"failures": 0,
"data": [
{
"status": "SUCCESS",
"entityId": 387979573,
"sideEffects": [
{
"entityType": "USER",
"rawAwardedPoints": 500.000,
"awardedPoints": 500,
"type": "points"
}
]
}
],
"warnings": []
}
{
"total": 1,
"success": 1,
"failures": 0,
"data": [
{
"status": "SUCCESS",
"eventLogId": 634634563,
"entityId": 566135941,
"sideEffects": [
{
"entityType": "USER",
"rawAwardedValue": 200.000,
"alternateCurrencyIdentifier": "9DxGBP",
"alternateCurrencyName": "DocCoin",
"awardedValue": 200,
"type": "alternate_currency"
}
]
}
],
"warnings": []
}
API Specific Error Codes
Code | Description | Reason |
---|---|---|
8136 | Program with id not found | programId provided is invalid |
8136 | Award Strategy not found with id : <id number> | awardStrategyId provided is invalid |
8136 | Expiry strategy not found with id : : <id number> | expiryStrategyId provided is invalid |
8136 | Event not supported for Manual currency allocation, Supported events are [TransactionAdd, TargetCompleted, Behavioural events] | eventName provided is invalid or unsupported. |
8139 | Bill not found with id <id number> | eventSourceId provided is invalid. |
8136 | Alternate currency not found with provided identifier : <alternate currency id> | alternateCurrencyIdentifier provided is invalid |