codespar_crypto_pay
Crypto payments. Stablecoin USD on Coinbase Commerce; crypto BRL on Bitso (BR fiat-onramp via crypto rail).
codespar_crypto_pay
Meta-tool
codespar_crypto_pay is the crypto-rail meta-tool. Use it when the buyer or recipient wants to settle in stablecoin or another crypto asset rather than fiat — typical for cross-border B2B settlement, stablecoin payouts, and Bitso's BR fiat-onramp flow.
There is no typed wrapper yet — call via session.execute().
Rails
| Rail | Currency | Country | Provider | Notes |
|---|---|---|---|---|
| Stablecoin | USD (USDC) | INTL | Coinbase Commerce | Default. Returns hosted payment URL |
| Crypto | BRL | BR | Bitso | BR-friendly fiat-onramp via crypto. hmac_signed auth pattern |
Coinbase Commerce returns a payment page URL — share with the user, they pay any supported chain, and the webhook lands when settled. Bitso is the right pick when the operator wants to accept BRL but settle internally in crypto (or vice versa).
Direct execute
const result = await session.execute("codespar_crypto_pay", {
amount: "0.05",
currency: "ETH",
method: "stablecoin",
recipient: { wallet_address: "0xabc..." },
metadata: { order_id: "1234" },
});
console.log(result.payment_url ?? result.destination_address, result.tool_call_id);Args shape
| Field | Type | Required | Description |
|---|---|---|---|
amount | string | number | Yes | Crypto amounts pass as decimal strings to avoid float rounding |
currency | string | Yes | USDC, ETH, BTC, BRL (Bitso) |
method | string | No | stablecoin (default), native_crypto |
recipient | object | No | { wallet_address } for outbound; omitted for inbound (returns hosted URL) |
metadata | object | No | Arbitrary key-value pairs |
Result shape
type CryptoPayResult = {
tool_call_id: string;
payment_url?: string; // Coinbase Commerce hosted URL — inbound flow
destination_address?: string; // for outbound payouts
expires_at?: string;
status: "pending"; // terminal state via paymentStatus
};Operator setup
- Coinbase Commerce — API key (
api_keyauth_type). Optional shared-secret for webhook verification. - Bitso —
hmac_signedauth_type. Operator stamps API key + API secret in/dashboard/auth-configs; runtime signs each request with HMAC-SHA256 overnonce + method + path + body.
The Coinbase Commerce catalog row currently has an auth-shape mismatch flagged in the operator runbook — verify the connect modal shows the right inputs (API key + shared secret) before stamping production credentials.
Async settlement
Crypto rails settle on-chain; latency varies by chain (seconds for most stablecoins on Polygon / Arbitrum, minutes on Bitcoin). The flow mirrors codespar_charge:
codespar_crypto_payreturns thepayment_urlordestination_addressand atool_call_id.- Buyer pays on the hosted page or sends the on-chain transfer.
- Provider webhook lands — backend correlates by
idempotency_key↔external_reference. session.paymentStatus(tool_call_id)returnssucceeded(orexpiredif the buyer abandoned).
See async settlement.
See also
- codespar_charge — fiat counterpart
- hmac_signed auth — Bitso authentication pattern
- Crypto Pay Agent cookbook — end-to-end stablecoin example
- Tools & meta-tools — full meta-tool list
Last updated on
codespar_ship
Domestic shipping. Three rails on Melhor Envio — domestic-label, domestic-quote, domestic-track. Typed wrapper session.ship(args).
codespar_kyc
Identity verification. Persona (default INTL), Sift (fraud-score), Konduto (BR fraud), Truora (LATAM-wide). Async — track via verificationStatus.