Modify Currency

Modify Currency

Add, remove, or set a user's wallet, bank, or crystals

Fields

FieldTypeRequiredDescription
targetenum: wallet | bank | crystalsyesWhich balance to modify.
operationenum: add | subtract | set | addPercent | subtractPercentyesaddPercent/subtractPercent compute floor(current * amount / 100).
amountnumber (as string) or {path}yesCapped at 1,000,000,000.
preventNegativebooleannoDefaults to true; floors the result at 0.
targetUserIdstring or {path}noCross-user write target; only valid on six of the seven modify_* step types (all except modify_status) plus read_field.

Example

{
  "id": "01H8XGJVBWX7Y5Z3K9M2N4P6Q1",
  "type": "modify_currency",
  "target": "wallet",
  "operation": "add",
  "amount": "50",
  "preventNegative": true
}

Did this page help you?