> ## 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.
</Warning>

## 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.

<Columns cols={2}>
  <Card title="Authentication" icon="key" href="/authentication">
    Protect the integration key and understand tenant isolation.
  </Card>

  <Card title="Errors and lifecycle" icon="triangle-exclamation" href="/errors-lifecycle">
    Decide when to retry, requote, or ask the user to sign again.
  </Card>
</Columns>
