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 node interacts with a Digital Wallet Cards loyalty program API, specifically managing loyalty cards and their transactions. The "Add Visits" operation for the "Card" resource allows users to add a specified number of visits to a loyalty card. This is useful in scenarios where businesses track customer visits as part of a rewards or loyalty program.
For example, a coffee shop could use this operation to increment the visit count on a customer's loyalty card each time they make a purchase, enabling rewards based on visit frequency.
Properties
| Name | Meaning |
|---|---|
| Amount | The number of visits to add to the card (must be a non-negative number, precision 2). |
| Description | Optional text describing the reason or details of the visit addition transaction. |
| Transaction ID | Optional unique identifier for tracking the transaction; if omitted, one is generated automatically. |
Output
The output JSON contains the response from the API after adding visits to the card. It typically includes details about the updated card state or confirmation of the transaction. The exact structure depends on the API but generally confirms success and may include updated visit counts or transaction metadata.
No binary data output is involved in this operation.
Dependencies
- Requires an API key credential configured in n8n to authenticate requests to the Digital Wallet Cards API.
- The node makes HTTP POST requests to the endpoint
/api/v2/cards/{cardId}/add-visit. - Uses utility functions for request handling, parameter validation, and response transformation bundled within the node's codebase.
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 invalid number format may cause API rejection.
- API Errors: Network issues or invalid credentials will result in errors from the API. Ensure the API key is valid and the service is reachable.
- Transaction ID Conflicts: If a duplicate transaction ID is used, the API might reject the request or treat it as a duplicate. It's recommended to let the node generate this automatically unless you have a specific tracking system.
Links and References
- Digital Wallet Cards API Documentation (assumed base URL from code)
- n8n documentation on Creating Custom Nodes
- General REST API usage best practices for idempotent transaction handling