Deduct points from user using userId

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
  • Make sure you have the access to Points access group resource. For more information, see access group documentation.

Resource information

URIv2/customers/{userid}/negativePointsAdjustment
HTTP methodPOST
PaginationNA
Rate limitNA
Batch supportNA

API endpoint example

https://eu.api.capillarytech.com/v2/customers/{userid}/negativePointsAdjustment?source=INSTORE

Request path parameters

Field NameData TypeDescription
userId*IntegerUnique ID of the customer (customerId).
Note: When using userId as an identifier, request it within the path parameter.

Request query parameters

Field nameData typeDescription
sourceEnumSource 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 nameData typeDescription
pointsToBeAdjusted*IntegerPoints which need to be deducted for the user. (value should be >0)
programIdIntegerUnique ID of the loyalty program to associate with the promotion.
reasonOfReturn*StringEnter the reason for the return of the points.
pointsAwardedIdIntegerUnique ID of the awarded points.
promotionIdIntegerUnique 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.
promotionIdentifierstringIdentifier for the promotion. NOTE : If promotionIdentifier is passed, programId can not be empty/null.
pointsAwardedRefTypestringReference 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 nameData typeDescription
StatusStringStatus of the API call
pointsAvailableIntegerPoints available for the customer after the points deduction
messageStringNote for the point deduction
warningsArrayWarnings (if any)
{
    "status": "success",
    "pointsAvailable": "670.000",
    "message": "points deducted successfully for the user ",
    "warnings": []
}

API Error Codes

CodeDescriptionReason
8906decimal places passed: 3 is greater than the configured round decimals: 2 for programId: 973Decimal places are higher than configured decimals for the program.
8015Customer not found for the given identifiersIdentifier value is invalid or incorrect.
8907points 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.
Language
Credentials
Basic
base64
:
URL
Click Try It! to start a request and see the response here!