Modify customer balance arbitrarily
Learn how to modify wallets arbitrarily using Masivo’s REST API
You should only modify customers’ balances when you are certain of what you are doing and have the proper authorization to do so.
When to modify wallets
- Testing: You can use this feature to test your application’s behavior with different wallet balances.
- Customer support: Sometimes, you may need to adjust a customer’s balance due to a mistake or a special situation.
- Promotions: You can use this feature to give customers a bonus for a promotion or a special event.
Which modifications can be made
- Add funds: Create new “accumulation” transactions of a given reward.
- Subtract funds: Create new “redemption” transactions of a given reward.
Limitations
You will not be able to modify the existing transaction history of a customer. This means that new modifications will be added as new transactions.
How to modify wallets
Add funds
Create a new custom event type with a name that fits what you want to do. For instance: corrections.
Then create a new campaign that triggers when this event is emitted.
This campaign should have a rule that grants the customer a reward of the amount you want to add to their balance.
Finally, emit the event with the customer’s ID as the target.
Use the Emit event endpoint to emit the event.
Include in the metadata a ‘reason’ field to explain why the balance was modified.
A accumulation correction
Subtract funds
You don’t need to create a customer event type for this operation. But we recommend you to emit and event with a custom ‘type’ as shown in the example below.
Use the Emit event endpoint to emit a new event including the rewards you would like to subtract from the customer’s balance.
You will need to use the ‘redeem’ field in the top level of the event. This field does not validate if a reward can be redeemed, so you can use it to subtract funds arbitrarily.
Include in the metadata a ‘reason’ field to explain why the balance was modified.
A redemption correction