Digital Wallet Cards icon

Digital Wallet Cards

Interact with Digital Wallet Cards loyalty program API

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-stamp to perform the deduction.

Troubleshooting

  • Missing Required Fields: The operation requires cardId and amount. 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

Discussion