# テナントバイヤー 取得

`GET /v1/buyer_platform/tenants/{id}`

- operationId: `retrieveTenantBuyer`
- tags: テナントバイヤー

`id`で指定したテナントバイヤー情報を取得します。


## コードサンプル

### cURL

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

### Node.js

```javascript
const API_KEY = "<Secret API Key>";
const TENANT_BUYER_ID = "<Tenant Buyer ID>";

(async () => {
    const response = await fetch(`https://api.test.fincode.jp/v1/buyer_platform/tenants/${TENANT_BUYER_ID}`, {
        method: "GET",
        headers: {
            Authorization: `Bearer ${API_KEY}`,
        },
    });

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

### Go

```go
package main

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

func main() {
	apiKey := "<Secret API Key>"
	tenantBuyerID := "<Tenant Buyer ID>"

	req, _ := http.NewRequest(
		"GET",
		fmt.Sprintf("https://api.test.fincode.jp/v1/buyer_platform/tenants/%s", tenantBuyerID),
		nil,
	)
	req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", apiKey))

	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>';
$tenantBuyerId = '<Tenant Buyer ID>';

$baseUrl = "https://api.test.fincode.jp";
$endpoint = "/v1/buyer_platform/tenants/{$tenantBuyerId}";
$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);

$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>'
tenant_buyer_id = '<Tenant Buyer ID>'

url = f'https://api.test.fincode.jp/v1/buyer_platform/tenants/{tenant_buyer_id}'

headers = {
    'Authorization': f'Bearer {api_key}',
}

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"Request error: {e}")
```

### Ruby

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

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

def main
    tenant_buyer_id = '<Tenant Buyer ID>'
    endpoint = "/v1/buyer_platform/tenants/#{tenant_buyer_id}"

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

    puts response.body
end

main
```

## パラメータ

| 名前 | 位置 | 必須 | 型 | 説明 |
| --- | --- | --- | --- | --- |
| `id` | path | ✓ | schema | バイヤーID |

## レスポンス

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

| パラメータ | 型 | 必須 | 説明 |
| --- | --- | --- | --- |
| `buyer_id` | string |  | バイヤーID |
| `buyer_name` | string |  | バイヤー名称 |
| `buyer_name_kana` | string |  | バイヤー名カナ |
| `send_mail_address` | string |  | 通知先メールアドレス |
| `buyer_mail_address` | string |  | バイヤーメールアドレス |
| `buyer_type` | BuyerShopType |  |  |
| `buyer_platform_id` | string |  | バイヤープラットフォームID |
| `buyer_platform_name` | string |  | バイヤープラットフォーム名 |
| `buyer_platform_kickback_fee_rate_setting_list` | array<BuyerPlatformKickbackFeeRateSetting> |  | バイヤープラットフォーム還元率設定情報リスト |
| `api_key_display_flag` | enum(0 | 1) |  | APIキー表示フラグ。 |
| `created` | created |  |  |
| `updated` | updated |  |  |
| `buyer_password` | string |  | バイヤーパスワード（マスク） |
| `api_version` | string |  | APIバージョン |
| `enable_contracts_api` | enum(0 | 1) |  | 契約審査系API実行許可フラグ |
| `business_operator_id` | string |  | 事業者ID |
| `partition_id` | integer |  | パーティションID |

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

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

