Skip to main content
WAPIfor

Retail

Deploy a high-performance rewards ecosystem that scales with your ambition. WAPI provides the financial-grade ledgering infrastructure needed to transform simple "points" into a fluid, multi-asset retail economy—without the overhead of traditional banking stacks.

1// Define a unique bonus asset and register the customer
2await wapi.createToken({
3 foreign: 'EUR:bonus',
4});
5
6await wapi.createWallet({
7 foreign: 'client123',
8 metadata: {
9 shop: 'Tallinn',
10 }
11});
12
13// Distribute promotional bonus to the user
14const grantUserBonus = await wapi.createDeposit({
15 token: 'EUR:bonus',
16 wallet: 'client123',
17 amount: 2,
18});
19
20// Combine deposit, bonus conversion, and merchant payment
21
22await wapi.createTransferGroup(
23 {
24 identifier: "order-123",
25 children: [
26 {
27 // External deposit
28 wallet: "client123",
29 type: "deposit",
30 amount: 10,
31 token: "EUR",
32 },
33 {
34 // Burn bonus
35 wallet: "client123",
36 type: "withdrawal",
37 amount: 2,
38 token: "EUR:bonus",
39 },
40 {
41 // Convert to EUR
42 wallet: "client123",
43 type: "deposit",
44 amount: 2,
45 token: "EUR",
46 },
47 { // Final payment
48 from_wallet: "client123",
49 to_wallet: "shop1",
50 amount: 12,
51 token: "EUR",
52 },
53 ],
54 },
55 { create_to_wallet_if_not_exists: true }
56);
57
58// Mark the entire group as finished and verify the shop's revenue
59await wapi.updateTransferGroup({
60 transfer_group: 'order-123',
61 transfer_status: 'finished',
62});
63
64const balance = await wapi.getBalance({
65 token: 'EUR',
66 wallet: 'shop1',
67});

Frequently Asked Questions

Get started with WAPI.

Leave your email, we will get in touch with you as soon as possible.