Deduct Points and Alternate Currencies from user group

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

This API deducts reward currencies (points or alternate currencies) from a user group or fleet ledger. Identify the group using any of the supported query parameters.

šŸ“˜

Notes

  • For detailed information about our APIs and for hands-on testing, see API overview and Make your first API call.
  • You can enable ALLOW_NEGATIVE_BALANCE_ON_RETURN to allow the group points balance to go negative. For example, if the group has zero points, you can still deduct 100 points from it. To enable, raise a JIRA ticket to the Capillary product support team.
  • This API overrides the CONF_POINTS_RETURN_ENABLED configuration that prevents reversal of earned points on transaction returns. Points are reversed even if the configuration is disabled.
  • To deduct points from an individual customer instead of a group, see Deduct points and alternate currencies from user.

Example request

curl --location 'https://eu.api.capillarytech.com/v2/userGroup2/negativePointsAdjustment?externalId=fleet_group_123' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Basic <base64-encoded-credentials>' \
--data '{
    "pointsToBeAdjusted": "100.00",
    "programId": 3500,
    "reasonOfReturn": "store redemption"
}'

Prerequisites

  • Authentication: Basic or OAuth authentication.
  • Access to the Points access group resource. For more information, see access group documentation.

Query parameters

Pass at least one of id, externalId, primaryUserId, or primaryUserIdentifierType + primaryUserIdentifierValue to identify the group.

FieldTypeRequiredDescription
idIntegerConditionalIdentifier for the user group.
externalIdStringConditionalExternal ID of the user group.
primaryUserIdIntegerConditionalUser ID of the primary member. The group associated with this member is resolved.
primaryUserIdentifierTypeEnumConditionalIdentifier type for looking up the primary member. Supported values: mobile, email, externalId, userId, cardnumber. Provide primaryUserIdentifierValue along with this parameter.
primaryUserIdentifierValueStringConditionalValue of the primary member identifier. Provide primaryUserIdentifierType along with this parameter.
primaryUserSourceEnumConditionalSource in which the primary member identifier is registered. Supported values: INSTORE, WEB_ENGAGE, WECHAT.
primaryUserAccountIdStringConditionalAccount ID for the primary member.

Body parameters

FieldTypeRequiredDescription
pointsToBeAdjustedStringRequiredPoints to deduct from the group. Provide a value greater than 0. Applicable for points.
reasonOfReturnStringRequiredReason for the points deduction.
programIdIntegerOptionalUnique ID of the loyalty program.
valueToBeAdjustedStringOptionalAlternate currencies to deduct from the group. Provide a value greater than 0. Applicable for alternate currencies. Provide alternateCurrencyName along with this parameter.
alternateCurrencyNameStringOptionalUnique name of the alternate currency. See viewing alternate currencies.
pointCategoryTypesEnumOptionalPoints category to deduct. Supported values: REGULAR, PROMISED, EXTERNAL_TRIGGER_BASED. Defaults to REGULAR. See points categories.
pointsAwardedIdIntegerOptionalUnique ID of the awarded points entry. Provide pointsAwardedRefType along with this parameter. This ID cannot be retrieved through an API — contact the Capillary support team to obtain it.
pointsAwardedRefTypeEnumOptionalReference type for the awarded points entry. Supported values: bill_regular, bill_promotions, line_item_regular, line_item_promotions, customer_promotions.
promotionIdIntegerOptionalUnique identifier of the promotion. Provide either promotionId or promotionIdentifier, not both.
promotionIdentifierStringOptionalExternal identifier of the promotion. Provide programId along with this parameter.

Example response

{
    "status": "success",
    "pointsAvailable": "490.000",
    "message": "points deducted successfully for the user ",
    "warnings": []
}

Response parameters

FieldTypeDescription
statusStringStatus of the deduction. Possible value: success.
pointsAvailableStringGroup points balance after the deduction.
messageStringNote for the deduction operation.
warningsArrayArray of warning objects returned for non-fatal conditions. Empty on a successful deduction.

Error & warning codes

CodeTypeDescription
1635ErrorNo group identifier passed. Provide at least one of: id, externalId, primaryUserId, or primaryUserIdentifierType.
1632ErrorGroup identifier doesn't resolve to a valid group.
8888ErrorPoints to be adjusted can't be zero. Provide a value greater than 0.
8882ErrorReason for adjustment can't be null.
8907ErrorPoints to deduct exceed the available group points balance and ALLOW_NEGATIVE_BALANCE_ON_RETURN is disabled for the org.
8887ErrorprogramId not provided along with promotionIdentifier.
8874ErrorpromotionId is invalid or incorrect.
8877ErrorpointsAwardedId is invalid or incorrect.
9975ErrorpointsAwardedRefType is invalid or incorrect.
8911ErroralternateCurrencyName not found for the program in this org.
1218ErrorGroup not enrolled in the loyalty program, or programId is invalid or incorrect.
Query Params
integer
string
integer
string
string
string
string
Body Params
string
required
string
required
integer
string
string
string
enum
Defaults to REGULAR
Allowed:
integer
string
enum
Allowed:
integer
string
Headers
string
Response

Language
Credentials
Basic
base64
:
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json