These are the calls of API v2 for this flow. $W3C_API stands for the API address of your environment, like https://api.sandbox.creditcard/v2, and $W3C_API_KEY for your key.
- 1Bring the token
The Bridge of the app brings the token to the program token, on the network of the program, in the person's own wallet. The person signs each transaction: nothing goes through the platform, and there is no API call.
# The bridge has no API call.# It runs in the Bridge screen of your users' app, or in the Bridge tab of the panel:# the person picks the token and signs each transaction in their own wallet. It arrives as USDC on Polygon.# Nothing goes through you or the platform. - 2Receive in the wallet
The route ends in the person's wallet, on the network of the program. The balance of the token shows there.
# The route ends in the person's wallet, with USDC on Polygon.# Read the balance of the token in the wallet: no API call is needed. - 3Deposit into the program
Deposits go from the wallet into your program contract. The API returns the two transactions to sign: the authorization of the amount and the deposit. A deposit counts for the wallet that signs it.
Responsecurl -X POST "$W3C_API/vault/deposits" \-H "Authorization: Bearer $W3C_API_KEY" \-H "Content-Type: application/json" \-H "Idempotency-Key: deposit-0001" \-d '{"amount": 100}'{"success": true,"onchain": {"network": "polygon","chainId": 137,"vault": "0xVAULT","token": "USDC","tokenAddress": "0xTOKEN","decimals": 6,"amount": "100000000"},"quote": {"currency": "USD","minDeposit": 5,"vaultCostsMax": 5,"maxCosts": 5.01},"calls": [{"chainId": 137,"to": "0xTOKEN","data": "0x095ea7b3…","value": "0","method": "approve(address,uint256)","args": ["0xVAULT", "100000000"],"skipIfAllowanceAtLeast": "100000000"},{"chainId": 137,"to": "0xVAULT","data": "0xe2bbb158…","value": "0","method": "deposit(uint256,uint256)","args": ["100000000", "5010000"]}]} - 4Top up the card
Moves balance from the program to the card. The API returns the transaction for the wallet to sign, and the Idempotency-Key makes a repeated call safe.
Responsecurl -X POST "$W3C_API/cards/card_7KQ2M9XF3TB1A/loads" \-H "Authorization: Bearer $W3C_API_KEY" \-H "Content-Type: application/json" \-H "Idempotency-Key: topup-card_7KQ2M9XF3TB1A-0001" \-d '{"amount": 100}'{"success": true,"onchain": {"network": "polygon","chainId": 137,"vault": "0xVAULT","token": "USDC","tokenAddress": "0xTOKEN","decimals": 6,"amount": "100000000"},"quote": {"currency": "USD","loadPriceBps": 200,"loadPrice": 2,"programCostsMax": 0,"maxCharges": 2.01},"calls": [{"chainId": 137,"to": "0xVAULT","data": "0x57c0b6ff…","value": "0","method": "requestLoad(uint256,uint256,bytes32,uint256)","args": ["1", "100000000", "0x5f1c…9a20", "2010000"]}]} - 5Receive the event
Your systems get a signed event when the flow ends. Check the signature before trusting it.
# POST to your webhook URL# X-W3C-Timestamp: 1795183200# X-W3C-Signature: v1=<HMAC SHA-256 of the timestamp, a dot and the raw body>{"id": "evt_3T9KQ2M7XB4AP","type": "top_up.completed","createdAt": "2026-11-20T14:00:00Z","livemode": false,"data": {"cardId": "card_7KQ2M9XF3TB1A","userId": "user_4M8T2KX9PQ7AB","loadId": 42,"transactionId": "tx_9B2KQ7M4XT8AP","amount": 100}}
Cosa mostra il costruttore di flussi
Il costruttore di flussi funziona nel tuo browser. Non viene inviato nulla e nessun wallet viene collegato. Gli importi, gli indirizzi e gli identificatori nel codice sono esempi.
Scegli un token e la sua rete a sinistra, poi dove deve arrivare. Il flusso a destra disegna ogni passaggio del token. Passa il cursore su un passaggio per vedere la sua chiamata nel codice qui sotto, oppure fai clic per raggiungerla.
Dove inizia un flusso
Un flusso inizia nel wallet dell'utente, su una di queste reti.
| Rete | Token |
|---|---|
| BNB Chain | BNB, USDT, USDC |
| Ethereum | ETH, USDT, USDC |
| Arbitrum | ETH, USDT, USDC |
| Polygon | POL, USDT, USDC |
| Base | ETH, USDC |
Your project token segue il percorso che funziona oggi. La tua azienda crea un pool del tuo token con USDT o USDC su un exchange decentralizzato (DEX), con il proprio wallet, e vi mantiene liquidità. La persona scambia il token in quel pool, firmando nel proprio wallet, fuori dalla piattaforma: il vault del tuo programma accetta solo USDT o USDC, e il Bridge dell'app non accetta token di progetto. Da lì il percorso è quello di qualsiasi USDT o USDC.
Dove finisce un flusso
| Destinazione | Cosa succede |
|---|---|
| Your wallet | La persona riceve il token del programma, sulla rete del programma, nel proprio wallet |
| Program contract | Il token del programma viene depositato nel tuo contratto del programma e diventa saldo del wallet che ha effettuato il deposito |
| Visa card | Dopo il deposito, una ricarica sposta il saldo dal contratto a una carta, pronta per essere spesa |
La rete del programma (Program network) e il token del programma (Program token) sono quelli del tuo contratto del programma: BNB Chain, Arbitrum o Polygon, con USDT o USDC, scelti una sola volta alla creazione del contratto. Selezionali a sinistra per vedere il percorso e le chiamate del tuo programma. USDT e USDC hanno 18 decimali su BNB Chain e 6 sulle altre reti, e gli importi nel codice li rispettano.
I passaggi di un percorso
| Passaggio | Cosa fa |
|---|---|
| DEX swap | Solo per il token del tuo progetto: la persona lo scambia con USDT o USDC nel pool della tua azienda, fuori dalla piattaforma |
| Web3Card Bridge | Porta il token da un'altra rete alla rete del programma, convertendolo lungo il percorso quando serve |
| Deposit | Sposta il token del programma dal wallet al tuo contratto del programma |
| Top up | Sposta il saldo dal contratto a una carta. La commissione di ricarica si paga in aggiunta, quindi la carta riceve l'importo intero |
La persona firma ogni transazione nel proprio wallet. I token escono dal wallet e arrivano allo stesso wallet: lungo il percorso nulla passa da te o dalla piattaforma. Un token che è già il token del programma, sulla rete del programma, salta il bridge.
Le chiamate
Ogni passaggio del flusso mostra la sua chiamata dell'API v2 nel pannello Code, in cURL e in JavaScript, con una risposta di esempio. Il JavaScript del deposito e della ricarica è completo: interroga l'API, salta l'autorizzazione già sufficiente, firma ogni transazione con un wallet gestito dalla tua azienda e attende la rete. La rete, il chain id e gli importi in unità del token seguono il programma che hai scelto.
| Passaggio | Che cos'è |
|---|---|
| Scambiare il token del tuo progetto | Un exchange decentralizzato, nel pool della tua azienda. Non prevede chiamate a Web3Card: la persona firma nel proprio wallet |
| Portare il token | Il Bridge dell'app dei tuoi utenti, o la scheda Bridge del pannello. Non prevede chiamate API: la persona firma nel proprio wallet |
| Ricevere nel wallet | Il percorso finisce nel wallet della persona, sulla rete del programma. Nessuna chiamata API |
| Depositare nel programma | POST /v2/vault/deposits restituisce le due transazioni da firmare: l'autorizzazione dell'importo e il deposito. Consulta Depositare nel vault |
| Ricaricare la carta | POST /v2/cards/{id}/loads restituisce la transazione che il wallet deve firmare. Consulta Ricaricare una carta |
| Ricevere l'evento | I tuoi sistemi ricevono vault.deposit.completed o top_up.completed, firmati. Consulta Webhook |
$W3C_API indica l'indirizzo API del tuo ambiente, come https://api.sandbox.creditcard/v2, e $W3C_API_KEY la tua chiave.
Pagine correlate
| Pagina | Cosa tratta |
|---|---|
| Playground delle carte | Progetta una carta di esempio e guarda cosa fa ogni azione |
| Panoramica dell'API v2 | Che cos'è l'API v2 e i principi su cui è progettata |
| Carte e Paesi | Quale carta è adatta al tuo team o ai tuoi utenti e la verifica di qualsiasi Paese |