Skip to main content
The Swaps API prepares a transaction for the user wallet. COP By does not sign or submit it.

Supported pairs

Amounts use token atomic units: USDT and USDC have 6 decimals; COPm and USDm have 18.

1. Prepare

Call POST /api/integrations/swaps/prepare with the wallet, tokens, amount, and slippage. The response contains the transaction data the wallet must review and sign.
Never sign on behalf of a user or modify the returned target, calldata, token, or amount.

2. Submit from the wallet

Ask the connected wallet to submit the prepared transaction on Celo. Keep the returned intentId and transaction hash together.

3. Confirm

Call POST /api/integrations/swaps/{intentId}/confirm with the transaction hash. COP By verifies and records the result; a prepared intent alone is not a completed swap.

4. Reconcile

Use GET /api/integrations/swaps with your integration_id, an optional since timestamp, and a limit of up to 500. The API key must belong to that integration.

Authentication

Protect the integration key and understand tenant isolation.

Errors and lifecycle

Decide when to retry, requote, or ask the user to sign again.