# テナントショップ本番環境申請情報 更新

`PUT /v1/contracts/examinations_v2/tenants/{id}`

- operationId: `updateTenantExaminationInfoV2`
- tags: テナント申請管理

`id`で指定したテナントショップの本番環境申請情報を登録します。既に本番環境申請済みのショップのidはご指定いただけません。


## コードサンプル

### cURL

```bash
curl \
    -X PUT \
    -H "Authorization:Bearer <Secret API Key>" \
    -H "Content-Type: application/json" \
    -H "Tenant-Shop-Id: <Tenant Shop ID>" \
    -d '{
    "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",
        "representative_gender": 0,
        "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@exampple.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",
            "capital": 1000000,
            "established_at": "2018/11/01",
            "yearly_sales": 100000000,
            "business_details": "○○の販売"
        }
    }
}' \
'https://api.test.fincode.jp/v1/contracts/examinations_v2/tenants/{Tenant Shop 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 tenantShoptId = "<Tenant Shop ID>";

    try {
        // リクエストの送信
        const examinationInfo = await fincode.tenants.updateExaminationInfoV2(
            tenantShoptId,
            {
                contract_info: {
                    corporate: true,
                    corporate_info: {
                        corporate_number: "1234567890123",
                        corporate_name: "株式会社テスト",
                        corporate_name_kana: "カブシキガイシャテスト",
                        // hp: "",
                        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",

                        capital: 1000000,
                        established_at: "2018/11/01",
                        yearly_sales: 100000000,
                        business_details: "○○の販売",
                    },
                    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",
                    representative_gender: 0,

                    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",
                },
            },
            { tenantShoptId: tenantShoptId }
        );
    } catch (e) {
        // エラーの処理
    }
})();
```

### Go

```go
package main

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

func main() {

	apiKey := "<Secret API Key>"

	tenantShopID := "<Tenant Shop ID>"

	body := UpdatingExaminationInfoRequest_v2{
		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",
			RepresentativeGender:                  0,
			Staff1LastName:                        "鈴木",
			Staff1LastNameKana:                    "スズキ",
			Staff1FirstName:                       "次郎",
			Staff1FirstNameKana:                   "ジロウ",
			Staff1CompanyName:                     "株式会社テスト",
			Staff1Belongs:                         "EC運営部",
			Staff1Tel:                             "08012345678",
			Staff1Mail:                            "staff-1@example.com",
			Corporate:                             true,
			CorporateInfo: CorporateInfo{
				CorporateNumber:                "1234567890123",
				CorporateName:                  "株式会社テスト",
				CorporateNameKana:              "カブシキガイシャテスト",
				CompanyPostalCode:              "123-4567",
				CompanyPrefecture:              "東京都",
				CompanyPrefectureKana:          "トウキョウト",
				CompanyAddressMunicipality:     "渋谷区",
				CompanyAddressMunicipalityKana: "シブヤク",
				CompanyAddressSection:          "道玄坂",
				CompanyAddressSectionKana:      "ドウゲンザカ",
				CompanyAddressChrome:           "1-2-3",
				CompanyAddressChromeKana:       "イチニサン",
				CompanyTel:                     "0312345678",
				Capital:                        1000000,
				EstablishedAt:                  "2018/11/01",
				YearlySales:                    100000000,
				BusinessDetails:                "○○の販売",
			},
		},
	}

	marshalledBody, _ := json.Marshal(body)

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

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

}

type UpdatingExaminationInfoRequest_v2 struct {
	ContractInfo ContractInfo `json:"contract_info"`
}
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"`
	RepresentativeGender                  int           `json:"representative_gender"`
	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"`
	Staff2LastName                        *string       `json:"staff2_last_name,omitempty"`
	Staff2LastNameKana                    *string       `json:"staff2_last_name_kana,omitempty"`
	Staff2FirstName                       *string       `json:"staff2_first_name,omitempty"`
	Staff2FirstNameKana                   *string       `json:"staff2_first_name_kana,omitempty"`
	Staff2CompanyName                     *string       `json:"staff2_company_name,omitempty"`
	Staff2Belongs                         *string       `json:"staff2_belongs,omitempty"`
	Staff2Tel                             *string       `json:"staff2_tel,omitempty"`
	Staff2Mail                            *string       `json:"staff2_mail,omitempty"`
	Corporate                             bool          `json:"corporate"`
	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"`
	Capital                        int     `json:"capital"`
	EstablishedAt                  string  `json:"established_at"`
	YearlySales                    int     `json:"yearly_sales"`
	BusinessDetails                string  `json:"business_details"`
}
```

### PHP

```php
<?php

$apiKey = '<Secret API Key>';

$tenantShopId = '<Tenant Shop ID>';

$baseUrl = "https://api.test.fincode.jp";
$endpoint = "/v1/contracts/examinations_v2/tenants/{$tenantShopId}";
$headers = [
    "Authorization: Bearer " . $apiKey,
    "Content-Type: application/json",
    "Tenant-Shop-Id: " . $tenantShopId,
];

$data = json_encode([
    "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",
        "representative_gender" => 0,
        "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",
            "capital" => 1000000,
            "established_at" => "2018/11/01",
            "yearly_sales" => 100000000,
            "business_details" => "○○の販売"
        ]
    ]
]);

$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>'

tenant_shop_id = '<Tenant Shop ID>'

url = f'https://api.test.fincode.jp/v1/contracts/examinations_v2/tenants/{tenant_shop_id}'

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

data = {
    "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",
        "representative_gender": 0,
        "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",
            "capital": 1000000,
            "established_at": "2018/11/01",
            "yearly_sales": 100000000,
            "business_details": "○○の販売"
        }
    }
}

# 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
    tenant_shop_id = '<Tenant Shop ID>'
    endpoint = "/v1/contracts/examinations_v2/tenants/#{tenant_shop_id}"
    
    uri = URI.parse(BASE_URL + endpoint)

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

    data = {
        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',
            representative_gender: 0,
            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',
                capital: 1000000,
                established_at: '2018/11/01',
                yearly_sales: 100000000,
                business_details: '○○の販売'
            }
        }
    }

    # リクエストの作成
    request = Net::HTTP::Put.new(uri.request_uri)
    request['Authorization'] = "Bearer #{API_KEY}"
    request['Content-Type'] = 'application/json'
    request['Tenant-Shop-Id'] = tenant_shop_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-Shop-Id`ヘッダーも併せて指定してください。 |
| `Tenant-Shop-Id` | header | ✓ | schema | <span class="smallText color--red-400">※ プラットフォームのメインショップのみ指定可</span> |

## リクエストボディ

Content-Type: `application/json`

| パラメータ | 型 | 必須 | 説明 |
| --- | --- | --- | --- |
| `contract_info` | ContractInfo.V2 |  | 契約情報 |
| `shop_info` | ShopInfo.V2 |  | ショップ情報 |
| `bank_account_info` | BankAccountInfo.V2 |  | 銀行口座情報 |
| `business_operator_bank_account_info` | BusinessOperatorBankAccountInfo.PUT.V2 |  | 事業者口座情報 |
| `deposit_cycle_info` | DepositCycleInfo.V2 |  | 入金サイクル情報 |
| `merchant_category_code` | string |  | 業種コード |

## レスポンス

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

| パラメータ | 型 | 必須 | 説明 |
| --- | --- | --- | --- |
| `status_code` | ContractStatus |  |  |
| `contract_info` | ContractInfo.V2 |  | 契約情報 |
| `shop_info` | ShopInfo.V2 |  | ショップ情報 |
| `bank_account_info` | BankAccountInfo.V2.Response |  | 銀行口座情報 |
| `business_operator_bank_account_info` | BusinessOperatorBankAccountInfo.V2 |  | 事業者口座情報 |
| `deposit_cycle_info` | DepositCycleInfo.V2 |  | 入金サイクル情報 |

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

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

