post https://{host}/v2/customers/lookup/negativePointsAdjustment
This API allows you to deduct points from a user. It is also referred to as the Manual Points Adjustment API
. Additionally, you can raise a request to enable configuration ALLOW_NEGATIVE_BALANCE_ON_RETURN
that support negative points. For example, if the negative points configuration is enabled and the currently available points for a customer are 0, you can still deduct 100 points from a customer.
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
- Access to Points access group resource. For more information, see access group documentation.
Resource information
URI | v2/customers/lookup/negativePointsAdjustment |
HTTP method | POST |
Pagination | NA |
Rate limit | NA |
Batch support | NA |
API endpoint example
https://eu.api.capillarytech.com/v2/customers/lookup/negativePointsAdjustment?identifierName=mobile&identifierValue=9876543210&source=INSTORE
Request query parameters
Field name | Data type | Description |
---|---|---|
identifierName* | Enum | Identifier of the user. Supported values: externalId, mobile |
identifierValue* | String | Value of the identifier. |
source* | Enum | Source in which the identifier is available. Supported values: INSTORE , MARTJACK , WECHAT , FACEBOOK , WEB_ENGAGE , INSTORE , TMALL , TAOBAO , JD , ECOMMERCE , WEBSITE , LINE , ALL . |
Request body parameters
Field name | Data type | Description |
---|---|---|
pointsToBeAdjusted* | Integer | Points which need to be deducted for the user. (value should be >0) |
programId | Integer | Unique ID of the loyalty program to associate with the promotion. |
reasonOfReturn* | String | Enter the reason for the return of the points. |
pointsAwardedId | Integer | Unique ID of the awarded points. |
promotionId | Integer | Unique identifier for the promotion NOTE: If promotionId and promotionIdentifier both are set, it is an invalid input combination. Either of 1 needs to be passed and not both. |
promotionIdentifier | string | Identifier for the promotion. NOTE : If promotionIdentifier is passed, programId can not be empty/null. |
pointsAwardedRefType | Enum | Reference type for points awarded. Supported values: bill_regular , bill_promotions , line_item_regular , line_item_promotions , customer_promotions |
{
"pointsToBeAdjusted": "100.00",
"programId": 469,
"reasonOfReturn": "testing"
}
Response parameters
Field name | Data type | Description |
---|---|---|
Status | String | Status of the API call |
pointsAvailable | Integer | Points available for the customer after the points deduction |
message | String | Note for the point deduction |
warnings | Array | Warnings (if any) |
{
"status": "success",
"pointsAvailable": "670.000",
"message": "points deducted successfully for the user ",
"warnings": []
}
API Error Codes
Code | Description | Reason |
---|---|---|
8906 | decimal places passed: 3 is greater than the configured round decimals: 2 for programId: 973 | Decimal places are higher than configured decimals for the program. |
8003 | Invalid source | Source is invalid or incorrect. |
8015 | Customer not found for the given identifiers | Identifier value is invalid or incorrect. |
8013 | Lookup,Invalid identifier passed | Type of identifier is invalid or incorrect. |
8907 | points to be deducted 101.54 is greater than available points for program and NegativeBalanceOnReturn config is disabled for org. | Points to deduct is higher than the available points balance. |