# バイヤープラットフォーム報酬 一覧取得

`GET /v1/buyer_platform_accounts`

- operationId: `retrieveBuyerPlatformAccountList`
- tags: バイヤープラットフォーム報酬

バイヤープラットフォーム報酬（プラットフォームキックバック）の一覧を取得するAPI。


## コードサンプル

### cURL

```bash
curl \
    -X GET \
    -H "Authorization:Bearer <Secret API Key>" \
'https://api.test.fincode.jp/v1/buyer_platform_accounts'
```

### Node.js

```javascript
import fetch from "node-fetch";

const BASE_URL = "https://api.test.fincode.jp";
const API_KEY = "<Secret API Key>";

(async () => {
    const endpoint = `${BASE_URL}/v1/buyer_platform_accounts`;

    const response = await fetch(endpoint, {
        method: "GET",
        headers: {
            Authorization: `Bearer ${API_KEY}`,
        },
    });
    const buyerPlatformAccounts = await response.json();
    console.log(buyerPlatformAccounts); // 取得したバイヤープラットフォーム報酬データを出力
})();
```

### Go

```go
package main

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

func main() {
	// APIキーの指定
	apiKey := "<Secret API Key>"

	// リクエストの作成
	req, err := http.NewRequest(
		"GET",
		"https://api.test.fincode.jp/v1/buyer_platform_accounts",
		nil,
	)
	if err != nil {
		log.Fatalf("リクエストの作成エラー: %v", err)
	}

	req.Header.Set("Authorization", "Bearer "+apiKey)

	// リクエストの送信
	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatalf("リクエスト送信エラー: %v", err)
	}
	defer resp.Body.Close()

	fmt.Println(resp.Status)
}
```

### PHP

```php
<?php

$apiKey = '<Secret API Key>';
$baseUrl = "https://api.test.fincode.jp";
$endpoint = "/v1/buyer_platform_accounts"; // GETリクエストのエンドポイント

$headers = [
    "Authorization: Bearer " . $apiKey,
];

$session = curl_init();
curl_setopt($session, CURLOPT_URL, $baseUrl . $endpoint);
curl_setopt($session, CURLOPT_HTTPHEADER, $headers);
curl_setopt($session, CURLOPT_HTTPGET, true);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
// curl_setopt($session, CURLOPT_SSL_VERIFYPEER, true);
// curl_setopt($session, CURLOPT_SSL_VERIFYHOST, 2);

$response = curl_exec($session);

if ($response === false) {
    // エラー処理
    echo "cURL Error: " . curl_error($session);
} else {
    // APIからのデータを処理
    echo $response;
}

curl_close($session);
?>
```

### Python 3

```python
import requests

api_key = '<Secret API Key>'
base_url = "https://api.test.fincode.jp"
endpoint = "/v1/buyer_platform_accounts"  # GETリクエストのエンドポイント

# ヘッダーを設定
headers = {
    'Authorization': f'Bearer {api_key}',
}

try:
    response = requests.get(f"{base_url}{endpoint}", headers=headers)

    # レスポンスの処理
    if response.status_code == 200:
        # APIからのデータを処理
        print(f"Success: {response.json()}")
    else:
        # エラーの処理
        print(f"Error: {response.json()}")
except requests.RequestException as e:
    # 通信エラーの処理
    print(f"Request error: {e}")
```

### Ruby

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

API_KEY = '<Secret API Key>'
BASE_URL = 'https://api.test.fincode.jp'

def main
    endpoint = "/v1/buyer_platform_accounts"  # GETリクエストのエンドポイント

    uri = URI.parse(BASE_URL + endpoint)

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

    # リクエストの作成
    request = Net::HTTP::Get.new(uri.request_uri)
    request['Authorization'] = "Bearer #{API_KEY}"

    # リクエストの送信
    response = http.request(request)

    case response
    when Net::HTTPSuccess
        puts 'SUCCESS'
        # レスポンスの表示
        puts JSON.pretty_generate(JSON.parse(response.body))
    else
        puts 'ERROR'
        # エラーの表示
        puts response.body
    end
end

main
```

## パラメータ

| 名前 | 位置 | 必須 | 型 | 説明 |
| --- | --- | --- | --- | --- |
| `クエリ` | query |  | Pagination.QueryParams | 検索条件クエリパラメータ |

## レスポンス

### 200 リクエストに成功

| パラメータ | 型 | 必須 | 説明 |
| --- | --- | --- | --- |
| `total_count` | integer |  | 総件数 |
| `last_page` | integer |  | 最後のページのページ数 |
| `current_page` | integer |  | 現在のページのページ数 |
| `limit` | integer |  | 1ページの最大件数 |
| `link_next` | string |  | 次のページのコンテンツを取得するためのURL |
| `link_previous` | string |  | 前のページのコンテンツを取得するためのURL |
| `list` | array<BuyerPlatformAccount.ListItem> |  | データリスト |

### 400 不正なリクエスト

| パラメータ | 型 | 必須 | 説明 |
| --- | --- | --- | --- |
| `errors` | array<FincodeAPIError> |  |  |

