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

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

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

※ このAPIの使用は現在非推奨です。新しいテナントショップ本番環境申請情報 更新APIをご利用ください。\
`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 '{
    "update_contract_detail": true,
    "contract_detail": {
        "corporate": true,
        "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": "○○の販売",
        "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"
    }
}' \
'https://api.test.fincode.jp/v1/contracts/examinations/tenants/{Tenant Shop ID}'
```

### Node.js

```javascript
const BASE_URL = "https://api.test.fincode.jp";

const API_KEY = "<Secret API Key>";

(async () => {
    const tenantShopId = "<Tenant Shop ID>";

    const endpoint = `${BASE_URL}/v1/contracts/examinations/tenants/${tenantShopId}`;

    const response = await fetch(endpoint, {
        method: "PUT",
        headers: {
            Authorization: `Bearer ${API_KEY}`,
            "Content-Type": "application/json",
            "Tenant-Shop-Id": tenantShopId,
        },
        body: JSON.stringify({
            update_contract_detail: true,
            contract_detail: {
                corporate: true,
                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: "○○の販売",
                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",
            },
        }),
    });
    const examinationInfo = await response.json();
})();
```

### Go

```go
package main

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

func main() {

	apiKey := "<Secret API Key>"

	tenantShopID := "<Tenant Shop ID>"

	body := UpdatingExaminationInfoRequest{
		UpdateContractDetail: true,
		ContractDetail: ContractDetail{
			Corporate:                             true,
			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:                       "○○の販売",
			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",
		},
	}

	marshalledBody, _ := json.Marshal(body)

	// リクエストの作成
	req, _ := http.NewRequest("PUT", fmt.Sprintf("https://api.test.fincode.jp/v1/contracts/examinations/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 struct {
	UpdateContractDetail bool           `json:"update_contract_detail"`
	ContractDetail       ContractDetail `json:"contract_detail"`
}

type ContractDetail struct {
	Corporate                             bool    `json:"corporate"`
	CorporateNumber                       string  `json:"corporate_number"`
	CorporateName                         string  `json:"corporate_name"`
	CorporateNameKana                     string  `json:"corporate_name_kana"`
	HP                                    *string `json:"hp,omitempty"`
	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"`
	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"`
}
```

### PHP

```php
<?php

$apiKey = '<Secret API Key>';

$tenantShopId = '<Tenant Shop ID>';

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

$data = json_encode([
    "update_contract_detail" => true,
    "contract_detail" => [
        "corporate" => true,
        "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" => "○○の販売",
        "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"
    ]
]);

$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/tenants/{tenant_shop_id}'

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

data = {
    "update_contract_detail": True,
    "contract_detail": {
        "corporate": True,
        "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": "○○の販売",
        "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",
    }
}

# 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/tenants/#{tenant_shop_id}"
    uri = URI.parse(BASE_URL + endpoint)

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

    data = {
        update_contract_detail: true,
        contract_detail: {
            corporate: true,
            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: "○○の販売",
            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",
        }
    }

    # リクエストの作成
    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`

| パラメータ | 型 | 必須 | 説明 |
| --- | --- | --- | --- |
| `update_contract_detail` | update_contract_detail |  |  |
| `update_shop` | update_shop |  |  |
| `update_bank_account` | update_bank_account |  |  |
| `update_deposit_cycle` | update_deposit_cycle |  |  |
| `deposit_cycle_master_id` | DepositCycleMasterId |  |  |
| `contract_detail` | ContractDetail |  | 契約情報 |
| `shop_item_detail` | array<ContentInfo> |  | ショップ 取扱商材情報 |
| `contract_bank_account` | ContractBankAccountInfo |  | 銀行口座情報 |

## レスポンス

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

| パラメータ | 型 | 必須 | 説明 |
| --- | --- | --- | --- |
| `shop_id` | Shop_properties-id |  | ショップID（テナント） |
| `platform_id` | platform_id |  |  |
| `shop_type` | ShopType |  |  |
| `status_code` | ContractStatus |  |  |
| `deposit_cycle_master_id` | DepositCycleMasterId |  |  |
| `contract_detail` | ContractDetail |  | 契約情報 |
| `shop_item_detail` | array<ContentInfo> |  | ショップ 取扱商材情報 |
| `contract_bank_account` | ContractBankAccountInfo |  | 銀行口座情報 |
| `contract_input_status` | object |  |  |

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

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

