Digital Wallet Cards icon

Digital Wallet Cards

Interact with Digital Wallet Cards loyalty program API

Overview

The "Deduct Amount" operation on the Card resource allows you to subtract a specified monetary amount from a loyalty card's balance within a digital wallet or loyalty program system. This is useful in scenarios where a customer redeems part of their stored balance for purchases, refunds, or adjustments.

Practical examples include:

  • Deducting the cost of a purchase from a customer's prepaid card balance.
  • Adjusting balances after returns or cancellations.
  • Managing loyalty card balances in retail or service environments.

This operation ensures accurate tracking and management of card balances by recording each deduction as a transaction with optional descriptive details and transaction IDs for audit purposes.

Properties

Name Meaning
Amount The numeric amount to deduct from the card balance (precision up to 2 decimals, minimum 0).
Description Optional text describing the reason or context for the deduction operation.
Transaction ID Optional unique identifier for the transaction to help with tracking and reconciliation.

Output

The output JSON contains the response from the API after performing the deduction. It typically includes details about the updated card balance and confirmation of the transaction. The exact structure depends on the API but generally confirms success and provides updated card state information.

No binary data output is involved in this operation.

Dependencies

  • Requires an active connection to the Digital Wallet Cards API endpoint (https://api.digitalwallet.cards).
  • Requires valid API authentication credentials configured in n8n to authorize requests.
  • Utilizes internal utility functions for making HTTP requests, validating required fields, cleaning objects, and formatting responses.

Troubleshooting

  • Missing Required Fields: If cardId or amount is not provided, the node will throw an error indicating these are required.
  • Invalid Amount: Providing a negative amount or zero may cause validation errors or be rejected by the API.
  • API Errors: Network issues, invalid credentials, or API limits can cause request failures. Check API key validity and network connectivity.
  • Duplicate Transaction IDs: Reusing a transaction ID might cause conflicts; ensure transaction IDs are unique or omitted to auto-generate.
  • Empty Description: While optional, providing meaningful descriptions helps with auditing and troubleshooting transactions.

Links and References


If you need details on other operations or resources, feel free to ask!

Discussion