Skip to main content
WAPIfor

e-Commerce

Simplify the architecture of your marketplace or storefront with a ledgering system built for the modern web. WAPI provides the infrastructure to handle multi-party settlements, automated shipping fees, and real-time reconciliation—all within a single, high-throughput environment.

1// Ensure the buyer has a dedicated ledger entry
2await wapi.createWallet({
3 foreign: 'buyer1',
4 metadata: {
5 location: 'EU',
6 }
7});
8
9// Map a single order to multiple ledger movements
10await wapi.createTransferGroup({
11 identifier: 'order1',
12 children: [
13 // Initial deposit from external provider
14 { wallet: 'buyer1', token: 'EUR', amount: 12, type: 'deposit', metadata: { paypal: true } },
15 // Payment for the seller
16 { from_wallet: 'buyer1', to_wallet: 'seller1', token: 'EUR', amount: 10 },
17 // Payment for shipping
18 { from_wallet: 'buyer1', to_wallet: 'house', token: 'EUR', amount: 2, metadata: { shipping: true } }
19 ],
20});
21
22// Commit all sub-transfers simultaneously
23await wapi.updateTransferGroup({
24 transfer_group: 'order1',
25 transfer_status: 'finished',
26});
27
28// Fetch a consolidated view of the transaction's impact
29const balances = await wapi.findBalances()
30 .where('token', 'EUR')
31 .where((t) => {
32 return t.where('wallet', 'buyer1')
33 .orWhere('wallet', 'seller1')
34 .orWhere('wallet', 'house');
35 })
36 .orderBy('wallet_foreign asc');

Frequently Asked Questions

Get started with WAPI.

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