# 一括決済詳細 一覧取得

`GET /v1/payments/bulk/{id}`

- operationId: `retrievePaymentBulkDetailList`
- tags: 一括決済

IDで指定した一括決済情報の詳細（決済1件ごとの情報）と各決済で発生したエラーの情報を一覧で取得します。


## コードサンプル

### cURL

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

### Node.js

```javascript
import { createFincode } from "@fincode/node";

const API_KEY = "<Secret API Key>";

(async () => {
    const fincode = createFincode({ apiKey: API_KEY, isLiveMode: false });

    const paymentBulkId = "<Payment Bulk ID>";

    try {
        // リクエストの送信
        const details = await fincode.paymentBulks.retrieveDetailList(
            paymentBulkId,
            {
                limit: 10,
            }
        );
    } catch (e) {
        // エラーの処理
    }
})();
```

### Go

```go
package main

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

func main() {

	apiKey := "<Secret API Key>"

	bulkPaymentID := "<Bulk Payment ID>"

	// リクエストの作成
	req, _ := http.NewRequest(
		"GET",
		fmt.Sprintf("https://api.test.fincode.jp/v1/payments/bulk/%s", bulkPaymentID),
		nil,
	)
	req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", apiKey))

	params := req.URL.Query()
	params.Add("limit", "10")
	params.Add("pay_type", "Card")
	req.URL.RawQuery = params.Encode()

	// リクエストの送信
	client := &http.Client{}
	res, err := client.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer res.Body.Close()

}
```

### PHP

```php
<?php

$apiKey = '<Secret API Key>';

$paymentBulkId = '<Payment Bulk ID>';

$baseUrl = "https://api.test.fincode.jp";
$endpoint = "/v1/payments/bulk/{$paymentBulkId}";
$queryParams = [
    "pay_type" => "Card",
    "limit" => 10,
];
$headers = [
    "Authorization: Bearer " . $apiKey,
];

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

$response = curl_exec($session);

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

curl_close($session);
```

### Python 3

```python
import requests

api_key = '<Secret API Key>'

payments_bulk_id = '<Payments Bulk ID>'

url = f'https://api.test.fincode.jp/v1/payments/bulk/{payments_bulk_id}'
query_params = {
    'pay_type': 'Card',
    'limit': '10',
}

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

try:
    response = requests.get(url, headers=headers, params=query_params)

    # レスポンスの処理
    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'

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

def main
    payments_bulk_id = '<Payments Bulk ID>'
    endpoint = "/v1/payments/bulk/#{payments_bulk_id}"
    query_params =  {
        limit: 10,
        pay_type: 'Card',
    }

    uri = URI.parse(BASE_URL + endpoint)
    uri.query = URI.encode_www_form(query_params)

    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'
    else
        puts 'ERROR'
    end

    # レスポンスの表示
    puts response.body
end

main
```

## パラメータ

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

## レスポンス

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

##### カード決済

| パラメータ | 型 | 必須 | 説明 |
| --- | --- | --- | --- |
| `total_count` | integer |  | 総件数 |
| `last_page` | integer |  | 最後のページのページ数 |
| `current_page` | integer |  | 現在のページのページ数 |
| `limit` | integer |  | 1ページの最大件数 |
| `link_next` | string |  | 次のページのコンテンツを取得するためのURL |
| `link_previous` | string |  | 前のページのコンテンツを取得するためのURL |
| `error_code` | error_code |  | この一括決済処理において発生したエラーのうち、一番最新のエラーのエラーコードです。 |
| `list` | array<PaymentBulkDetail> |  | 一括決済詳細リスト |
| `error_detail` | array<PaymentBulkErrorDetail> |  | 一括決済エラー詳細リスト |

##### 銀行振込（バーチャル口座）

| パラメータ | 型 | 必須 | 説明 |
| --- | --- | --- | --- |
| `total_count` | integer |  | 総件数 |
| `last_page` | integer |  | 最後のページのページ数 |
| `current_page` | integer |  | 現在のページのページ数 |
| `limit` | integer |  | 1ページの最大件数 |
| `link_next` | string |  | 次のページのコンテンツを取得するためのURL |
| `link_previous` | string |  | 前のページのコンテンツを取得するためのURL |
| `error_code` | error_code |  | この一括決済処理において発生したエラーのうち、一番最新のエラーのエラーコードです。 |
| `list` | array<PaymentBulkDetail.VirtualAccount> |  | 一括決済詳細リスト |
| `error_detail` | array<PaymentBulkErrorDetail> |  | 一括決済エラー詳細リスト |

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

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

