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

# List Payouts

> Retrieve the list of payouts for a account.

Retrieve the list of payouts for a account.

```http theme={null}
GET https://services.leadconnectorhq.com/affiliate-manager/{locationId}/payouts
```

## Autorización

<ParamField header="Authorization" type="string" required>
  Bearer token generado desde el portal Leadway. Ver [Autenticación](/authentication).
</ParamField>

<ParamField header="Version" type="string" required default="2021-07-28">
  Versión de la API.
</ParamField>

## Path parameters

<ParamField path="locationId" type="string" required default="ve9EPM428h8vShlRW1KT">
  Account Id
</ParamField>

## Query parameters

<ParamField query="status" type="string" default="pending">
  Payout status
</ParamField>

<ParamField query="query" type="string" default="john">
  query
</ParamField>

<ParamField query="affiliateId" type="string" default="65df04201e428a0c5ebb6572">
  Affiliate Id
</ParamField>

<ParamField query="campaignId" type="string" default="65df04201e428a0c5ebb6573">
  Campaign Id
</ParamField>

<ParamField query="skip" type="number" default="1" />

<ParamField query="limit" type="number" default="10" />

<ParamField query="start" type="string" default="2022-12-01T00:00:00.000Z" />

<ParamField query="end" type="string" default="2022-12-31T23:59:59.999Z" />

## Respuestas

<Accordion title="200 - Successful response">
  <ResponseField name="payouts" type="object[]" required>
    Payout list

    <Expandable title="cada item">
      <ResponseField name="_id" type="string" required default="65df04201e428a0c5ebb6571">
        Payout id
      </ResponseField>

      <ResponseField name="locationId" type="string" required default="ve9EPM428h8vShlRW1KT">
        Account id
      </ResponseField>

      <ResponseField name="affiliateId" type="string" required default="65df04201e428a0c5ebb6572">
        Affiliate id
      </ResponseField>

      <ResponseField name="campaignId" type="string" default="65df04201e428a0c5ebb6573">
        Campaign id
      </ResponseField>

      <ResponseField name="currency" type="string" required default="USD">
        Payout currency
      </ResponseField>

      <ResponseField name="amount" type="number" required default="150">
        Payout amount
      </ResponseField>

      <ResponseField name="status" type="string" default="pending">
        Payout status
      </ResponseField>

      <ResponseField name="payoutMonth" type="string" default="2024-06-01T00:00:00.000Z">
        Payout month
      </ResponseField>

      <ResponseField name="dueAt" type="string" default="2024-06-30T00:00:00.000Z">
        Payout due date
      </ResponseField>

      <ResponseField name="paidAt" type="string" default="2024-06-30T00:00:00.000Z">
        Payout paid date
      </ResponseField>

      <ResponseField name="paidMeta" type="object">
        Payout metadata
      </ResponseField>

      <ResponseField name="paidMethod" type="string" default="manual">
        Payout paid method
      </ResponseField>

      <ResponseField name="altId" type="string" default="alt_123">
        Alternate id
      </ResponseField>

      <ResponseField name="deleted" type="boolean" default="False">
        Whether the payout is deleted
      </ResponseField>

      <ResponseField name="isMigrated" type="boolean" default="False">
        Whether the payout is migrated
      </ResponseField>

      <ResponseField name="createdAt" type="string" default="2024-06-16T00:00:00.000Z">
        Created at timestamp
      </ResponseField>

      <ResponseField name="updatedAt" type="string" default="2024-06-17T00:00:00.000Z">
        Updated at timestamp
      </ResponseField>

      <ResponseField name="campaign" type="string" default="Summer Promo">
        Campaign name
      </ResponseField>

      <ResponseField name="affiliateName" type="string" default="John Doe">
        Affiliate display name
      </ResponseField>

      <ResponseField name="affiliateEmail" type="string" default="john.doe@example.com">
        Affiliate email
      </ResponseField>

      <ResponseField name="payoutMethod" type="string" default="paypal">
        Primary payout method
      </ResponseField>

      <ResponseField name="affiliate" type="object">
        Affiliate details
      </ResponseField>
    </Expandable>
  </ResponseField>

  <ResponseField name="meta" type="object">
    Pagination metadata
  </ResponseField>

  ```json theme={null}
  {
    "payouts": [
      {
        "_id": "65df04201e428a0c5ebb6571",
        "locationId": "ve9EPM428h8vShlRW1KT",
        "affiliateId": "65df04201e428a0c5ebb6572",
        "campaignId": "65df04201e428a0c5ebb6573",
        "currency": "USD",
        "amount": 150,
        "status": "pending",
        "payoutMonth": "2024-06-01T00:00:00.000Z",
        "dueAt": "2024-06-30T00:00:00.000Z",
        "paidAt": "2024-06-30T00:00:00.000Z",
        "paidMeta": {},
        "paidMethod": "manual",
        "altId": "alt_123",
        "deleted": false,
        "isMigrated": false,
        "createdAt": "2024-06-16T00:00:00.000Z",
        "updatedAt": "2024-06-17T00:00:00.000Z",
        "campaign": "Summer Promo",
        "affiliateName": "John Doe",
        "affiliateEmail": "john.doe@example.com",
        "payoutMethod": "paypal"
      }
    ]
  }
  ```
</Accordion>

<Accordion title="400 - Bad Request">
  ```json theme={null}
  {}
  ```
</Accordion>

<Accordion title="401 - Unauthorized">
  ```json theme={null}
  {}
  ```
</Accordion>

<Accordion title="422 - Unprocessable Entity">
  ```json theme={null}
  {}
  ```
</Accordion>

## Ejemplo

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET 'https://services.leadconnectorhq.com/affiliate-manager/YOUR_locationId/payouts' \
    -H 'Authorization: Bearer YOUR_TOKEN' \
    -H 'Version: 2021-07-28'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://services.leadconnectorhq.com/affiliate-manager/YOUR_locationId/payouts', {
    method: 'GET',
    headers: {
      Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
      Version: '2021-07-28',
    },
  });
  const data = await response.json();
  ```

  ```python Python theme={null}
  import os, requests
  response = requests.request(
      'GET',
      'https://services.leadconnectorhq.com/affiliate-manager/YOUR_locationId/payouts',
      headers={
          'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
          'Version': '2021-07-28',
      },
  )
  data = response.json()
  ```

  ```php PHP theme={null}
  <?php
  $ch = curl_init('https://services.leadconnectorhq.com/affiliate-manager/YOUR_locationId/payouts');
  curl_setopt_array($ch, [
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_CUSTOMREQUEST => 'GET',
      CURLOPT_HTTPHEADER => [
          'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
          'Version: 2021-07-28',
      ],
  ]);
  $data = json_decode(curl_exec($ch), true);
  ```
</CodeGroup>
