> ## Documentation Index
> Fetch the complete documentation index at: https://docs.copby.digitalcop.shop/llms.txt
> Use this file to discover all available pages before exploring further.

# Celo swaps

> Prepare, sign, confirm, and reconcile COPm swaps on Celo.

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

```text theme={null}
Prepare intent → user signs on Celo → confirm tx hash → read confirmed swaps
```

## Supported pairs

| From | To |
| - | - |
| USDT, USDC, or USDm | COPm |
| COPm | USDT |

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.

> [!WARNING]
>
> 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.

> [card] [Authentication](https://docs.copby.digitalcop.shop/authentication.md)
>
> Protect the integration key and understand tenant isolation.

> [card] [Errors and lifecycle](https://docs.copby.digitalcop.shop/errors-lifecycle.md)
>
> Decide when to retry, requote, or ask the user to sign again.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.