# ショップ決済手段 一覧取得

`GET /v1/shops/payment_methods`

- operationId: `retrieveShopPaymentMethodList`
- tags: ショップ決済手段

ショップに紐づくショップ決済手段の一覧を取得します。


## コードサンプル

### cURL

```bash
curl \
    -X GET \
    -H "Authorization:Bearer <Secret API Key>" \
    -H "Content-Type: application/json" \
    'https://api.test.fincode.jp/v1/shops/payment_methods?pay_type=Payeeaccount'
```

### 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/shops/payment_methods?pay_type=Payeeaccount`;

    const response = await fetch(endpoint, {
        method: "GET",
        headers: {
            Authorization: `Bearer ${API_KEY}`,
            "Content-Type": "application/json",
        },
    });

    if (!response.ok) {
        console.error(`Error: ${response.statusText}`);
        return;
    }

    const data = await response.json();
    console.log(data);
})();
```

### Go

```go
package main

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

func main() {
	apiKey := "<Secret API Key>"

	url := "https://api.test.fincode.jp/v1/shops/payment_methods?pay_type=Payeeaccount"

	req, err := http.NewRequest("GET", url, nil)
	if err != nil {
		log.Fatalf("リクエスト作成エラー: %v", err)
	}
	req.Header.Set("Authorization", "Bearer "+apiKey)
	req.Header.Set("Content-Type", "application/json")

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

	respBody, _ := io.ReadAll(resp.Body)
	fmt.Println(string(respBody))
}
```

### PHP

```php
<?php

$apiKey = '<Secret API Key>';
$baseUrl = "https://api.test.fincode.jp";
$endpoint = "/v1/shops/payment_methods?pay_type=Payeeaccount";
$headers = [
    "Authorization: Bearer " . $apiKey,
    "Content-Type: application/json"
];

$session = curl_init();
curl_setopt($session, CURLOPT_URL, $baseUrl . $endpoint);
curl_setopt($session, CURLOPT_HTTPHEADER, $headers);
curl_setopt($session, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($session);
if ($response === false) {
    echo "cURL Error: " . curl_error($session);
} else {
    var_dump($response);
}
curl_close($session);
```

### Python 3

```python
import requests

api_key = '<Secret API Key>'
url = 'https://api.test.fincode.jp/v1/shops/payment_methods?pay_type=Payeeaccount'

headers = {
    'Authorization': f'Bearer {api_key}',
    'Content-Type': 'application/json'
}

try:
    response = requests.get(url, headers=headers)
    if response.status_code == 200:
        print(f"Success: {response.json()}")
    else:
        print(f"Error: {response.json()}")
except requests.RequestException as e:
    print(f"通信エラー: {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/shops/payment_methods?pay_type=Payeeaccount'
  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}"
  request['Content-Type'] = 'application/json'

  response = http.request(request)
  puts response.body
end

main
```

## パラメータ

| 名前 | 位置 | 必須 | 型 | 説明 |
| --- | --- | --- | --- | --- |
| `Tenant-Shop-Id` | header |  | schema | <span class="smallText color--red-400">※ プラットフォームのメインショップのみ指定可</span> |
| `クエリ` | query | ✓ | ShopPaymentMethod.ListRetrieving.QueryParams | ショップ決済手段の一覧取得において検索条件となるクエリパラメータ |

## レスポンス

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

##### 銀行振込（指定口座）

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

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

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

