# List Payout Methods

GET https://services.leadconnectorhq.com/affiliate-manager/{locationId}/affiliate/{affiliateId}/payout-method

List the payout methods stored for an affiliate. Bank account values are returned as their last four characters only.

## Authentication

Send `Authorization: Bearer <token>` using any one of:

- **Sub-Account token: OAuth access token or Private Integration Token.** Scopes: `affiliate-manager.readonly`
- **Sub-Account token: OAuth access token or Private Integration Token.** Scopes: `affiliate-manager.readonly`

## Parameters

### Header Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Version` | string | Yes | API Version |

### Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `locationId` | string | Yes | Location Id |
| `affiliateId` | string | Yes | Affiliate Id |

### Query Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `skip` | number | No | Number of payout methods to skip |
| `limit` | number | No | Maximum number of payout methods to return |

## OpenAPI Specification

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "HighLevel API",
    "version": "2021-07-28"
  },
  "servers": [
    {
      "url": "https://services.leadconnectorhq.com"
    }
  ],
  "paths": {
    "/affiliate-manager/{locationId}/affiliate/{affiliateId}/payout-method": {
      "get": {
        "summary": "List Payout Methods",
        "operationId": "listPayoutMethods",
        "description": "List the payout methods stored for an affiliate. Bank account values are returned as their last four characters only.",
        "parameters": [
          {
            "name": "Version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "2021-07-28"
              ]
            }
          },
          {
            "name": "locationId",
            "required": true,
            "in": "path",
            "description": "Location Id",
            "schema": {
              "example": "ve9EPM428h8vShlRW1KT",
              "type": "string"
            }
          },
          {
            "name": "affiliateId",
            "required": true,
            "in": "path",
            "description": "Affiliate Id",
            "schema": {
              "example": "63e35ac8b4dac93dfc2757c7",
              "type": "string"
            }
          },
          {
            "name": "skip",
            "required": false,
            "in": "query",
            "description": "Number of payout methods to skip",
            "schema": {
              "minimum": 0,
              "maximum": 10000,
              "default": 0,
              "example": 1,
              "type": "number"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Maximum number of payout methods to return",
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "default": 10,
              "example": 10,
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListPayoutMethodsResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestDTO"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedDTO"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnprocessableDTO"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": [
              "affiliate-manager.readonly"
            ]
          },
          {
            "Location-Access": [
              "affiliate-manager.readonly"
            ]
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access-Only": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account.",
        "type": "http"
      },
      "Agency-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Agency (OR) Private Integration Token of Agency.",
        "type": "http"
      },
      "Agency-Access-Only": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Agency.",
        "type": "http"
      }
    },
    "schemas": {
      "ListPayoutMethodsResponseDto": {
        "type": "object",
        "properties": {
          "payoutMethods": {
            "description": "Payout methods for the affiliate",
            "example": [
              {
                "_id": "63e35ac8b4dac93dfc2757c7",
                "locationId": "ve9EPM428h8vShlRW1KT",
                "affiliateId": "6385d230f6d19db03eef6fb2",
                "method": "PAYPAL",
                "paypalEmail": "john@doe.com",
                "isPrimary": true,
                "createdAt": "2024-06-16T00:00:00.000Z",
                "updatedAt": "2024-06-16T00:00:00.000Z"
              }
            ],
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "_id": {
                  "type": "string",
                  "description": "Payout method id",
                  "example": "63e35ac8b4dac93dfc2757c7"
                },
                "locationId": {
                  "type": "string",
                  "description": "Location the payout method belongs to",
                  "example": "ve9EPM428h8vShlRW1KT"
                },
                "affiliateId": {
                  "type": "string",
                  "description": "Affiliate the payout method belongs to",
                  "example": "6385d230f6d19db03eef6fb2"
                },
                "method": {
                  "type": "string",
                  "description": "Payout method type",
                  "example": "PAYPAL",
                  "enum": [
                    "PAYPAL",
                    "BANK"
                  ]
                },
                "paypalEmail": {
                  "type": "string",
                  "description": "PayPal email, when the method is PAYPAL",
                  "example": "john@doe.com"
                },
                "bankDetails": {
                  "description": "Bank details, when the method is BANK",
                  "allOf": [
                    {
                      "type": "object",
                      "properties": {
                        "bankCountry": {
                          "type": "string",
                          "description": "Country the account is held in",
                          "example": "United States"
                        },
                        "accountHolderName": {
                          "type": "string",
                          "description": "Name on the account",
                          "example": "John Doe"
                        },
                        "recipientAddress": {
                          "description": "Address of the account holder",
                          "allOf": [
                            {
                              "type": "object",
                              "properties": {
                                "country": {
                                  "type": "string",
                                  "description": "Country of the account holder",
                                  "example": "United States"
                                },
                                "state": {
                                  "type": "string",
                                  "description": "State or province",
                                  "example": "California"
                                },
                                "city": {
                                  "type": "string",
                                  "description": "City",
                                  "example": "San Francisco"
                                },
                                "postalCode": {
                                  "type": "string",
                                  "description": "Postal code",
                                  "example": "94105"
                                }
                              },
                              "required": [
                                "country",
                                "city",
                                "postalCode"
                              ],
                              "title": "PayoutMethodRecipientAddressResponseDto"
                            }
                          ]
                        },
                        "fields": {
                          "description": "Bank fields required by the account country, with values reduced to their last four characters",
                          "example": [
                            {
                              "key": "accountNumber",
                              "value": "********5678"
                            },
                            {
                              "key": "bankName",
                              "value": "Bank of America"
                            }
                          ],
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string",
                                "description": "Field key, as declared by the country bank mapping",
                                "example": "accountNumber"
                              },
                              "value": {
                                "type": "string",
                                "description": "Account-identifying values are masked to their last four characters, with the rest replaced by asterisks so the length is preserved. Descriptive fields such as the bank and branch name are returned in full.",
                                "example": "********5678"
                              }
                            },
                            "required": [
                              "key",
                              "value"
                            ],
                            "title": "PayoutMethodBankFieldResponseDto"
                          }
                        }
                      },
                      "required": [
                        "bankCountry",
                        "accountHolderName",
                        "recipientAddress",
                        "fields"
                      ],
                      "title": "PayoutMethodBankDetailsResponseDto"
                    }
                  ]
                },
                "isPrimary": {
                  "type": "boolean",
                  "description": "Whether payouts default to this method",
                  "example": true
                },
                "createdAt": {
                  "type": "string",
                  "description": "Created at timestamp",
                  "example": "2024-06-16T00:00:00.000Z"
                },
                "updatedAt": {
                  "type": "string",
                  "description": "Updated at timestamp",
                  "example": "2024-06-16T00:00:00.000Z"
                }
              },
              "required": [
                "_id",
                "locationId",
                "affiliateId",
                "method",
                "isPrimary",
                "createdAt",
                "updatedAt"
              ],
              "title": "PayoutMethodResponseDto"
            }
          },
          "meta": {
            "description": "Pagination metadata",
            "example": {
              "count": 2
            },
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "count": {
                    "type": "number",
                    "description": "Total payout methods for the affiliate",
                    "example": 2
                  }
                },
                "required": [
                  "count"
                ],
                "title": "PayoutMethodListMetaResponseDto"
              }
            ]
          }
        },
        "required": [
          "payoutMethods",
          "meta"
        ],
        "title": "ListPayoutMethodsResponseDto"
      },
      "BadRequestDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 400
          },
          "message": {
            "type": "string",
            "example": "Bad Request"
          }
        },
        "title": "BadRequestDTO"
      },
      "UnauthorizedDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 401
          },
          "message": {
            "type": "string",
            "example": "Invalid token: access token is invalid"
          },
          "error": {
            "type": "string",
            "example": "Unauthorized"
          }
        },
        "title": "UnauthorizedDTO"
      },
      "UnprocessableDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 422
          },
          "message": {
            "example": [
              "Unprocessable Entity"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "error": {
            "type": "string",
            "example": "Unprocessable Entity"
          }
        },
        "title": "UnprocessableDTO"
      }
    }
  }
}
```

## Code Examples

**cURL**

```bash
curl -L -X GET 'https://services.leadconnectorhq.com/affiliate-manager/<locationId>/affiliate/<affiliateId>/payout-method' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Version: 2021-07-28'
```

**Node.js**

```javascript
const options = {
  method: 'GET',
  headers: {
    Authorization: 'Bearer <TOKEN>',
    Version: '2021-07-28'
  }
};

try {
  const response = await fetch('https://services.leadconnectorhq.com/affiliate-manager/<locationId>/affiliate/<affiliateId>/payout-method', options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

**Python**

```python
import requests

url = "https://services.leadconnectorhq.com/affiliate-manager/{locationId}/affiliate/{affiliateId}/payout-method"

headers = {
    "Authorization": "Bearer <TOKEN>",
    "Version": "2021-07-28"
}

response = requests.get(url, headers=headers)
print(response.json())
```

**PHP**

```php
<?php
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => 'https://services.leadconnectorhq.com/affiliate-manager/<locationId>/affiliate/<affiliateId>/payout-method',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer <TOKEN>',
    'Version: 2021-07-28',
  ],
]);

$response = curl_exec($curl);
curl_close($curl);
echo $response;
```

**Java**

```java
HttpResponse<String> response = Unirest
  .get("https://services.leadconnectorhq.com/affiliate-manager/<locationId>/affiliate/<affiliateId>/payout-method")
  .header("Authorization", "Bearer <TOKEN>")
  .header("Version", "2021-07-28")
  .asString();
```

**Go**

```go
package main

import (
  "fmt"
  "net/http"
  "io"
)

func main() {
  url := "https://services.leadconnectorhq.com/affiliate-manager/<locationId>/affiliate/<affiliateId>/payout-method"
  req, _ := http.NewRequest("GET", url, nil)
  req.Header.Add("Authorization", "Bearer <TOKEN>")
  req.Header.Add("Version", "2021-07-28")

  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := io.ReadAll(res.Body)
  fmt.Println(string(body))
}
```

**Ruby**

```ruby
require 'uri'
require 'net/http'

url = URI("https://services.leadconnectorhq.com/affiliate-manager/<locationId>/affiliate/<affiliateId>/payout-method")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = "Bearer <TOKEN>"
request["Version"] = "2021-07-28"

response = http.request(request)
puts response.read_body
```

**PowerShell**

```powershell
$headers = @{
  "Authorization" = "Bearer <TOKEN>"
  "Version" = "2021-07-28"
}

$response = Invoke-RestMethod -Uri 'https://services.leadconnectorhq.com/affiliate-manager/<locationId>/affiliate/<affiliateId>/payout-method' -Method 'GET' -Headers $headers
$response | ConvertTo-Json
```
