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 Stamps" operation on the Card resource allows users to subtract a specified number of stamps from a loyalty card within a digital wallet or loyalty program system. This operation is useful in scenarios where customers redeem stamps for rewards, or when correcting stamp balances due to returns or errors.
Practical examples include:
- Deducting stamps after a customer redeems a reward that costs a certain number of stamps.
- Adjusting stamp counts if a transaction was reversed or canceled.
- Managing loyalty programs where stamps represent visits or purchases and need to be decremented accordingly.
This operation ensures accurate tracking of stamp balances on customer loyalty cards.
Properties
| Name | Meaning |
|---|---|
| Amount | The number of stamps to deduct from the card. Must be a non-negative number with up to two decimal places. |
| Description | Optional text describing the reason or details of the deduction operation. |
| Transaction ID | Optional unique identifier for the transaction, used for tracking purposes. If not provided, one is generated automatically. |
Output
The output JSON contains the response from the API after performing the deduction operation. It typically includes updated card information reflecting the new stamp balance and metadata about the transaction.
Example fields in the output may include (but are not limited to):
- Updated stamp count on the card.
- Confirmation of the transaction including the transaction ID.
- Any messages or status indicators returned by the API.
The node does not output binary data for this operation.
Dependencies
- Requires an active connection to the Digital Wallet Cards API.
- An API authentication token or API key credential must be configured in n8n to authorize requests.
- The node uses HTTP POST requests to the endpoint
/api/v2/cards/{cardId}/subtract-stampto perform the deduction.
Troubleshooting
- Missing Required Fields: The operation requires
cardIdandamount. Omitting these will cause validation errors. - Invalid Amount: Providing a negative amount or zero may result in API rejection or no change.
- Transaction ID Conflicts: If a duplicate transaction ID is provided, the API might reject the request or treat it as a duplicate.
- API Connectivity Issues: Network problems or invalid credentials will cause request failures.
- Card Not Found: Using an incorrect or non-existent card ID will result in an error from the API.
To resolve these issues:
- Ensure all required parameters are set correctly.
- Use valid and existing card IDs.
- Provide positive amounts for deductions.
- Check API credentials and network connectivity.
- Avoid reusing transaction IDs unless intentional.
Links and References
- Digital Wallet Cards API Documentation (hypothetical link)
- n8n documentation on Creating Custom Nodes
- General best practices for Loyalty Program Management (example external resource)