# Related payment methods

List payment methods linked to this counterparty.

Returns catalog instruments owned by the counterparty and shared instruments associated with it. Sorted by code. Includes a transaction_count on each instrument.


- HTTP method: `GET`
- Path: `/api/v1/counterparties/:code/payment-methods`
- URL: `https://api.invunion.com/api/v1/counterparties/:code/payment-methods`
- Required scope: `counterparties:read`
- HTML docs: https://www.invunion.com/knowledge-base/api/list-counterparty-payment-methods/
- Markdown docs: https://www.invunion.com/knowledge-base/api/list-counterparty-payment-methods.md

## Path parameters

| Name | Type | Required | Description | Allowed values | Example |
| --- | --- | --- | --- | --- | --- |
| `code` | string, max 50 | required | Counterparty code (`account_code`). |  | `CPT-042` |



## Errors

| Error | HTTP code | Description |
| --- | --- | --- |
| `Missing Bearer token` | `401` | The Authorization header is missing or is not a Bearer token. |
| `Invalid or revoked API key` | `401` | The API key is unknown, malformed, expired, or has been revoked. |
| `API key is missing scope counterparties:read` | `403` | The key does not include counterparties:read. A write scope does not imply the matching read scope. |
| `Too many requests, please try again later` | `429` | Wait and retry. The Retry-After header is the number of seconds to wait. |
| `Counterparty not found` | `404` | No counterparty with this code exists in the authenticated tenant. |
| `Internal server error` | `500` | Unexpected server error. The JSON body includes correlationId. Retry with backoff. |

## Request (curl)

```bash
curl --request GET \
  --url https://api.invunion.com/api/v1/counterparties/CPT-042/payment-methods \
  --header 'accept: application/json' \
  --header 'authorization: Bearer uk_live_YOUR_API_KEY'
```

## Request (Python)

```python
import requests

url = "https://api.invunion.com/api/v1/counterparties/CPT-042/payment-methods"
headers = {
    "Accept": "application/json",
    "Authorization": "Bearer uk_live_YOUR_API_KEY",
}
response = requests.get(url, headers=headers)
print(response.json())
```

## Request (Ruby)

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

uri = URI("https://api.invunion.com/api/v1/counterparties/CPT-042/payment-methods")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
request['Accept'] = 'application/json'
request['Authorization'] = 'Bearer uk_live_YOUR_API_KEY'
response = http.request(request)
puts response.body
```

## Request (JavaScript)

```javascript
const response = await fetch("https://api.invunion.com/api/v1/counterparties/CPT-042/payment-methods", {
  method: "GET",
  headers: {
    "Accept": "application/json",
    "Authorization": "Bearer uk_live_YOUR_API_KEY"
  },
});
const data = await response.json();
```

## Request (Go)

```go
package main

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

func main() {
	req, err := http.NewRequest("GET", "https://api.invunion.com/api/v1/counterparties/CPT-042/payment-methods", nil)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Accept", "application/json")
	req.Header.Set("Authorization", "Bearer uk_live_YOUR_API_KEY")
	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()
	body, _ := io.ReadAll(resp.Body)
	fmt.Println(string(body))
}
```

## Request (Node)

```javascript
const response = await fetch("https://api.invunion.com/api/v1/counterparties/CPT-042/payment-methods", {
  method: "GET",
  headers: {
    "Accept": "application/json",
    "Authorization": "Bearer uk_live_YOUR_API_KEY"
  },
});
console.log(await response.json());
```

## Success (200)

```json
{
  "success": true,
  "data": [
    {
      "id": "8a1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
      "code": "PM-001",
      "type": "iban",
      "name": "Leones Cars EUR",
      "iban": "FR7630006000011234567890189",
      "bic": "BNPAFRPP",
      "currency": "EUR",
      "is_default": true,
      "transaction_count": 12
    },
    {
      "id": "6c8b02d3-29f5-4e70-b9d2-0f3e6a1c84b2",
      "code": "PM-003",
      "type": "paypal",
      "name": "Leones Cars PayPal",
      "iban": null,
      "bic": null,
      "currency": "EUR",
      "is_default": false,
      "transaction_count": 3
    }
  ]
}
```
