Digital Wallet Cards icon

Digital Wallet Cards

Interact with Digital Wallet Cards loyalty program API

Overview

The "Deduct Reward" operation on the Card resource allows users to subtract a specified reward amount from a loyalty card within a digital wallet or loyalty program system. This operation is useful in scenarios where rewards need to be redeemed, adjusted, or corrected on a customer's card balance.

Typical use cases include:

  • Redeeming rewards when a customer uses them for purchases.
  • Adjusting reward balances due to returns or cancellations.
  • Correcting errors in reward allocations.

For example, if a customer redeems 10 reward points for a discount, this operation deducts those 10 points from their card's reward balance.

Properties

Name Meaning
Amount The numeric amount of the reward to deduct (must be zero or positive, with up to 2 decimals).
Description Optional text describing the reason or context for the deduction operation.
Transaction ID Optional unique identifier for tracking the transaction; if not provided, one is generated automatically.

Output

The output JSON contains the response from the API after performing the deduction. It typically includes details about the updated card state, such as the new reward balance and confirmation of the transaction.

Example structure (simplified):

{
  "cardId": "string",
  "rewardBalance": "number",
  "transactionId": "string",
  "description": "string",
  "timestamp": "ISO8601 datetime"
}

No binary data output is involved in this operation.

Dependencies

  • Requires an active connection to the Digital Wallet Cards API.
  • Needs an API authentication token configured in n8n credentials to authorize requests.
  • The node uses internal utility functions for making HTTP requests, validating fields, and formatting responses.

Troubleshooting

  • Missing Required Fields: If cardId or amount is missing or invalid, the node will throw an error indicating required parameters are missing.
  • Invalid Amount: Amount must be a non-negative number with up to two decimal places; negative values or invalid formats will cause errors.
  • API Errors: Errors returned by the external API (e.g., insufficient reward balance, invalid card ID) will be propagated. Check the error message for details.
  • Transaction ID Conflicts: If a duplicate transaction ID is used, the API might reject the request. Use unique IDs or omit to auto-generate.
  • Network Issues: Connectivity problems with the API endpoint will result in request failures.

To resolve issues:

  • Ensure all required inputs are correctly set.
  • Verify API credentials and network connectivity.
  • Review API error messages for specific causes.

Links and References

Discussion