Actions47
- Template Actions
- Communication Actions
- Card Actions
- Create
- Get
- Get All
- Update
- Delete
- Get Balance
- Add Points
- Deduct Points
- Add Amount
- Deduct Amount
- Add Stamps
- Deduct Stamps
- Transfer Points
- Transfer Amount
- Block Card
- Unblock Card
- Generate QR Code
- Get Operations
- Add Visits
- Deduct Visits
- Add Reward
- Deduct Reward
- Receive Reward
- Redeem Coupon
- Set Expiration Date
- Set Membership Tier
- Customer Actions
- Company Actions
- Analytics Actions
- System Actions
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
cardIdoramountis 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
- Digital Wallet Cards API Documentation (hypothetical link based on base URL)
- n8n Documentation on Creating Custom Nodes
- General best practices for managing loyalty card transactions and balances.
If you need details on other operations or resources, feel free to ask!