Passa al contenuto principale
FlowHover a step to see its call
Base walletThe user's wallet
Web3Card BridgeCross-chain route
User's walletOn Polygon
Program contractYour program on Polygon
VISAVisa cardVirtual card
Code

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.

  1. 1
    Bring 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.
  2. 2
    Receive 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.
  3. 3
    Deposit 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.

    curl -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
    }'
    Response
    {
    "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"]
    }
    ]
    }
  4. 4
    Top 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.

    curl -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
    }'
    Response
    {
    "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"]
    }
    ]
    }
  5. 5
    Receive 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.

ReteToken
BNB ChainBNB, USDT, USDC
EthereumETH, USDT, USDC
ArbitrumETH, USDT, USDC
PolygonPOL, USDT, USDC
BaseETH, 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​

DestinazioneCosa succede
Your walletLa persona riceve il token del programma, sulla rete del programma, nel proprio wallet
Program contractIl token del programma viene depositato nel tuo contratto del programma e diventa saldo del wallet che ha effettuato il deposito
Visa cardDopo 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​

PassaggioCosa fa
DEX swapSolo per il token del tuo progetto: la persona lo scambia con USDT o USDC nel pool della tua azienda, fuori dalla piattaforma
Web3Card BridgePorta il token da un'altra rete alla rete del programma, convertendolo lungo il percorso quando serve
DepositSposta il token del programma dal wallet al tuo contratto del programma
Top upSposta 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.

PassaggioChe cos'è
Scambiare il token del tuo progettoUn exchange decentralizzato, nel pool della tua azienda. Non prevede chiamate a Web3Card: la persona firma nel proprio wallet
Portare il tokenIl Bridge dell'app dei tuoi utenti, o la scheda Bridge del pannello. Non prevede chiamate API: la persona firma nel proprio wallet
Ricevere nel walletIl percorso finisce nel wallet della persona, sulla rete del programma. Nessuna chiamata API
Depositare nel programmaPOST /v2/vault/deposits restituisce le due transazioni da firmare: l'autorizzazione dell'importo e il deposito. Consulta Depositare nel vault
Ricaricare la cartaPOST /v2/cards/{id}/loads restituisce la transazione che il wallet deve firmare. Consulta Ricaricare una carta
Ricevere l'eventoI 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.

PaginaCosa tratta
Playground delle carteProgetta una carta di esempio e guarda cosa fa ogni azione
Panoramica dell'API v2Che cos'è l'API v2 e i principi su cui è progettata
Carte e PaesiQuale carta è adatta al tuo team o ai tuoi utenti e la verifica di qualsiasi Paese