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

# Payouts

> Read every transfer Compago sent to your bank account, and the sales, fees, refunds and balance behind it

## Overview

> [!NOTE]
>
> These examples call the production host. While you build, replace `https://api-harmony.compago.com` with `https://demo-api-harmony.compago.com` and use a key from the Demo dashboard. See [Environments](https://docs.compago.com/get-started/environments.md).

A payout is one SPEI transfer Compago sent to one of your bank accounts. It pays one or more settlements: a day's sales usually, or several days when they were held back until they reached the minimum transfer amount. `GET /developer/v1/payout` lists them, newest first, and `GET /developer/v1/payout/{id}/line` itemizes one, so you can match each deposit on your bank statement to the sales it paid.

```bash theme={null}
curl "https://api-harmony.compago.com/api/developer/v1/payout?status=PAID&limit=50" \
  -H "x-api-key: $COMPAGO_API_KEY"
```

## The payout object

```json theme={null}
{
  "id": "0b6f2c1e-4d3a-4c8b-9e7f-1a2b3c4d5e6f",
  "status": "PAID",
  "amount": 1408.35,
  "feeAmount": 14.08,
  "netAmount": 1394.27,
  "currency": "MXN",
  "trackingKey": "CMPG2026110300001",
  "bankAccountId": "5b1d7c2e-8a34-4f6b-9c1d-0e2f3a4b5c61",
  "periodFrom": "2026-11-01T06:00:00.000Z",
  "periodTo": "2026-11-03T06:00:00.000Z",
  "paidAt": "2026-11-03T15:01:00.000Z",
  "returnReason": null,
  "returnReasonCode": null,
  "createdAt": "2026-11-03T15:00:00.000Z"
}
```

> [accordion] amount, feeAmount and netAmount
>
> `amount` is what the settlements in this payout owe you. `feeAmount` is what Compago charged for sending the money early, when you asked for it from the dashboard before your balance reached the minimum transfer amount; it is `0` on every transfer sent on schedule. `netAmount` is `amount - feeAmount`: the figure that lands in your bank account.

> [accordion] trackingKey is the SPEI clave de rastreo
>
> The tracking key your bank statement shows for the deposit, and the one Banxico's CEP is looked up with. It is `null` until the bank assigns it, and on a transfer Compago settled by hand.

> [accordion] bankAccountId is where the money went
>
> Match it against [`GET /developer/v1/bank-account`](https://docs.compago.com/developer/organization#bank-accounts) to show the account's name. It is `null` on payouts from before your business could have more than one account. The account number, its holder and its bank are never returned.

> [accordion] paidAt is the bank's date
>
> When the transfer happened, by the bank's clock when it gave one. Only set on `PAID`.

> [accordion] returnReason explains a refused transfer
>
> On `FAILED` and `RETURNED`, the reason and SPEI code the bank gave, for example a closed account. `null` on every other status.

## Statuses

| Status | Meaning |
| - | - |
| `SCHEDULED` | Created and waiting its turn to be sent. Nothing has left Compago yet |
| `IN_TRANSIT` | Sent to the bank, not confirmed yet |
| `PAID` | Deposited in your account |
| `FAILED` | The bank refused the transfer. The money is still owed to you and is sent again in a new payout |
| `RETURNED` | The money reached the bank and came back. It is owed to you again and is sent in a new payout |
| `IN_REVIEW` | A return or a rejection Compago has to confirm by hand before anything else happens |

> [!NOTE]
>
> A transfer that failed is not edited into a success: the retry is a new payout with its own `id`. Filtering by `paymentId` returns both, so you can see the whole history of a sale's deposit.

## Lines

`GET /developer/v1/payout/{id}/line` returns what a payout is made of, oldest first, paginated like every other list. Every line has the same fields, and for every line `net = amount - refundedAmount - fee - tax - promotionShare`.

```json theme={null}
{
  "data": [
    {
      "type": "PAYMENT",
      "paymentId": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
      "amount": 550,
      "refundedAmount": 0,
      "fee": 19.26,
      "tax": 3.08,
      "promotionShare": 10,
      "net": 517.66,
      "createdAt": "2026-11-02T15:00:00.000Z"
    },
    {
      "type": "BALANCE_RECOVERY",
      "paymentId": null,
      "amount": -20,
      "refundedAmount": 0,
      "fee": 0,
      "tax": 0,
      "promotionShare": 0,
      "net": -20,
      "createdAt": "2026-11-03T06:15:00.000Z"
    }
  ],
  "pagination": { "limit": 20, "hasMore": false, "nextCursor": null }
}
```

| Type | What it is |
| - | - |
| `PAYMENT` | A sale. `amount` is what the customer was charged, tip included. `fee` is Compago's commission and `tax` its IVA. `promotionShare` is the part of the sale a promotion's sponsor took for funding its months without interest, as your settlement in the dashboard shows it, and `0` when there was no promotion |
| `REFUND` | A sale refunded before it was settled, whose fee is kept (see [Refunds and fees](https://docs.compago.com/refunds/refunds-and-fees.md)). `refundedAmount` is what went back to the customer, so `net` is minus the fee and its IVA |
| `BALANCE_RECOVERY` | Money taken from this payout to pay back your refund balance: fees of earlier refunds a day could not cover, or a refund of a sale that had already been paid to you. Negative |
| `BALANCE_CARRY` | What a day could not cover was carried to your balance instead of being taken from the deposit, to be recovered from a later payout. Positive |
| `EARLY_RELEASE_FEE` | The fee for sending the money early. Negative, and equal to `-feeAmount` |
| `ADJUSTMENT` | The centavos that rounding each line on its own leaves against the stored settlement, so the lines add up exactly |

The `net` of every line, over every page, adds up to the payout's `netAmount` to the centavo. `paymentId` links a `PAYMENT` or `REFUND` line to [the payment](https://docs.compago.com/developer/payments.md); the other lines have none.

> [!NOTE]
>
> A payment's own status and installment plan are not part of a line: read them from `GET /developer/v1/payment/{id}`.

## Reconciliation

The common job is matching yesterday's deposits to your sales.

```javascript theme={null}
async function payoutWithLines(apiKey, payoutId) {
  const base = 'https://api-harmony.compago.com/api/developer/v1';
  const headers = { 'x-api-key': apiKey };

  const payout = await (await fetch(`${base}/payout/${payoutId}`, { headers })).json();
  const lines = [];
  let cursor = null;

  do {
    const url = new URL(`${base}/payout/${payoutId}/line`);
    url.searchParams.set('limit', '100');
    if (cursor) url.searchParams.set('cursor', cursor);

    const res = await fetch(url, { headers });
    if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);

    const body = await res.json();
    lines.push(...body.data);
    cursor = body.pagination.nextCursor;
  } while (cursor);

  return { payout, lines };
}
```

To find when one sale was deposited, filter by it:

```bash theme={null}
curl "https://api-harmony.compago.com/api/developer/v1/payout?paymentId=aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" \
  -H "x-api-key: $COMPAGO_API_KEY"
```

## Filters

| Parameter | Notes |
| - | - |
| `status` | Repeat for several: `?status=FAILED&status=RETURNED` |
| `bankAccountId` | Only the transfers sent to one of your accounts |
| `paymentId` | The transfers that paid one sale |
| `createdAtFrom`, `createdAtTo` | ISO-8601 bounds on when the payout was created, both inclusive |

## What this endpoint does not include

* **Money not sent yet.** Sales that are settled but held back until they reach the minimum transfer amount have no payout until they are sent. The dashboard's **Liquidaciones** shows how close they are.
* **Bank account numbers and the CEP.** The CEP names your full account number, so it is not returned; look it up on Banxico's site with the `trackingKey`.


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