# テナントバイヤー本番環境申請情報 更新

`PUT /v1/buyer/contracts/examinations/{id}`

- operationId: `updateBuyerExaminationInfo`
- tags: テナントバイヤー申請管理

`id`で指定したテナントバイヤーの本番環境申請情報を更新します。


## コードサンプル

### cURL

```bash
curl \
    -X PUT \
    -H "Authorization:Bearer <Secret API Key>" \
    -H "Content-Type: application/json" \
    -H "Tenant-Buyer-Id: <Tenant Buyer ID>" \
    -d '{
    "corporate_number": "1234567890123",
    "contract_info": {
        "representative_last_name": "山田",
        "representative_last_name_kana": "ヤマダ",
        "representative_first_name": "太郎",
        "representative_first_name_kana": "タロウ",
        "representative_birthday": "1998/11/01",
        "representative_tel": "0312345678",
        "representative_postal_code": "123-4567",
        "representative_prefecture": "東京都",
        "representative_prefecture_kana": "トウキョウト",
        "representative_address_municipality": "渋谷区",
        "representative_address_municipality_kana": "シブヤク",
        "representative_address_section": "道玄坂",
        "representative_address_section_kana": "ドウゲンザカ",
        "representative_address_chrome": "1-2-3",
        "representative_address_chrome_kana": "イチニサン",
        "representative_address_building_name": "テストビル",
        "representative_address_building_name_kana": "テストビル",
        "staff1_last_name": "鈴木",
        "staff1_last_name_kana": "スズキ",
        "staff1_first_name": "次郎",
        "staff1_first_name_kana": "ジロウ",
        "staff1_company_name": "株式会社テスト",
        "staff1_belongs": "EC運営部",
        "staff1_tel": "08012345678",
        "staff1_mail": "staff-1@example.com",
        "content_description": "○○の販売",
        "corporate": true,
        "expect_usage_amount": 1000000,
        "corporate_info": {
            "company_tel": "0312345678",
            "corporate_name": "株式会社テスト",
            "corporate_name_kana": "カブシキガイシャテスト",
            "hp": "https://example.com",
            "company_postal_code": "123-4567",
            "company_prefecture": "東京都",
            "company_prefecture_kana": "トウキョウト",
            "company_address_municipality": "渋谷区",
            "company_address_municipality_kana": "シブヤク",
            "company_address_section": "道玄坂",
            "company_address_section_kana": "ドウゲンザカ",
            "company_address_chrome": "1-2-3",
            "company_address_chrome_kana": "イチニサン",
            "company_address_building_name": "テストビル",
            "company_address_building_name_kana": "テストビル"
        }
    },
    "business_operator_bank_account_info": {
        "bank_code": "0001",
        "branch_code": "001",
        "account_kind": 1,
        "account_number": "1234567",
        "account_name": "ヤマダタロウ"
    }
}' \
'https://api.test.fincode.jp/v1/buyer/contracts/examinations/{Tenant Buyer ID}'
```

### Node.js

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

(async () => {
  try {
    const response = await fetch(
      `https://api.test.fincode.jp/v1/buyer/contracts/examinations/${BUYER_ID}`,
      {
        method: "PUT",
        headers: {
          Authorization: `Bearer ${API_KEY}`,
          "Content-Type": "application/json",
          "Tenant-Buyer-Id": TENANT_BUYER_ID,
        },
        body: JSON.stringify({
          corporate_number: "1234567890123",
          contract_info: {
            corporate: true,
            corporate_info: {
              corporate_name: "株式会社テスト",
              corporate_name_kana: "カブシキガイシャテスト",
              hp: "https://example.com",
              company_prefecture: "東京都",
              company_prefecture_kana: "トウキョウト",
              company_address_municipality: "渋谷区",
              company_address_municipality_kana: "シブヤク",
              company_address_section: "道玄坂",
              company_address_section_kana: "ドウゲンザカ",
              company_address_chrome: "1-2-3",
              company_address_chrome_kana: "イチニサン",
              company_tel: "0312345678",
              company_postal_code: "123-4567",
            },
            representative_first_name: "山田",
            representative_first_name_kana: "ヤマダ",
            representative_last_name: "太郎",
            representative_last_name_kana: "タロウ",
            representative_postal_code: "123-4567",
            representative_prefecture: "東京都",
            representative_prefecture_kana: "トウキョウト",
            representative_address_municipality: "渋谷区",
            representative_address_municipality_kana: "シブヤク",
            representative_address_section: "道玄坂",
            representative_address_section_kana: "ドウゲンザカ",
            representative_address_chrome: "1-2-3",
            representative_address_chrome_kana: "イチニサン",
            representative_tel: "0312345678",
            representative_birthday: "1998/11/01",
            staff1_first_name: "鈴木",
            staff1_first_name_kana: "スズキ",
            staff1_last_name: "次郎",
            staff1_last_name_kana: "ジロウ",
            staff1_company_name: "株式会社テスト",
            staff1_belongs: "EC運営部",
            staff1_tel: "08012345678",
            staff1_mail: "staff-1@example.com",
          },
          business_operator_bank_account_info: {
            bank_code: "0001",
            branch_code: "001",
            account_kind: 1,
            account_number: "1234567",
            account_name: "ヤマダタロウ",
          },
        }),
      }
    );

    const data = await response.json();
    console.log(data);
  } catch (e) {
    console.error(e);
  }
})();
```

### Go

```go
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"log"
	"net/http"
)

func main() {

	apiKey := "<Secret API Key>"

    buyerId := "<Buyer ID>"
	tenantBuyerID := "<Tenant Buyer ID>"

	body := UpdatingExaminationInfoRequest{
		CorporateNumber: "1234567890123",
		ContractInfo: ContractInfo{
			RepresentativeLastName:                "山田",
			RepresentativeLastNameKana:            "ヤマダ",
			RepresentativeFirstName:               "太郎",
			RepresentativeFirstNameKana:           "タロウ",
			RepresentativePostalCode:              "123-4567",
			RepresentativePrefecture:              "東京都",
			RepresentativePrefectureKana:          "トウキョウト",
			RepresentativeAddressMunicipality:     "渋谷区",
			RepresentativeAddressMunicipalityKana: "シブヤク",
			RepresentativeAddressSection:          "道玄坂",
			RepresentativeAddressSectionKana:      "ドウゲンザカ",
			RepresentativeAddressChrome:           "1-2-3",
			RepresentativeAddressChromeKana:       "イチニサン",
			RepresentativeTel:                     "0312345678",
			RepresentativeBirthday:                "1998/11/01",
			Staff1LastName:                        "鈴木",
			Staff1LastNameKana:                    "スズキ",
			Staff1FirstName:                       "次郎",
			Staff1FirstNameKana:                   "ジロウ",
			Staff1CompanyName:                     "株式会社テスト",
			Staff1Belongs:                         "EC運営部",
			Staff1Tel:                             "08012345678",
			Staff1Mail:                            "staff-1@example.com",
			Corporate:                             true,
			ExpectUsageAmount:                     "1000000",
			CorporateInfo: CorporateInfo{
				CorporateName:                  "株式会社テスト",
				CorporateNameKana:              "カブシキガイシャテスト",
				Hp:                             "https://www.test.co.jp",
				CompanyPostalCode:              "123-4567",
				CompanyPrefecture:              "東京都",
				CompanyPrefectureKana:          "トウキョウト",
				CompanyAddressMunicipality:     "渋谷区",
				CompanyAddressMunicipalityKana: "シブヤク",
				CompanyAddressSection:          "道玄坂",
				CompanyAddressSectionKana:      "ドウゲンザカ",
				CompanyAddressChrome:           "1-2-3",
				CompanyAddressChromeKana:       "イチニサン",
				CompanyTel:                     "0312345678",
			},
		},
		BusinessOperatorBankAccountInfo: BusinessOperatorBankAccountInfo{
			BankCode:      "0001",
			BranchCode:    "001",
			AccountKind:   "1",
			AccountNumber: "1234567",
			AccountName:   "ヤマダタロウ",
		},
	}

	marshalledBody, _ := json.Marshal(body)

	// リクエストの作成
	req, _ := http.NewRequest("PUT", fmt.Sprintf("https://api.test.fincode.jp/v1/buyer/contracts/examinations/%s", buyerId), bytes.NewBuffer(marshalledBody))
	req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", apiKey))
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("Tenant-Buyer-Id", tenantBuyerID)

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

}

type UpdatingExaminationInfoRequest struct {
	CorporateNumber                string                          `json:"corporate_number"`
	ContractInfo                   ContractInfo                    `json:"contract_info"`
	BusinessOperatorBankAccountInfo BusinessOperatorBankAccountInfo `json:"business_operator_bank_account_info"`
}

type BusinessOperatorBankAccountInfo struct {
	BankCode      string `json:"bank_code"`
	BranchCode    string `json:"branch_code"`
	AccountKind   string `json:"account_kind"`
	AccountNumber string `json:"account_number"`
	AccountName   string `json:"account_name"`
}
type ContractInfo struct {
	RepresentativeLastName                string        `json:"representative_last_name"`
	RepresentativeLastNameKana            string        `json:"representative_last_name_kana"`
	RepresentativeFirstName               string        `json:"representative_first_name"`
	RepresentativeFirstNameKana           string        `json:"representative_first_name_kana"`
	RepresentativePostalCode              string        `json:"representative_postal_code"`
	RepresentativePrefecture              string        `json:"representative_prefecture"`
	RepresentativePrefectureKana          string        `json:"representative_prefecture_kana"`
	RepresentativeAddressMunicipality     string        `json:"representative_address_municipality"`
	RepresentativeAddressMunicipalityKana string        `json:"representative_address_municipality_kana"`
	RepresentativeAddressSection          string        `json:"representative_address_section"`
	RepresentativeAddressSectionKana      string        `json:"representative_address_section_kana"`
	RepresentativeAddressChrome           string        `json:"representative_address_chrome"`
	RepresentativeAddressChromeKana       string        `json:"representative_address_chrome_kana"`
	RepresentativeAddressBuildingName     *string       `json:"representative_address_building_name,omitempty"`
	RepresentativeAddressBuildingNameKana *string       `json:"representative_address_building_name_kana,omitempty"`
	RepresentativeTel                     string        `json:"representative_tel"`
	RepresentativeBirthday                string        `json:"representative_birthday"`
	Staff1LastName                        string        `json:"staff1_last_name"`
	Staff1LastNameKana                    string        `json:"staff1_last_name_kana"`
	Staff1FirstName                       string        `json:"staff1_first_name"`
	Staff1FirstNameKana                   string        `json:"staff1_first_name_kana"`
	Staff1CompanyName                     string        `json:"staff1_company_name"`
	Staff1Belongs                         string        `json:"staff1_belongs"`
	Staff1Tel                             string        `json:"staff1_tel"`
	Staff1Mail                            string        `json:"staff1_mail"`
	Corporate                             bool          `json:"corporate"`
	ExpectUsageAmount                     int           `json:"expect_usage_amount"`
	CorporateInfo                         CorporateInfo `json:"corporate_info"`
}
type CorporateInfo struct {
	CorporateNumber                string  `json:"corporate_number"`
	CorporateName                  string  `json:"corporate_name"`
	CorporateNameKana              string  `json:"corporate_name_kana"`
	CompanyPostalCode              string  `json:"company_postal_code"`
	CompanyPrefecture              string  `json:"company_prefecture"`
	CompanyPrefectureKana          string  `json:"company_prefecture_kana"`
	CompanyAddressMunicipality     string  `json:"company_address_municipality"`
	CompanyAddressMunicipalityKana string  `json:"company_address_municipality_kana"`
	CompanyAddressSection          string  `json:"company_address_section"`
	CompanyAddressSectionKana      string  `json:"company_address_section_kana"`
	CompanyAddressChrome           string  `json:"company_address_chrome"`
	CompanyAddressChromeKana       string  `json:"company_address_chrome_kana"`
	CompanyAddressBuildingName     *string `json:"company_address_building_name,omitempty"`
	CompanyAddressBuildingNameKana *string `json:"company_address_building_name_kana,omitempty"`
	CompanyTel                     string  `json:"company_tel"`
}
```

### PHP

```php
<?php

$apiKey = '<Secret API Key>';

$buyerId = '<Buyer ID>';
$tenantBuyerId = '<Tenant Buyer ID>';

$baseUrl = "https://api.test.fincode.jp";
$endpoint = "/v1/buyer/contracts/examinations/{$buyerId}";
$headers = [
    "Authorization: Bearer " . $apiKey,
    "Content-Type: application/json",
    "Tenant-Buyer-Id: " . $tenantBuyerId,
];

$data = json_encode([
    "corporate_number" => "1234567890123",
    "contract_info" => [
        "representative_last_name" => "山田",
        "representative_last_name_kana" => "ヤマダ",
        "representative_first_name" => "太郎",
        "representative_first_name_kana" => "タロウ",
        "representative_postal_code" => "123-4567",
        "representative_prefecture" => "東京都",
        "representative_prefecture_kana" => "トウキョウト",
        "representative_address_municipality" => "渋谷区",
        "representative_address_municipality_kana" => "シブヤク",
        "representative_address_section" => "道玄坂",
        "representative_address_section_kana" => "ドウゲンザカ",
        "representative_address_chrome" => "1-2-3",
        "representative_address_chrome_kana" => "イチニサン",
        "representative_tel" => "0312345678",
        "representative_birthday" => "1998/11/01",
        "staff1_last_name" => "鈴木",
        "staff1_last_name_kana" => "スズキ",
        "staff1_first_name" => "次郎",
        "staff1_first_name_kana" => "ジロウ",
        "staff1_company_name" => "株式会社テスト",
        "staff1_belongs" => "EC運営部",
        "staff1_tel" => "08012345678",
        "staff1_mail" => "staff-1@example.com",
        "corporate" => true,
        "expect_usage_amount" => "1000000",
        "corporate_info" => [
            "corporate_name" => "株式会社テスト",
            "corporate_name_kana" => "カブシキガイシャテスト",
            "hp" => "https://www.test.com",
            "company_postal_code" => "123-4567",
            "company_prefecture" => "東京都",
            "company_prefecture_kana" => "トウキョウト",
            "company_address_municipality" => "渋谷区",
            "company_address_municipality_kana" => "シブヤク",
            "company_address_section" => "道玄坂",
            "company_address_section_kana" => "ドウゲンザカ",
            "company_address_chrome" => "1-2-3",
            "company_address_chrome_kana" => "イチニサン",
            "company_tel" => "0312345678"
        ]
    ],
    "business_operator_bank_account_info" => [
        "bank_code" => "0001",
        "branch_code" => "001",
        "account_kind" => "1",
        "account_number" => "1234567",
        "account_name" => "ヤマダタロウ"
    ]
]);

$session = curl_init();
curl_setopt($session, CURLOPT_URL, $baseUrl . $endpoint);
curl_setopt($session, CURLOPT_HTTPHEADER, $headers);
curl_setopt($session, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($session, CURLOPT_POSTFIELDS, $data);
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>'

buyer_id = '<Buyer ID>'
tenant_buyer_id = '<Tenant Buyer ID>'

url = f'https://api.test.fincode.jp/v1/buyer/contracts/examinations/{buyer_id}'

# ヘッダーを設定
headers = {
    'Authorization': f'Bearer {api_key}',
    'Content-Type': 'application/json',
    'Tenant-Buyer-Id': tenant_buyer_id,
}

data = {
    "corporate_number": "1234567890123",
    "contract_info": {
        "representative_last_name": "山田",
        "representative_last_name_kana": "ヤマダ",
        "representative_first_name": "太郎",
        "representative_first_name_kana": "タロウ",
        "representative_postal_code": "123-4567",
        "representative_prefecture": "東京都",
        "representative_prefecture_kana": "トウキョウト",
        "representative_address_municipality": "渋谷区",
        "representative_address_municipality_kana": "シブヤク",
        "representative_address_section": "道玄坂",
        "representative_address_section_kana": "ドウゲンザカ",
        "representative_address_chrome": "1-2-3",
        "representative_address_chrome_kana": "イチニサン",
        "representative_tel": "0312345678",
        "representative_birthday": "1998/11/01",
        "staff1_last_name": "鈴木",
        "staff1_last_name_kana": "スズキ",
        "staff1_first_name": "次郎",
        "staff1_first_name_kana": "ジロウ",
        "staff1_company_name": "株式会社テスト",
        "staff1_belongs": "EC運営部",
        "staff1_tel": "08012345678",
        "staff1_mail": "staff-1@example.com",
        "corporate": True,
        "corporate_info": {
            "corporate_number": "1234567890123",
            "corporate_name": "株式会社テスト",
            "corporate_name_kana": "カブシキガイシャテスト",
            "company_postal_code": "123-4567",
            "company_prefecture": "東京都",
            "company_prefecture_kana": "トウキョウト",
            "company_address_municipality": "渋谷区",
            "company_address_municipality_kana": "シブヤク",
            "company_address_section": "道玄坂",
            "company_address_section_kana": "ドウゲンザカ",
            "company_address_chrome": "1-2-3",
            "company_address_chrome_kana": "イチニサン",
            "company_tel": "0312345678"
        }
    },
    "business_operator_bank_account_info": {
        "bank_code": "0001",
        "branch_code": "001",
        "account_kind": 1,
        "account_number": "1234567",
        "account_name": "ヤマダタロウ"
    }
}

# HTTP POSTリクエストの送信
try:
    response = requests.put(url, headers=headers, json=data)

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

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

def main
    buyer_id = '<Buyer ID>'
    tenant_buyer_id = '<Tenant Buyer ID>'
    endpoint = "/v1/buyer/contracts/examinations/#{buyer_id}"
    
    uri = URI.parse(BASE_URL + endpoint)

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

    data = {
        corporate_number: '1234567890123',
        contract_info: {
            representative_last_name: '山田',
            representative_last_name_kana: 'ヤマダ',
            representative_first_name: '太郎',
            representative_first_name_kana: 'タロウ',
            representative_postal_code: '123-4567',
            representative_prefecture: '東京都',
            representative_prefecture_kana: 'トウキョウト',
            representative_address_municipality: '渋谷区',
            representative_address_municipality_kana: 'シブヤク',
            representative_address_section: '道玄坂',
            representative_address_section_kana: 'ドウゲンザカ',
            representative_address_chrome: '1-2-3',
            representative_address_chrome_kana: 'イチニサン',
            representative_tel: '0312345678',
            representative_birthday: '1998/11/01',
            staff1_last_name: '鈴木',
            staff1_last_name_kana: 'スズキ',
            staff1_first_name: '次郎',
            staff1_first_name_kana: 'ジロウ',
            staff1_company_name: '株式会社テスト',
            staff1_belongs: 'EC運営部',
            staff1_tel: '08012345678',
            staff1_mail: 'staff-1@example.com',
            corporate: true,
            expect_usage_amount: '1000000',
            corporate_info: {
                corporate_name: '株式会社テスト',
                corporate_name_kana: 'カブシキガイシャテスト',
                hp: 'https://www.test.com',
                company_postal_code: '123-4567',
                company_prefecture: '東京都',
                company_prefecture_kana: 'トウキョウト',
                company_address_municipality: '渋谷区',
                company_address_municipality_kana: 'シブヤク',
                company_address_section: '道玄坂',
                company_address_section_kana: 'ドウゲンザカ',
                company_address_chrome: '1-2-3',
                company_address_chrome_kana: 'イチニサン',
                company_address_building_name: 'テストビル',
                company_address_building_name_kana: 'テストビル',
                company_tel: '0312345678'
            }
        },
        business_operator_bank_account_info: {
                bank_code: '0001',
                branch_code: '001',
                account_kind: '1',
                account_number: '1234567',
                account_name: 'ヤマダタロウ'
        }
    }

    # リクエストの作成
    request = Net::HTTP::Put.new(uri.request_uri)
    request['Authorization'] = "Bearer #{API_KEY}"
    request['Content-Type'] = 'application/json'
    request['Tenant-Buyer-Id'] = tenant_buyer_id

    request.body = data.to_json

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

    case response
    when Net::HTTPSuccess
        puts 'SUCCESS'
    else
        puts 'ERROR'
    end

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

main
```

## パラメータ

| 名前 | 位置 | 必須 | 型 | 説明 |
| --- | --- | --- | --- | --- |
| `id` | path | ✓ | schema | 指定したテナントバイヤーの本番環境申請情報を更新します。`Tenant-Buyer-Id`ヘッダーも併せて指定してください。 |
| `Tenant-Buyer-Id` | header | ✓ | schema | <span class="smallText color--red-400">※ プラットフォームのメインショップのみ指定可</span> |

## リクエストボディ

Content-Type: `application/json`

| パラメータ | 型 | 必須 | 説明 |
| --- | --- | --- | --- |
| `corporate_number` | string | ✓ | 法人番号 |
| `contract_info` | BuyerContractInfo.PUT |  | 契約情報 |
| `business_operator_bank_account_info` | BusinessOperatorBuyerBankAccountInfo.PUT |  | 事業者口座情報 |

## レスポンス

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

| パラメータ | 型 | 必須 | 説明 |
| --- | --- | --- | --- |
| `buyer_id` | buyer_id |  | バイヤーID |
| `corporate_number` | corporate_number |  | 法人番号 |
| `status_code` | ContractStatus |  |  |
| `contract_info` | BuyerContractInfo |  | 契約情報 |
| `business_operator_bank_account_info` | BusinessOperatorBuyerBankAccountInfo |  | 事業者口座情報 |

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

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

