openapi: 3.0.2
info:
  title: fincode バイヤープラットフォーム API
  description: |
    fincode バイヤープラットフォーム用のAPIリファレンスの雛形です。
    必要なエンドポイント、サーバー定義、コンポーネントを追加して利用してください。
  version: 1.4.0
servers:
  - url: https://api.fincode.jp
    description: 本番環境
  - url: https://api.test.fincode.jp
    description: テスト環境
tags:
  - name: Webhook設定
    description: |
      Webhook設定を管理するAPIです。\
      fincode上で指定したイベントが発生した場合、指定したエンドポイントでリアルタイムで通知を受け取れます。\
      [Webhook通知仕様はこちら](#tag/Webhook_)\
      \
      ※1 テナントバイヤーのイベントを受けとるためにはバイヤーテナントごとにWebhook設定を登録する必要があります。

      | 機能                         | イベント名                  | イベントパラメータ                         |
      |----------------------------|--------------------------|-----------------------------------------|
      | 請求書カード払い                     | 登録                     | business_payments.regist                   |
      | 請求書カード払い                     | 実行                     | business_payments.exec                     |
      | 請求書カード払い                     | 更新                     | business_payments.update                  |
      | テナントバイヤー審査状況                     | 更新                     | buyer.contracts.status_code.updated                  |
  - name: Webhook_通知仕様
    description: |
      イベントが発生したときに、fincodeから加盟店様が設定したエンドポイントURLへWebhookのリクエストを送信するときの仕様です。\
      [イベント一覧はこちら](#tag/Webhook)\
      ※通知対象のパラメータは、機能追加等に伴い追加される可能性があります。\
      ※予告なくパラメータ名の変更、削除が行われることはありません。\
      \
      Webhookを利用する場合は、正常受信または受信失敗のレスポンスをWebhookのリクエストに対して返却する必要があります。\
      Webhookのリクエストがエラーで失敗した場合は、リトライ仕様に従って再送します。
externalDocs:
  description: fincode バイヤープラットフォーム JSの仕様はこちらの JSリファレンス から確認できます。
  url: /js-buyerplatform
paths:
  /v1/business_payments:
    get:
      security:
        - Secret-Bearer-Auth: []
        - Secret-Basic-Auth: []
      operationId: retrieveBusinessPaymentList
      tags:
        - 請求書カード払い
      summary: 請求書カード払い 一覧取得
      description: |
        リクエスト情報に設定された条件に当てはまる請求書カード払い情報を一覧取得するAPI。
        検索項目は、「取引ID（完全一致）」「取引先名（LIKE検索）」「支払金額（範囲）」「ステータス（列挙値）」「支払期日（範囲）」「振込実行日（範囲）」「更新日時（範囲）」
      parameters:
        - in: header
          name: Tenant-Buyer-Id
          required: true
          schema:
            allOf:
              - $ref: '#/components/schemas/schema'
          description: |
            <span class="smallText color--red-400">※ バイヤープラットフォームのみ指定可</span>\
            テナントバイヤーID。\
            指定したテナントバイヤーの請求書カード払い情報一覧を取得します。
        - in: query
          name: クエリ
          description: |
            検索条件クエリパラメータ
          required: false
          schema:
            allOf:
              - $ref: '#/components/schemas/Pagination.QueryParams'
              - $ref: '#/components/schemas/BusinessPayment.ListRetrieving.QueryParams'
      responses:
        '200':
          description: リクエストに成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BusinessPayment.ListRetrieving.Response'
        '400':
          description: 不正なリクエスト
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FincodeAPIError.Response'
      x-code-samples:
        - lang: curl
          label: cURL
          source: |
            curl \
                -X GET \
                -H "Authorization:Bearer <Secret API Key>" \
                -H "Tenant-Buyer-Id: b_***********" \
            'https://api.test.fincode.jp/v1/business_payments'
        - lang: node
          label: Node.js
          source: |
            import fetch from "node-fetch";

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

            (async () => {
                const endpoint = `${BASE_URL}/v1/business_payments`;

                const response = await fetch(endpoint, {
                    method: "GET",
                    headers: {
                        Authorization: `Bearer ${API_KEY}`,
                        "Tenant-Buyer-Id": "b_***********",
                    },
                });
                const businessPayments = await response.json();
                console.log(businessPayments); // 取得した請求書カード払いデータを出力
            })();
        - lang: go
          label: Go
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n)\n\nfunc main() {\n\t// APIキーの指定\n\tapiKey := \"<Secret API Key>\"\n\n\t// リクエストの作成\n\treq, err := http.NewRequest(\n\t\t\"GET\",\n\t\t\"https://api.test.fincode.jp/v1/business_payments\",\n\t\tnil,\n\t)\n\tif err != nil {\n\t\tlog.Fatalf(\"リクエストの作成エラー: %v\", err)\n\t}\n\n\treq.Header.Set(\"Authorization\", \"Bearer \"+apiKey)\n    req.Header.Set(\"Tenant-Buyer-Id\", \"b_***********\")\n\n\t// リクエストの送信\n\tresp, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tlog.Fatalf(\"リクエスト送信エラー: %v\", err)\n\t}\n\tdefer resp.Body.Close()\n\n\tfmt.Println(resp.Status)\n}\n"
        - lang: php
          label: PHP
          source: |
            <?php

            $apiKey = '<Secret API Key>';
            $baseUrl = "https://api.test.fincode.jp";
            $endpoint = "/v1/business_payments"; // GETリクエストのエンドポイント

            $headers = [
                "Authorization: Bearer " . $apiKey,
                "Tenant-Buyer-Id: b_***********"
            ];

            $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);
            // curl_setopt($session, CURLOPT_SSL_VERIFYPEER, true);
            // curl_setopt($session, CURLOPT_SSL_VERIFYHOST, 2);

            $response = curl_exec($session);

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

            curl_close($session);
            ?>
        - lang: python
          label: Python 3
          source: |
            import requests

            api_key = '<Secret API Key>'
            base_url = "https://api.test.fincode.jp"
            endpoint = "/v1/business_payments"  # GETリクエストのエンドポイント

            # ヘッダーを設定
            headers = {
                'Authorization': f'Bearer {api_key}',
                'Tenant-Buyer-Id': 'b_***********'
            }

            try:
                response = requests.get(f"{base_url}{endpoint}", headers=headers)

                # レスポンスの処理
                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}")
        - lang: ruby
          label: Ruby
          source: |
            require 'net/http'
            require 'uri'
            require 'json'

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

            def main
                endpoint = "/v1/business_payments"  # GETリクエストのエンドポイント

                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}"
                request["Tenant-Buyer-Id"] = "b_***********"

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

                case response
                when Net::HTTPSuccess
                    puts 'SUCCESS'
                    # レスポンスの表示
                    puts JSON.pretty_generate(JSON.parse(response.body))
                else
                    puts 'ERROR'
                    # エラーの表示
                    puts response.body
                end
            end

            main
    post:
      security:
        - Secret-Bearer-Auth: []
        - Secret-Basic-Auth: []
      operationId: createBusinessPayment
      tags:
        - 請求書カード払い
      summary: 請求書カード払い登録
      description: |
        請求書カード払い情報を登録します。
      parameters:
        - in: header
          name: Tenant-Buyer-Id
          required: true
          schema:
            allOf:
              - $ref: '#/components/schemas/schema'
          description: |
            <span class="smallText color--red-400">※ バイヤープラットフォームのみ指定可</span>\
            テナントバイヤーID。\
            指定したテナントバイヤーの請求書カード払い情報を登録します。
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BusinessPayment.Creating.Request'
      responses:
        '200':
          description: リクエストに成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BusinessPayment.Creating.Response'
        '400':
          description: 不正なリクエスト
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FincodeAPIError.Response'
      x-code-samples:
        - lang: curl
          label: cURL
          source: |
            curl \
                -X POST \
                -H "Authorization:Bearer <Secret API Key>" \
                -H "Content-Type: application/json" \
                -H "Tenant-Buyer-Id: b_***********" \
                -d '{
                "receipt_id": "rc_-RcdyjisQl-Uk5D7Q12f0A"
            }' \
            'https://api.test.fincode.jp/v1/business_payments'
        - lang: node
          label: Node.js
          source: |
            const API_KEY = "<Secret API Key>";

            (async () => {
                const response = await fetch("https://api.test.fincode.jp/v1/business_payments", {
                    method: "POST",
                    headers: {
                        Authorization: `Bearer ${API_KEY}`,
                        "Content-Type": "application/json",
                        "Tenant-Buyer-Id": "b_***********",
                    },
                    body: JSON.stringify({
                        "receipt_id": "rc_-RcdyjisQl-Uk5D7Q12f0A"
                    }),
                });

                const data = await response.json();
                console.log(data);
            })();
        - lang: go
          label: Go
          source: |
            package main

            import (
                "bytes"
                "fmt"
                "io"
                "net/http"
            )

            func main() {
                body := []byte(`{"receipt_id": "rc_-RcdyjisQl-Uk5D7Q12f0A"}`)

                req, err := http.NewRequest(http.MethodPost, "https://api.test.fincode.jp/v1/business_payments", bytes.NewBuffer(body))
                if err != nil {
                    panic(err)
                }

                req.Header.Set("Authorization", "Bearer <Secret API Key>")
                req.Header.Set("Content-Type", "application/json")
                req.Header.Set("Tenant-Buyer-Id", "b_***********")

                resp, err := http.DefaultClient.Do(req)
                if err != nil {
                    panic(err)
                }
                defer resp.Body.Close()

                b, err := io.ReadAll(resp.Body)
                if err != nil {
                    panic(err)
                }

                fmt.Println(string(b))
            }
        - lang: php
          label: PHP
          source: |
            <?php

            $payload = json_encode([
                'receipt_id' => 'rc_-RcdyjisQl-Uk5D7Q12f0A',
            ]);

            $ch = curl_init('https://api.test.fincode.jp/v1/business_payments');
            curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
            curl_setopt($ch, CURLOPT_HTTPHEADER, [
                'Authorization: Bearer <Secret API Key>',
                'Content-Type: application/json',
                "Tenant-Buyer-Id: b_***********"
            ]);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

            $response = curl_exec($ch);
            curl_close($ch);

            echo $response;
        - lang: python
          label: Python 3
          source: |
            import requests

            api_key = '<Secret API Key>'

            url = 'https://api.test.fincode.jp/v1/business_payments'
            headers = {
                'Authorization': f'Bearer {api_key}',
                'Content-Type': 'application/json'
                'Tenant-Buyer-Id': 'b_***********'
            }
            data = {
                "receipt_id": "rc_-RcdyjisQl-Uk5D7Q12f0A"
            }

            response = requests.post(url, headers=headers, json=data)
            print(response.text)
        - lang: ruby
          label: Ruby
          source: |
            require "net/http"
            require "uri"
            require "json"

            uri = URI.parse("https://api.test.fincode.jp/v1/business_payments")
            request = Net::HTTP::Post.new(uri)
            request["Authorization"] = "Bearer <Secret API Key>"
            request["Content-Type"] = "application/json"
            request["Tenant-Buyer-Id"] = "b_***********"
            request.body = {
              receipt_id: "rc_-RcdyjisQl-Uk5D7Q12f0A"
            }.to_json

            response = Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
              http.request(request)
            end

            puts response.body
  /v1/business_payments/{id}:
    get:
      security:
        - Secret-Bearer-Auth: []
        - Secret-Basic-Auth: []
      operationId: retrieveBusinessPayment
      tags:
        - 請求書カード払い
      summary: 請求書カード払い情報取得
      description: |
        エンドポイントに指定してある取引IDに応じたバイヤ請求書カード払い情報を取得する。
      parameters:
        - in: header
          name: Tenant-Buyer-Id
          required: true
          schema:
            allOf:
              - $ref: '#/components/schemas/schema'
          description: |
            <span class="smallText color--red-400">※ バイヤープラットフォームのみ指定可</span>\
            テナントバイヤーID。\
            指定したテナントバイヤーに紐づく請求書カード払い情報を取得します。
        - name: id
          in: path
          required: true
          schema:
            type: string
            minLength: 25
            maxLength: 25
          description: 取引ID
      responses:
        '200':
          description: リクエストに成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BusinessPayment.Detail'
        '400':
          description: 不正なリクエスト
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FincodeAPIError.Response'
      x-code-samples:
        - lang: curl
          label: cURL
          source: |
            curl \
                -X GET \
                -H "Authorization:Bearer <Secret API Key>" \
                -H "Tenant-Buyer-Id: b_***********" \
            'https://api.test.fincode.jp/v1/business_payments/{id}'
        - lang: node
          label: Node.js
          source: |
            import { createFincode } from "@fincode/node";

            const API_KEY = "<Secret API Key>";

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

                const accessId = "<Access ID>";

                try {
                    // リクエストの送信
                    const businessPayment = await fincode.businessPayments.retrieve(accessId);
                } catch (e) {
                    // エラーの処理
                }
            })();
        - lang: go
          label: Go
          source: |
            package main

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

            func main() {
                apiKey := "<Secret API Key>"
                accessID := "<Access ID>"

                // リクエストの作成
                req, _ := http.NewRequest("GET", fmt.Sprintf("https://api.test.fincode.jp/v1/business_payments/%s", accessID), nil)
                req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", apiKey))
                req.Header.Set("Tenant-Buyer-Id", "b_***********")

                // リクエストの送信
                client := &http.Client{}
                res, err := client.Do(req)
                if err != nil {
                    log.Fatal(err)
                }
                defer res.Body.Close()
            }
        - lang: php
          label: PHP
          source: |
            <?php

            $apiKey = '<Secret API Key>';

            $accessId = '<Access ID>';

            $baseUrl = "https://api.test.fincode.jp";
            $endpoint = "/v1/business_payments/{$accessId}";
            $headers = [
                "Authorization: Bearer " . $apiKey,
                "Content-Type: application/json"
                "Tenant-Buyer-Id: b_***********"
            ];

            $session = curl_init();
            curl_setopt($session, CURLOPT_URL, $baseUrl . $endpoint);
            curl_setopt($session, CURLOPT_HTTPHEADER, $headers);
            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);
        - lang: python
          label: Python 3
          source: |
            import requests

            api_key = '<Secret API Key>'

            access_id = '<Access ID>'

            url = f'https://api.test.fincode.jp/v1/business_payments/{access_id}'

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

            # HTTP GETリクエストの送信
            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}")
        - lang: ruby
          label: Ruby
          source: |
            require 'net/http'
            require 'uri'
            require 'json'

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

            def main
              access_id = '<Access ID>'
              endpoint = "/v1/business_payments/#{access_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}"
              request['Content-Type'] = 'application/json'
              request["Tenant-Buyer-Id"] = "b_***********"

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

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

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

            main
    post:
      security:
        - Secret-Bearer-Auth: []
        - Secret-Basic-Auth: []
      operationId: updateBusinessPayment
      tags:
        - 請求書カード払い
      summary: 請求書カード払い更新
      description: |
        指定したIDの請求書カード払い情報を更新します。
      parameters:
        - in: header
          name: Tenant-Buyer-Id
          required: true
          schema:
            allOf:
              - $ref: '#/components/schemas/schema'
          description: |
            <span class="smallText color--red-400">※ バイヤープラットフォームのみ指定可</span>\
            テナントバイヤーID。\
            指定したテナントバイヤーに紐づく請求書カード払い情報を更新します。
        - name: id
          in: path
          required: true
          schema:
            type: string
            minLength: 25
            maxLength: 25
          description: 取引ID
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/BusinessPayment.Updating.Request'
      responses:
        '200':
          description: リクエストに成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BusinessPayment.Updating.Response'
        '400':
          description: 不正なリクエスト
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FincodeAPIError.Response'
      x-code-samples:
        - lang: curl
          label: cURL
          source: |
            curl \
                -X POST \
                -H "Authorization:Bearer <Secret API Key>" \
                -H "Content-Type: multipart/form-data" \
                -H "Tenant-Buyer-Id: b_***********" \
                -F 'data=@<File Name>;type=application/json' \
                -F 'invoice_file=@<File Name>' \
            'https://api.test.fincode.jp/v1/business_payments/bp_VbZbE8t6RMGIsIfOP3U7ww
        - lang: node
          label: Node.js
          source: |
            const API_KEY = "<Secret API Key>";
            const BUSINESS_PAYMENT_ID = "bp_VbZbE8t6RMGIsIfOP3U7ww";

            const form = new FormData();

            form.append("invoice_file", "<File>");
            form.append("data", `{
                billing_amount: 10000,
                card_token: null,
                due_date: "2025/05/11",
                invoice_file_name_display: "請求書.pdf",
                remitter_name: "カタカナ テストタロウ XYZ",
                payee: {
                    company_name: "株式会社アイネット",
                    corporate: "0",
                    representative_name: "株式会社アイネット",
                    invoice_registration_number: "T7020001030145",
                    addr_post_code: "220-0012",
                    addr_state: "横浜市",
                    addr_city: "西区",
                    addr_line_1: "みなとみらい5-1-2",
                    addr_line_2: "横浜シンフォステージ ウエストタワー13階",
                    email: "test@test.com",
                    phone_no: "045-682-0845",
                },
                payee_bank: {
                    bank_code: "0011",
                    bank_name: "三井住友",
                    branch_code: "012",
                    branch_name: "横浜",
                    account_kind: 1,
                    account_number: "4108217",
                    account_name: "カテスト タロウ",
                },
            }`);

            (async () => {
                const response = await fetch(`https://api.test.fincode.jp/v1/business_payments/${BUSINESS_PAYMENT_ID}`, {
                    method: "POST",
                    headers: {
                        Authorization: `Bearer ${API_KEY}`,
                        "Content-Type": "multipart/form-data",
                        "Tenant-Buyer-Id": "b_***********",
                    },
                    body: form,
                });

                const data = await response.json();
                console.log(data);
            })();
        - lang: go
          label: Go
          source: |
            package main

            import (
                "bytes"
                "fmt"
                "io"
                "net/http"
            )

            func main() {
                body := []byte(`{"invoice_file":"string <binary>","data":"{
                    BillingAmount:           10000,
                    CardToken:               nil,
                    BusinessPaymentsCardID:  "1234",
                    CardRegisterFlag:        nil,
                    DueDate:                 "2025/05/11",
                    InvoiceFileNameDisplay:  "請求書.pdf",
                    RemitterName:            "カタカナ テストタロウ XYZ",
                    Payee: Payee{
                        CompanyName:               "株式会社アイネット",
                        Corporate:                 "0",
                        RepresentativeName:        "株式会社アイネット",
                        InvoiceRegistrationNumber: "T7020001030145",
                        AddrPostCode:              "220-0012",
                        AddrState:                 "横浜市",
                        AddrCity:                  "西区",
                        AddrLine1:                 "みなとみらい5-1-2",
                        AddrLine2:                 "横浜シンフォステージ ウエストタワー13階",
                        Email:                     "test@test.com",
                        PhoneNo:                   "045-682-0845",
                    },
                    PayeeBank: PayeeBank{
                        BankCode:      "0011",
                        BankName:      "三井住友",
                        BranchCode:    "012",
                        BranchName:    "横浜",
                        AccountKind:   1,
                        AccountNumber: "4108217",
                        AccountName:   "カテスト タロウ",
                    },
                }"}`)

                req, err := http.NewRequest(http.MethodPost, "https://api.test.fincode.jp/v1/business_payments/bp_abc123", bytes.NewBuffer(body))
                if err != nil {
                    panic(err)
                }

                req.Header.Set("Authorization", "Bearer <Secret API Key>")
                req.Header.Set("Content-Type", "multipart/form-data")
                req.Header.Set("Tenant-Buyer-Id", "b_***********")

                resp, err := http.DefaultClient.Do(req)
                if err != nil {
                    panic(err)
                }
                defer resp.Body.Close()

                b, err := io.ReadAll(resp.Body)
                if err != nil {
                    panic(err)
                }

                fmt.Println(string(b))
            }
        - lang: php
          label: PHP
          source: |
            <?php

            $payload = json_encode([
                'billing_amount' => 10000,
                'card_token' => null,
                'due_date' => '2025/05/11',
                'invoice_file_name_display' => '請求書.pdf',
                'remitter_name' => 'カタカナ テストタロウ XYZ',
                'payee' => [
                    'company_name' => '株式会社アイネット',
                    'corporate' => '0',
                    'representative_name' => '株式会社アイネット',
                    'invoice_registration_number' => 'T7020001030145',
                    'addr_post_code' => '220-0012',
                    'addr_state' => '横浜市',
                    'addr_city' => '西区',
                    'addr_line_1' => 'みなとみらい5-1-2',
                    'addr_line_2' => '横浜シンフォステージ ウエストタワー13階',
                    'email' => 'test@test.com',
                    'phone_no' => '045-682-0845',
                ],
                'payee_bank' => [
                    'bank_code' => '0011',
                    'bank_name' => '三井住友',
                    'branch_code' => '012',
                    'branch_name' => '横浜',
                    'account_kind' => 1,
                    'account_number' => '4108217',
                    'account_name' => 'カテスト タロウ',
                ],
            ]);

            $ch = curl_init('https://api.test.fincode.jp/v1/business_payments/bp_VbZbE8t6RMGIsIfOP3U7ww');
            curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
            curl_setopt($ch, CURLOPT_HTTPHEADER, [
                'Authorization: Bearer <Secret API Key>',
                'Content-Type: multipart/form-data',
                'Tenant-Buyer-Id: b_***********'
            ]);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

            $response = curl_exec($ch);
            curl_close($ch);

            echo $response;
        - lang: python
          label: Python 3
          source: |
            import requests

            api_key = '<Secret API Key>'

            url = 'https://api.test.fincode.jp/v1/business_payments/bp_VbZbE8t6RMGIsIfOP3U7ww'
            headers = {
                'Authorization': f'Bearer {api_key}',
                'Content-Type': 'multipart/form-data'
                'Tenant-Buyer-Id': 'b_***********'
            }
            data = {
                'billing_amount': 10000,
                'card_token': None,
                'due_date': '2025/05/11',
                'invoice_file_name_display': '請求書.pdf',
                'remitter_name': 'カタカナ テストタロウ XYZ',
                'payee': {
                    'company_name': '株式会社アイネット',
                    'corporate': '0',
                    'representative_name': '株式会社アイネット',
                    'invoice_registration_number': 'T7020001030145',
                    'addr_post_code': '220-0012',
                    'addr_state': '横浜市',
                    'addr_city': '西区',
                    'addr_line_1': 'みなとみらい5-1-2',
                    'addr_line_2': '横浜シンフォステージ ウエストタワー13階',
                    'email': 'test@test.com',
                    'phone_no': '045-682-0845'
                },
                'payee_bank': {
                    'bank_code': '0011',
                    'bank_name': '三井住友',
                    'branch_code': '012',
                    'branch_name': '横浜',
                    'account_kind': 1,
                    'account_number': '4108217',
                    'account_name': 'カテスト タロウ'
                }
            }

            response = requests.post(url, headers=headers, json=data)
            print(response.text)
        - lang: ruby
          label: Ruby
          source: |
            require "net/http"
            require "uri"
            require "json"

            uri = URI.parse("https://api.test.fincode.jp/v1/business_payments/bp_VbZbE8t6RMGIsIfOP3U7ww")
            request = Net::HTTP::Post.new(uri)
            request["Authorization"] = "Bearer <Secret API Key>"
            request["Content-Type"] = "multipart/form-data"
            request["Tenant-Buyer-Id"] = "b_***********"
            request.body = {
              billing_amount: 10000,
              card_token: nil,
              due_date: "2025/05/11",
              invoice_file_name_display: "請求書.pdf",
              remitter_name: "カタカナ テストタロウ XYZ",
              payee: {
                company_name: "株式会社アイネット",
                corporate: "0",
                representative_name: "株式会社アイネット",
                invoice_registration_number: "T7020001030145",
                addr_post_code: "220-0012",
                addr_state: "横浜市",
                addr_city: "西区",
                addr_line_1: "みなとみらい5-1-2",
                addr_line_2: "横浜シンフォステージ ウエストタワー13階",
                email: "test@test.com",
                phone_no: "045-682-0845"
              },
              payee_bank: {
                bank_code: "0011",
                bank_name: "三井住友",
                branch_code: "012",
                branch_name: "横浜",
                account_kind: 1,
                account_number: "4108217",
                account_name: "カテスト タロウ"
              }
            }.to_json

            response = Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
              http.request(request)
            end

            puts response.body
    put:
      security:
        - Secret-Bearer-Auth: []
        - Secret-Basic-Auth: []
      operationId: submitBusinessPayment
      tags:
        - 請求書カード払い
      summary: 請求書カード払い提出
      description: |
        請求書カード払い情報を提出する。
      parameters:
        - in: header
          name: Tenant-Buyer-Id
          required: true
          schema:
            allOf:
              - $ref: '#/components/schemas/schema'
          description: |
            <span class="smallText color--red-400">※ バイヤープラットフォームのみ指定可</span>\
            テナントバイヤーID。\
            指定したテナントバイヤーに紐づく請求書カード払い情報を提出します。
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: 取引ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BusinessPayment.Submitting.Request'
      responses:
        '200':
          description: リクエストに成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BusinessPayment.Submitting.Response'
        '400':
          description: 不正なリクエスト
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FincodeAPIError.Response'
      x-code-samples:
        - lang: curl
          label: cURL
          source: |
            curl \
                -X PUT \
                -H "Authorization:Bearer <Secret API Key>" \
                -H "Content-Type: application/json" \
                -H "Tenant-Buyer-Id: b_***********" \
                -d '{
                        "billing_amount": 10000,
                        "card_token": null,
                        "due_date": "2025/05/11",
                        "invoice_file_name_display": "請求書.pdf",
                        "remitter_name": "カタカナ　テストタロウ　ＸＹＺ",
                        "payee": {
                            "company_name": "株式会社アイネット",
                            "corporate": "0",
                            "representative_name": "株式会社アイネット",
                            "invoice_registration_number": "T7020001030145",
                            "addr_post_code": "220-0012",
                            "addr_state": "横浜市",
                            "addr_city": "西区",
                            "addr_line_1": "みなとみらい5-1-2",
                            "addr_line_2": "横浜シンフォステージ ウエストタワー13階",
                            "email": "test@test.com",
                            "phone_no": "045-682-0845"
                        },
                        "payee_bank": {
                            "bank_code": "0011",
                            "bank_name": "三井住友",
                            "branch_code": "012",
                            "branch_name": "横浜",
                            "account_kind": 1,
                            "account_number": "4108217",
                            "account_name": "カテスト　タロウ"
                        }
            }' \
            'https://api.test.fincode.jp/v1/business_payments/{id}'
        - lang: node
          label: Node.js
          source: |
            import fetch from "node-fetch";

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

            (async () => {
                const businessPaymentId = "<Business Payment ID>"; // ここにBusiness Payment IDを設定

                const endpoint = `${BASE_URL}/v1/business_payments/${businessPaymentId}`;

                const response = await fetch(endpoint, {
                    method: "PUT",
                    headers: {
                        Authorization: `Bearer ${API_KEY}`,
                        "Content-Type": "application/json",
                        "Tenant-Buyer-Id": "b_***********",
                    },
                    body: JSON.stringify({
                        billing_amount: 10000,
                        card_token: null,
                        due_date: "2025/05/11",
                        invoice_file_name_display: "請求書.pdf",
                        remitter_name: "カタカナ テストタロウ XYZ",
                        payee: {
                            company_name: "株式会社アイネット",
                            corporate: "0",
                            representative_name: "株式会社アイネット",
                            invoice_registration_number: "T7020001030145",
                            addr_post_code: "220-0012",
                            addr_state: "横浜市",
                            addr_city: "西区",
                            addr_line_1: "みなとみらい5-1-2",
                            addr_line_2: "横浜シンフォステージ ウエストタワー13階",
                            email: "test@test.com",
                            phone_no: "045-682-0845",
                        },
                        payee_bank: {
                            bank_code: "0011",
                            bank_name: "三井住友",
                            branch_code: "012",
                            branch_name: "横浜",
                            account_kind: 1,
                            account_number: "4108217",
                            account_name: "カテスト タロウ",
                        },
                    }),
                });

                if (response.ok) {
                    const businessPaymentData = await response.json();
                    console.log("Business Payment Submitted:", businessPaymentData);
                } else {
                    console.error("Error submitting business payment:", await response.text());
                }
            })();
        - lang: go
          label: Go
          source: |
            package main

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

            func main() {
                // APIキーと請求書カード払いIDを指定
                apiKey := "<Secret API Key>"
                businessPaymentID := "<Business Payment ID>"

                body := SubmitBusinessPaymentRequest{
                    BillingAmount:           10000,
                    CardToken:               nil,
                    BusinessPaymentsCardID:  "1234",
                    CardRegisterFlag:        nil,
                    DueDate:                 "2025/05/11",
                    InvoiceFileNameDisplay:  "請求書.pdf",
                    RemitterName:            "カタカナ テストタロウ XYZ",
                    Payee: Payee{
                        CompanyName:               "株式会社アイネット",
                        Corporate:                 "0",
                        RepresentativeName:        "株式会社アイネット",
                        InvoiceRegistrationNumber: "T7020001030145",
                        AddrPostCode:              "220-0012",
                        AddrState:                 "横浜市",
                        AddrCity:                  "西区",
                        AddrLine1:                 "みなとみらい5-1-2",
                        AddrLine2:                 "横浜シンフォステージ ウエストタワー13階",
                        Email:                     "test@test.com",
                        PhoneNo:                   "045-682-0845",
                    },
                    PayeeBank: PayeeBank{
                        BankCode:      "0011",
                        BankName:      "三井住友",
                        BranchCode:    "012",
                        BranchName:    "横浜",
                        AccountKind:   1,
                        AccountNumber: "4108217",
                        AccountName:   "カテスト タロウ",
                    },
                }

                marshalledBody, err := json.Marshal(body)
                if err != nil {
                    log.Fatalf("エンコードエラー: %v", err)
                }

                url := fmt.Sprintf("https://api.test.fincode.jp/v1/business_payments/%s", businessPaymentID)

                req, err := http.NewRequest(http.MethodPut, url, bytes.NewBuffer(marshalledBody))
                if err != nil {
                    log.Fatalf("リクエストの作成エラー: %v", err)
                }

                req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", apiKey))
                req.Header.Set("Content-Type", "application/json")
                req.Header.Set("Tenant-Buyer-Id", "b_***********")

                client := &http.Client{}
                resp, err := client.Do(req)
                if err != nil {
                    log.Fatalf("リクエストエラー: %v", err)
                }
                defer resp.Body.Close()

                fmt.Println("Status:", resp.Status)
            }

            type SubmitBusinessPaymentRequest struct {
                BillingAmount          int     `json:"billing_amount"`
                CardToken              *string `json:"card_token"`
                DueDate                string  `json:"due_date"`
                InvoiceFileNameDisplay string  `json:"invoice_file_name_display"`
                RemitterName           string  `json:"remitter_name"`
                Payee                  Payee   `json:"payee"`
                PayeeBank              PayeeBank `json:"payee_bank"`
            }

            type Payee struct {
                CompanyName               string `json:"company_name"`
                Corporate                 string `json:"corporate"`
                RepresentativeName        string `json:"representative_name"`
                InvoiceRegistrationNumber string `json:"invoice_registration_number"`
                AddrPostCode              string `json:"addr_post_code"`
                AddrState                 string `json:"addr_state"`
                AddrCity                  string `json:"addr_city"`
                AddrLine1                 string `json:"addr_line_1"`
                AddrLine2                 string `json:"addr_line_2"`
                Email                     string `json:"email"`
                PhoneNo                   string `json:"phone_no"`
            }

            type PayeeBank struct {
                BankCode      string `json:"bank_code"`
                BankName      string `json:"bank_name"`
                BranchCode    string `json:"branch_code"`
                BranchName    string `json:"branch_name"`
                AccountKind   int    `json:"account_kind"`
                AccountNumber string `json:"account_number"`
                AccountName   string `json:"account_name"`
            }
        - lang: php
          label: PHP
          source: |
            <?php

            $apiKey = '<Secret API Key>';
            $businessPaymentId = '<Business Payment ID>'; // ここにBusiness Payment IDを設定

            $baseUrl = "https://api.test.fincode.jp";
            $endpoint = "/v1/business_payments/{$businessPaymentId}";

            $headers = [
                "Authorization: Bearer " . $apiKey,
                "Content-Type: application/json"
                "Tenant-Buyer-Id: b_***********"
            ];

            $data = json_encode([
                'billing_amount' => 10000,
                'card_token' => null,
                'due_date' => '2025/05/11',
                'invoice_file_name_display' => '請求書.pdf',
                'remitter_name' => 'カタカナ テストタロウ XYZ',
                'payee' => [
                    'company_name' => '株式会社アイネット',
                    'corporate' => '0',
                    'representative_name' => '株式会社アイネット',
                    'invoice_registration_number' => 'T7020001030145',
                    'addr_post_code' => '220-0012',
                    'addr_state' => '横浜市',
                    'addr_city' => '西区',
                    'addr_line_1' => 'みなとみらい5-1-2',
                    'addr_line_2' => '横浜シンフォステージ ウエストタワー13階',
                    'email' => 'test@test.com',
                    'phone_no' => '045-682-0845',
                ],
                'payee_bank' => [
                    'bank_code' => '0011',
                    'bank_name' => '三井住友',
                    'branch_code' => '012',
                    'branch_name' => '横浜',
                    'account_kind' => 1,
                    'account_number' => '4108217',
                    'account_name' => 'カテスト タロウ',
                ],
            ]);

            $session = curl_init();
            curl_setopt($session, CURLOPT_URL, $baseUrl . $endpoint);
            curl_setopt($session, CURLOPT_CUSTOMREQUEST, 'PUT');
            curl_setopt($session, CURLOPT_HTTPHEADER, $headers);
            curl_setopt($session, CURLOPT_POSTFIELDS, $data);
            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);
        - lang: python
          label: Python 3
          source: |
            import requests

            api_key = '<Secret API Key>'
            business_payment_id = '<Business Payment ID>'  # ここにBusiness Payment IDを設定

            url = f'https://api.test.fincode.jp/v1/business_payments/{business_payment_id}'

            # ヘッダーを設定
            headers = {
                'Authorization': f'Bearer {api_key}',
                'Content-Type': 'application/json'
                'Tenant-Buyer-Id': 'b_***********'
            }
            data = {
                'billing_amount': 10000,
                'card_token': None,
                'due_date': '2025/05/11',
                'invoice_file_name_display': '請求書.pdf',
                'remitter_name': 'カタカナ テストタロウ XYZ',
                'payee': {
                    'company_name': '株式会社アイネット',
                    'corporate': '0',
                    'representative_name': '株式会社アイネット',
                    'invoice_registration_number': 'T7020001030145',
                    'addr_post_code': '220-0012',
                    'addr_state': '横浜市',
                    'addr_city': '西区',
                    'addr_line_1': 'みなとみらい5-1-2',
                    'addr_line_2': '横浜シンフォステージ ウエストタワー13階',
                    'email': 'test@test.com',
                    'phone_no': '045-682-0845'
                },
                'payee_bank': {
                    'bank_code': '0011',
                    'bank_name': '三井住友',
                    'branch_code': '012',
                    'branch_name': '横浜',
                    'account_kind': 1,
                    'account_number': '4108217',
                    'account_name': 'カテスト タロウ'
                }
            }

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

                # レスポンスの処理
                if response.status_code == 200:
                    print(f"Success: {response.json()}")
                else:
                    print(f"Error: {response.text}")
            except requests.RequestException as e:
                print(f"Request error: {e}")
        - lang: ruby
          label: Ruby
          source: |
            require "net/http"
            require "uri"
            require "json"

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

            def main
              business_payment_id = '<Business Payment ID>' # ここにBusiness Payment IDを設定
              endpoint = "/v1/business_payments/#{business_payment_id}"

              uri = URI.parse(BASE_URL + endpoint)

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

              data = {
                billing_amount: 10000,
                card_token: nil,
                due_date: "2025/05/11",
                invoice_file_name_display: "請求書.pdf",
                remitter_name: "カタカナ テストタロウ XYZ",
                payee: {
                  company_name: "株式会社アイネット",
                  corporate: "0",
                  representative_name: "株式会社アイネット",
                  invoice_registration_number: "T7020001030145",
                  addr_post_code: "220-0012",
                  addr_state: "横浜市",
                  addr_city: "西区",
                  addr_line_1: "みなとみらい5-1-2",
                  addr_line_2: "横浜シンフォステージ ウエストタワー13階",
                  email: "test@test.com",
                  phone_no: "045-682-0845"
                },
                payee_bank: {
                  bank_code: "0011",
                  bank_name: "三井住友",
                  branch_code: "012",
                  branch_name: "横浜",
                  account_kind: 1,
                  account_number: "4108217",
                  account_name: "カテスト タロウ"
                }
              }

              request = Net::HTTP::Put.new(uri.request_uri)
              request['Authorization'] = "Bearer #{API_KEY}"
              request['Content-Type'] = 'application/json'
              request["Tenant-Buyer-Id"] = "b_***********"
              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
  /v1/business_payments/{id}/delete:
    put:
      security:
        - Secret-Bearer-Auth: []
        - Secret-Basic-Auth: []
      operationId: deleteBusinessPayment
      tags:
        - 請求書カード払い
      summary: 請求書カード払い情報削除
      description: |
        指定したIDの請求書カード払い情報を削除します。
      parameters:
        - in: header
          name: Tenant-Buyer-Id
          required: true
          schema:
            allOf:
              - $ref: '#/components/schemas/schema'
          description: |
            <span class="smallText color--red-400">※ バイヤープラットフォームのみ指定可</span>\
            テナントバイヤーID。\
            指定したテナントバイヤーに紐づく請求書カード払い情報を削除します。
        - name: id
          in: path
          required: true
          schema:
            type: string
            minLength: 25
            maxLength: 25
          description: 取引ID
      responses:
        '200':
          description: リクエストに成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BusinessPayment.Deleting.Response'
        '400':
          description: 不正なリクエスト
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FincodeAPIError.Response'
        '404':
          description: 該当データなし
      x-code-samples:
        - lang: curl
          label: cURL
          source: |
            curl \
                -X PUT \
                -H "Authorization:Bearer <Secret API Key>" \
                -H "Tenant-Buyer-Id:b_***********" \
                -H "Tenant-Buyer-Id: b_***********" \
            'https://api.test.fincode.jp/v1/business_payments/bp_VbZbE8t6RMGIsIfOP3U7ww/delete'
        - lang: node
          label: Node.js
          source: |
            const API_KEY = "<Secret API Key>";
            const BUSINESS_PAYMENT_ID = "bp_VbZbE8t6RMGIsIfOP3U7ww";

            (async () => {
                const response = await fetch(`https://api.test.fincode.jp/v1/business_payments/${BUSINESS_PAYMENT_ID}/delete`, {
                    method: "PUT",
                    headers: {
                        Authorization: `Bearer ${API_KEY}`,
                        "Tenant-Buyer-Id": "b_***********",
                    },
                });

                const data = await response.json();
                console.log(data);
            })();
        - lang: go
          label: Go
          source: |
            package main

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

            func main() {
                req, err := http.NewRequest(http.MethodPut, "https://api.test.fincode.jp/v1/business_payments/bp_VbZbE8t6RMGIsIfOP3U7ww/delete", nil)
                if err != nil {
                    panic(err)
                }

                req.Header.Set("Authorization", "Bearer <Secret API Key>")
                req.Header.Set("Tenant-Buyer-Id", "b_***********")

                resp, err := http.DefaultClient.Do(req)
                if err != nil {
                    panic(err)
                }
                defer resp.Body.Close()

                body, err := io.ReadAll(resp.Body)
                if err != nil {
                    panic(err)
                }

                fmt.Println(string(body))
            }
        - lang: php
          label: PHP
          source: |
            <?php

            $ch = curl_init('https://api.test.fincode.jp/v1/business_payments/bp_VbZbE8t6RMGIsIfOP3U7ww/delete');
            curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
            curl_setopt($ch, CURLOPT_HTTPHEADER, [
                'Authorization: Bearer <Secret API Key>',
                'Tenant-Buyer-Id: b_***********',
            ]);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

            $response = curl_exec($ch);
            curl_close($ch);

            echo $response;
        - lang: python
          label: Python 3
          source: |
            import requests

            api_key = '<Secret API Key>'

            url = 'https://api.test.fincode.jp/v1/business_payments/bp_abc123/delete'
            headers = {
                'Authorization': f'Bearer {api_key}'
                'Tenant-Buyer-Id': 'b_***********'
            }

            response = requests.put(url, headers=headers)
            print(response.text)
        - lang: ruby
          label: Ruby
          source: |
            require "net/http"
            require "uri"

            uri = URI.parse("https://api.test.fincode.jp/v1/business_payments/bp_VbZbE8t6RMGIsIfOP3U7ww/delete")
            request = Net::HTTP::Put.new(uri)
            request["Authorization"] = "Bearer <Secret API Key>"
            request["Tenant-Buyer-Id"] = "b_***********"

            response = Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
              http.request(request)
            end

            puts response.body
  /v1/business_payments/request:
    put:
      security:
        - Secret-Bearer-Auth: []
        - Secret-Basic-Auth: []
      operationId: requestBusinessPayment
      tags:
        - 請求書カード払い
      summary: 請求書カード払い依頼
      description: |
        請求書カード払い依頼を行います。
      parameters:
        - in: header
          name: Tenant-Buyer-Id
          required: true
          schema:
            allOf:
              - $ref: '#/components/schemas/schema'
          description: |
            <span class="smallText color--red-400">※ バイヤープラットフォームのみ指定可</span>\
            テナントバイヤーID。\
            指定したテナントバイヤーの請求書カード払い情報依頼を行います。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BusinessPayment.Requesting.Request'
      responses:
        '200':
          description: リクエストに成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BusinessPayment.Requesting.Response'
        '400':
          description: 不正なリクエスト
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FincodeAPIError.Response'
      x-code-samples:
        - lang: curl
          label: cURL
          source: |
            curl \
                -X PUT \
                -H "Authorization:Bearer <Secret API Key>" \
                -H "Content-Type: application/json" \
                -H "Tenant-Buyer-Id: b_***********" \
                -d '{
                "access_id": "bp_abcdefghijklmnopqrstuv",
            }' \
            'https://api.test.fincode.jp/v1/business_payments/request'
        - lang: node
          label: Node.js
          source: |
            const API_KEY = "<Secret API Key>";

            (async () => {
              const response = await fetch(
                "https://api.test.fincode.jp/v1/business_payments/request",
                {
                  method: "PUT",
                  headers: {
                    Authorization: `Bearer ${API_KEY}`,
                    "Content-Type": "application/json",
                    "Tenant-Buyer-Id": "b_***********",
                  },
                  body: JSON.stringify({
                    access_id: "bp_abcdefghijklmnopqrstuv",
                  }),
                },
              );

              const data = await response.json();
              console.log(data);
            })();
        - lang: go
          label: Go
          source: |
            package main

            import (
                "bytes"
                "fmt"
                "io"
                "net/http"
            )

            func main() {
                body := []byte(`{"access_id":"bp_abcdefghijklmnopqrstuv"}`)

                req, err := http.NewRequest(http.MethodPut, "https://api.test.fincode.jp/v1/business_payments/request", bytes.NewBuffer(body))
                if err != nil {
                    panic(err)
                }

                req.Header.Set("Authorization", "Bearer <Secret API Key>")
                req.Header.Set("Content-Type", "application/json")
                req.Header.Set("Tenant-Buyer-Id", "b_***********")

                resp, err := http.DefaultClient.Do(req)
                if err != nil {
                    panic(err)
                }
                defer resp.Body.Close()

                b, err := io.ReadAll(resp.Body)
                if err != nil {
                    panic(err)
                }

                fmt.Println(string(b))
            }
        - lang: php
          label: PHP
          source: |
            <?php

            $payload = json_encode([
                'access_id' => 'bp_abcdefghijklmnopqrstuv',
            ]);

            $ch = curl_init('https://api.test.fincode.jp/v1/business_payments/request');
            curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
            curl_setopt($ch, CURLOPT_HTTPHEADER, [
                'Authorization: Bearer <Secret API Key>',
                'Content-Type: application/json',
                'Tenant-Buyer-Id: b_***********'
            ]);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

            $response = curl_exec($ch);
            curl_close($ch);

            echo $response;
        - lang: python
          label: Python 3
          source: |
            import requests

            api_key = '<Secret API Key>'

            url = 'https://api.test.fincode.jp/v1/business_payments/request'
            headers = {
                'Authorization': f'Bearer {api_key}',
                'Tenant-Buyer-Id': 'b_***********'
                'Content-Type': 'application/json'
            }
            data = {
                'access_id': 'bp_abcdefghijklmnopqrstuv'
            }

            response = requests.put(url, headers=headers, json=data)
            print(response.text)
        - lang: ruby
          label: Ruby
          source: |
            require "net/http"
            require "uri"
            require "json"

            uri = URI.parse("https://api.test.fincode.jp/v1/business_payments/request")
            request = Net::HTTP::Put.new(uri)
            request["Authorization"] = "Bearer <Secret API Key>"
            request["Tenant-Buyer-Id"] = "b_***********"
            request["Content-Type"] = "application/json"
            request.body = {
              access_id: "bp_abcdefghijklmnopqrstuv"
            }.to_json

            response = Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
              http.request(request)
            end

            puts response.body
  /v1/business_payments/auth:
    put:
      security:
        - Secret-Bearer-Auth: []
        - Secret-Basic-Auth: []
      operationId: authorizeBusinessPayment
      tags:
        - 請求書カード払い
      summary: 請求書カード払いオーソリ依頼
      parameters:
        - in: header
          name: Tenant-Buyer-Id
          required: true
          schema:
            allOf:
              - $ref: '#/components/schemas/schema'
          description: |
            <span class="smallText color--red-400">※ バイヤープラットフォームのみ指定可</span>\
            テナントバイヤーID。
      description: |
        請求書カード払いオーソリ依頼を行います。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BusinessPayment.Authorizing.Request'
      responses:
        '200':
          description: リクエストに成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BusinessPayment.Authorizing.Response'
        '400':
          description: 不正なリクエスト
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FincodeAPIError.Response'
      x-code-samples:
        - lang: curl
          label: cURL
          source: |
            curl \
                -X PUT \
                -H "Authorization:Bearer <Secret API Key>" \
                -H "Content-Type: application/json" \
                -H "Tenant-Buyer-Id: b_***********" \
                -d '{
                "p": "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefh"
            }' \
            'https://api.test.fincode.jp/v1/business_payments/auth'
        - lang: node
          label: Node.js
          source: |
            const API_KEY = "<Secret API Key>";

            (async () => {
              const response = await fetch(
                "https://api.test.fincode.jp/v1/business_payments/auth",
                {
                  method: "PUT",
                  headers: {
                    Authorization: `Bearer ${API_KEY}`,
                    "Content-Type": "application/json",
                    "Tenant-Buyer-Id": "b_***********",
                  },
                  body: JSON.stringify({
                    p: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefh",
                  }),
                },
              );

              const data = await response.json();
              console.log(data);
            })();
        - lang: go
          label: Go
          source: |
            package main

            import (
                "bytes"
                "fmt"
                "io"
                "net/http"
            )

            func main() {
                body := []byte(`{"p": "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefh"}`)

                req, err := http.NewRequest(http.MethodPut, "https://api.test.fincode.jp/v1/business_payments/auth", bytes.NewBuffer(body))
                if err != nil {
                    panic(err)
                }

                req.Header.Set("Authorization", "Bearer <Secret API Key>")
                req.Header.Set("Content-Type", "application/json")
                req.Header.Set("Tenant-Buyer-Id", "b_***********")

                resp, err := http.DefaultClient.Do(req)
                if err != nil {
                    panic(err)
                }
                defer resp.Body.Close()

                b, err := io.ReadAll(resp.Body)
                if err != nil {
                    panic(err)
                }

                fmt.Println(string(b))
            }
        - lang: php
          label: PHP
          source: |
            <?php

            $payload = json_encode([
                'p' => 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefh',
            ]);

            $ch = curl_init('https://api.test.fincode.jp/v1/business_payments/auth');
            curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
            curl_setopt($ch, CURLOPT_HTTPHEADER, [
                'Authorization: Bearer <Secret API Key>',
                'Content-Type: application/json',
                'Tenant-Buyer-Id: b_***********'
            ]);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

            $response = curl_exec($ch);
            curl_close($ch);

            echo $response;
        - lang: python
          label: Python 3
          source: |
            import requests

            api_key = '<Secret API Key>'

            url = 'https://api.test.fincode.jp/v1/business_payments/auth'
            headers = {
                'Authorization': f'Bearer {api_key}',
                'Content-Type': 'application/json'
                'Tenant-Buyer-Id': 'b_***********'
            }
            data = {
                'p': 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefh'
            }

            response = requests.put(url, headers=headers, json=data)
            print(response.text)
        - lang: ruby
          label: Ruby
          source: |
            require "net/http"
            require "uri"
            require "json"

            uri = URI.parse("https://api.test.fincode.jp/v1/business_payments/auth")
            request = Net::HTTP::Put.new(uri)
            request["Authorization"] = "Bearer <Secret API Key>"
            request["Content-Type"] = "application/json"
            request["Tenant-Buyer-Id"] = "b_***********"
            request.body = {
              p: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefh"
            }.to_json

            response = Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
              http.request(request)
            end

            puts response.body
  /v1/business_payments/business:
    get:
      security:
        - Secret-Bearer-Auth: []
        - Secret-Basic-Auth: []
      operationId: retrieveBusinessPaymentBusiness
      tags:
        - 請求書カード払い
      summary: 請求書カード払い事業者情報取得
      description: |
        請求書カード払い事業者情報を取得します。
      parameters:
        - in: header
          name: Tenant-Buyer-Id
          required: true
          schema:
            allOf:
              - $ref: '#/components/schemas/schema'
          description: |
            <span class="smallText color--red-400">※ バイヤープラットフォームのみ指定可</span>\
            テナントバイヤーID。\
            指定したテナントバイヤーの請求書カード払い事業者情報を取得します。
      responses:
        '200':
          description: リクエストに成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BusinessPayment.Business'
        '400':
          description: 不正なリクエスト
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FincodeAPIError.Response'
      x-code-samples:
        - lang: curl
          label: cURL
          source: |
            curl \
                -X GET \
                -H "Authorization:Bearer <Secret API Key>" \
                -H "Tenant-Buyer-Id: b_***********" \
            'https://api.test.fincode.jp/v1/business_payments/business'
        - lang: node
          label: Node.js
          source: |
            const API_KEY = "<Secret API Key>";

            (async () => {
                const response = await fetch("https://api.test.fincode.jp/v1/business_payments/business", {
                    method: "GET",
                    headers: {
                        Authorization: `Bearer ${API_KEY}`,
                        "Tenant-Buyer-Id": "b_***********",
                    },
                });

                const data = await response.json();
                console.log(data);
            })();
        - lang: go
          label: Go
          source: |
            package main

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

            func main() {
                req, err := http.NewRequest(http.MethodGet, "https://api.test.fincode.jp/v1/business_payments/business", nil)
                if err != nil {
                    panic(err)
                }

                req.Header.Set("Authorization", "Bearer <Secret API Key>")
                req.Header.Set("Tenant-Buyer-Id", "b_***********")

                resp, err := http.DefaultClient.Do(req)
                if err != nil {
                    panic(err)
                }
                defer resp.Body.Close()

                body, err := io.ReadAll(resp.Body)
                if err != nil {
                    panic(err)
                }

                fmt.Println(string(body))
            }
        - lang: php
          label: PHP
          source: |
            <?php

            $ch = curl_init('https://api.test.fincode.jp/v1/business_payments/business');
            curl_setopt($ch, CURLOPT_HTTPHEADER, [
                'Authorization: Bearer <Secret API Key>',
                'Tenant-Buyer-Id: b_***********'
            ]);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

            $response = curl_exec($ch);
            curl_close($ch);

            echo $response;
        - lang: python
          label: Python 3
          source: |
            from urllib.request import Request, urlopen

            request = Request(
                "https://api.test.fincode.jp/v1/business_payments/business",
                headers={
                    "Authorization": "Bearer <Secret API Key>",
                    'Tenant-Buyer-Id': 'b_***********'
                },
                method="GET",
            )

            with urlopen(request) as response:
                print(response.read().decode("utf-8"))
        - lang: ruby
          label: Ruby
          source: |
            require "net/http"
            require "uri"

            uri = URI.parse("https://api.test.fincode.jp/v1/business_payments/business")
            request = Net::HTTP::Get.new(uri)
            request["Authorization"] = "Bearer <Secret API Key>"
            request["Tenant-Buyer-Id"] = "b_***********"

            response = Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
              http.request(request)
            end

            puts response.body
  /v1/buyer_platform/tenants:
    get:
      security:
        - Secret-Bearer-Auth: []
        - Secret-Basic-Auth: []
      tags:
        - テナントバイヤー
      operationId: retrieveTenantBuyerList
      summary: テナントバイヤー 一覧取得
      description: |
        テナントバイヤーを一覧で取得します。\
        クエリパラメータを指定して取得する条件を絞り込めます。
      parameters:
        - name: クエリ
          in: query
          description: |
            テナントバイヤー情報の一覧取得において検索条件となるクエリパラメータ
          required: false
          schema:
            allOf:
              - $ref: '#/components/schemas/Pagination.QueryParams'
              - $ref: '#/components/schemas/TenantBuyer.ListRetrieving.QueryParams'
      responses:
        '200':
          description: リクエストに成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TenantBuyer.ListRetrieving.Response'
        '400':
          description: 不正なリクエスト
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FincodeAPIError.Response'
      x-code-samples:
        - lang: curl
          label: cURL
          source: |+
            curl \
                -X GET \
                -H "Authorization:Bearer <Secret API Key>" \
            'https://api.test.fincode.jp/v1/buyer_platform/tenants'

        - lang: node
          label: Node.js
          source: |+
            const API_KEY = "<Secret API Key>";

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

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

        - lang: go
          label: Go
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n)\n\nfunc main() {\n\tapiKey := \"<Secret API Key>\"\n\n\treq, _ := http.NewRequest(\"GET\", \"https://api.test.fincode.jp/v1/buyer_platform/tenants\", nil)\n\treq.Header.Set(\"Authorization\", fmt.Sprintf(\"Bearer %s\", apiKey))\n\n\tparams := req.URL.Query()\n\tparams.Add(\"limit\", \"10\")\n\treq.URL.RawQuery = params.Encode()\n\n\tclient := &http.Client{}\n\tres, err := client.Do(req)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer res.Body.Close()\n}\n\n"
        - lang: php
          label: PHP
          source: |+
            <?php

            $apiKey = '<Secret API Key>';

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

            $response = curl_exec($session);

            if ($response === false) {
                echo "cURL Error: " . curl_error($session);
            } else {
                var_dump($response);
            }

            curl_close($session);

        - lang: python
          label: Python 3
          source: |+
            import requests

            api_key = '<Secret API Key>'

            url = 'https://api.test.fincode.jp/v1/buyer_platform/tenants'
            query_params = {
                'limit': '10',
            }

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

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

                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}")

        - lang: ruby
          label: Ruby
          source: |+
            require 'net/http'
            require 'uri'

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

            def main
                endpoint = '/v1/buyer_platform/tenants'
                query_params = { limit: 10 }

                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

  /v1/buyer_platform/tenants/{id}:
    get:
      security:
        - Secret-Bearer-Auth: []
        - Secret-Basic-Auth: []
      tags:
        - テナントバイヤー
      operationId: retrieveTenantBuyer
      summary: テナントバイヤー 取得
      description: |
        `id`で指定したテナントバイヤー情報を取得します。
      parameters:
        - name: id
          in: path
          description: |
            バイヤーID
          required: true
          schema:
            allOf:
              - $ref: '#/components/schemas/schema'
      responses:
        '200':
          description: リクエストに成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TenantBuyer.Retrieving.Response'
        '400':
          description: 不正なリクエスト
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FincodeAPIError.Response'
      x-code-samples:
        - lang: curl
          label: cURL
          source: |+
            curl \
                -X GET \
                -H "Authorization:Bearer <Secret API Key>" \
            'https://api.test.fincode.jp/v1/buyer_platform/tenants/{id}'

        - lang: node
          label: Node.js
          source: |+
            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);
            })();

        - lang: go
          label: Go
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n)\n\nfunc main() {\n\tapiKey := \"<Secret API Key>\"\n\ttenantBuyerID := \"<Tenant Buyer ID>\"\n\n\treq, _ := http.NewRequest(\n\t\t\"GET\",\n\t\tfmt.Sprintf(\"https://api.test.fincode.jp/v1/buyer_platform/tenants/%s\", tenantBuyerID),\n\t\tnil,\n\t)\n\treq.Header.Set(\"Authorization\", fmt.Sprintf(\"Bearer %s\", apiKey))\n\n\tclient := &http.Client{}\n\tres, err := client.Do(req)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer res.Body.Close()\n}\n\n"
        - lang: php
          label: PHP
          source: |+
            <?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);

        - lang: python
          label: Python 3
          source: |+
            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}")

        - lang: ruby
          label: Ruby
          source: |+
            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

  /v1/buyer_platform/tenant_entries:
    post:
      security:
        - Secret-Bearer-Auth: []
        - Secret-Basic-Auth: []
      operationId: createTenantBuyerWithNewUser
      tags:
        - テナントバイヤー申請管理
      summary: テナントバイヤー 作成（新規ユーザー登録）
      description: |
        新規ユーザーを作成し、作成されたユーザーをオーナーとして新規テナントバイヤーを作成するAPIです。\
        このAPIでのテナントバイヤー作成に成功すると、登録されたメールアドレス宛にメールアドレス認証メールが送信されます。
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/POST.BuyerPlatformTenantEntries.Request'
      responses:
        '200':
          description: リクエストに成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/POST.BuyerPlatformTenantEntries.Response'
        '400':
          description: 不正なリクエスト
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FincodeAPIError.Response'
      x-code-samples:
        - lang: curl
          label: cURL
          source: |+
            curl \
                -X POST \
                -H "Authorization:Bearer <Secret API Key>" \
                -H "Content-Type: application/json" \
                -d '{
                "email": "<New User Email Address>",
                "password": "<New User Password>",
                "name": "<New User Name>",
                "tenant_url_id": "<Tenant Invitation URL ID>"
            }' \
            'https://api.test.fincode.jp/v1/buyer_platform/tenant_entries'

        - lang: node
          label: Node.js
          source: |+
            const API_KEY = "<Secret API Key>";

            (async () => {
                const response = await fetch("https://api.test.fincode.jp/v1/buyer_platform/tenant_entries", {
                    method: "POST",
                    headers: {
                        Authorization: `Bearer ${API_KEY}`,
                        "Content-Type": "application/json",
                    },
                    body: JSON.stringify({
                        email: "new-user@example.com",
                        password: "new-user-password",
                        name: "New User",
                        tenant_url_id: "<Tenant Invitation URL ID>",
                    }),
                });

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

        - lang: go
          label: Go
          source: "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n)\n\nfunc main() {\n\tapiKey := \"<Secret API Key>\"\n\n\tbody := CreatingTenantBuyerWithNewUserRequest{\n\t\tEmail:       \"new-user@example.com\",\n\t\tPassword:    \"new-user-password\",\n\t\tName:        \"New User\",\n\t\tTenantURLID: \"<Tenant Invitation URL ID>\",\n\t}\n\n\tmarshalledBody, _ := json.Marshal(body)\n\n\treq, _ := http.NewRequest(\"POST\", \"https://api.test.fincode.jp/v1/buyer_platform/tenant_entries\", bytes.NewBuffer(marshalledBody))\n\treq.Header.Set(\"Authorization\", fmt.Sprintf(\"Bearer %s\", apiKey))\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tclient := &http.Client{}\n\tres, err := client.Do(req)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer res.Body.Close()\n}\n\ntype CreatingTenantBuyerWithNewUserRequest struct {\n\tEmail       string `json:\"email\"`\n\tPassword    string `json:\"password\"`\n\tName        string `json:\"name\"`\n\tTenantURLID string `json:\"tenant_url_id\"`\n}\n\n"
        - lang: php
          label: PHP
          source: |+
            <?php

            $apiKey = '<Secret API Key>';

            $baseUrl = "https://api.test.fincode.jp";
            $endpoint = "/v1/buyer_platform/tenant_entries";
            $headers = [
                "Authorization: Bearer " . $apiKey,
                "Content-Type: application/json"
            ];

            $data = json_encode([
                "email" => "new-user@example.com",
                "password" => "new-user-password",
                "name" => "New User",
                "tenant_url_id" => "<Tenant Invitation URL ID>",
            ]);

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

        - lang: python
          label: Python 3
          source: |+
            import requests

            api_key = '<Secret API Key>'

            url = 'https://api.test.fincode.jp/v1/buyer_platform/tenant_entries'

            headers = {
                'Authorization': f'Bearer {api_key}',
                'Content-Type': 'application/json'
            }

            data = {
                'email': 'new-user@example.com',
                'password': 'new-user-password',
                'name': 'New User',
                'tenant_url_id': '<Tenant Invitation URL ID>'
            }

            try:
                response = requests.post(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}")

        - lang: ruby
          label: Ruby
          source: |+
            require 'net/http'
            require 'uri'
            require 'json'

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

            def main
                endpoint = '/v1/buyer_platform/tenant_entries'

                uri = URI.parse(BASE_URL + endpoint)

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

                data = {
                    email: 'new-user@example.com',
                    password: 'new-user-password',
                    name: 'New User',
                    tenant_url_id: '<Tenant Invitation URL ID>'
                }

                request = Net::HTTP::Post.new(uri.request_uri)
                request['Authorization'] = "Bearer #{API_KEY}"
                request['Content-Type'] = 'application/json'
                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

  /v1/buyer_platform/join_tenants:
    post:
      security:
        - Secret-Bearer-Auth: []
        - Secret-Basic-Auth: []
      operationId: createTenantBuyerWithExistingUser
      tags:
        - テナントバイヤー申請管理
      summary: テナントバイヤー 作成（既存ユーザー参加）
      description: |
        指定したバイヤープラットフォームのユーザーを新規テナントバイヤーのオーナーとして新規テナントバイヤーを作成するAPIです。\
        \
        `password`パラメータに関して、ユーザーのパスワードがfincode管理画面アプリケーション上で更新されることを想定して実装・運用することが推奨されます。
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/POST.BuyerPlatformJoinTenants.Request'
      responses:
        '200':
          description: リクエストに成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/POST.BuyerPlatformJoinTenants.Response'
        '400':
          description: 不正なリクエスト
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FincodeAPIError.Response'
      x-code-samples:
        - lang: curl
          label: cURL
          source: |
            curl \
                -X POST \
                -H "Authorization:Bearer <Secret API Key>" \
                -H "Content-Type: application/json" \
                -d '{
                "email": "platform-user@example.com",
                "password": "platform-user-password",
                "tenant_buyer_url_id": "<Tenant Buyer Invitation URL ID>"
            }' \
            'https://api.test.fincode.jp/v1/buyer_platform/join_tenants'
        - lang: node
          label: Node.js
          source: |
            import { createFincode } from "@fincode/node";

            const API_KEY = "<Secret API Key>";

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

                try {
                    // リクエストの送信
                    const tenantShop = await fincode.tenants.createWithExistingUser({
                        email: "existing-user@example.com",
                        password: "existing-user-password",
                        tenant_buyer_url_id: "<Tenant Buyer Invitation URL ID>",
                    });
                } catch (e) {
                    // エラーの処理
                }
            })();
        - lang: go
          label: Go
          source: "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n)\n\nfunc main() {\n\n\tapiKey := \"<Secret API Key>\"\n\n\tbody := CreatingTenantWithNewUserRequest{\n\t\tEmail:    \"new-user@example.com\",\n\t\tPassword: \"new-user-password\",\n\t\tName:     \"New User\",\n\t}\n\n\tmarshalledBody, _ := json.Marshal(body)\n\n\t// リクエストの作成\n\treq, _ := http.NewRequest(\"POST\", \"https://api.test.fincode.jp/v1/buyer_platform/join_tenants\", bytes.NewBuffer(marshalledBody))\n\treq.Header.Set(\"Authorization\", fmt.Sprintf(\"Bearer %s\", apiKey))\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\t// リクエストの送信\n\tclient := &http.Client{}\n\tres, err := client.Do(req)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer res.Body.Close()\n}\n\ntype CreatingTenantWithNewUserRequest struct {\n\tEmail            string `json:\"email\"`\n\tPassword         string `json:\"password\"`\n\tName             string `json:\"name\"`\n\tTenantBuyerUrlId string `json:\"tenant_buyer_url_id\"`\n}\n"
        - lang: php
          label: PHP
          source: |
            <?php

            $apiKey = '<Secret API Key>';

            $baseUrl = "https://api.test.fincode.jp";
            $endpoint = "/v1/buyer_platform/join_tenants";
            $headers = [
                "Authorization: Bearer " . $apiKey,
                "Content-Type: application/json"
            ];

            $data = json_encode([
                "email" => "platform-user@example.com",
                "password" => "platform-user-password",
                "tenant_buyer_url_id" => "<Tenant Buyer Invitation URL ID>"
            ]);

            $session = curl_init();
            curl_setopt($session, CURLOPT_URL, $baseUrl . $endpoint);
            curl_setopt($session, CURLOPT_HTTPHEADER, $headers);
            curl_setopt($session, CURLOPT_POST, true);
            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);
        - lang: python
          label: Python 3
          source: |
            import requests

            api_key = '<Secret API Key>'

            url = f'https://api.test.fincode.jp/v1/buyer_platform/join_tenants'

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

            data = {
                "email": "platform-user@example.com",
                "password": "platform-user-password",
                "tenant_buyer_url_id": "<Tenant Buyer Invitation URL ID>"
            }

            # HTTP POSTリクエストの送信
            try:
                response = requests.post(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}")
        - lang: ruby
          label: Ruby
          source: |
            require 'net/http'
            require 'uri'
            require 'json'


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

            def main
                endpoint = "/v1/buyer_platform/join_tenants"
                uri = URI.parse(BASE_URL + endpoint)

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

                data = {
                    email: "platform-user@example.com",
                    password: "platform-user-password",
                    tenant_buyer_url_id: "<Tenant Buyer Invitation URL ID>"
                }

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

                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
  /v1/buyer/contracts/{id}:
    get:
      security:
        - Secret-Bearer-Auth: []
        - Secret-Basic-Auth: []
      operationId: retrieveBuyerContract
      tags:
        - テナントバイヤー申請管理
      summary: テナントバイヤー契約情報 取得
      description: |
        `id`で指定したテナントバイヤーの契約情報を取得します。
      parameters:
        - name: id
          in: path
          description: |
            指定したテナントバイヤーの契約情報を取得します。`Tenant-Buyer-Id`ヘッダーも併せて指定してください。
          schema:
            allOf:
              - $ref: '#/components/schemas/schema'
          required: true
        - in: header
          name: Tenant-Buyer-Id
          required: true
          schema:
            allOf:
              - $ref: '#/components/schemas/schema'
          description: |
            <span class="smallText color--red-400">※ プラットフォームのメインショップのみ指定可</span>\
            テナントバイヤーID。\
            指定したテナントバイヤーの契約情報を取得します。
      responses:
        '200':
          description: リクエストに成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BuyerContracts.Retrieving.Response'
        '400':
          description: 不正なリクエスト
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FincodeAPIError.Response'
      x-code-samples:
        - lang: curl
          label: cURL
          source: |
            curl \
                -X GET \
                -H "Authorization:Bearer <Secret API Key>" \
                -H "Tenant-Buyer-Id: <Tenant Buyer ID>" \
            'https://api.test.fincode.jp/v1/buyer/contracts/{Tenant Buyer ID}'
        - lang: node
          label: Node.js
          source: |-
            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/${BUYER_ID}`,
                  {
                    method: "GET",
                    headers: {
                      Authorization: `Bearer ${API_KEY}`,
                      "Tenant-Buyer-Id": TENANT_BUYER_ID,
                    },
                  }
                );

                const data = await response.json();
                console.log(data);
              } catch (e) {
                console.error(e);
              }
            })();
        - lang: go
          label: Go
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n)\n\nfunc main() {\n\n\tapiKey := \"<Secret API Key>\"\n\n\tbuyerId := \"<Buyer ID>\"\n\ttenantBuyerID := \"<Tenant Buyer ID>\"\n\n\t// リクエストの作成\n\treq, _ := http.NewRequest(\"GET\", fmt.Sprintf(\"https://api.test.fincode.jp/v1/buyer/contracts/%s\", buyerId), nil)\n\treq.Header.Set(\"Authorization\", fmt.Sprintf(\"Bearer %s\", apiKey))\n\treq.Header.Set(\"Tenant-Buyer-Id\", tenantBuyerID)\n\n\t// リクエストの送信\n\tclient := &http.Client{}\n\tres, err := client.Do(req)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer res.Body.Close()\n\n}\n"
        - lang: php
          label: PHP
          source: |
            <?php

            $apiKey = '<Secret API Key>';

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

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

            $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);
            // 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);
        - lang: python
          label: Python 3
          source: |
            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/{buyer_id}'

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

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

                # レスポンスの処理
                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}")
        - lang: ruby
          label: Ruby
          source: |
            require 'net/http'
            require 'uri'

            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/#{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}"
                request['Tenant-Buyer-Id'] = tenant_buyer_id

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

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

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

            main
  /v1/buyer/contracts/examinations:
    post:
      security:
        - Secret-Bearer-Auth: []
        - Secret-Basic-Auth: []
      operationId: requestBuyerProductionEnvironment
      tags:
        - テナントバイヤー申請管理
      summary: テナントバイヤー 本番環境申請
      description: |
        `id`で指定したテナントバイヤーの本番環境の利用申請を行います。このAPIを呼び出すまでにテナントバイヤー本番環境申請情報 更新APIで申請情報を用意しておく必要があります。
      parameters:
        - in: header
          name: Tenant-Buyer-Id
          required: true
          schema:
            allOf:
              - $ref: '#/components/schemas/schema'
          description: |
            <span class="smallText color--red-400">※ プラットフォームのメインショップのみ指定可</span>\
            テナントバイヤーID。\
            指定したテナントバイヤーのものとして申請情報を登録します。
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/POST.BuyerContractsExaminations.Request'
      responses:
        '200':
          description: リクエストに成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/POST.BuyerContractsExaminations.Response'
        '400':
          description: 不正なリクエスト
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FincodeAPIError.Response'
      x-code-samples:
        - lang: curl
          label: cURL
          source: |
            curl \
                -X POST \
                -H "Authorization:Bearer <Secret API Key>" \
                -H "Content-Type: application/json" \
                -H "Tenant-Buyer-Id: <Tenant Buyer ID>" \
                -d '{
                "buyer_id": "<Buyer ID>",
                "force_credit_check_skip": false
            }' \
            'https://api.test.fincode.jp/v1/buyer/contracts/examinations'
        - lang: node
          label: Node.js
          source: |-
            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",
                  {
                    method: "POST",
                    headers: {
                      Authorization: `Bearer ${API_KEY}`,
                      "Tenant-Buyer-Id": TENANT_BUYER_ID,
                      "Content-Type": "application/json",
                    },
                    body: JSON.stringify({
                      buyer_id: BUYER_ID,
                      force_credit_check_skip: false,
                    }),
                  }
                );

                const data = await response.json();
                console.log(data);
              } catch (e) {
                console.error(e);
              }
            })();
        - lang: go
          label: Go
          source: "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n)\n\nfunc main() {\n\n\tapiKey := \"<Secret API Key>\"\n\n\ttenantBuyerID := \"<Tenant Buyer ID>\"\n\n\tbody := RequestExaminationRequestBody{\n\t\tBuyerID:             \"<Buyer ID>\",\n\t\tEnableImmediateUse: false,\n\t}\n\n\tmarshalledBody, _ := json.Marshal(body)\n\n\t// リクエストの作成\n\treq, _ := http.NewRequest(\"POST\", \"https://api.test.fincode.jp/v1/buyer/contracts/examinations\", bytes.NewBuffer(marshalledBody))\n\treq.Header.Set(\"Authorization\", fmt.Sprintf(\"Bearer %s\", apiKey))\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\treq.Header.Set(\"Tenant-Buyer-Id\", tenantBuyerID)\n\n\t// リクエストの送信\n\tclient := &http.Client{}\n\tres, err := client.Do(req)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer res.Body.Close()\n\n}\n\ntype RequestExaminationRequestBody struct {\n\tBuyerID             string `json:\"buyer_id\"`\n\tEnableImmediateUse bool   `json:\"enable_immediate_use\"`\n}\n"
        - lang: php
          label: PHP
          source: |
            <?php

            $apiKey = '<Secret API Key>';

            $tenantBuyerId = '<Tenant Buyer ID>';

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

            $data = json_encode([
                "buyer_id" => "b_***********",
                "force_credit_check_skip" => "false",
            ]);

            $session = curl_init();
            curl_setopt($session, CURLOPT_URL, $baseUrl . $endpoint);
            curl_setopt($session, CURLOPT_HTTPHEADER, $headers);
            curl_setopt($session, CURLOPT_POST, true);
            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);
        - lang: python
          label: Python 3
          source: |
            import requests

            api_key = '<Secret API Key>'

            tenant_buyer_id = '<Tenant Buyer ID>'
            url = f'https://api.test.fincode.jp/v1/buyer/contracts/examinations'

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

            data = {
                "buyer_id": "<Buyer ID>",
                "force_credit_check_skip": "false",
            }

            # HTTP POSTリクエストの送信
            try:
                response = requests.post(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}")
        - lang: ruby
          label: Ruby
          source: |
            require 'net/http'
            require 'uri'
            require 'json'


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

            def main
                tenant_buyer_id = '<Tenant Buyer ID>'

                endpoint = "/v1/buyer/contracts/examinations"
                uri = URI.parse(BASE_URL + endpoint)

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

                data = {
                    buyer_id: '<Buyer ID>',
                    force_credit_check_skip: false,
                }

                # リクエストの作成
                request = Net::HTTP::Post.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
  /v1/buyer/contracts/examinations/{id}:
    get:
      security:
        - Secret-Bearer-Auth: []
        - Secret-Basic-Auth: []
      operationId: retrieveBuyerExaminationInfo
      tags:
        - テナントバイヤー申請管理
      summary: テナントバイヤー本番環境申請情報 取得
      description: |
        `id`で指定したテナントバイヤーの本番環境申請情報を取得します。
      parameters:
        - name: id
          in: path
          description: |
            指定したテナントバイヤーの本番環境申請情報を取得します。`Tenant-Buyer-Id`ヘッダーも併せて指定してください。
          schema:
            allOf:
              - $ref: '#/components/schemas/schema'
          required: true
        - in: header
          name: Tenant-Buyer-Id
          required: true
          schema:
            allOf:
              - $ref: '#/components/schemas/schema'
          description: |
            <span class="smallText color--red-400">※ プラットフォームのメインショップのみ指定可</span>\
            テナントバイヤーID。\
            指定したテナントバイヤーの本番環境申請情報を取得します。
      responses:
        '200':
          description: リクエストに成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BuyerExaminationInfo.Retrieving.Response'
        '400':
          description: 不正なリクエスト
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FincodeAPIError.Response'
      x-code-samples:
        - lang: curl
          label: cURL
          source: |
            curl \
                -X GET \
                -H "Authorization:Bearer <Secret API Key>" \
                -H "Tenant-Buyer-Id: <Tenant Buyer ID>" \
            'https://api.test.fincode.jp/v1/buyer/contracts/examinations/{Tenant Buyer ID}'
        - lang: node
          label: Node.js
          source: |-
            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: "GET",
                    headers: {
                      Authorization: `Bearer ${API_KEY}`,
                      "Tenant-Buyer-Id": TENANT_BUYER_ID,
                    },
                  }
                );

                const data = await response.json();
                console.log(data);
              } catch (e) {
                console.error(e);
              }
            })();
        - lang: go
          label: Go
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n)\n\nfunc main() {\n\n\tapiKey := \"<Secret API Key>\"\n\n    buyerId := \"<Buyer ID>\"\n\ttenantBuyerID := \"<Tenant Buyer ID>\"\n\n\t// リクエストの作成\n\treq, _ := http.NewRequest(\"GET\", fmt.Sprintf(\"https://api.test.fincode.jp/v1/buyer/contracts/examinations/%s\", buyerId), nil)\n\treq.Header.Set(\"Authorization\", fmt.Sprintf(\"Bearer %s\", apiKey))\n\treq.Header.Set(\"Tenant-Buyer-Id\", tenantBuyerID)\n\n\t// リクエストの送信\n\tclient := &http.Client{}\n\tres, err := client.Do(req)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer res.Body.Close()\n\n}\n"
        - lang: php
          label: PHP
          source: |
            <?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,
                "Tenant-Buyer-Id: " . $tenantBuyerId,
            ];

            $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);
            // 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);
        - lang: python
          label: Python 3
          source: |
            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}',
                'Tenant-Buyer-Id': tenant_buyer_id,
            }

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

                # レスポンスの処理
                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}")
        - lang: ruby
          label: Ruby
          source: |
            require 'net/http'
            require 'uri'

            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

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

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

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

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

            main
    put:
      security:
        - Secret-Bearer-Auth: []
        - Secret-Basic-Auth: []
      operationId: updateBuyerExaminationInfo
      tags:
        - テナントバイヤー申請管理
      summary: テナントバイヤー本番環境申請情報 更新
      description: |
        `id`で指定したテナントバイヤーの本番環境申請情報を更新します。
      parameters:
        - name: id
          in: path
          description: |
            指定したテナントバイヤーの本番環境申請情報を更新します。`Tenant-Buyer-Id`ヘッダーも併せて指定してください。
          schema:
            allOf:
              - $ref: '#/components/schemas/schema'
          required: true
        - in: header
          name: Tenant-Buyer-Id
          required: true
          schema:
            allOf:
              - $ref: '#/components/schemas/schema'
          description: |
            <span class="smallText color--red-400">※ プラットフォームのメインショップのみ指定可</span>\
            テナントバイヤーID。\
            指定したテナントバイヤーの本番環境申請情報を更新します。
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BuyerExaminationInfo.Updating.Request'
      responses:
        '200':
          description: リクエストに成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BuyerExaminationInfo.Updating.Response'
        '400':
          description: 不正なリクエスト
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FincodeAPIError.Response'
      x-code-samples:
        - lang: curl
          label: cURL
          source: |
            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}'
        - lang: node
          label: Node.js
          source: |-
            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);
              }
            })();
        - lang: go
          label: Go
          source: "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n)\n\nfunc main() {\n\n\tapiKey := \"<Secret API Key>\"\n\n    buyerId := \"<Buyer ID>\"\n\ttenantBuyerID := \"<Tenant Buyer ID>\"\n\n\tbody := UpdatingExaminationInfoRequest{\n\t\tCorporateNumber: \"1234567890123\",\n\t\tContractInfo: ContractInfo{\n\t\t\tRepresentativeLastName:                \"山田\",\n\t\t\tRepresentativeLastNameKana:            \"ヤマダ\",\n\t\t\tRepresentativeFirstName:               \"太郎\",\n\t\t\tRepresentativeFirstNameKana:           \"タロウ\",\n\t\t\tRepresentativePostalCode:              \"123-4567\",\n\t\t\tRepresentativePrefecture:              \"東京都\",\n\t\t\tRepresentativePrefectureKana:          \"トウキョウト\",\n\t\t\tRepresentativeAddressMunicipality:     \"渋谷区\",\n\t\t\tRepresentativeAddressMunicipalityKana: \"シブヤク\",\n\t\t\tRepresentativeAddressSection:          \"道玄坂\",\n\t\t\tRepresentativeAddressSectionKana:      \"ドウゲンザカ\",\n\t\t\tRepresentativeAddressChrome:           \"1-2-3\",\n\t\t\tRepresentativeAddressChromeKana:       \"イチニサン\",\n\t\t\tRepresentativeTel:                     \"0312345678\",\n\t\t\tRepresentativeBirthday:                \"1998/11/01\",\n\t\t\tStaff1LastName:                        \"鈴木\",\n\t\t\tStaff1LastNameKana:                    \"スズキ\",\n\t\t\tStaff1FirstName:                       \"次郎\",\n\t\t\tStaff1FirstNameKana:                   \"ジロウ\",\n\t\t\tStaff1CompanyName:                     \"株式会社テスト\",\n\t\t\tStaff1Belongs:                         \"EC運営部\",\n\t\t\tStaff1Tel:                             \"08012345678\",\n\t\t\tStaff1Mail:                            \"staff-1@example.com\",\n\t\t\tCorporate:                             true,\n\t\t\tExpectUsageAmount:                     \"1000000\",\n\t\t\tCorporateInfo: CorporateInfo{\n\t\t\t\tCorporateName:                  \"株式会社テスト\",\n\t\t\t\tCorporateNameKana:              \"カブシキガイシャテスト\",\n\t\t\t\tHp:                             \"https://www.test.co.jp\",\n\t\t\t\tCompanyPostalCode:              \"123-4567\",\n\t\t\t\tCompanyPrefecture:              \"東京都\",\n\t\t\t\tCompanyPrefectureKana:          \"トウキョウト\",\n\t\t\t\tCompanyAddressMunicipality:     \"渋谷区\",\n\t\t\t\tCompanyAddressMunicipalityKana: \"シブヤク\",\n\t\t\t\tCompanyAddressSection:          \"道玄坂\",\n\t\t\t\tCompanyAddressSectionKana:      \"ドウゲンザカ\",\n\t\t\t\tCompanyAddressChrome:           \"1-2-3\",\n\t\t\t\tCompanyAddressChromeKana:       \"イチニサン\",\n\t\t\t\tCompanyTel:                     \"0312345678\",\n\t\t\t},\n\t\t},\n\t\tBusinessOperatorBankAccountInfo: BusinessOperatorBankAccountInfo{\n\t\t\tBankCode:      \"0001\",\n\t\t\tBranchCode:    \"001\",\n\t\t\tAccountKind:   \"1\",\n\t\t\tAccountNumber: \"1234567\",\n\t\t\tAccountName:   \"ヤマダタロウ\",\n\t\t},\n\t}\n\n\tmarshalledBody, _ := json.Marshal(body)\n\n\t// リクエストの作成\n\treq, _ := http.NewRequest(\"PUT\", fmt.Sprintf(\"https://api.test.fincode.jp/v1/buyer/contracts/examinations/%s\", buyerId), bytes.NewBuffer(marshalledBody))\n\treq.Header.Set(\"Authorization\", fmt.Sprintf(\"Bearer %s\", apiKey))\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\treq.Header.Set(\"Tenant-Buyer-Id\", tenantBuyerID)\n\n\t// リクエストの送信\n\tclient := &http.Client{}\n\tres, err := client.Do(req)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer res.Body.Close()\n\n}\n\ntype UpdatingExaminationInfoRequest struct {\n\tCorporateNumber                string                          `json:\"corporate_number\"`\n\tContractInfo                   ContractInfo                    `json:\"contract_info\"`\n\tBusinessOperatorBankAccountInfo BusinessOperatorBankAccountInfo `json:\"business_operator_bank_account_info\"`\n}\n\ntype BusinessOperatorBankAccountInfo struct {\n\tBankCode      string `json:\"bank_code\"`\n\tBranchCode    string `json:\"branch_code\"`\n\tAccountKind   string `json:\"account_kind\"`\n\tAccountNumber string `json:\"account_number\"`\n\tAccountName   string `json:\"account_name\"`\n}\ntype ContractInfo struct {\n\tRepresentativeLastName                string        `json:\"representative_last_name\"`\n\tRepresentativeLastNameKana            string        `json:\"representative_last_name_kana\"`\n\tRepresentativeFirstName               string        `json:\"representative_first_name\"`\n\tRepresentativeFirstNameKana           string        `json:\"representative_first_name_kana\"`\n\tRepresentativePostalCode              string        `json:\"representative_postal_code\"`\n\tRepresentativePrefecture              string        `json:\"representative_prefecture\"`\n\tRepresentativePrefectureKana          string        `json:\"representative_prefecture_kana\"`\n\tRepresentativeAddressMunicipality     string        `json:\"representative_address_municipality\"`\n\tRepresentativeAddressMunicipalityKana string        `json:\"representative_address_municipality_kana\"`\n\tRepresentativeAddressSection          string        `json:\"representative_address_section\"`\n\tRepresentativeAddressSectionKana      string        `json:\"representative_address_section_kana\"`\n\tRepresentativeAddressChrome           string        `json:\"representative_address_chrome\"`\n\tRepresentativeAddressChromeKana       string        `json:\"representative_address_chrome_kana\"`\n\tRepresentativeAddressBuildingName     *string       `json:\"representative_address_building_name,omitempty\"`\n\tRepresentativeAddressBuildingNameKana *string       `json:\"representative_address_building_name_kana,omitempty\"`\n\tRepresentativeTel                     string        `json:\"representative_tel\"`\n\tRepresentativeBirthday                string        `json:\"representative_birthday\"`\n\tStaff1LastName                        string        `json:\"staff1_last_name\"`\n\tStaff1LastNameKana                    string        `json:\"staff1_last_name_kana\"`\n\tStaff1FirstName                       string        `json:\"staff1_first_name\"`\n\tStaff1FirstNameKana                   string        `json:\"staff1_first_name_kana\"`\n\tStaff1CompanyName                     string        `json:\"staff1_company_name\"`\n\tStaff1Belongs                         string        `json:\"staff1_belongs\"`\n\tStaff1Tel                             string        `json:\"staff1_tel\"`\n\tStaff1Mail                            string        `json:\"staff1_mail\"`\n\tCorporate                             bool          `json:\"corporate\"`\n\tExpectUsageAmount                     int           `json:\"expect_usage_amount\"`\n\tCorporateInfo                         CorporateInfo `json:\"corporate_info\"`\n}\ntype CorporateInfo struct {\n\tCorporateNumber                string  `json:\"corporate_number\"`\n\tCorporateName                  string  `json:\"corporate_name\"`\n\tCorporateNameKana              string  `json:\"corporate_name_kana\"`\n\tCompanyPostalCode              string  `json:\"company_postal_code\"`\n\tCompanyPrefecture              string  `json:\"company_prefecture\"`\n\tCompanyPrefectureKana          string  `json:\"company_prefecture_kana\"`\n\tCompanyAddressMunicipality     string  `json:\"company_address_municipality\"`\n\tCompanyAddressMunicipalityKana string  `json:\"company_address_municipality_kana\"`\n\tCompanyAddressSection          string  `json:\"company_address_section\"`\n\tCompanyAddressSectionKana      string  `json:\"company_address_section_kana\"`\n\tCompanyAddressChrome           string  `json:\"company_address_chrome\"`\n\tCompanyAddressChromeKana       string  `json:\"company_address_chrome_kana\"`\n\tCompanyAddressBuildingName     *string `json:\"company_address_building_name,omitempty\"`\n\tCompanyAddressBuildingNameKana *string `json:\"company_address_building_name_kana,omitempty\"`\n\tCompanyTel                     string  `json:\"company_tel\"`\n}\n"
        - lang: php
          label: PHP
          source: |
            <?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);
        - lang: python
          label: Python 3
          source: |
            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}")
        - lang: ruby
          label: Ruby
          source: |
            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
  /v1/buyer_platform_accounts:
    get:
      security:
        - Secret-Bearer-Auth: []
        - Secret-Basic-Auth: []
      operationId: retrieveBuyerPlatformAccountList
      tags:
        - バイヤープラットフォーム報酬
      summary: バイヤープラットフォーム報酬 一覧取得
      description: |
        バイヤープラットフォーム報酬（プラットフォームキックバック）の一覧を取得するAPI。
      parameters:
        - in: query
          name: クエリ
          description: |
            検索条件クエリパラメータ
          required: false
          schema:
            allOf:
              - $ref: '#/components/schemas/Pagination.QueryParams'
      responses:
        '200':
          description: リクエストに成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BuyerPlatformAccount.ListRetrieving.Response'
        '400':
          description: 不正なリクエスト
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FincodeAPIError.Response'
      x-code-samples:
        - lang: curl
          label: cURL
          source: |
            curl \
                -X GET \
                -H "Authorization:Bearer <Secret API Key>" \
            'https://api.test.fincode.jp/v1/buyer_platform_accounts'
        - lang: node
          label: Node.js
          source: |
            import fetch from "node-fetch";

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

            (async () => {
                const endpoint = `${BASE_URL}/v1/buyer_platform_accounts`;

                const response = await fetch(endpoint, {
                    method: "GET",
                    headers: {
                        Authorization: `Bearer ${API_KEY}`,
                    },
                });
                const buyerPlatformAccounts = await response.json();
                console.log(buyerPlatformAccounts); // 取得したバイヤープラットフォーム報酬データを出力
            })();
        - lang: go
          label: Go
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n)\n\nfunc main() {\n\t// APIキーの指定\n\tapiKey := \"<Secret API Key>\"\n\n\t// リクエストの作成\n\treq, err := http.NewRequest(\n\t\t\"GET\",\n\t\t\"https://api.test.fincode.jp/v1/buyer_platform_accounts\",\n\t\tnil,\n\t)\n\tif err != nil {\n\t\tlog.Fatalf(\"リクエストの作成エラー: %v\", err)\n\t}\n\n\treq.Header.Set(\"Authorization\", \"Bearer \"+apiKey)\n\n\t// リクエストの送信\n\tresp, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tlog.Fatalf(\"リクエスト送信エラー: %v\", err)\n\t}\n\tdefer resp.Body.Close()\n\n\tfmt.Println(resp.Status)\n}\n"
        - lang: php
          label: PHP
          source: |
            <?php

            $apiKey = '<Secret API Key>';
            $baseUrl = "https://api.test.fincode.jp";
            $endpoint = "/v1/buyer_platform_accounts"; // GETリクエストのエンドポイント

            $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);
            // curl_setopt($session, CURLOPT_SSL_VERIFYPEER, true);
            // curl_setopt($session, CURLOPT_SSL_VERIFYHOST, 2);

            $response = curl_exec($session);

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

            curl_close($session);
            ?>
        - lang: python
          label: Python 3
          source: |
            import requests

            api_key = '<Secret API Key>'
            base_url = "https://api.test.fincode.jp"
            endpoint = "/v1/buyer_platform_accounts"  # GETリクエストのエンドポイント

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

            try:
                response = requests.get(f"{base_url}{endpoint}", headers=headers)

                # レスポンスの処理
                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}")
        - lang: ruby
          label: Ruby
          source: |
            require 'net/http'
            require 'uri'
            require 'json'

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

            def main
                endpoint = "/v1/buyer_platform_accounts"  # GETリクエストのエンドポイント

                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'
                    # レスポンスの表示
                    puts JSON.pretty_generate(JSON.parse(response.body))
                else
                    puts 'ERROR'
                    # エラーの表示
                    puts response.body
                end
            end

            main
  /v1/buyer_platform_accounts/{id}:
    get:
      security:
        - Secret-Bearer-Auth: []
        - Secret-Basic-Auth: []
      operationId: retrieveBuyerPlatformAccount
      tags:
        - バイヤープラットフォーム報酬
      summary: バイヤープラットフォーム報酬 取得
      description: |
        エンドポイントに指定したIDのバイヤープラットフォーム報酬情報を取得するAPI。
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: プラットフォーム報酬ID
      responses:
        '200':
          description: リクエストに成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BuyerPlatformAccount.Detail'
        '400':
          description: 不正なリクエスト
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FincodeAPIError.Response'
      x-code-samples:
        - lang: curl
          label: cURL
          source: |
            curl \
                -X GET \
                -H "Authorization:Bearer <Secret API Key>" \
            'https://api.test.fincode.jp/v1/buyer_platform_accounts/{id}'
        - lang: node
          label: Node.js
          source: |
            import fetch from "node-fetch";

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

            (async () => {
                const id = "<プラットフォーム報酬ID>";
                const endpoint = `${BASE_URL}/v1/buyer_platform_accounts/${id}`;

                const response = await fetch(endpoint, {
                    method: "GET",
                    headers: {
                        Authorization: `Bearer ${API_KEY}`,
                    },
                });
                const buyerPlatformAccount = await response.json();
                console.log(buyerPlatformAccount); // 取得したバイヤープラットフォーム報酬データを出力
            })();
        - lang: go
          label: Go
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n)\n\nfunc main() {\n\t// APIキーの指定\n\tapiKey := \"<Secret API Key>\"\n\n\t// プラットフォーム報酬IDの指定\n\tid := \"<プラットフォーム報酬ID>\"\n\n\t// リクエストの作成\n\treq, err := http.NewRequest(\n\t\t\"GET\",\n\t\t\"https://api.test.fincode.jp/v1/buyer_platform_accounts/\"+id,\n\t\tnil,\n\t)\n\tif err != nil {\n\t\tlog.Fatalf(\"リクエストの作成エラー: %v\", err)\n\t}\n\n\treq.Header.Set(\"Authorization\", \"Bearer \"+apiKey)\n\n\t// リクエストの送信\n\tresp, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tlog.Fatalf(\"リクエスト送信エラー: %v\", err)\n\t}\n\tdefer resp.Body.Close()\n\n\tfmt.Println(resp.Status)\n}\n"
        - lang: php
          label: PHP
          source: |
            <?php

            $apiKey = '<Secret API Key>';
            $id = '<プラットフォーム報酬ID>';
            $baseUrl = "https://api.test.fincode.jp";
            $endpoint = "/v1/buyer_platform_accounts/" . $id; // GETリクエストのエンドポイント

            $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);
            // curl_setopt($session, CURLOPT_SSL_VERIFYPEER, true);
            // curl_setopt($session, CURLOPT_SSL_VERIFYHOST, 2);

            $response = curl_exec($session);

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

            curl_close($session);
            ?>
        - lang: python
          label: Python 3
          source: |
            import requests

            api_key = '<Secret API Key>'
            id = '<プラットフォーム報酬ID>'

            url = f'https://api.test.fincode.jp/v1/buyer_platform_accounts/{id}'

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

            # HTTP GETリクエストの送信
            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}")
        - lang: ruby
          label: Ruby
          source: |
            require 'net/http'
            require 'uri'
            require 'json'

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

            def main
                id = "<プラットフォーム報酬ID>"
                endpoint = "/v1/buyer_platform_accounts/#{id}"  # GETリクエストのエンドポイント

                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'
                    # レスポンスの表示
                    puts JSON.pretty_generate(JSON.parse(response.body))
                else
                    puts 'ERROR'
                    # エラーの表示
                    puts response.body
                end
            end

            main
  /v1/webhook_settings:
    post:
      security:
        - Secret-Bearer-Auth: []
        - Secret-Basic-Auth: []
      operationId: createWebhookSetting
      tags:
        - Webhook設定
      summary: Webhook設定 登録
      parameters:
        - in: header
          name: Tenant-Buyer-Id
          required: true
          schema:
            allOf:
              - $ref: '#/components/schemas/schema'
          description: |
            <span class="smallText color--red-400">※ バイヤープラットフォームのみ指定可</span>\
            テナントバイヤーID。
      description: |
        Webhook設定を登録します。
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookSettingBuyerPlatform.Creating.Request'
      responses:
        '200':
          description: リクエストに成功
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/WebhookSettingBuyerPlatform'
        '400':
          description: 不正なリクエスト
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FincodeAPIError.Response'
      x-code-samples:
        - lang: curl
          label: cURL
          source: |
            curl \
                -X POST \
                -H "Authorization:Bearer <Secret API Key>" \
                -H "Content-Type: application/json" \
                -d '{
                "event": "payments.card.secure",
                "url": "https://your-service.example.com/webhook-receiver",
            }' \
            'https://api.test.fincode.jp/v1/webhook_settings'
        - lang: node
          label: Node.js
          source: |
            import { createFincode } from "@fincode/node";

            const API_KEY = "<Secret API Key>";

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

                try {
                    // リクエストの送信
                    const webhookSetting = await fincode.webhookSettings.create({
                        url: "https://your-service.example.com/webhook-receiver",
                        event: "payments.card.secure",
                        signature: "WEBHOOK_FROM_FINCODE",
                    });
                } catch (e) {
                    // エラーの処理
                }
            })();
        - lang: go
          label: Go
          source: "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n)\n\nfunc main() {\n\n\tapiKey := \"<Secret API Key>\"\n\n\tbody := CreatingWebhookSettingRequest{\n\t\tURL:       stringPointer(\"https://your-service.example.com/webhook-receiver\"),\n\t\tEvent:     stringPointer(\"payments.card.secure\"),\n\t\tSignature: stringPointer(\"WEBHOOK_FROM_FINCODE\"),\n\t}\n\n\tmarshalledBody, _ := json.Marshal(body)\n\n\t// リクエストの作成\n\treq, _ := http.NewRequest(\"POST\", \"https://api.test.fincode.jp/v1/webhook_settings\", bytes.NewBuffer(marshalledBody))\n\treq.Header.Set(\"Authorization\", fmt.Sprintf(\"Bearer %s\", apiKey))\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\t// リクエストの送信\n\tclient := &http.Client{}\n\tres, err := client.Do(req)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer res.Body.Close()\n\n}\n\ntype CreatingWebhookSettingRequest struct {\n\tID        *string `json:\"id\"`\n\tURL       *string `json:\"url\"`\n\tEvent     *string `json:\"event\"`\n\tSignature *string `json:\"signature\"`\n}\n\nfunc stringPointer(s string) *string {\n\treturn &s\n}\n"
        - lang: php
          label: PHP
          source: |
            <?php

            $apiKey = '<Secret API Key>';

            $baseUrl = "https://api.test.fincode.jp";
            $endpoint = "/v1/webhook_settings";
            $headers = [
                "Authorization: Bearer " . $apiKey,
                "Content-Type: application/json"
            ];

            $data = json_encode([
                "url" => "https://your-service.example.com/webhook-receiver",
                "event" => "payments.card.secure",
                "signature" => "WEBHOOK_FROM_FINCODE"
            ]);

            $session = curl_init();
            curl_setopt($session, CURLOPT_URL, $baseUrl . $endpoint);
            curl_setopt($session, CURLOPT_HTTPHEADER, $headers);
            curl_setopt($session, CURLOPT_POST, true);
            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);
        - lang: python
          label: Python 3
          source: |
            import requests

            api_key = '<Secret API Key>'

            url = f'https://api.test.fincode.jp/v1/webhook_settings'

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

            data = {
                "event": "payments.card.secure",
                "url": "https://your-service.example.com/webhook-receiver",
                "signature": "WEBHOOK_FROM_FINCODE"
            }

            # HTTP POSTリクエストの送信
            try:
                response = requests.post(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}")
        - lang: ruby
          label: Ruby
          source: |
            require 'net/http'
            require 'uri'
            require 'json'


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

            def main
                endpoint = "/v1/webhook_settings"
                uri = URI.parse(BASE_URL + endpoint)

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

                data = {
                    event: "payments.card.secure",
                    url: "https://your-service.example.com/webhook-receiver",
                    signature: "WEBHOOK_FROM_FINCODE"
                }

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

                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
    get:
      security:
        - Secret-Bearer-Auth: []
        - Secret-Basic-Auth: []
      operationId: retrieveWebhookSettingList
      tags:
        - Webhook設定
      summary: Webhook設定 一覧取得
      description: |
        Webhook設定を一覧で取得します。
      parameters:
        - in: header
        - in: header
          name: Tenant-Buyer-Id
          required: true
          schema:
            allOf:
              - $ref: '#/components/schemas/schema'
          description: |
            <span class="smallText color--red-400">※ バイヤープラットフォームのみ指定可</span>\
            テナントバイヤーID。\
            このテナントバイヤーに紐づくWebhook設定から一覧で取得します。
      responses:
        '200':
          description: リクエストに成功
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/WebhookSettingBuyerPlatform.list'
        '400':
          description: 不正なリクエスト
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FincodeAPIError.Response'
      x-code-samples:
        - lang: curl
          label: cURL
          source: |
            curl \
                -X GET \
                -H "Authorization:Bearer <Secret API Key>" \
            'https://api.test.fincode.jp/v1/webhook_settings'
        - lang: node
          label: Node.js
          source: |
            import { createFincode } from "@fincode/node";

            const API_KEY = "<Secret API Key>";

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

                try {
                    // リクエストの送信
                    const webhookSettings = await fincode.webhookSettings.retrieveList();
                } catch (e) {
                    // エラーの処理
                }
            })();
        - lang: go
          label: Go
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n)\n\nfunc main() {\n\n\tapiKey := \"<Secret API Key>\"\n\n\t// リクエストの作成\n\treq, _ := http.NewRequest(\"GET\", \"https://api.test.fincode.jp/v1/webhook_settings\", nil)\n\treq.Header.Set(\"Authorization\", fmt.Sprintf(\"Bearer %s\", apiKey))\n\n\tparams := req.URL.Query()\n\tparams.Add(\"limit\", \"10\")\n\treq.URL.RawQuery = params.Encode()\n\n\t// リクエストの送信\n\tclient := &http.Client{}\n\tres, err := client.Do(req)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer res.Body.Close()\n\n}\n"
        - lang: php
          label: PHP
          source: |
            <?php

            $apiKey = '<Secret API Key>';

            $baseUrl = "https://api.test.fincode.jp";
            $endpoint = "/v1/webhook_settings";

            $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);
            // 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);
        - lang: python
          label: Python 3
          source: |
            import requests

            api_key = '<Secret API Key>'

            url = f'https://api.test.fincode.jp/v1/webhook_settings'

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

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

                # レスポンスの処理
                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}")
        - lang: ruby
          label: Ruby
          source: |
            require 'net/http'
            require 'uri'

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

            def main
                endpoint = "/v1/webhook_settings"

                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
  /v1/webhook_settings/{id}:
    get:
      security:
        - Secret-Bearer-Auth: []
        - Secret-Basic-Auth: []
      operationId: retrieveWebhookSetting
      tags:
        - Webhook設定
      summary: Webhook設定 取得
      description: |
        IDで指定したWebhook設定を取得します。
      parameters:
        - name: id
          in: path
          description: Webhook設定のID
          schema:
            allOf:
              - $ref: '#/components/schemas/WebhookSettingId_schema'
          required: true
        - name: Tenant-Shop-Id
        - in: header
          name: Tenant-Buyer-Id
          required: true
          schema:
            allOf:
              - $ref: '#/components/schemas/schema'
          description: |
            <span class="smallText color--red-400">※ バイヤープラットフォームのみ指定可</span>\
            テナントバイヤーID。
      responses:
        '200':
          description: リクエストに成功
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/WebhookSettingBuyerPlatform'
        '400':
          description: 不正なリクエスト
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FincodeAPIError.Response'
      x-code-samples:
        - lang: curl
          label: cURL
          source: |
            curl \
                -X GET \
                -H "Authorization:Bearer <Secret API Key>" \
            'https://api.test.fincode.jp/v1/webhook_settings/{id}'
        - lang: node
          label: Node.js
          source: |
            import { createFincode } from "@fincode/node";

            const API_KEY = "<Secret API Key>";

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

                const webhookSettingId = "<Webhook Setting ID>";

                try {
                    // リクエストの送信
                    const webhookSetting = await fincode.webhookSettings.retrieve(
                        webhookSettingId
                    );
                } catch (e) {
                    // エラーの処理
                }
            })();
        - lang: go
          label: Go
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n)\n\nfunc main() {\n\n\tapiKey := \"<Secret API Key>\"\n\n\twebhookSettingID := \"<Webhook Setting ID>\"\n\n\t// リクエストの作成\n\treq, _ := http.NewRequest(\n\t\t\"GET\",\n\t\tfmt.Sprintf(\"https://api.test.fincode.jp/v1/webhook_settings/%s\", webhookSettingID),\n\t\tnil,\n\t)\n\treq.Header.Set(\"Authorization\", fmt.Sprintf(\"Bearer %s\", apiKey))\n\n\t// リクエストの送信\n\tclient := &http.Client{}\n\tres, err := client.Do(req)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer res.Body.Close()\n\n}\n"
        - lang: php
          label: PHP
          source: |
            <?php

            $apiKey = '<Secret API Key>';

            $webhookSettingId = '<Webhook Setting ID>';

            $baseUrl = "https://api.test.fincode.jp";
            $endpoint = "/v1/webhook_settings/{$webhookSettingId}";
            $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);
            // 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);
        - lang: python
          label: Python 3
          source: |
            import requests

            api_key = '<Secret API Key>'

            webhook_setting_id = '<Webhook Setting ID>'

            url = f'https://api.test.fincode.jp/v1/webhook_settings/{webhook_setting_id}'

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

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

                # レスポンスの処理
                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}")
        - lang: ruby
          label: Ruby
          source: |
            require 'net/http'
            require 'uri'

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

            def main
                webhook_setting_id = '<Webhook Setting ID>'
                endpoint = "/v1/webhook_settings/#{webhook_setting_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
    put:
      security:
        - Secret-Bearer-Auth: []
        - Secret-Basic-Auth: []
      operationId: updateWebhookSetting
      tags:
        - Webhook設定
      summary: Webhook設定 更新
      description: |
        IDで指定したWebhook設定を更新します。
      parameters:
        - name: id
          in: path
          description: Webhook設定のID
          schema:
            allOf:
              - $ref: '#/components/schemas/WebhookSettingId_schema'
          required: true
        - in: header
        - in: header
          name: Tenant-Buyer-Id
          required: true
          schema:
            allOf:
              - $ref: '#/components/schemas/schema'
          description: |
            <span class="smallText color--red-400">※ バイヤープラットフォームのみ指定可</span>\
            テナントバイヤーID。\
            このテナントバイヤーに紐づくWebhook設定のうち、指定したIDのWebhook設定を更新します。
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookSettingBuyerPlatform.Updating.Request'
      responses:
        '200':
          description: リクエストに成功
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/WebhookSettingBuyerPlatform'
        '400':
          description: 不正なリクエスト
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FincodeAPIError.Response'
      x-code-samples:
        - lang: curl
          label: cURL
          source: |
            curl \
                -X PUT \
                -H "Authorization:Bearer <Secret API Key>" \
                -H "Content-Type: application/json" \
                -d '{
                "signature": "WEBHOOK_FROM_FINCODE"
            }' \
            'https://api.test.fincode.jp/v1/webhook_settings/{id}'
        - lang: node
          label: Node.js
          source: |
            import { createFincode } from "@fincode/node";

            const API_KEY = "<Secret API Key>";

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

                const webhookSettingId = "<Webhook Setting ID>";

                try {
                    // リクエストの送信
                    const webhookSetting = await fincode.webhookSettings.update(
                        webhookSettingId,
                        {
                            url: "https://your-service.example.com/v2/webhook-receiver",
                        }
                    );
                } catch (e) {
                    // エラーの処理
                }
            })();
        - lang: go
          label: Go
          source: "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n)\n\nfunc main() {\n\n\tapiKey := \"<Secret API Key>\"\n\n\twebhookSettingID := \"<Webhook Setting ID>\"\n\n\tbody := UpdatingWebhookSettingRequest{\n\t\tURL: stringPointer(\"https://your-service.example.com/v2/webhook-receiver\"),\n\t}\n\n\tmarshalledBody, _ := json.Marshal(body)\n\n\t// リクエストの作成\n\treq, _ := http.NewRequest(\n\t\t\"PUT\",\n\t\tfmt.Sprintf(\"https://api.test.fincode.jp/v1/webhook_settings/%s\", webhookSettingID),\n\t\tbytes.NewBuffer(marshalledBody),\n\t)\n\n\treq.Header.Set(\"Authorization\", fmt.Sprintf(\"Bearer %s\", apiKey))\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\t// リクエストの送信\n\tclient := &http.Client{}\n\tres, err := client.Do(req)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer res.Body.Close()\n\n}\n\ntype UpdatingWebhookSettingRequest struct {\n\tURL       *string `json:\"url\"`\n\tEvent     *string `json:\"event\"`\n\tSignature *string `json:\"signature\"`\n}\n\nfunc stringPointer(s string) *string {\n\treturn &s\n}\n"
        - lang: php
          label: PHP
          source: |
            <?php

            $apiKey = '<Secret API Key>';

            $webhookSettingId = '<Webhook Setting ID>';

            $baseUrl = "https://api.test.fincode.jp";
            $endpoint = "/v1/webhook_settings/{$webhookSettingId}";
            $headers = [
                "Authorization: Bearer " . $apiKey,
            ];

            $data = json_encode([
                "url" => "https://your-service.example.com/v2/webhook-receiver",
            ]);

            $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);
        - lang: python
          label: Python 3
          source: |
            import requests

            api_key = '<Secret API Key>'

            webhook_setting_id = '<Webhook Setting ID>'

            url = f'https://api.test.fincode.jp/v1/webhook_settings/{webhook_setting_id}'

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

            data = {
                "signature": "WEBHOOK_FROM_FINCODE"
            }

            # 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}")
        - lang: ruby
          label: Ruby
          source: |
            require 'net/http'
            require 'uri'
            require 'json'


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

            def main
                webhook_setting_id = '<Webhook Setting ID>'
                endpoint = "/v1/webhook_settings/#{webhook_setting_id}"
                
                uri = URI.parse(BASE_URL + endpoint)

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

                data = {
                    signature: "WEBHOOK_FROM_FINCODE"
                }

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

                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
    delete:
      security:
        - Secret-Bearer-Auth: []
        - Secret-Basic-Auth: []
      operationId: deleteWebhookSetting
      tags:
        - Webhook設定
      summary: Webhook設定 削除
      description: |
        IDで指定したWebhook設定を削除します。
      parameters:
        - name: id
          in: path
          description: Webhook設定のID
          schema:
            allOf:
              - $ref: '#/components/schemas/WebhookSettingId_schema'
          required: true
        - name: Tenant-Shop-Id
        - in: header
          name: Tenant-Buyer-Id
          required: true
          schema:
            allOf:
              - $ref: '#/components/schemas/schema'
          description: |
            <span class="smallText color--red-400">※ バイヤープラットフォームのみ指定可</span>\
            テナントバイヤーID。\
            このテナントバイヤーに紐づくWebhook設定のうち、指定したIDのWebhook設定を削除します。
      responses:
        '200':
          description: リクエストに成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookSetting.Deleting.Response'
        '400':
          description: 不正なリクエスト
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FincodeAPIError.Response'
      x-code-samples:
        - lang: curl
          label: cURL
          source: |
            curl \
                -X DELETE \
                -H "Authorization:Bearer <Secret API Key>" \
            'https://api.test.fincode.jp/v1/webhook_settings/{id}'
        - lang: node
          label: Node.js
          source: |
            import { createFincode } from "@fincode/node";

            const API_KEY = "<Secret API Key>";

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

                const webhookSettingId = "<Webhook Setting ID>";

                try {
                    // リクエストの送信
                    const result = await fincode.webhookSettings.delete(webhookSettingId);
                } catch (e) {
                    // エラーの処理
                }
            })();
        - lang: go
          label: Go
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n)\n\nfunc main() {\n\n\tapiKey := \"<Secret API Key>\"\n\n\twebhookSettingID := \"<Webhook Setting ID>\"\n\n\t// リクエストの作成\n\treq, _ := http.NewRequest(\n\t\t\"DELETE\",\n\t\tfmt.Sprintf(\"https://api.test.fincode.jp/v1/webhook_settings/%s\", webhookSettingID),\n\t\tnil,\n\t)\n\treq.Header.Set(\"Authorization\", fmt.Sprintf(\"Bearer %s\", apiKey))\n\n\t// リクエストの送信\n\tclient := &http.Client{}\n\tres, err := client.Do(req)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer res.Body.Close()\n}\n"
        - lang: php
          label: PHP
          source: |
            <?php

            $apiKey = '<Secret API Key>';

            $webhookSettingId = '<Webhook Setting ID>';

            $baseUrl = "https://api.test.fincode.jp";
            $endpoint = "/v1/webhook_settings/{$webhookSettingId}";
            $headers = [
                "Authorization: Bearer " . $apiKey,
            ];

            $session = curl_init();
            curl_setopt($session, CURLOPT_URL, $baseUrl . $endpoint);
            curl_setopt($session, CURLOPT_HTTPHEADER, $headers);
            curl_setopt($session, CURLOPT_CUSTOMREQUEST, 'DELETE');
            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);
        - lang: python
          label: Python 3
          source: |
            import requests

            api_key = '<Secret API Key>'

            webhook_setting_id = '<Webhook Setting ID>'

            url = f'https://api.test.fincode.jp/v1/webhook_settings/{webhook_setting_id}'

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

            try:
                response = requests.delete(url, headers=headers)

                # レスポンスの処理
                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}")
        - lang: ruby
          label: Ruby
          source: |
            require 'net/http'
            require 'uri'

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

            def main
                webhook_setting_id = '<Webhook Setting ID>'
                endpoint = "/v1/webhook_settings/#{webhook_setting_id}"

                uri = URI.parse(BASE_URL + endpoint)

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

                # リクエストの作成
                request = Net::HTTP::Delete.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
  /your-endpoint-on-business-payments-regist:
    post:
      security:
        - Secret-Bearer-Auth: []
        - Secret-Basic-Auth: []
      operationId: receiveWebhookOfBusinessPaymentsRegister
      tags:
        - Webhook_通知仕様
      summary: 請求書カード払い登録
      description: |
        請求書カード払い登録イベント（`business_payments.regist`）で通知されるリクエストのボディの仕様です。
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookEvent.BusinessPaymentsRegister'
      responses:
        '200':
          description: |
            fincodeに正常にWebhookを受信した旨をレスポンスしてください。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookResponse'
            text/plain:
              schema:
                allOf:
                  - $ref: '#/components/schemas/WebhookResponse-plain'
              examples:
                html:
                  value: 0
        '400':
          description: |
            4xx系、5xx系または上記以外のレスポンスを返却した場合、fincodeはエラーと判断しWebhook通知のリトライを行います。
  /your-endpoint-on-business-payments-exec:
    post:
      security:
        - Secret-Bearer-Auth: []
        - Secret-Basic-Auth: []
      operationId: receiveWebhookOfBusinessPaymentsExec
      tags:
        - Webhook_通知仕様
      summary: 請求書カード払い実行
      description: |
        請求書カード払い実行イベント（`business_payments.exec`）（請求書カード払いオーソリ依頼API完了時）で通知されるリクエストのボディの仕様です。
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookEvent.BusinessPaymentsExec'
      responses:
        '200':
          description: |
            fincodeに正常にWebhookを受信した旨をレスポンスしてください。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookResponse'
            text/plain:
              schema:
                allOf:
                  - $ref: '#/components/schemas/WebhookResponse-plain'
              examples:
                html:
                  value: 0
        '400':
          description: |
            4xx系、5xx系または上記以外のレスポンスを返却した場合、fincodeはエラーと判断しWebhook通知のリトライを行います。
  /your-endpoint-on-business-payments-update:
    post:
      security:
        - Secret-Bearer-Auth: []
        - Secret-Basic-Auth: []
      operationId: receiveWebhookOfBusinessPaymentsUpdate
      tags:
        - Webhook_通知仕様
      summary: 請求書カード払い更新
      description: |
        請求書カード払い更新イベント（結果通知受信API取引ステータス更新時、「支払い中」以外）（`business_payments.update`）で通知されるリクエストのボディの仕様です。
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookEvent.BusinessPaymentsUpdate'
      responses:
        '200':
          description: |
            fincodeに正常にWebhookを受信した旨をレスポンスしてください。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookResponse'
            text/plain:
              schema:
                allOf:
                  - $ref: '#/components/schemas/WebhookResponse-plain'
              examples:
                html:
                  value: 0
        '400':
          description: |
            4xx系、5xx系または上記以外のレスポンスを返却した場合、fincodeはエラーと判断しWebhook通知のリトライを行います。
  /your-endpoint-on-buyer-contract:
    post:
      security:
        - Secret-Bearer-Auth: []
        - Secret-Basic-Auth: []
      operationId: receiveWebhookOfBuyerContract
      tags:
        - Webhook_通知仕様
      summary: テナントバイヤー審査状況 更新
      description: |
        テナントバイヤー審査状況 更新イベント（`buyer.contracts.status_code.updated`）で通知されるリクエストのボディの仕様です。
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookEvent.BuyerContract'
      responses:
        '200':
          description: |
            fincodeに正常にWebhookを受信した旨をレスポンスしてください。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookResponse'
            text/plain:
              schema:
                allOf:
                  - $ref: '#/components/schemas/WebhookResponse-plain'
              examples:
                html:
                  value: 0
        '400':
          description: |
            4xx系、5xx系または上記以外のレスポンスを返却した場合、fincodeはエラーと判断しWebhook通知のリトライを行います。
components:
  securitySchemes:
    Secret-Bearer-Auth:
      type: http
      scheme: bearer
      description: |
        このAPIはシークレットキーによる認証を必要とします。\
        Bearer認証を用いる場合、リクエストヘッダー `Authorization`に下記の形式でシークレットキーを指定します。
        ```
          Authorization: Bearer␣{APIキー}
        ```
        シークレットキーはfincodeの管理画面から取得できます。
    Secret-Basic-Auth:
      type: http
      scheme: basic
      description: |
        このAPIはシークレットキーによる認証を必要とします。\
        Basic認証を用いる場合、リクエストヘッダー `Authorization`に下記の形式でシークレットキーを指定します。
        ``` JavaScript
          Authorization: Basic␣{Base64でエンコードしたAPIキー}
        ```
        シークレットキーはfincodeの管理画面から取得できます。
    Public-Bearer-Auth:
      type: http
      scheme: bearer
      description: |
        このAPIはパブリックキーによる認証で利用できます。\
        Bearer認証を用いる場合、リクエストヘッダー `Authorization`に下記の形式でパブリックキーを指定します。
        ```
          Authorization: Bearer␣{APIキー}
        ```
        パブリックキーはfincodeの管理画面から取得できます。
    Public-Basic-Auth:
      type: http
      scheme: basic
      description: |
        このAPIはパブリックキーによる認証を必要とします。\
        Basic認証を用いる場合、リクエストヘッダー `Authorization`に下記の形式でパブリックキーを指定します。
        ``` JavaScript
          Authorization: Basic␣{Base64でエンコードしたAPIキー}
        ```
        パブリックキーはfincodeの管理画面から取得できます。
    Both-Bearer-Auth:
      type: http
      scheme: bearer
      description: |
        このAPIはシークレットキーまたはパブリックキーによる認証を必要とします。\
        Bearer認証を用いる場合、リクエストヘッダー `Authorization`に下記の形式でシークレットキーまたはパブリックキーを指定します。
        ```
          Authorization: Bearer␣{APIキー}
        ```
        シークレットキーまたはパブリックキーはfincodeの管理画面から取得できます。
    Both-Basic-Auth:
      type: http
      scheme: basic
      description: |
        このAPIはシークレットキーまたはパブリックキーによる認証を必要とします。\
        Basic認証を用いる場合、リクエストヘッダー `Authorization`に下記の形式でシークレットキーまたはパブリックキーを指定します。
        ``` JavaScript
          Authorization: Basic␣{Base64でエンコードしたAPIキー}
        ```
        シークレットキーまたはパブリックキーはfincodeの管理画面から取得できます。
  schemas:
    schema:
      type: string
      example: b_***********
    Pagination.QueryParams:
      type: object
      properties:
        page:
          type: integer
          minLength: 1
          nullable: true
          description: ページ番号
        limit:
          type: integer
          nullable: true
          minLength: 10
          maxLength: 100
          description: 1回で取得するデータの最大件数
        count_only:
          type: boolean
          nullable: true
          description: |
            総件数のみ取得するか。\
            `true`を指定した場合、検索結果の総件数（`total_count`）のみ取得します。
      x-common-properties:
        sort:
          type: string
          example: updated␣desc,created␣asc
    BusinessPayment.ListRetrieving.QueryParams:
      type: object
      properties:
        access_id:
          type: string
          nullable: true
          description: |
            取引ID  
              
            指定した場合、取引IDに完全一致する請求書カード払いデータのみを取得します。
        company_name:
          type: string
          nullable: true
          minLength: 1
          maxLength: 255
          description: |
            取引先名  
              
            指定した場合、取引先名に部分一致する請求書カード払いデータのみを取得します。
        payment_amount_min:
          type: number
          nullable: true
          description: |
            支払金額範囲（下限）  
              
            指定した場合、支払金額が指定金額以上の請求書カード払いデータのみを取得します。
        payment_amount_max:
          type: number
          nullable: true
          description: |
            支払金額範囲（上限）  
              
            指定した場合、支払金額が指定金額以下の請求書カード払いデータのみを取得します。
        status:
          type: string
          nullable: true
          description: |
            ステータス  
              
            カンマ(,)区切りで複数指定も可能です。  
              
            - `DRAFT`: 下書き
            - `REVIEWING`: 審査中
            - `REVIEW_NG`: 審査NG
            - `PAYING`: 支払い中
            - `FAILED`: 失敗
            - `PAID`: 支払い完了
            - `EXPIRED`: 期限切れ
            - `CANCELED`: キャンセル済
        due_date_from:
          type: string
          nullable: true
          description: |
            支払期日範囲（開始）  
            形式： `yyyy/MM/dd`  
              
            指定した場合、支払期日が指定日以降である請求書カード払いデータのみを取得します。
        due_date_to:
          type: string
          nullable: true
          description: |
            支払期日範囲（終了）  
            形式： `yyyy/MM/dd`  
              
            指定した場合、支払期日が指定日以前の請求書カード払いデータのみを取得します。
        transfer_exec_date_from:
          type: string
          nullable: true
          description: |
            振込実行日範囲（開始）  
            形式： `yyyy/MM/dd`  
              
            指定した場合、振込実行日が指定日以降である請求書カード払いデータのみを取得します。
        transfer_exec_date_to:
          type: string
          nullable: true
          description: |
            振込実行日範囲（終了）  
            形式： `yyyy/MM/dd`  
              
            指定した場合、振込実行日が指定日以前の請求書カード払いデータのみを取得します。
        update_date_from:
          type: string
          nullable: true
          description: |
            更新日時範囲（開始）  
            形式： `yyyy/MM/dd`  
              
            指定した場合、更新日時が指定日以降である請求書カード払いデータのみを取得します。
        update_date_to:
          type: string
          nullable: true
          description: |
            更新日時範囲（終了）  
            形式： `yyyy/MM/dd`  
              
            指定した場合、更新日時が指定日以前の請求書カード払いデータのみを取得します。
    _ListResponse:
      type: object
      properties:
        total_count:
          type: integer
          example: 100
          description: 総件数
        last_page:
          type: integer
          example: 20
          description: 最後のページのページ数
        current_page:
          type: integer
          example: 3
          description: 現在のページのページ数
        limit:
          type: integer
          example: 5
          description: 1ページの最大件数
        link_next:
          type: string
          example: /v1/{resource}?limit=5&page=4
          nullable: true
          description: 次のページのコンテンツを取得するためのURL
        link_previous:
          type: string
          example: /v1/{resource}?limit=5&page=2
          nullable: true
          description: 前のページのコンテンツを取得するためのURL
    BusinessPayment.ListItem:
      type: object
      description: 請求書カード払い 一覧項目
      properties:
        access_id:
          type: string
          description: 取引ID
          example: bp_abcdefghijklmnopqrstuv
        company_name:
          type: string
          description: 取引先名
          example: 株式会社アイネット
        payment_amount:
          type: number
          description: 支払金額
          example: 10000
        status:
          type: string
          description: ステータス
          example: DRAFT
        card_no_display:
          type: string
          description: 表示用カード番号
          example: '************8217'
        card_brand:
          type: string
          description: カードブランド
          example: jcb
        due_date:
          type: string
          description: 支払期日（yyyy/MM/dd）
          example: 2025/05/11
        transfer_exec_date:
          type: string
          nullable: true
          description: 振込実行日（yyyy/MM/dd）
          example: null
        update_date:
          type: string
          description: 更新日時（yyyy/MM/dd HH:mm）
          example: 2025/05/23 09:43
    BusinessPayment.list:
      type: object
      properties:
        list:
          type: array
          description: |
            データリスト
            検索結果が0件の場合、空のリストを返却します。
          items:
            $ref: '#/components/schemas/BusinessPayment.ListItem'
    BusinessPayment.ListRetrieving.Response:
      allOf:
        - $ref: '#/components/schemas/_ListResponse'
        - $ref: '#/components/schemas/BusinessPayment.list'
    FincodeAPIError:
      type: object
      description: |
        1つのエラーを表現するオブジェクト。
      properties:
        error_code:
          type: string
          minLength: 11
          maxLength: 11
          example: E**********
          description: |
            エラー内容を判定する場合はこの`error_code`の使用が推奨されます。\
            [各エラーコードの定義はこちらを参照](https://docs.fincode.jp/develop_support/error)して確認できます。
        error_message:
          type: string
          description: |
            エラーの内容を表現するメッセージです。\
            このエラーメッセージは予告なく変更されるため、エラー内容を判定する場合はこの値ではなく`error_code`の使用が推奨されます。
    FincodeAPIError.Response:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/FincodeAPIError'
    BusinessPayment.Creating.Request:
      type: object
      description: 請求書カード払い登録リクエスト
      properties:
        receipt_id:
          example: rc_-RcdyjisQl-Uk5D7Q12f0A
          type: string
          minLength: 1
          maxLength: 30
          description: |
            支払ID。\
            支払管理の支払情報を請求書カード払いする場合に指定します。
    BusinessPayment.Creating.Response:
      type: object
      description: 請求書カード払い登録レスポンス
      properties:
        access_id:
          example: bp_VbZbE8t6RMGIsIfOP3U7ww
          type: string
          minLength: 25
          maxLength: 25
          description: 取引ID
    BusinessPayment.Payee.Detail:
      type: object
      description: |
        支払先情報
      properties:
        company_name:
          type: string
          minLength: 1
          maxLength: 100
          description: 会社名
          example: 株式会社アイネット
        representative_name:
          type: string
          minLength: 1
          maxLength: 100
          description: 代表者名
          example: 株式会社アイネット
        invoice_registration_number:
          type: string
          minLength: 14
          maxLength: 14
          description: 適格請求書発行事業者登録番号
          example: T7020001030145
        addr_post_code:
          type: string
          minLength: 1
          maxLength: 16
          description: 郵便番号
          example: 220-0012
        addr_state:
          type: string
          minLength: 1
          maxLength: 15
          description: 都道府県
          example: 横浜市
        addr_city:
          type: string
          minLength: 1
          maxLength: 50
          description: 市区町村
          example: 西区
        addr_line_1:
          type: string
          minLength: 1
          maxLength: 50
          description: 町名・番地
          example: みなとみらい５－１－２
        addr_line_2:
          type: string
          minLength: 1
          maxLength: 50
          description: 建物名等
          example: 横浜シンフォステージ ウエストタワー１３階
        email:
          type: string
          minLength: 1
          maxLength: 254
          description: メールアドレス
          example: test@test.com
        phone_no:
          type: string
          minLength: 1
          maxLength: 16
          description: 電話番号
          example: 456820845
    BankAccountKind:
      type: integer
      enum:
        - 0
        - 1
      example: 1
      description: |
        口座種別

        - `0`: 普通
        - `1`: 当座
    BusinessPayment.PayeeBank.Detail:
      type: object
      description: |
        振込先金融機関情報
      properties:
        bank_code:
          type: string
          minLength: 1
          maxLength: 4
          description: 金融機関コード
          example: '0011'
        bank_name:
          type: string
          minLength: 1
          maxLength: 100
          description: 金融機関名
          example: 三井住友
        branch_code:
          type: string
          minLength: 1
          maxLength: 3
          description: 支店コード
          example: '012'
        branch_name:
          type: string
          minLength: 1
          maxLength: 50
          description: 支店名
          example: 横浜
        account_kind:
          allOf:
            - $ref: '#/components/schemas/BankAccountKind'
        account_number:
          type: string
          minLength: 1
          maxLength: 32
          description: 口座番号
          example: '4108217'
        account_name:
          type: string
          minLength: 1
          maxLength: 100
          description: 口座名義
          example: カテスト　タロウ
    BusinessPayment.Detail:
      type: object
      description: 請求書カード払い情報取得レスポンス
      properties:
        access_id:
          type: string
          minLength: 1
          maxLength: 25
          description: 取引ID
          example: bp_abcdefghijklmnopqrstuv
        buyer_shop_id:
          type: string
          minLength: 1
          maxLength: 13
          description: バイヤーID
          example: s_12345678901
        billing_amount:
          type: number
          minLength: 1
          maxLength: 10
          description: 請求金額
          example: 10000
        card_payment_fee:
          type: number
          minLength: 1
          maxLength: 10
          description: カード払い手数料
          example: 300
        fee_rate:
          type: number
          minLength: 1
          maxLength: 10
          description: 手数料率（3%の場合は0.03）
          example: 0.03
        min_fee:
          type: number
          minLength: 1
          maxLength: 10
          description: 最低手数料金額
          example: 100
        total_amount:
          type: number
          minLength: 1
          maxLength: 10
          description: 合計金額
          example: 10300
        status:
          type: string
          minLength: 1
          maxLength: 30
          description: ステータス
          example: DRAFT
        process_date:
          type: string
          minLength: 1
          maxLength: 23
          description: 処理日時（yyyy/MM/dd HH:mm:ss.SSS）
          example: 2025/05/23 09:43:20
        card_brand:
          type: string
          minLength: 1
          maxLength: 10
          description: カードブランド
          example: jcb
        card_no_display:
          type: string
          minLength: 1
          maxLength: 16
          description: 表示用カード番号
          example: '************8217'
        due_date:
          type: string
          minLength: 1
          maxLength: 10
          description: 支払期日（yyyy/MM/dd）
          example: 2025/05/11
        transfer_exec_date:
          type: string
          nullable: true
          minLength: 1
          maxLength: 10
          description: 振込実行日（yyyy/MM/dd）
          example: null
        invoice_file_name_display:
          type: string
          minLength: 1
          maxLength: 100
          description: 表示用請求書ファイル名
          example: 請求書.pdf
        remitter_name:
          type: string
          minLength: 1
          maxLength: 50
          description: 振込依頼人名
          example: カタカナ　テストタロウ　ＸＹＺ
        invoice_file:
          type: string
          description: 請求書ファイル（Base64でエンコード化）
          example: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
        customer_buyer_shop_id:
          type: string
          minLength: 1
          maxLength: 13
          description: 顧客バイヤーID
          example: b_25060517098
        receipt_id:
          type: string
          minLength: 1
          maxLength: 30
          description: 支払ID
          example: rc_-RcdyjisQl-Uk5D7Q12f0A
        bill_pay_types:
          type: array
          description: 請求管理_決済種別
          example:
            - '0'
            - '7'
          items:
            type: string
        examin_result_reason:
          type: string
          minLength: 1
          maxLength: 300
          description: 審査結果理由
        auth_ret_url:
          type: string
          minLength: 1
          maxLength: 512
          description: オーソリコールバックURL（指定がない場合は `null`）
          example: https://example.com/business_payments/auth/
        payee:
          allOf:
            - $ref: '#/components/schemas/BusinessPayment.Payee.Detail'
        payee_bank:
          allOf:
            - $ref: '#/components/schemas/BusinessPayment.PayeeBank.Detail'
        mulpay_api_key:
          type: string
          minLength: 1
          maxLength: 128
          description: マルペイキー
          example: xxxxxxxx=
        mulpay_public_key_path:
          type: string
          minLength: 1
          maxLength: 50
          description: マルペイ公開鍵のパス
          example: /file/public.key
    CorporateType:
      type: string
      enum:
        - '0'
        - '1'
        - '2'
      example: '0'
      description: |
        事業形態

        - `0`: 法人
        - `1`: 個人事業主
        - `2`: その他
    BusinessPayment.Payee.Submitting:
      type: object
      description: |
        支払先情報
      required:
        - company_name
        - corporate
        - representative_name
        - invoice_registration_number
        - addr_post_code
        - addr_state
        - addr_city
        - addr_line_1
        - phone_no
      properties:
        company_name:
          type: string
          minLength: 1
          maxLength: 100
          description: 会社名
          example: 株式会社アイネット
        corporate:
          allOf:
            - $ref: '#/components/schemas/CorporateType'
        representative_name:
          type: string
          minLength: 1
          maxLength: 50
          description: 代表者名
          example: 株式会社アイネット
        invoice_registration_number:
          type: string
          minLength: 14
          maxLength: 14
          description: 適格請求書発行事業者登録番号
          example: T7020001030145
        addr_post_code:
          type: string
          minLength: 1
          maxLength: 8
          description: |
            郵便番号

            ハイフンなしで7桁まで
          example: 220-0012
        addr_state:
          type: string
          minLength: 1
          maxLength: 15
          description: 都道府県
          example: 横浜市
        addr_city:
          type: string
          minLength: 1
          maxLength: 50
          description: 市区町村
          example: 西区
        addr_line_1:
          type: string
          minLength: 1
          maxLength: 50
          description: 町名・番地
          example: みなとみらい５－１－２
        addr_line_2:
          type: string
          minLength: 1
          maxLength: 50
          description: 建物名等
          example: 横浜シンフォステージ ウエストタワー１３階
        email:
          type: string
          minLength: 1
          maxLength: 100
          description: メールアドレス
          example: test@test.com
        phone_no:
          type: string
          minLength: 1
          maxLength: 25
          description: |
            電話番号

            ハイフンなしで20桁まで
          example: 456820845
    BusinessPayment.PayeeBank.Submitting:
      type: object
      description: 振込先金融機関情報
      required:
        - bank_code
        - bank_name
        - branch_code
        - branch_name
        - account_kind
        - account_number
        - account_name
      properties:
        bank_code:
          type: string
          minLength: 4
          maxLength: 4
          description: 金融機関コード
          example: '0011'
        bank_name:
          type: string
          minLength: 1
          maxLength: 100
          description: 金融機関名
          example: 三井住友
        branch_code:
          type: string
          minLength: 3
          maxLength: 3
          description: 支店コード
          example: '012'
        branch_name:
          type: string
          minLength: 1
          maxLength: 50
          description: 支店名
          example: 横浜
        account_kind:
          allOf:
            - $ref: '#/components/schemas/BankAccountKind'
        account_number:
          type: string
          minLength: 1
          maxLength: 7
          description: 口座番号
          example: '4108217'
        account_name:
          type: string
          minLength: 1
          maxLength: 50
          description: |
            口座名義

            利用可能文字制限有り
            全角カタカナ、全角大文字アルファベット、全角数字、スペース、（）．，ー－／
          example: カテスト　タロウ
    BusinessPayment.Submitting.Request:
      type: object
      description: 請求書カード払い提出リクエスト
      required:
        - billing_amount
        - due_date
        - invoice_file_name_display
        - remitter_name
        - card_token
      properties:
        billing_amount:
          type: number
          minLength: 1
          maxLength: 8
          description: 請求金額
          example: 10000
        card_token:
          type: string
          minLength: 1
          maxLength: 100
          description: カードトークン（新規カードの場合設定）
          example: null
        due_date:
          type: string
          minLength: 1
          maxLength: 10
          description: 支払期日（yyyy/MM/dd）
          example: 2025/05/11
        invoice_file_name_display:
          type: string
          minLength: 1
          maxLength: 100
          description: 表示用請求書ファイル名
          example: 請求書.pdf
        remitter_name:
          type: string
          minLength: 1
          maxLength: 40
          description: 振込依頼人名（利用可能文字制限有り：全角カタカナ、全角大文字アルファベット、全角数字、スペース、（）．，ー－／）
          example: カタカナ　テストタロウ　ＸＹＺ
        auth_ret_url:
          type: string
          minLength: 1
          maxLength: 512
          description: |
            オーソリコールバックURL。\
            カード認証の完了後に遷移させるURLを指定します。指定しない場合は fincode 既定のURLが使用されます。\
            指定したURLの末尾に取引IDが付与されます（末尾が `/` でない場合は `/` を補って付与）。\
            また、遷移時にクエリパラメータ `p`（ブラウザ情報）が付与されます。遷移先で `p` を受け取り、請求書カード払いオーソリ依頼APIのリクエストに設定してください。\
            （遷移先の例）`https://example.com/business_payments/auth/bp_abcdefghijklmnopqrstuv?p=abcdefghijklmnopqrstuvwxyz`
          example: https://example.com/business_payments/auth/
        payee:
          allOf:
            - $ref: '#/components/schemas/BusinessPayment.Payee.Submitting'
        payee_bank:
          allOf:
            - $ref: '#/components/schemas/BusinessPayment.PayeeBank.Submitting'
    BusinessPayment.Submitting.Response:
      type: object
      description: 請求書カード払い提出レスポンス
      properties:
        access_id:
          type: string
          minLength: 25
          maxLength: 25
          description: 取引ID
          sample: bp_VbZbE8t6RMGIsIfOP3U7ww
    BusinessPayment.Updating.Request.detail:
      type: object
      description: |
        JSON形式データ

        `data` には以下のJSON文字列を設定します。

        JSON形式データの項目:
            
      required:
        - billing_amount
        - due_date
        - invoice_file_name_display
        - remitter_name
        - card_token
      properties:
        billing_amount:
          type: number
          minLength: 1
          maxLength: 8
          description: 請求金額
          example: 10000
        card_token:
          type: string
          minLength: 1
          maxLength: 100
          description: カードトークン
          example: null
        due_date:
          type: string
          minLength: 1
          maxLength: 10
          description: 支払期日（yyyy/MM/dd）
          example: 2025/05/11
        invoice_file_name_display:
          type: string
          minLength: 1
          maxLength: 100
          description: 表示用請求書ファイル名
          example: 請求書.pdf
        remitter_name:
          type: string
          minLength: 1
          maxLength: 40
          description: 振込依頼人名（利用可能文字制限有り：全角カタカナ、全角大文字アルファベット、全角数字、スペース、（）．，ー－／）
          example: カタカナ　テストタロウ　ＸＹＺ
        auth_ret_url:
          type: string
          minLength: 1
          maxLength: 512
          description: |
            オーソリコールバックURL。\
            カード認証の完了後に遷移させるURLを指定します。指定しない場合は fincode 既定のURLが使用されます。\
            指定したURLの末尾に取引IDが付与されます（末尾が `/` でない場合は `/` を補って付与）。\
            また、遷移時にクエリパラメータ `p`（ブラウザ情報）が付与されます。遷移先で `p` を受け取り、請求書カード払いオーソリ依頼APIのリクエストに設定してください。\
            （遷移先の例）`https://example.com/business_payments/auth/bp_abcdefghijklmnopqrstuv?p=abcdefghijklmnopqrstuvwxyz`
          example: https://example.com/business_payments/auth/
        step:
          type: string
          minLength: 1
          maxLength: 1
          description: |
            入力ステップ。`1`〜`4` を指定します。\
            指定したステップで入力する項目のみ必須チェックの対象になります（`3` を指定した場合のみ `due_date` が必須）。\
            指定しない場合は全項目が必須チェックの対象になります。\
            桁数・書式・値域のチェックは本項目の指定に依らず常に実施されます。
          example: '3'
        payee:
          allOf:
            - $ref: '#/components/schemas/BusinessPayment.Payee.Submitting'
        payee_bank:
          allOf:
            - $ref: '#/components/schemas/BusinessPayment.PayeeBank.Submitting'
    BusinessPayment.Updating.Request:
      type: object
      description: 請求書カード払い更新リクエスト
      properties:
        invoice_file:
          type: string
          format: binary
          description: アップロードファイル（未設定の場合はS3アップロード不要）
        data:
          allOf:
            - $ref: '#/components/schemas/BusinessPayment.Updating.Request.detail'
      required:
        - data
    BusinessPayment.Updating.Response:
      type: object
      description: 請求書カード払い更新レスポンス
      properties:
        access_id:
          example: bp_VbZbE8t6RMGIsIfOP3U7ww
          type: string
          minLength: 25
          maxLength: 25
          description: 取引ID
    BusinessPayment.Deleting.Response:
      type: object
      properties:
        access_id:
          example: bp_VbZbE8t6RMGIsIfOP3U7ww
          type: string
          minLength: 25
          maxLength: 25
          description: 取引ID
        deleted:
          example: '1'
          type: string
          minLength: 1
          maxLength: 1
          description: |
            論理削除フラグ

            - `1`: 削除
    BusinessPayment.Requesting.Request:
      type: object
      description: 請求書カード払い依頼リクエスト
      required:
        - access_id
      properties:
        access_id:
          type: string
          minLength: 1
          maxLength: 25
          description: 取引ID
          example: bp_abcdefghijklmnopqrstuv
    BusinessPayment.Requesting.Response:
      type: object
      description: 請求書カード払い依頼レスポンス
      properties:
        redirect_url:
          type: string
          minLength: 1
          maxLength: 512
          description: 認証開始URL
          example: http://xxx.xxx.xxx.xx/xxx
    BusinessPayment.Authorizing.Request:
      type: object
      description: 請求書カード払いオーソリ依頼リクエスト
      required:
        - p
      properties:
        p:
          type: string
          description: ブラウザ情報<br> 購入者がredirect_urlにアクセスし、 3Dセキュア認証成功をトリガーにオーソリコールバックURL宛に送信するデータのうち、 pの値を設定します。
          example: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefh
    BusinessPayment.Authorizing.Response:
      type: object
      description: 請求書カード払いオーソリ依頼レスポンス
      properties:
        result:
          type: string
          enum:
            - OK
            - NG
          description: 'オーソリ結果 OK: オーソリ成功 NG: オーソリ失敗'
    BusinessPayment.Business:
      type: object
      description: 請求書カード払い事業者情報
      properties:
        result:
          type: string
          description: 結果
          enum:
            - OK
            - NG
        commission_list:
          type: array
          items:
            type: object
            properties:
              from_amount:
                type: number
                format: double
                description: from金額
                example: 1
              to_amount:
                type: number
                format: double
                description: to金額
                example: 99999
              commission_rate:
                type: number
                format: double
                description: 手数料率
                example: 0.03
              min_commission_amount:
                type: number
                format: double
                description: 最低手数料金額
                example: 100
        mulpay_api_key:
          type: string
          description: マルペイキー
          example: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefh
        mulpay_public_key_path:
          type: string
          description: マルペイ公開鍵のパス
          example: /path/to/mulpay_public_key.pem
    ContractStatus:
      type: string
      enum:
        - '101'
        - '102'
        - '103'
        - '105'
        - '106'
        - '107'
      description: |
        契約ステータス\
        \
        fincodeとそのショップの運営事業者の契約のステータスを表します。

        - `101`: 未契約<br /><span class="smallText">まだfincodeの本番環境申請の提出が完了していない状態です。</span>
        - `102`: 利用審査中<br /><span class="smallText">fincodeの本番環境申請の提出が完了し、利用審査中の状態です。</span>
        - `103`: 利用審査中（VISA/Mastercard利用可）<br /><span class="smallText">即時利用によりVISA/Mastercardブランドの決済受付が可能な状態です。審査は継続して行われます。</span>
        - `105`: 解約済
        - `106`: 契約不成立<br /><span class="smallText">審査の結果、fincodeの利用が不可となった状態です。</span>
        - `107`: 稼働中<br /><span class="smallText">fincodeの本番環境申請が完了し、クレジットカード決済の受付が可能な状態です。</span>
    sort:
      type: string
      example: updated␣desc,created␣asc
    TenantBuyer.ListRetrieving.QueryParams:
      type: object
      properties:
        id:
          type: string
          nullable: true
          minLength: 13
          maxLength: 13
          example: b_***********
          default: null
          description: |
            バイヤーID
        buyer_name:
          type: string
          nullable: true
          minLength: 1
          maxLength: 20
          example: My Buyer
          default: null
          description: |
            バイヤー名称
        buyer_mail_address:
          type: string
          nullable: true
          minLength: 1
          maxLength: 254
          example: tenant-buyer@example.com
          default: null
          description: |
            バイヤーメールアドレス
        contract_status:
          allOf:
            - $ref: '#/components/schemas/ContractStatus'
          nullable: true
          description: |
            契約ステータス\
            \
            fincodeに登録されているバイヤーの契約ステータスで検索できます。
        created_from:
          type: string
          nullable: true
          example: 2022/05/16
          default: null
          description: |
            作成日の範囲指定 開始日\
            この日付以降に作成されたショップを検索できます。\
            形式：`yyyy/MM/dd`
        created_to:
          type: string
          nullable: true
          example: 2022/05/16
          default: null
          description: |
            作成日の範囲指定 終了日\
            この日付以前に作成されたショップを検索できます。\
            形式：`yyyy/MM/dd`
        sort:
          allOf:
            - $ref: '#/components/schemas/sort'
          nullable: true
          description: |
            ソートする項目と順序を指定します。\
            例： `?sort=updated␣desc,created␣asc`\
            \
            ソート可能な項目

            - `id`: バイヤーID
            - `buyer_name`: バイヤー名称
            - `corporate_name_or_representative_full_name`: 法人名/代表者名
            - `created`: 作成日時
            - `updated`: 更新日時
    BuyerShopType:
      type: string
      enum:
        - null
        - platform
        - tenant
      example: platform
      description: |
        バイヤータイプ。

        - `null`: スタンダードショップ
        - `platform`: バイヤープラットフォーム
        - `tenant`: テナントバイヤー
    BuyerPlatformKickbackFeeRateSetting:
      type: object
      properties:
        platform_kickback_fee_rate:
          type: big decimal
          format: double
          nullable: true
          example: 1.5
          description: |
            バイヤープラットフォーム還元率
        platform_kickback_min_fee:
          type: big decimal
          format: double
          nullable: true
          example: 30
          description: |
            バイヤープラットフォーム還元最低手数料
        applied_since:
          type: timestamp
          nullable: true
          example: '2024-01-01T00:00:00Z'
          description: |
            適用期間（開始日）
        applied_until:
          type: timestamp
          nullable: true
          example: '2024-12-31T23:59:59Z'
          description: |
            適用期間（終了日）
        promotion_flag:
          type: boolean
          nullable: true
          example: true
          description: |
            キャンペーンフラグ
    created:
      type: string
      example: 2022/05/16 23:59:59.999
      description: |
        作成日\
        形式：`yyyy/MM/dd HH:mm:ss.SSS`
    updated:
      type: string
      nullable: true
      example: 2022/05/16 23:59:59.999
      description: |
        更新日\
        形式：`yyyy/MM/dd HH:mm:ss.SSS`
    BuyerShop:
      type: object
      properties:
        buyer_id:
          type: string
          minLength: 13
          maxLength: 13
          example: b_***********
          description: |
            バイヤーID
        buyer_name:
          type: string
          minLength: 1
          maxLength: 384
          nullable: true
          example: Buyer Shop
          description: |
            バイヤー名称
        buyer_name_kana:
          type: string
          minLength: 1
          maxLength: 100
          nullable: true
          example: バイヤー
          description: |
            バイヤー名カナ
        send_mail_address:
          type: string
          minLength: 1
          maxLength: 200
          nullable: true
          example: notify@example.com
          description: |
            通知先メールアドレス
        buyer_mail_address:
          type: string
          minLength: 1
          maxLength: 256
          nullable: true
          example: buyer-shop@example.com
          description: |
            バイヤーメールアドレス
        buyer_type:
          allOf:
            - $ref: '#/components/schemas/BuyerShopType'
        buyer_platform_id:
          type: string
          minLength: 13
          maxLength: 13
          nullable: true
          example: bp_***********
          description: |
            バイヤープラットフォームID
        buyer_platform_name:
          type: string
          minLength: 1
          maxLength: 384
          nullable: true
          example: Buyer Platform
          description: |
            バイヤープラットフォーム名
        buyer_platform_kickback_fee_rate_setting_list:
          type: array
          items:
            $ref: '#/components/schemas/BuyerPlatformKickbackFeeRateSetting'
          description: |
            バイヤープラットフォーム還元率設定情報リスト
        api_key_display_flag:
          type: string
          minLength: 1
          maxLength: 1
          nullable: true
          enum:
            - '0'
            - '1'
          example: '1'
          description: |
            APIキー表示フラグ。

            - `0`: 表示しない
            - `1`: 表示する
        created:
          allOf:
            - $ref: '#/components/schemas/created'
        updated:
          allOf:
            - $ref: '#/components/schemas/updated'
    BuyerShop.list:
      type: object
      properties:
        list:
          type: array
          items:
            allOf:
              - $ref: '#/components/schemas/BuyerShop'
              - type: object
                properties:
                  status_code:
                    allOf:
                      - $ref: '#/components/schemas/ContractStatus'
                  corporate_name_or_representative_full_name:
                    type: string
                    nullable: true
                    minLength: 1
                    maxLength: 416
                    description: |
                      法人名/代表者名
                  staff1_last_name:
                    type: string
                    nullable: true
                    minLength: 1
                    maxLength: 50
                    description: |
                      担当者1 名前 姓
                  staff1_first_name:
                    type: string
                    nullable: true
                    minLength: 1
                    maxLength: 50
                    description: |
                      担当者1 名前 名
                  staff1_tel:
                    type: string
                    nullable: true
                    minLength: 1
                    maxLength: 15
                    description: |
                      担当者1 電話番号
                  staff1_mail:
                    type: string
                    nullable: true
                    minLength: 1
                    maxLength: 254
                    format: email
                    description: |
                      担当者1 メールアドレス
                  contracted_at:
                    type: string
                    nullable: true
                    example: 2021/01/01 10:00:00
                    description: |
                      本番環境申請日

                      形式：`yyyy/MM/dd HH:mm:ss`
    TenantBuyer.ListRetrieving.Response:
      allOf:
        - $ref: '#/components/schemas/BuyerShop.list'
    TenantBuyer.Retrieving.Response:
      allOf:
        - $ref: '#/components/schemas/BuyerShop'
        - type: object
          properties:
            buyer_password:
              type: string
              minLength: 1
              maxLength: 13
              nullable: true
              example: '********'
              description: |
                バイヤーパスワード（マスク）
            api_version:
              type: string
              minLength: 1
              maxLength: 8
              nullable: true
              example: '20211001'
              description: |
                APIバージョン
            enable_contracts_api:
              type: string
              minLength: 1
              maxLength: 1
              nullable: true
              enum:
                - '0'
                - '1'
              example: '0'
              description: |
                契約審査系API実行許可フラグ

                - `0`: 許可しない
                - `1`: 許可する
            business_operator_id:
              type: string
              minLength: 1
              maxLength: 30
              nullable: true
              description: |
                事業者ID
            partition_id:
              type: integer
              minimum: 0
              nullable: true
              description: |
                パーティションID
    email:
      type: string
      minLength: 1
      maxLength: 254
      example: new-fincode-user@example.com
      description: |
        メールアドレス\
        \
        fincodeに新規作成するユーザーのメールアドレス。\
        すでに登録されているメールアドレスを指定するとエラーとなります。（エラーコード：`E0087012014`）\
        \
        形式： RFC 5322
    password:
      type: string
      minLength: 12
      maxLength: 100
      example: password1234
      description: |
        パスワード\
        \
        fincodeに新規作成するユーザーのパスワード。\
        パスワードは以下の条件を満たす必要があります。

        - 半角英数のみ
        - 12文字以上
        - 英数ともに使用
        - 大文字小文字ともに使用
    name:
      type: string
      minLength: 1
      maxLength: 384
      example: Epsilon Taro
      description: |
        ユーザー名\
        \
        fincodeに新規作成するユーザーの名前
    tenant_buyer_url_id:
      type: string
      minLength: 1
      maxLength: 25
      example: tbu_ *********************
      description: |
        テナントバイヤー登録URL ID\
        \
        テナントバイヤー登録URL ID。\
        [管理画面 > プラットフォームの運用と管理 > 構成](https://dashboard.test.fincode.jp/buyer_platform/constitution)の『テナントバイヤー登録用のURL』の`tenant_buyer_url_id`の値をこのパラメータに指定します。
    POST.BuyerPlatformTenantEntries.Request:
      type: object
      properties:
        email:
          allOf:
            - $ref: '#/components/schemas/email'
        password:
          allOf:
            - $ref: '#/components/schemas/password'
        name:
          allOf:
            - $ref: '#/components/schemas/name'
        tenant_buyer_url_id:
          allOf:
            - $ref: '#/components/schemas/tenant_buyer_url_id'
      required:
        - email
        - password
        - name
        - tenant_buyer_url_id
    id:
      type: string
      minLength: 13
      maxLength: 13
      example: s_***********
      description: |
        ショップID
    properties-id:
      type: integer
      minLength: 1
      maxLength: 11
      example: 9
      description: |
        ロールID\
        \
        ユーザーの管理画面における権限を示すIDです。
    User:
      type: object
      properties:
        id:
          type: string
          minLength: 24
          maxLength: 24
          example: u_**********************
          description: |
            ユーザーID
        default_shop_id:
          allOf:
            - $ref: '#/components/schemas/id'
          description: |
            デフォルトショップID\
            \
            このユーザーがログインした際、どのショップにログインするかを示すID
        role_id:
          allOf:
            - $ref: '#/components/schemas/properties-id'
        name:
          type: string
          minLength: 1
          maxLength: 384
          example: Epsilon Taro
          description: |
            ユーザー名
        email:
          type: string
          minLength: 1
          maxLength: 384
          example: new-fincode-user@example.com
          description: |
            メールアドレス
        type:
          type: string
          enum:
            - '01'
          example: '01'
          description: |
            ユーザー種別

            - `01`: ショップユーザー
        two_factor_auth_status:
          type: string
          enum:
            - '00'
            - '01'
          example: '00'
          description: |
            二要素認証ステータス

            - `00`: 未設定\
            - `01`: 設定済み
        mail_auth_status:
          type: string
          enum:
            - '00'
            - '01'
          example: '00'
          description: |
            メールアドレス認証ステータス

            - `00`: 未設定\
            - `01`: 設定済み
        password_lock_status:
          type: string
          enum:
            - '00'
            - '01'
          example: '00'
          description: |
            パスワードロックステータス

            - `00`: ロックされていない\
            - `01`: ロック中
        last_login_date:
          type: string
          nullable: true
          example: null
          description: |
            最終ログイン日時\
            \
            形式：`yyyy/MM/dd HH:mm:ss.SSS`
        login_failure_date:
          type: string
          nullable: true
          example: null
          description: |
            ログイン失敗日時\
            \
            形式：`yyyy/MM/dd HH:mm:ss.SSS`
        login_failure_times:
          type: integer
          example: 0
          description: |
            ログイン失敗回数
        password_expire:
          type: string
          nullable: true
          example: 2022/05/16 12.34.56.789
          description: |
            パスワード有効期限\
            \
            形式：`yyyy/MM/dd HH:mm:ss.SSS`
        account_status:
          type: string
          enum:
            - '00'
            - '01'
          example: '00'
          description: |
            アカウントステータス

            - `00`: 有効
            - `01`: 無効
        invite_status:
          type: string
          enum:
            - '01'
            - '02'
          example: '02'
          description: |
            招待ステータス

            - `01`: 招待中
            - `02`: 参加済み
        created:
          allOf:
            - $ref: '#/components/schemas/created'
        updated:
          allOf:
            - $ref: '#/components/schemas/updated'
    POST.BuyerPlatformTenantEntries:
      type: object
      properties:
        user_data:
          allOf:
            - $ref: '#/components/schemas/User'
          description: |
            新規作成されたユーザー情報（このAPIによって新規作成されたテナントのショップIDを含む）
        access_token:
          type: string
          minLength: 112
          maxLength: 112
          example: a_****_**************
          description: |
            アクセストークン
        authorities:
          type: array
          items:
            type: object
            properties:
              auth_id:
                type: integer
                example: 18
                description: 権限ID
              endpoint:
                type: string
                example: /v1/payments
                description: エンドポイント
              method:
                type: string
                example: GET
                description: HTTPメソッド
          description: |
            ユーザーの権限情報\
            \
            このユーザーが実行可能なエンドポイントとHTTPメソッドの情報
      x-req-properties:
        email:
          type: string
          minLength: 1
          maxLength: 254
          example: new-fincode-user@example.com
          description: |
            メールアドレス\
            \
            fincodeに新規作成するユーザーのメールアドレス。\
            すでに登録されているメールアドレスを指定するとエラーとなります。（エラーコード：`E0087012014`）\
            \
            形式： RFC 5322
        password:
          type: string
          minLength: 12
          maxLength: 100
          example: password1234
          description: |
            パスワード\
            \
            fincodeに新規作成するユーザーのパスワード。\
            パスワードは以下の条件を満たす必要があります。

            - 半角英数のみ
            - 12文字以上
            - 英数ともに使用
            - 大文字小文字ともに使用
        name:
          type: string
          minLength: 1
          maxLength: 384
          example: Epsilon Taro
          description: |
            ユーザー名\
            \
            fincodeに新規作成するユーザーの名前
        tenant_buyer_url_id:
          type: string
          minLength: 1
          maxLength: 25
          example: tbu_ *********************
          description: |
            テナントバイヤー登録URL ID\
            \
            テナントバイヤー登録URL ID。\
            [管理画面 > プラットフォームの運用と管理 > 構成](https://dashboard.test.fincode.jp/buyer_platform/constitution)の『テナントバイヤー登録用のURL』の`tenant_buyer_url_id`の値をこのパラメータに指定します。
    POST.BuyerPlatformTenantEntries.Response:
      allOf:
        - $ref: '#/components/schemas/POST.BuyerPlatformTenantEntries'
    x-req-properties-email:
      type: string
      minLength: 1
      maxLength: 254
      example: new-fincode-user@example.com
      description: |
        メールアドレス\
        \
        バイヤープラットフォームのユーザーのメールアドレス。
    x-req-properties-password:
      type: string
      minLength: 12
      maxLength: 254
      example: password1234
      description: |
        パスワード\
        \
        バイヤープラットフォームのユーザーのパスワード。
    x-req-properties-tenant_buyer_url_id:
      type: string
      minLength: 1
      maxLength: 25
      example: tbu_*********************
      description: |
        テナントバイヤー登録URL ID\
        \
        テナントバイヤー登録URLのID。\
        [管理画面 > バイヤープラットフォームの運用と管理 > 構成](https://dashboard.test.fincode.jp/buyer_platform/constitution)の『テナントバイヤー登録用のURL』の`tenant_buyer_url_id`の値をこのパラメータに指定します。
    POST.BuyerPlatformJoinTenants.Request:
      type: object
      properties:
        email:
          allOf:
            - $ref: '#/components/schemas/x-req-properties-email'
        password:
          allOf:
            - $ref: '#/components/schemas/x-req-properties-password'
        tenant_buyer_url_id:
          allOf:
            - $ref: '#/components/schemas/x-req-properties-tenant_buyer_url_id'
      required:
        - email
        - password
        - tenant_buyer_url_id
    TenantBuyer_properties-id:
      type: string
      minLength: 13
      maxLength: 13
      example: b_***********
      description: |
        テナントバイヤーID
    buyer_name:
      type: string
      minLength: 1
      maxLength: 384
      nullable: true
      example: Tenant Buyer
      description: |
        テナントバイヤー名称
    buyer_name_kana:
      type: string
      minLength: 1
      maxLength: 100
      nullable: true
      example: バイヤー
      description: |
        テナントバイヤー名カナ
    send_address:
      type: string
      minLength: 1
      maxLength: 200
      nullable: true
      example: notify@example.com
      description: |
        通知先メールアドレス
    buyer_mail_address:
      type: string
      minLength: 1
      maxLength: 256
      nullable: true
      example: buyer-shop@example.com
      description: |
        テナントバイヤーメールアドレス
    buyer_type:
      allOf:
        - $ref: '#/components/schemas/BuyerShopType'
    buyer_platform_id:
      type: string
      minLength: 13
      maxLength: 13
      nullable: true
      example: bp_***********
      description: |
        バイヤープラットフォームID
    buyer_platform_name:
      type: string
      minLength: 1
      maxLength: 384
      nullable: true
      example: Buyer Platform
      description: |
        バイヤープラットフォーム名
    api_key_display_flag:
      type: string
      minLength: 1
      maxLength: 1
      nullable: true
      enum:
        - '0'
        - '1'
      example: '1'
      description: |
        APIキー表示フラグ。

        - `0`: 表示しない
        - `1`: 表示する
    business_operator_id:
      type: string
      minLength: 1
      maxLength: 30
      nullable: true
      description: |
        事業者ID
    partition_id:
      type: integer
      minimum: 0
      nullable: true
      description: |
        パーティションID
    properties-created:
      allOf:
        - $ref: '#/components/schemas/created'
    properties-updated:
      allOf:
        - $ref: '#/components/schemas/updated'
    POST.BuyerPlatformJoinTenants:
      type: object
      properties:
        id:
          allOf:
            - $ref: '#/components/schemas/TenantBuyer_properties-id'
        buyer_name:
          allOf:
            - $ref: '#/components/schemas/buyer_name'
        buyer_name_kana:
          allOf:
            - $ref: '#/components/schemas/buyer_name_kana'
        send_address:
          allOf:
            - $ref: '#/components/schemas/send_address'
        buyer_mail_address:
          allOf:
            - $ref: '#/components/schemas/buyer_mail_address'
        buyer_type:
          allOf:
            - $ref: '#/components/schemas/buyer_type'
        buyer_platform_id:
          allOf:
            - $ref: '#/components/schemas/buyer_platform_id'
        buyer_platform_name:
          allOf:
            - $ref: '#/components/schemas/buyer_platform_name'
        api_key_display_flag:
          allOf:
            - $ref: '#/components/schemas/api_key_display_flag'
        business_operator_id:
          allOf:
            - $ref: '#/components/schemas/business_operator_id'
        partition_id:
          allOf:
            - $ref: '#/components/schemas/partition_id'
        created:
          allOf:
            - $ref: '#/components/schemas/properties-created'
        updated:
          allOf:
            - $ref: '#/components/schemas/properties-updated'
      x-req-properties:
        email:
          type: string
          minLength: 1
          maxLength: 254
          example: new-fincode-user@example.com
          description: |
            メールアドレス\
            \
            バイヤープラットフォームのユーザーのメールアドレス。
        password:
          type: string
          minLength: 12
          maxLength: 254
          example: password1234
          description: |
            パスワード\
            \
            バイヤープラットフォームのユーザーのパスワード。
        tenant_buyer_url_id:
          type: string
          minLength: 1
          maxLength: 25
          example: tbu_*********************
          description: |
            テナントバイヤー登録URL ID\
            \
            テナントバイヤー登録URLのID。\
            [管理画面 > バイヤープラットフォームの運用と管理 > 構成](https://dashboard.test.fincode.jp/buyer_platform/constitution)の『テナントバイヤー登録用のURL』の`tenant_buyer_url_id`の値をこのパラメータに指定します。
    POST.BuyerPlatformJoinTenants.Response:
      allOf:
        - $ref: '#/components/schemas/POST.BuyerPlatformJoinTenants'
    buyer_id:
      type: string
      minLength: 13
      maxLength: 13
      example: b_***********
      description: |
        バイヤーID
    corporate_name:
      type: string
      minLength: 1
      maxLength: 150
      example: サンプル株式会社
      description: |
        法人名
    corporate_name_kana:
      type: string
      minLength: 1
      maxLength: 150
      example: サンプルカブシキガイシャ
      description: |
        法人名（カナ）
    hp:
      type: string
      minLength: 1
      maxLength: 300
      nullable: true
      example: https://www.sample-corp.example.com
      description: |
        企業サイトURL
    company_postal_code:
      type: string
      nullable: true
      minLength: 8
      maxLength: 8
      example: 123-4567
      description: |
        会社住所 郵便番号\
        形式： 半角数字（ハイフンあり）
    company_prefecture:
      type: string
      nullable: true
      minLength: 3
      maxLength: 4
      example: 東京都
      description: |
        会社住所 都道府県\
        形式： 漢字
    company_prefecture_kana:
      type: string
      nullable: true
      minLength: 1
      maxLength: 50
      example: トウキョウト
      description: |
        会社住所 都道府県（カナ）\
        形式： 全角カタカナ
    company_address_municipality:
      type: string
      nullable: true
      minLength: 1
      maxLength: 50
      example: 渋谷区
      description: |
        会社住所 市区町村\
        形式： 漢字/ひらがな/カタカナ/半角英数
    company_address_municipality_kana:
      type: string
      nullable: true
      minLength: 1
      maxLength: 100
      example: シブヤク
      description: |
        会社住所 市区町村（カナ）\
        形式： 全角カタカナ
    company_address_section:
      type: string
      nullable: true
      minLength: 1
      maxLength: 50
      example: 道玄坂
      description: |
        会社住所 町域\
        形式： 漢字/ひらがな/カタカナ/半角英数
    company_address_section_kana:
      type: string
      nullable: true
      minLength: 1
      maxLength: 100
      example: ドウゲンザカ
      description: |
        会社住所 町域（カナ）\
        形式： 全角カタカナ
    company_address_chrome:
      type: string
      nullable: true
      minLength: 1
      maxLength: 50
      example: 1-2-3
      description: |
        会社住所 番地\
        形式： 漢字/ひらがな/カタカナ/半角英数
    company_address_chrome_kana:
      type: string
      nullable: true
      minLength: 1
      maxLength: 100
      example: イチニサン
      description: |
        会社住所 番地（カナ）\
        形式： 全角カタカナ
    company_address_building_name:
      type: string
      nullable: true
      minLength: 1
      maxLength: 100
      example: サンプルビル
      description: |
        会社住所 ビル名\
        形式： 漢字/ひらがな/カタカナ/半角英数
    company_address_building_name_kana:
      type: string
      nullable: true
      minLength: 1
      maxLength: 100
      example: サンプルビル
      description: |
        会社住所 ビル名（カナ）\
        形式： 全角カタカナ
    company_tel:
      type: string
      nullable: true
      minLength: 1
      maxLength: 15
      example: '0312345678'
      description: |
        会社情報 電話番号\
        形式： 半角数字（ハイフンなし）
    representative_last_name:
      type: string
      minLength: 1
      maxLength: 20
      nullable: true
      example: 山田
      description: |
        代表者 姓
        形式： 漢字/ひらがな/カタカナ/半角英字
    representative_last_name_kana:
      type: string
      minLength: 1
      maxLength: 20
      nullable: true
      example: ヤマダ
      description: |
        代表者 姓（カナ）\
        形式： 全角カナ
    representative_first_name:
      type: string
      minLength: 1
      maxLength: 20
      nullable: true
      example: 太郎
      description: |
        代表者 名\
        形式： 漢字/ひらがな/カタカナ/半角英字
    representative_first_name_kana:
      type: string
      minLength: 1
      maxLength: 20
      nullable: true
      example: タロウ
      description: |
        代表者 名（カナ）\
        形式： 全角カナ
    representative_birthday:
      type: string
      pattern: ^\d{4}/\d{2}/\d{2}$
      nullable: true
      example: 1980/01/01
      description: |
        代表者 生年月日\
        \
        形式：`yyyy/MM/dd`
    representative_postal_code:
      type: string
      pattern: ^\d{3}-\d{4}$
      nullable: true
      minLength: 8
      maxLength: 8
      example: 150-0043
      description: |
        代表者 住所 郵便番号\
        形式：`xxx-xxxx`
    representative_prefecture:
      type: string
      minLength: 3
      maxLength: 4
      nullable: true
      example: 東京都
      description: |
        代表者 住所 都道府県\
        形式： 漢字
    representative_prefecture_kana:
      type: string
      minLength: 1
      maxLength: 50
      nullable: true
      example: トウキョウト
      description: |
        代表者 住所 都道府県（カナ）\
        形式： 全角カナ
    representative_address_municipality:
      type: string
      minLength: 1
      maxLength: 50
      nullable: true
      example: 渋谷区
      description: |
        代表者 住所 市区町村\
        形式： 漢字/ひらがな/カタカナ/半角英数
    representative_address_municipality_kana:
      type: string
      minLength: 1
      maxLength: 100
      nullable: true
      example: シブヤク
      description: |
        代表者 住所 市区町村（カナ）\
        形式： 全角カナ
    representative_address_section:
      type: string
      minLength: 1
      maxLength: 50
      nullable: true
      example: 道玄坂
      description: |
        代表者 住所 町域\
        形式： 漢字/ひらがな/カタカナ/半角英数
    representative_address_section_kana:
      type: string
      minLength: 1
      maxLength: 100
      nullable: true
      example: ドウゲンザカ
      description: |
        代表者 住所 町域（カナ）\
        形式： 全角カナ
    representative_address_chrome:
      type: string
      minLength: 1
      maxLength: 50
      nullable: true
      example: 1-14-6
      description: |
        代表者 住所 番地\
        形式： 漢字/ひらがな/カタカナ/半角英数
    representative_address_chrome_kana:
      type: string
      minLength: 1
      maxLength: 100
      nullable: true
      example: 1-14-6
      description: |
        代表者 住所 番地（カナ）
    representative_address_building_name:
      type: string
      minLength: 1
      maxLength: 100
      nullable: true
      example: ヒューマックス渋谷ビル 7F
      description: |
        代表者 住所 建物名\
        形式： 漢字/ひらがな/カタカナ/半角英数
    representative_address_building_name_kana:
      type: string
      minLength: 1
      maxLength: 100
      nullable: true
      example: ヒューマックスシブヤビル ナナカイ
      description: |
        代表者 住所 建物名（カナ）\
        形式： 全角カナ
    representative_tel:
      type: string
      minLength: 1
      maxLength: 15
      pattern: ^\d{1,15}$
      nullable: true
      example: '0364330000'
      description: |
        代表者 電話番号\
        形式： 半角数字（ハイフンなし、PHS番号不可）
    staff1_last_name:
      type: string
      minLength: 1
      maxLength: 20
      nullable: true
      example: 鈴木
      description: |
        担当者1 姓\
        形式： 漢字/ひらがな/カタカナ/半角英字\
        \
        fincodeは担当者1,2宛てに審査結果の通知や審査保留対応の連絡などを行います。
    staff1_last_name_kana:
      type: string
      minLength: 1
      maxLength: 20
      nullable: true
      example: スズキ
      description: |
        担当者1 姓（カナ）\
        形式： 全角カナ
    staff1_first_name:
      type: string
      minLength: 1
      maxLength: 20
      nullable: true
      example: 次郎
      description: |
        担当者1 名\
        形式： 漢字/ひらがな/カタカナ/半角英字
    staff1_first_name_kana:
      type: string
      minLength: 1
      maxLength: 20
      nullable: true
      example: ジロウ
      description: |
        担当者1 名（カナ）\
        形式： 全角カナ
    staff1_company_name:
      type: string
      minLength: 1
      maxLength: 150
      nullable: true
      example: サンプル株式会社
      description: |
        担当者1 会社名\
        形式： 漢字/ひらがな/カタカナ/半角英数
    staff1_belongs:
      type: string
      minLength: 1
      maxLength: 50
      nullable: true
      example: EC事業部
      description: |
        担当者1 部署名\
        形式： 漢字/ひらがな/カタカナ/半角英数
    staff1_tel:
      type: string
      minLength: 1
      maxLength: 15
      pattern: ^\d{1,15}$
      nullable: true
      example: '09000000000'
      description: |
        担当者1 電話番号\
        形式： 半角数字（ハイフンなし、PHS番号不可）
    staff1_mail:
      type: string
      minLength: 1
      maxLength: 254
      format: email
      nullable: true
      example: staff-1@example.com
      description: |
        担当者1 メールアドレス\
        形式： RFC 5322
    content_description:
      type: string
      nullable: true
      minLength: 1
      maxLength: 5000
      example: |
        本サービスは、ユーザーが自由にWeb記事を投稿・販売できるコンテンツを提供しています。
      description: |
        取扱商材の説明\
        \
        ショップの提供する商材についての説明
    BuyerContractDetail:
      type: object
      properties:
        corporate:
          type: boolean
          nullable: true
          example: true
          description: |
            事業形態

            - `true`: 法人
            - `false`: 個人事業主
        corporate_number:
          type: string
          nullable: true
          minLength: 13
          maxLength: 13
          example: '1234567890123'
          description: |
            法人番号
        corporate_name:
          allOf:
            - $ref: '#/components/schemas/corporate_name'
          nullable: true
        corporate_name_kana:
          allOf:
            - $ref: '#/components/schemas/corporate_name_kana'
          nullable: true
        hp:
          allOf:
            - $ref: '#/components/schemas/hp'
          nullable: true
        company_postal_code:
          allOf:
            - $ref: '#/components/schemas/company_postal_code'
          nullable: true
        company_prefecture:
          allOf:
            - $ref: '#/components/schemas/company_prefecture'
          nullable: true
        company_prefecture_kana:
          allOf:
            - $ref: '#/components/schemas/company_prefecture_kana'
          nullable: true
        company_address_municipality:
          allOf:
            - $ref: '#/components/schemas/company_address_municipality'
          nullable: true
        company_address_municipality_kana:
          allOf:
            - $ref: '#/components/schemas/company_address_municipality_kana'
          nullable: true
        company_address_section:
          allOf:
            - $ref: '#/components/schemas/company_address_section'
          nullable: true
        company_address_section_kana:
          allOf:
            - $ref: '#/components/schemas/company_address_section_kana'
          nullable: true
        company_address_chrome:
          allOf:
            - $ref: '#/components/schemas/company_address_chrome'
          nullable: true
        company_address_chrome_kana:
          allOf:
            - $ref: '#/components/schemas/company_address_chrome_kana'
          nullable: true
        company_address_building_name:
          allOf:
            - $ref: '#/components/schemas/company_address_building_name'
          nullable: true
        company_address_building_name_kana:
          allOf:
            - $ref: '#/components/schemas/company_address_building_name_kana'
          nullable: true
        company_tel:
          allOf:
            - $ref: '#/components/schemas/company_tel'
          nullable: true
        representative_last_name:
          allOf:
            - $ref: '#/components/schemas/representative_last_name'
          nullable: true
        representative_last_name_kana:
          allOf:
            - $ref: '#/components/schemas/representative_last_name_kana'
          nullable: true
        representative_first_name:
          allOf:
            - $ref: '#/components/schemas/representative_first_name'
          nullable: true
        representative_first_name_kana:
          allOf:
            - $ref: '#/components/schemas/representative_first_name_kana'
          nullable: true
        representative_birthday:
          allOf:
            - $ref: '#/components/schemas/representative_birthday'
          nullable: true
        representative_postal_code:
          allOf:
            - $ref: '#/components/schemas/representative_postal_code'
          nullable: true
        representative_prefecture:
          allOf:
            - $ref: '#/components/schemas/representative_prefecture'
          nullable: true
        representative_prefecture_kana:
          allOf:
            - $ref: '#/components/schemas/representative_prefecture_kana'
          nullable: true
        representative_address_municipality:
          allOf:
            - $ref: '#/components/schemas/representative_address_municipality'
          nullable: true
        representative_address_municipality_kana:
          allOf:
            - $ref: '#/components/schemas/representative_address_municipality_kana'
          nullable: true
        representative_address_section:
          allOf:
            - $ref: '#/components/schemas/representative_address_section'
          nullable: true
        representative_address_section_kana:
          allOf:
            - $ref: '#/components/schemas/representative_address_section_kana'
          nullable: true
        representative_address_chrome:
          allOf:
            - $ref: '#/components/schemas/representative_address_chrome'
          nullable: true
        representative_address_chrome_kana:
          allOf:
            - $ref: '#/components/schemas/representative_address_chrome_kana'
          nullable: true
        representative_address_building_name:
          allOf:
            - $ref: '#/components/schemas/representative_address_building_name'
          nullable: true
        representative_address_building_name_kana:
          allOf:
            - $ref: '#/components/schemas/representative_address_building_name_kana'
          nullable: true
        representative_tel:
          allOf:
            - $ref: '#/components/schemas/representative_tel'
          nullable: true
        staff1_last_name:
          allOf:
            - $ref: '#/components/schemas/staff1_last_name'
          nullable: true
        staff1_last_name_kana:
          allOf:
            - $ref: '#/components/schemas/staff1_last_name_kana'
          nullable: true
        staff1_first_name:
          allOf:
            - $ref: '#/components/schemas/staff1_first_name'
          nullable: true
        staff1_first_name_kana:
          allOf:
            - $ref: '#/components/schemas/staff1_first_name_kana'
          nullable: true
        staff1_company_name:
          allOf:
            - $ref: '#/components/schemas/staff1_company_name'
          nullable: true
        staff1_belongs:
          allOf:
            - $ref: '#/components/schemas/staff1_belongs'
          nullable: true
        staff1_tel:
          allOf:
            - $ref: '#/components/schemas/staff1_tel'
          nullable: true
        staff1_mail:
          allOf:
            - $ref: '#/components/schemas/staff1_mail'
          nullable: true
        content_description:
          allOf:
            - $ref: '#/components/schemas/content_description'
          nullable: true
    BusinessOperator:
      type: object
      properties:
        business_operator_id:
          type: string
          nullable: true
          description: |
            事業者ID
        business_operator_name:
          type: string
          nullable: true
          description: |
            事業者名
        business_operator_name_kana:
          type: string
          nullable: true
          description: |
            事業者名カナ
        service_name:
          type: string
          nullable: true
          description: |
            サービス名
        business_operator_examination_status_code:
          type: number
          nullable: true
          description: |
            事業者審査ステータス
    BusinessOperatorBuyerBankAccountInfo:
      type: object
      properties:
        bank_name:
          type: string
          example: GMOあおぞらネット銀行
          minLength: 1
          maxLength: 20
          description: |
            金融機関名
        bank_name_kana:
          type: string
          example: ジーエムオーアオゾラネットギンコウ
          minLength: 1
          maxLength: 100
          description: |
            金融機関名カナ
        bank_code:
          type: string
          minLength: 4
          maxLength: 4
          example: '0001'
          description: |
            金融機関コード
        branch_name:
          type: string
          example: うみ支店
          minLength: 1
          maxLength: 20
          description: |
            支店名
        branch_name_kana:
          type: string
          example: ウミシテン
          minLength: 1
          maxLength: 100
          description: |
            支店名カナ
        branch_code:
          type: string
          minLength: 3
          maxLength: 3
          example: '001'
          description: |
            支店コード
        account_kind:
          type: number
          enum:
            - 0
            - 1
          example: 0
          description: |
            口座種別

            - `0`: 普通
            - `1`: 当座
        account_number:
          type: string
          minLength: 1
          maxLength: 7
          example: '1234567'
          description: |
            口座番号
        account_name:
          type: string
          minLength: 1
          maxLength: 16
          example: サンプル株式会社
          description: |
            口座名義カナ
    BuyerContractBankAccountInfo:
      type: object
      properties:
        contract_bank_name:
          type: string
          minLength: 1
          maxLength: 20
          description: |
            金融機関名
        contract_bank_name_kana:
          type: string
          minLength: 1
          maxLength: 100
          description: |
            金融機関名カナ
        contract_bank_code:
          type: string
          minLength: 4
          maxLength: 4
          description: |
            金融機関コード
        contract_branch_code:
          type: string
          minLength: 3
          maxLength: 3
          description: |
            支店コード
        contract_branch_name:
          type: string
          minLength: 1
          maxLength: 20
          description: |
            支店名
        contract_branch_name_kana:
          type: string
          minLength: 1
          maxLength: 100
          description: |
            支店名カナ
        contract_account_kind:
          type: number
          enum:
            - 0
            - 1
          description: |
            口座種別

            - `0`: 普通
            - `1`: 当座
        contract_account_number:
          type: string
          minLength: 1
          maxLength: 7
          description: |
            口座番号
        contract_account_name:
          type: string
          minLength: 1
          maxLength: 16
          description: |
            口座名義カナ
    BuyerContractDetailInfo:
      type: object
      properties:
        buyer_id:
          allOf:
            - $ref: '#/components/schemas/buyer_id'
          description: |
            バイヤーID
        status_code:
          allOf:
            - $ref: '#/components/schemas/ContractStatus'
        create_date:
          type: string
          example: 2021/01/01
          description: |
            ショップを作成したユーザーの登録日

            形式：`yyyy/MM/dd`
        contracted_at:
          type: string
          nullable: true
          example: 2021/01/01
          description: |
            本番環境申請日 
            形式：`yyyy/MM/dd`
        start_charging_at:
          type: string
          nullable: true
          example: 2021/01/01
          description: |
            初回登録完了日
             形式：`yyyy/MM/dd`
        expired_at:
          type: string
          nullable: true
          example: 2021/01/01
          description: |
            解約日
             形式：`yyyy/MM/dd`
        denied_at:
          type: string
          nullable: true
          example: 2021/01/01
          description: |
            契約不成立日(審査NG日)
             形式：`yyyy/MM/dd`
        register_mail:
          type: string
          minLength: 3
          maxLength: 254
          nullable: true
          description: |
            登録メールアドレス
        buyer_shop_type:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/BuyerShopType'
        buyer_platform_id:
          allOf:
            - $ref: '#/components/schemas/buyer_platform_id'
        buyer_platform_name:
          type: string
          minLength: 1
          maxLength: 100
          nullable: true
          description: |
            バイヤープラットフォーム名
        buyer_platform_examination_status_code:
          type: number
          enum:
            - 1101
            - 1104
            - 1105
          nullable: true
          example: 1101
          description: |
            バイヤープラットフォームステータス

            - null：審査前
            - 1101：審査中
            - 1104：審査OK
            - 1105：登録完了
        buyer_contract_detail:
          allOf:
            - $ref: '#/components/schemas/BuyerContractDetail'
          description: |
            契約情報\
            \
            fincodeに登録されているバイヤーの契約情報の詳細
        buyer_examination:
          type: array
          items:
            type: object
            properties:
              examination_master_id:
                type: integer
                example: 1
                description: |
                  審査マスタID\
                  審査項目を識別するID
              status_code:
                type: number
                example: 1
                description: |
                  審査状況

                  - 1：審査中
                  - 2：審査OK
                  - 3：審査NG
              cut_over_at:
                type: string
                nullable: true
                example: 2021/01/01
                description: |
                  CO日

                  形式：`yyyy/MM/dd`
          description: |
            審査情報\
            \
            決済事業者ごとの審査状況を配列に格納しています。\
            ある決済手段について審査が開始されていない場合、その決済手段に対応する`examination_master_id`をもつオブジェクトは配列中に存在しません。
        business_operator:
          allOf:
            - $ref: '#/components/schemas/BusinessOperator'
          description: |
            事業者情報\
            \
            fincodeに登録されているバイヤーの事業者情報の詳細
        business_operator_bank_account_info:
          allOf:
            - $ref: '#/components/schemas/BusinessOperatorBuyerBankAccountInfo'
          description: |
            事業者銀行口座情報\
            \
            fincodeに登録されているバイヤーの銀行口座情報の詳細
        buyer_contract_bank_account:
          allOf:
            - $ref: '#/components/schemas/BuyerContractBankAccountInfo'
          description: |
            バイヤー入金銀行口座情報\
            \
            fincodeに登録されているバイヤーの入金銀行口座情報の詳細
    BuyerContracts.Retrieving.Response:
      allOf:
        - $ref: '#/components/schemas/BuyerContractDetailInfo'
    POST.BuyerContractsExaminations.Request:
      type: object
      properties:
        buyer_id:
          allOf:
            - $ref: '#/components/schemas/buyer_id'
        force_credit_check_skip:
          type: boolean
          description: |
            信用情報チェックを強制的にスキップする。

            - `true`: 審査管理画面から強制OKをする場合のみ
            - `false`: 本番環境申請時
      required:
        - buyer_id
        - force_credit_check_skip
    POST.BuyerContractsExaminations:
      type: object
      properties:
        buyer_id:
          allOf:
            - $ref: '#/components/schemas/buyer_id'
          description: |
            バイヤーID\
            \
            審査申請を行うバイヤーID
        status_code:
          type: number
          enum:
            - 1
            - 2
            - 3
          example: 1
          description: |
            申請ステータス

            - `1`: OK<br /><span class="smallText">申請が完了しました。審査を行います。</span>
            - `2`: NG<br /><span class="smallText">fincodeの利用が認められませんでした。</span>
            - `3`: 保留<br /><span class="smallText">申請は完了しており、審査は継続して行われます。</span>
    POST.BuyerContractsExaminations.Response:
      allOf:
        - $ref: '#/components/schemas/POST.BuyerContractsExaminations'
    corporate_number:
      type: string
      nullable: true
      minLength: 13
      maxLength: 13
      example: '1234567890123'
      description: |
        法人番号
    BuyerCorporateInfo:
      type: object
      properties:
        invoice_registration_number:
          type: string
          nullable: true
          minLength: 14
          maxLength: 14
          example: '1234567890123'
          description: |
            インボイス登録番号
        corporate_name:
          type: string
          minLength: 1
          maxLength: 150
          example: サンプル株式会社
          description: |
            法人名
        corporate_name_kana:
          type: string
          minLength: 1
          maxLength: 150
          example: サンプルカブシキガイシャ
          description: |
            法人名（カナ）
        hp:
          type: string
          minLength: 1
          maxLength: 300
          nullable: true
          example: https://www.sample-corp.example.com
          description: |
            企業サイトURL
        company_postal_code:
          type: string
          nullable: true
          minLength: 8
          maxLength: 8
          example: 123-4567
          description: |
            会社住所 郵便番号\
            形式： 半角数字（ハイフンあり）
        company_prefecture:
          type: string
          nullable: true
          minLength: 3
          maxLength: 4
          example: 東京都
          description: |
            会社住所 都道府県\
            形式： 漢字
        company_prefecture_kana:
          type: string
          nullable: true
          minLength: 1
          maxLength: 50
          example: トウキョウト
          description: |
            会社住所 都道府県（カナ）\
            形式： 全角カタカナ
        company_address_municipality:
          type: string
          nullable: true
          minLength: 1
          maxLength: 50
          example: 渋谷区
          description: |
            会社住所 市区町村\
            形式： 漢字/ひらがな/カタカナ/半角英数
        company_address_municipality_kana:
          type: string
          nullable: true
          minLength: 1
          maxLength: 100
          example: シブヤク
          description: |
            会社住所 市区町村（カナ）\
            形式： 全角カタカナ
        company_address_section:
          type: string
          nullable: true
          minLength: 1
          maxLength: 50
          example: 道玄坂
          description: |
            会社住所 町域\
            形式： 漢字/ひらがな/カタカナ/半角英数
        company_address_section_kana:
          type: string
          nullable: true
          minLength: 1
          maxLength: 100
          example: ドウゲンザカ
          description: |
            会社住所 町域（カナ）\
            形式： 全角カタカナ
        company_address_chrome:
          type: string
          nullable: true
          minLength: 1
          maxLength: 50
          example: 1-2-3
          description: |
            会社住所 番地\
            形式： 漢字/ひらがな/カタカナ/半角英数
        company_address_chrome_kana:
          type: string
          nullable: true
          minLength: 1
          maxLength: 100
          example: イチニサン
          description: |
            会社住所 番地（カナ）\
            形式： 全角カタカナ
        company_address_building_name:
          type: string
          nullable: true
          minLength: 1
          maxLength: 100
          example: サンプルビル
          description: |
            会社住所 ビル名\
            形式： 漢字/ひらがな/カタカナ/半角英数
        company_address_building_name_kana:
          type: string
          nullable: true
          minLength: 1
          maxLength: 100
          example: サンプルビル
          description: |
            会社住所 ビル名（カナ）\
            形式： 全角カタカナ
        company_tel:
          type: string
          nullable: true
          minLength: 1
          maxLength: 15
          example: '0312345678'
          description: |
            会社情報 電話番号\
            形式： 半角数字（ハイフンなし）
    BuyerContractInfo:
      type: object
      properties:
        representative_last_name:
          type: string
          minLength: 1
          maxLength: 20
          nullable: true
          example: 山田
          description: |
            代表者 姓
            形式： 漢字/ひらがな/カタカナ/半角英字
        representative_last_name_kana:
          type: string
          minLength: 1
          maxLength: 20
          nullable: true
          example: ヤマダ
          description: |
            代表者 姓（カナ）\
            形式： 全角カナ
        representative_first_name:
          type: string
          minLength: 1
          maxLength: 20
          nullable: true
          example: 太郎
          description: |
            代表者 名\
            形式： 漢字/ひらがな/カタカナ/半角英字
        representative_first_name_kana:
          type: string
          minLength: 1
          maxLength: 20
          nullable: true
          example: タロウ
          description: |
            代表者 名（カナ）\
            形式： 全角カナ
        representative_postal_code:
          type: string
          pattern: ^\d{3}-\d{4}$
          nullable: true
          minLength: 8
          maxLength: 8
          example: 150-0043
          description: |
            代表者 住所 郵便番号\
            形式：`xxx-xxxx`
        representative_prefecture:
          type: string
          minLength: 3
          maxLength: 4
          nullable: true
          example: 東京都
          description: |
            代表者 住所 都道府県\
            形式： 漢字
        representative_prefecture_kana:
          type: string
          minLength: 1
          maxLength: 50
          nullable: true
          example: トウキョウト
          description: |
            代表者 住所 都道府県（カナ）\
            形式： 全角カナ
        representative_address_municipality:
          type: string
          minLength: 1
          maxLength: 50
          nullable: true
          example: 渋谷区
          description: |
            代表者 住所 市区町村\
            形式： 漢字/ひらがな/カタカナ/半角英数
        representative_address_municipality_kana:
          type: string
          minLength: 1
          maxLength: 100
          nullable: true
          example: シブヤク
          description: |
            代表者 住所 市区町村（カナ）\
            形式： 全角カナ
        representative_address_section:
          type: string
          minLength: 1
          maxLength: 50
          nullable: true
          example: 道玄坂
          description: |
            代表者 住所 町域\
            形式： 漢字/ひらがな/カタカナ/半角英数
        representative_address_section_kana:
          type: string
          minLength: 1
          maxLength: 100
          nullable: true
          example: ドウゲンザカ
          description: |
            代表者 住所 町域（カナ）\
            形式： 全角カナ
        representative_address_chrome:
          type: string
          minLength: 1
          maxLength: 50
          nullable: true
          example: 1-14-6
          description: |
            代表者 住所 番地\
            形式： 漢字/ひらがな/カタカナ/半角英数
        representative_address_chrome_kana:
          type: string
          minLength: 1
          maxLength: 100
          nullable: true
          example: 1-14-6
          description: |
            代表者 住所 番地（カナ）
        representative_address_building_name:
          type: string
          minLength: 1
          maxLength: 100
          nullable: true
          example: ヒューマックス渋谷ビル 7F
          description: |
            代表者 住所 建物名\
            形式： 漢字/ひらがな/カタカナ/半角英数
        representative_address_building_name_kana:
          type: string
          minLength: 1
          maxLength: 100
          nullable: true
          example: ヒューマックスシブヤビル ナナカイ
          description: |
            代表者 住所 建物名（カナ）\
            形式： 全角カナ
        representative_tel:
          type: string
          minLength: 1
          maxLength: 15
          pattern: ^\d{1,15}$
          nullable: true
          example: '0364330000'
          description: |
            代表者 電話番号\
            形式： 半角数字（ハイフンなし、PHS番号不可）
        representative_birthday:
          type: string
          pattern: ^\d{4}/\d{2}/\d{2}$
          nullable: true
          example: 1980/01/01
          description: |
            代表者 生年月日\
            \
            形式：`yyyy/MM/dd`
        staff1_last_name:
          type: string
          minLength: 1
          maxLength: 20
          nullable: true
          example: 鈴木
          description: |
            担当者1 姓\
            形式： 漢字/ひらがな/カタカナ/半角英字\
            \
            fincodeは担当者1,2宛てに審査結果の通知や審査保留対応の連絡などを行います。
        staff1_last_name_kana:
          type: string
          minLength: 1
          maxLength: 20
          nullable: true
          example: スズキ
          description: |
            担当者1 姓（カナ）\
            形式： 全角カナ
        staff1_first_name:
          type: string
          minLength: 1
          maxLength: 20
          nullable: true
          example: 次郎
          description: |
            担当者1 名\
            形式： 漢字/ひらがな/カタカナ/半角英字
        staff1_first_name_kana:
          type: string
          minLength: 1
          maxLength: 20
          nullable: true
          example: ジロウ
          description: |
            担当者1 名（カナ）\
            形式： 全角カナ
        staff1_company_name:
          type: string
          minLength: 1
          maxLength: 150
          nullable: true
          example: サンプル株式会社
          description: |
            担当者1 会社名\
            形式： 漢字/ひらがな/カタカナ/半角英数
        staff1_belongs:
          type: string
          minLength: 1
          maxLength: 50
          nullable: true
          example: EC事業部
          description: |
            担当者1 部署名\
            形式： 漢字/ひらがな/カタカナ/半角英数
        staff1_tel:
          type: string
          minLength: 1
          maxLength: 15
          pattern: ^\d{1,15}$
          nullable: true
          example: '09000000000'
          description: |
            担当者1 電話番号\
            形式： 半角数字（ハイフンなし、PHS番号不可）
        staff1_mail:
          type: string
          minLength: 1
          maxLength: 254
          format: email
          nullable: true
          example: staff-1@example.com
          description: |
            担当者1 メールアドレス\
            形式： RFC 5322
        corporate:
          type: boolean
          nullable: true
          example: true
          description: |
            事業形態

            - `true`: 法人
            - `false`: 個人事業主
        expect_usage_amount:
          type: string
          nullable: true
          example: '1000000'
          description: |
            月間想定利用額
        corporate_info:
          allOf:
            - $ref: '#/components/schemas/BuyerCorporateInfo'
          nullable: true
          description: |
            法人情報
            \
            `corporate`が`true`のとき必須
    BuyerExaminationInfo:
      type: object
      properties:
        buyer_id:
          allOf:
            - $ref: '#/components/schemas/buyer_id'
          description: |
            バイヤーID
        corporate_number:
          allOf:
            - $ref: '#/components/schemas/corporate_number'
          description: |
            法人番号
        status_code:
          allOf:
            - $ref: '#/components/schemas/ContractStatus'
        contract_info:
          allOf:
            - $ref: '#/components/schemas/BuyerContractInfo'
          description: |
            契約情報\
            \
            fincodeに登録されているバイヤーの契約情報の詳細
        business_operator_bank_account_info:
          allOf:
            - $ref: '#/components/schemas/BusinessOperatorBuyerBankAccountInfo'
          description: |
            事業者口座情報
    BuyerExaminationInfo.Retrieving.Response:
      allOf:
        - $ref: '#/components/schemas/BuyerExaminationInfo'
    BuyerCorporateInfo.PUT:
      type: object
      properties:
        invoice_registration_number:
          type: string
          nullable: true
          minLength: 14
          maxLength: 14
          example: '1234567890123'
          description: |
            インボイス登録番号
        corporate_name:
          type: string
          minLength: 1
          maxLength: 150
          example: サンプル株式会社
          description: |
            法人名
        corporate_name_kana:
          type: string
          minLength: 1
          maxLength: 150
          example: サンプルカブシキガイシャ
          description: |
            法人名（カナ）
        hp:
          type: string
          minLength: 1
          maxLength: 300
          nullable: true
          example: https://www.sample-corp.example.com
          description: |
            企業サイトURL
        company_postal_code:
          type: string
          nullable: true
          minLength: 8
          maxLength: 8
          example: 123-4567
          description: |
            会社住所 郵便番号\
            形式： 半角数字（ハイフンあり）
        company_prefecture:
          type: string
          nullable: true
          minLength: 3
          maxLength: 4
          example: 東京都
          description: |
            会社住所 都道府県\
            形式： 漢字
        company_prefecture_kana:
          type: string
          nullable: true
          minLength: 1
          maxLength: 6
          example: トウキョウト
          description: |
            会社住所 都道府県（カナ）\
            形式： 全角カタカナ
        company_address_municipality:
          type: string
          nullable: true
          minLength: 1
          maxLength: 50
          example: 渋谷区
          description: |
            会社住所 市区町村\
            形式： 漢字/ひらがな/カタカナ/半角英数
        company_address_municipality_kana:
          type: string
          nullable: true
          minLength: 1
          maxLength: 100
          example: シブヤク
          description: |
            会社住所 市区町村（カナ）\
            形式： 全角カタカナ
        company_address_section:
          type: string
          nullable: true
          minLength: 1
          maxLength: 50
          example: 道玄坂
          description: |
            会社住所 町域\
            形式： 漢字/ひらがな/カタカナ/半角英数
        company_address_section_kana:
          type: string
          nullable: true
          minLength: 1
          maxLength: 100
          example: ドウゲンザカ
          description: |
            会社住所 町域（カナ）\
            形式： 全角カタカナ
        company_address_chrome:
          type: string
          nullable: true
          minLength: 1
          maxLength: 100
          example: 1-2-3
          description: |
            会社住所 番地\
            形式： 漢字/ひらがな/カタカナ/半角英数
        company_address_chrome_kana:
          type: string
          nullable: true
          minLength: 1
          maxLength: 100
          example: イチニサン
          description: |
            会社住所 番地（カナ）\
            形式： 全角カタカナ
        company_address_building_name:
          type: string
          nullable: true
          minLength: 1
          maxLength: 100
          example: サンプルビル
          description: |
            会社住所 ビル名\
            形式： 漢字/ひらがな/カタカナ/半角英数
        company_address_building_name_kana:
          type: string
          nullable: true
          minLength: 1
          maxLength: 100
          example: サンプルビル
          description: |
            会社住所 ビル名（カナ）\
            形式： 全角カタカナ
        company_tel:
          type: string
          nullable: true
          minLength: 1
          maxLength: 15
          example: '0312345678'
          description: |
            会社情報 電話番号\
            形式： 半角数字（ハイフンなし）
      required:
        - company_tel
        - corporate_name_kana
        - company_prefecture_kana
        - company_address_municipality_kana
        - company_address_section_kana
        - company_address_chrome_kana
    BuyerContractInfo.PUT:
      type: object
      properties:
        representative_last_name:
          type: string
          minLength: 1
          maxLength: 20
          nullable: true
          example: 山田
          description: |
            代表者 姓
            形式： 漢字/ひらがな/カタカナ/半角英字
        representative_last_name_kana:
          type: string
          minLength: 1
          maxLength: 20
          nullable: true
          example: ヤマダ
          description: |
            代表者 姓（カナ）\
            形式： 全角カナ
        representative_first_name:
          type: string
          minLength: 1
          maxLength: 20
          nullable: true
          example: 太郎
          description: |
            代表者 名\
            形式： 漢字/ひらがな/カタカナ/半角英字
        representative_first_name_kana:
          type: string
          minLength: 1
          maxLength: 20
          nullable: true
          example: タロウ
          description: |
            代表者 名（カナ）\
            形式： 全角カナ
        representative_postal_code:
          type: string
          pattern: ^\d{3}-\d{4}$
          nullable: true
          minLength: 8
          maxLength: 8
          example: 150-0043
          description: |
            代表者 住所 郵便番号\
            形式：`xxx-xxxx`
        representative_prefecture:
          type: string
          minLength: 1
          maxLength: 4
          nullable: true
          example: 東京都
          description: |
            代表者 住所 都道府県\
            形式： 漢字
        representative_prefecture_kana:
          type: string
          minLength: 1
          maxLength: 6
          nullable: true
          example: トウキョウト
          description: |
            代表者 住所 都道府県（カナ）\
            形式： 全角カナ
        representative_address_municipality:
          type: string
          minLength: 1
          maxLength: 50
          nullable: true
          example: 渋谷区
          description: |
            代表者 住所 市区町村\
            形式： 漢字/ひらがな/カタカナ/半角英数
        representative_address_municipality_kana:
          type: string
          minLength: 1
          maxLength: 100
          nullable: true
          example: シブヤク
          description: |
            代表者 住所 市区町村（カナ）\
            形式： 全角カナ
        representative_address_section:
          type: string
          minLength: 1
          maxLength: 50
          nullable: true
          example: 道玄坂
          description: |
            代表者 住所 町域\
            形式： 漢字/ひらがな/カタカナ/半角英数
        representative_address_section_kana:
          type: string
          minLength: 1
          maxLength: 100
          nullable: true
          example: ドウゲンザカ
          description: |
            代表者 住所 町域（カナ）\
            形式： 全角カナ
        representative_address_chrome:
          type: string
          minLength: 1
          maxLength: 50
          nullable: true
          example: 1-14-6
          description: |
            代表者 住所 番地\
            形式： 漢字/ひらがな/カタカナ/半角英数
        representative_address_chrome_kana:
          type: string
          minLength: 1
          maxLength: 100
          nullable: true
          example: 1-14-6
          description: |
            代表者 住所 番地（カナ）
        representative_address_building_name:
          type: string
          minLength: 1
          maxLength: 100
          nullable: true
          example: ヒューマックス渋谷ビル 7F
          description: |
            代表者 住所 建物名\
            形式： 漢字/ひらがな/カタカナ/半角英数
        representative_address_building_name_kana:
          type: string
          minLength: 1
          maxLength: 100
          nullable: true
          example: ヒューマックスシブヤビル ナナカイ
          description: |
            代表者 住所 建物名（カナ）\
            形式： 全角カナ
        representative_tel:
          type: string
          minLength: 1
          maxLength: 15
          pattern: ^\d{1,15}$
          nullable: true
          example: '0364330000'
          description: |
            代表者 電話番号\
            形式： 半角数字（ハイフンなし、PHS番号不可）
        representative_birthday:
          type: string
          pattern: ^\d{4}/\d{2}/\d{2}$
          nullable: true
          example: 1980/01/01
          description: |
            代表者 生年月日\
            \
            形式：`yyyy/MM/dd`
        staff1_last_name:
          type: string
          minLength: 1
          maxLength: 20
          nullable: true
          example: 鈴木
          description: |
            担当者1 姓\
            形式： 漢字/ひらがな/カタカナ/半角英字\
            \
            fincodeは担当者1,2宛てに審査結果の通知や審査保留対応の連絡などを行います。
        staff1_last_name_kana:
          type: string
          minLength: 1
          maxLength: 20
          nullable: true
          example: スズキ
          description: |
            担当者1 姓（カナ）\
            形式： 全角カナ
        staff1_first_name:
          type: string
          minLength: 1
          maxLength: 20
          nullable: true
          example: 次郎
          description: |
            担当者1 名\
            形式： 漢字/ひらがな/カタカナ/半角英字
        staff1_first_name_kana:
          type: string
          minLength: 1
          maxLength: 20
          nullable: true
          example: ジロウ
          description: |
            担当者1 名（カナ）\
            形式： 全角カナ
        staff1_company_name:
          type: string
          minLength: 1
          maxLength: 150
          nullable: true
          example: サンプル株式会社
          description: |
            担当者1 会社名\
            形式： 漢字/ひらがな/カタカナ/半角英数
        staff1_belongs:
          type: string
          minLength: 1
          maxLength: 50
          nullable: true
          example: EC事業部
          description: |
            担当者1 部署名\
            形式： 漢字/ひらがな/カタカナ/半角英数
        staff1_tel:
          type: string
          minLength: 1
          maxLength: 15
          pattern: ^\d{1,15}$
          nullable: true
          example: '09000000000'
          description: |
            担当者1 電話番号\
            形式： 半角数字（ハイフンなし、PHS番号不可）
        staff1_mail:
          type: string
          minLength: 1
          maxLength: 254
          format: email
          nullable: true
          example: staff-1@example.com
          description: |
            担当者1 メールアドレス\
            形式： RFC 5322
        corporate:
          type: boolean
          nullable: true
          example: true
          description: |
            事業形態

            - `true`: 法人
            - `false`: 個人事業主
        expect_usage_amount:
          type: string
          nullable: true
          example: 1000000
          description: |
            月間想定利用額
        corporate_info:
          allOf:
            - $ref: '#/components/schemas/BuyerCorporateInfo.PUT'
          nullable: true
          description: |
            法人情報
            \
            `corporate`が`true`のとき必須
      required:
        - representative_last_name
        - representative_last_name_kana
        - representative_first_name
        - representative_first_name_kana
        - representative_birthday
        - staff1_last_name
        - staff1_last_name_kana
        - staff1_first_name
        - staff1_first_name_kana
        - staff1_company_name
        - staff1_tel
        - staff1_mail
        - corporate
    BusinessOperatorBuyerBankAccountInfo.PUT:
      type: object
      properties:
        bank_code:
          type: string
          minLength: 4
          maxLength: 4
          example: '0001'
          description: |
            金融機関コード
        branch_code:
          type: string
          minLength: 3
          maxLength: 3
          example: '001'
          description: |
            支店コード
        account_kind:
          type: number
          enum:
            - 0
            - 1
          example: 0
          description: |
            口座種別

            - `0`: 普通
            - `1`: 当座
        account_number:
          type: string
          minLength: 1
          maxLength: 7
          example: '1234567'
          description: |
            口座番号
        account_name:
          type: string
          minLength: 1
          maxLength: 16
          example: ヤマダ タロウ
          description: |
            口座名義カナ
      required:
        - bank_code
        - branch_code
        - account_kind
        - account_number
    BuyerExaminationInfo.Updating.Request:
      type: object
      properties:
        corporate_number:
          type: string
          nullable: false
          minLength: 13
          maxLength: 13
          example: '1234567890123'
          description: |
            法人番号
        contract_info:
          allOf:
            - $ref: '#/components/schemas/BuyerContractInfo.PUT'
          description: |
            契約情報\
            \
            fincodeに登録するバイヤー運営事業者の契約情報の詳細
        business_operator_bank_account_info:
          allOf:
            - $ref: '#/components/schemas/BusinessOperatorBuyerBankAccountInfo.PUT'
          description: |
            事業者口座情報\
            \
            fincodeに登録する事業者の銀行口座情報の詳細
      required:
        - corporate_number
    BuyerExaminationInfo.Updating.Response:
      allOf:
        - $ref: '#/components/schemas/BuyerExaminationInfo'
    BuyerPlatformAccount.ListItem:
      type: object
      description: バイヤープラットフォーム報酬 一覧項目
      properties:
        id:
          type: string
          description: プラットフォーム報酬ID
          example: sales_bp_25062553595_250829_001
        buyer_account_id:
          type: string
          description: 精算ID
          example: '00000000000000000001'
        buyer_id:
          type: string
          description: バイヤーID
          example: b_00000000001
        aggregate_term_start:
          type: string
          description: |
            集計対象期間（開始）
            形式： `yyyy/MM/dd HH:mm:ss.SSS`
          example: 2025/12/01 00:00:00.000
        aggregate_term_end:
          type: string
          description: |
            集計対象期間（終了）
            形式： `yyyy/MM/dd HH:mm:ss.SSS`
          example: 2025/12/31 23:59:59.999
        scheduled_deposit_date:
          type: string
          description: |
            入金予定日
            形式： `yyyy/MM/dd HH:mm:ss.SSS`
          example: 2025/12/09 08:50:01.424
        deposit_date:
          type: string
          nullable: true
          description: |
            入金日
            形式： `yyyy/MM/dd HH:mm:ss.SSS`
            未入金の場合は `null`。
          example: 2025/12/03 08:50:01.424
        status_code:
          type: integer
          description: |
            ステータスコード

            - `3001`: 集計中
            - `3002`: 集計済
            - `3003`: 入金待ち
            - `3004`: 入金済
            - `3005`: 入金失敗
            - `3011`: 取消
            - `3013`: 保留
          example: 3003
        count:
          type: integer
          description: 対象取引件数
          example: 30
        total_amount:
          type: number
          description: 取引総額
          example: 400000
        platform_provision_fee_amount:
          type: number
          description: 請求書書面上の請求金額
          example: 30000
        platform_provision_fee_tax_amount:
          type: number
          description: プラットフォーム提供料消費税
          example: 3000
        platform_kickback_fee_amount:
          type: number
          description: プラットフォーム還元額
          example: 100000
        platform_kickback_fee_tax_amount:
          type: number
          description: プラットフォーム還元額消費税
          example: 10000
        deposit_amount:
          type: number
          description: 入金金額
          example: 143000
        created:
          type: string
          description: |
            登録日時
            形式： `yyyy/MM/dd HH:mm:ss.SSS`
          example: 2023/11/09 08:50:01.424
        updated:
          type: string
          description: |
            更新日時
            形式： `yyyy/MM/dd HH:mm:ss.SSS`
          example: 2023/11/09 10:10:01.424
    BuyerPlatformAccount.list:
      type: object
      properties:
        list:
          type: array
          description: |
            データリスト
            検索結果が0件の場合、空のリストを返却します。
          items:
            $ref: '#/components/schemas/BuyerPlatformAccount.ListItem'
    BuyerPlatformAccount.ListRetrieving.Response:
      allOf:
        - $ref: '#/components/schemas/_ListResponse'
        - $ref: '#/components/schemas/BuyerPlatformAccount.list'
    BuyerDepositDestinationHistory:
      type: object
      description: 入金先口座情報
      properties:
        recipient_corporate_name:
          type: string
          description: 入金先法人名
          example: 入金先法人名
        recipient_representative_last_name:
          type: string
          description: 入金先代表者姓
          example: 代表者姓
        recipient_representative_first_name:
          type: string
          description: 入金先代表者名
          example: 代表者名
        bank_name:
          type: string
          description: 金融機関名
          example: 金融機関名
        bank_name_kana:
          type: string
          description: 金融機関名（カナ）
          example: キンユウキカンメイ
        bank_code:
          type: string
          description: 金融機関コード
          example: '0001'
        branch_name:
          type: string
          description: 支店名
          example: 支店名
        branch_name_kana:
          type: string
          description: 支店名（カナ）
          example: シテンメイ
        branch_code:
          type: string
          description: 支店コード
          example: '1000'
        account_kind:
          type: integer
          description: |
            預金種別

            - `0`: 普通
            - `1`: 当座
          example: 0
        account_number:
          type: string
          description: 口座番号
          example: '1234567'
        account_name:
          type: string
          description: 口座名義
          example: 口座名義
    BuyerPlatformAccount.Detail:
      type: object
      description: バイヤープラットフォーム報酬 詳細
      properties:
        id:
          type: string
          description: プラットフォーム報酬ID
          example: sales_bp_25062553595_250829_000
        buyer_account_id:
          type: string
          description: 精算ID
          example: '00000000000000000000'
        buyer_id:
          type: string
          description: バイヤーID
          example: b_000000000000
        aggregate_term_start:
          type: string
          description: |
            集計対象期間（開始）
            形式： `yyyy/MM/dd HH:mm:ss.SSS`
          example: 2025/12/01 00:00:00.000
        aggregate_term_end:
          type: string
          description: |
            集計対象期間（終了）
            形式： `yyyy/MM/dd HH:mm:ss.SSS`
          example: 2025/12/31 23:59:59.999
        scheduled_deposit_date:
          type: string
          description: |
            入金予定日
            形式： `yyyy/MM/dd HH:mm:ss.SSS`
          example: 2025/12/09 08:50:01.424
        deposit_date:
          type: string
          nullable: true
          description: |
            入金日
            形式： `yyyy/MM/dd HH:mm:ss.SSS`
            未入金の場合は `null`。
          example: 2025/12/03 08:50:01.424
        status_code:
          type: integer
          description: |
            ステータスコード

            - `3001`: 集計中
            - `3002`: 集計済
            - `3003`: 入金待ち
            - `3004`: 入金済
            - `3005`: 入金失敗
            - `3011`: 取消
            - `3013`: 保留
          example: 3003
        count:
          type: integer
          description: 対象取引件数
          example: 30
        total_amount:
          type: number
          description: 取引総額
          example: 400000
        platform_provision_fee_amount:
          type: number
          description: 請求書書面上の請求金額
          example: 1000000
        platform_provision_fee_tax_amount:
          type: number
          description: プラットフォーム提供料消費税
          example: 30000
        platform_kickback_fee_amount:
          type: number
          description: プラットフォーム還元額
          example: 30000
        platform_kickback_fee_tax_amount:
          type: number
          description: プラットフォーム還元額消費税
          example: 3000
        platform_kickback_fee_tax_rate:
          type: number
          description: プラットフォーム還元額消費税率（%）
          example: 10
        deposit_amount:
          type: number
          description: 入金金額
          example: 33000
        created:
          type: string
          description: |
            登録日時
            形式： `yyyy/MM/dd HH:mm:ss.SSS`
          example: 2023/11/09 08:50:01.424
        updated:
          type: string
          description: |
            更新日時
            形式： `yyyy/MM/dd HH:mm:ss.SSS`
          example: 2023/11/09 10:10:01.424
        buyer_deposit_destination_history:
          allOf:
            - $ref: '#/components/schemas/BuyerDepositDestinationHistory'
          description: 入金先口座情報
    FincodeEventForBuyerPlatform:
      type: string
      enum:
        - business_payments.regist
        - business_payments.exec
        - business_payments.update
        - buyer.contracts.status_code.updated
      minLength: 1
      maxLength: 40
      example: business_payments.regist
      description: |
        Webhook通知 トリガーイベント
    WebhookSettingBuyerPlatform:
      type: object
      properties:
        id:
          type: string
          minLength: 1
          maxLength: 50
          example: w_*********************
          description: |
            Webhook設定ID
        url:
          type: string
          format: uri
          example: https://your-service.example.com/webhook-receiver
          description: |
            Webhook通知先 URL\
            \
            Webhookの通知先URLを指定します。\
            fincodeのWebhookはHTTPS通信かつ443ポートでのみ受信可能です。
        event:
          allOf:
            - $ref: '#/components/schemas/FincodeEventForBuyerPlatform'
        signature:
          type: string
          minLength: 1
          maxLength: 60
          example: WEBHOOK_FROM_FINCODE
          description: |
            署名\
            \
            このWebhookがfincodeから送信されたことを確認するための署名です。\
            fincodeからのWebhook通知において`Fincode-Signature`ヘッダーにこの値が含まれます。
        created:
          nullable: false
          allOf:
            - $ref: '#/components/schemas/created'
        updated:
          nullable: false
          allOf:
            - $ref: '#/components/schemas/updated'
    WebhookSettingBuyerPlatform.list:
      type: object
      properties:
        list:
          type: array
          items:
            $ref: '#/components/schemas/WebhookSettingBuyerPlatform'
    WebhookSetting_properties-id:
      type: string
      minLength: 1
      maxLength: 50
      example: w_*********************
      description: |
        Webhook設定ID
    url:
      type: string
      format: uri
      example: https://your-service.example.com/webhook-receiver
      description: |
        Webhook通知先 URL\
        \
        Webhookの通知先URLを指定します。\
        fincodeのWebhookはHTTPS通信かつ443ポートでのみ受信可能です。
    signature:
      type: string
      minLength: 1
      maxLength: 60
      example: WEBHOOK_FROM_FINCODE
      description: |
        署名\
        \
        このWebhookがfincodeから送信されたことを確認するための署名です。\
        fincodeからのWebhook通知において`Fincode-Signature`ヘッダーにこの値が含まれます。
    WebhookSettingBuyerPlatform.Creating.Request:
      type: object
      properties:
        id:
          allOf:
            - $ref: '#/components/schemas/WebhookSetting_properties-id'
        url:
          allOf:
            - $ref: '#/components/schemas/url'
        event:
          allOf:
            - $ref: '#/components/schemas/FincodeEventForBuyerPlatform'
        signature:
          allOf:
            - $ref: '#/components/schemas/signature'
      required:
        - event
    WebhookSettingId_schema:
      type: string
      example: w_**********************
    WebhookSettingBuyerPlatform.Updating.Request:
      type: object
      properties:
        url:
          allOf:
            - $ref: '#/components/schemas/url'
        event:
          allOf:
            - $ref: '#/components/schemas/FincodeEventForBuyerPlatform'
        signature:
          allOf:
            - $ref: '#/components/schemas/signature'
    delete_flag:
      type: string
      enum:
        - '1'
        - '0'
      example: '1'
      description: 削除フラグ
    WebhookSetting.Deleting.Response:
      type: object
      properties:
        id:
          allOf:
            - $ref: '#/components/schemas/WebhookSetting_properties-id'
          description: 削除されたWebhook設定のID
        delete_flag:
          allOf:
            - $ref: '#/components/schemas/delete_flag'
    BusinessPaymentStatus:
      type: string
      enum:
        - DRAFT
        - REVIEWING
        - REVIEW_NG
        - PAYING
        - FAILED
        - PAID
        - EXPIRED
        - CANCELED
        - DELETED
      minLength: 1
      maxLength: 40
      example: business_payments.regist
      description: |
        ステータス。
        - `DRAFT`:下書き
        - `REVIEWING`:審査中
        - `REVIEW_NG`:審査NG
        - `PAYING`:支払い中
        - `FAILED`:失敗
        - `PAID`:支払い完了
        - `EXPIRED`:期限切れ
        - `CANCELED`:キャンセル済
        - `DELETED`:削除
    WebhookEvent.BusinessPaymentsRegister:
      type: object
      properties:
        buyer_shop_id:
          allOf:
            - $ref: '#/components/schemas/buyer_id'
        event:
          allOf:
            - $ref: '#/components/schemas/FincodeEventForBuyerPlatform'
        access_id:
          type: string
          example: bp_8og75dSNQgOLbxxxxxxxxx
          description: |
            取引ID
        billing_amount:
          type: number
          description: |
            請求金額
          example: 112640
        card_payment_fee:
          type: number
          description: |
            カード払い手数料
          example: 2252
        fee_rate:
          type: number
          description: |
            手数料率
          example: 0.02
        min_fee:
          type: number
          description: |
            最低手数料金額
          example: 1000
        total_amount:
          type: number
          description: |
            合計金額
          example: 114892
        status:
          allOf:
            - $ref: '#/components/schemas/BusinessPaymentStatus'
          example: DRAFT
        process_date:
          type: string
          description: |
            処理日時
          example: 2026/03/02 15:02:16.138
        transaction_id:
          type: string
          description: |
            支払い情報ID
          example: 20260302144529d334a6f4-9181-4fca-b5e1-989dbf069f47
        due_date:
          type: string
          description: |
            支払期日
          example: 2026/04/08
        transfer_exec_date:
          type: string
          description: |
            振込実行日
          example: null
        remitter_name:
          type: string
          description: |
            振込依頼人名
          example: バイヤー
        receipt_id:
          type: string
          description: |
            支払ID。\
            支払管理の支払情報を請求書カード払いする場合に指定します。
          example: null
    WebhookResponse:
      type: object
      properties:
        receive:
          type: string
          minLength: 1
          maxLength: 1
          enum:
            - '0'
            - '1'
          example: '0'
          description: |
            Webhook通知受信\
            \
            Webhookの受信が正常に完了したかどうかをfincodeにレスポンスします。

            - `0`: 受信成功<br /><span class="smallText">fincodeは受信に成功したと判断し、通知を終了します。</span>
            - `1`: 受信失敗<br /><span class="smallText">fincodeは受信に失敗したと判断します。Webhookの受信に失敗した場合は、fincodeはリトライを行います。</span>
    WebhookResponse-plain:
      type: string
      description: |
        - `0`: 受信成功<br /><span class="smallText">fincodeは受信に成功したと判断し、通知を終了します。</span>
        - `1`: 受信失敗<br /><span class="smallText">fincodeは受信に失敗したと判断します。Webhookの受信に失敗した場合は、fincodeはリトライを行います。</span>
      example: 0
    WebhookEvent.BusinessPaymentsExec:
      type: object
      properties:
        buyer_shop_id:
          allOf:
            - $ref: '#/components/schemas/buyer_id'
        event:
          allOf:
            - $ref: '#/components/schemas/FincodeEventForBuyerPlatform'
          example: business_payments.exec
        access_id:
          type: string
          example: bp_8og75dSNQgOLbxxxxxxxxx
          description: |
            取引ID
        billing_amount:
          type: number
          description: |
            請求金額
          example: 112640
        card_payment_fee:
          type: number
          description: |
            カード払い手数料
          example: 2252
        fee_rate:
          type: number
          description: |
            手数料率
          example: 0.02
        min_fee:
          type: number
          description: |
            最低手数料金額
          example: 1000
        total_amount:
          type: number
          description: |
            合計金額
          example: 114892
        status:
          allOf:
            - $ref: '#/components/schemas/BusinessPaymentStatus'
          example: REVIEWING
        process_date:
          type: string
          description: |
            処理日時
          example: 2026/03/02 15:02:16.138
        transaction_id:
          type: string
          description: |
            支払い情報ID
          example: 20260302144529d334a6f4-9181-4fca-b5e1-989dbf069f47
        due_date:
          type: string
          description: |
            支払期日
          example: 2026/04/08
        transfer_exec_date:
          type: string
          description: |
            振込実行日
          example: null
        remitter_name:
          type: string
          description: |
            振込依頼人名
          example: バイヤー
        receipt_id:
          type: string
          description: |
            支払ID。\
            支払管理の支払情報を請求書カード払いする場合に指定します。
          example: null
    WebhookEvent.BusinessPaymentsUpdate:
      type: object
      properties:
        buyer_shop_id:
          allOf:
            - $ref: '#/components/schemas/buyer_id'
        event:
          allOf:
            - $ref: '#/components/schemas/FincodeEventForBuyerPlatform'
          example: business_payments.update
        access_id:
          type: string
          example: bp_8og75dSNQgOLbxxxxxxxxx
          description: |
            取引ID
        billing_amount:
          type: number
          description: |
            請求金額
          example: 112640
        card_payment_fee:
          type: number
          description: |
            カード払い手数料
          example: 2252
        fee_rate:
          type: number
          description: |
            手数料率
          example: 0.02
        min_fee:
          type: number
          description: |
            最低手数料金額
          example: 1000
        total_amount:
          type: number
          description: |
            合計金額
          example: 114892
        status:
          allOf:
            - $ref: '#/components/schemas/BusinessPaymentStatus'
          example: PAID
        process_date:
          type: string
          description: |
            処理日時
          example: 2026/03/02 15:02:16.138
        transaction_id:
          type: string
          description: |
            支払い情報ID
          example: 20260302144529d334a6f4-9181-4fca-b5e1-989dbf069f47
        due_date:
          type: string
          description: |
            支払期日
          example: 2026/04/08
        transfer_exec_date:
          type: string
          description: |
            振込実行日
          example: null
        remitter_name:
          type: string
          description: |
            振込依頼人名
          example: バイヤー
        receipt_id:
          type: string
          description: |
            支払ID。\
            支払管理の支払情報を請求書カード払いする場合に指定します。
          example: null
    AcquirerTenantBuyer:
      type: string
      enum:
        - BPSP
      description: |
        審査対象

        - `BPSP`: 請求書カード払い
      x-ja-description: |
        審査対象（和名）

        - `決済事業者審査: BPSP`
    AcquirerContractStatus:
      type: string
      enum:
        - '701'
        - '702'
        - '703'
        - '704'
        - '705'
        - '706'
        - '707'
        - '708'
        - '709'
      description: |
        決済事業者 契約ステータス

        - `701`: 申込なし<br /><span class="smallText">まだこの決済手段を利用申請していません</span>
        - `702`: 審査受付<br /><span class="smallText">fincodeが審査を受け付けました。まだこの決済手段は利用できません。</span>
        - `703`: 審査待ち<br /><span class="smallText">fincodeによる審査開始を待っています。まだこの決済手段は利用できません。</span>
        - `704`: 審査中<br /><span class="smallText">fincodeによる審査中です。まだこの決済手段は利用できません。</span>
        - `705`: 審査保留中<br /><span class="smallText">審査の過程で保留中が発生しました。まだこの決済手段は利用できません。</span>
        - `706`: 審査OK<br /><span class="smallText">fincodeによる審査の結果OKとなりました。まだこの決済手段は利用できません。</span>
        - `707`: 利用可能<br /><span class="smallText">この決済手段は利用可能です。</span>
        - `708`: 審査NG<br /><span class="smallText">fincodeによる審査の結果NGとなりました。この決済手段は利用できません。</span>
        - `709`: 申込中止<br /><span class="smallText">この決済手段の利用申請を中止しました。</span>
      x-ja-description: |
        決済事業者 契約ステータス（和名）

        - `申込なし`
        - `審査受付`
        - `審査待ち`
        - `審査中`
        - `審査保留中`
        - `審査OK`
        - `利用可能`
        - `審査NG`
        - `申込中止`
    WebhookEvent.BuyerContract:
      type: object
      properties:
        buyer_id:
          allOf:
            - $ref: '#/components/schemas/buyer_id'
        event:
          allOf:
            - $ref: '#/components/schemas/FincodeEventForBuyerPlatform'
        body:
          type: array
          description: |
            テナントバイヤー決済手段 契約状況リスト\
            \
            決済手段の種別とその契約ステータスを含むオブジェクトの配列です。
          items:
            type: object
            properties:
              acquirer:
                allOf:
                  - $ref: '#/components/schemas/AcquirerTenantBuyer'
              examination_task:
                type: string
                description: |
                  審査対象（和名）

                  - `決済事業者審査: BPSP`
              status_code:
                allOf:
                  - $ref: '#/components/schemas/AcquirerContractStatus'
              status:
                type: string
                description: |
                  決済事業者 契約ステータス（和名）

                  - `申込なし`
                  - `審査受付`
                  - `審査待ち`
                  - `審査中`
                  - `審査保留中`
                  - `審査OK`
                  - `利用可能`
                  - `審査NG`
                  - `申込中止`
              updated:
                type: boolean
                description: |
                  更新の有無\
                  \
                  更新があった場合は `true`になります。
x-tagGroups:
  - name: 請求書カード払い
    tags:
      - 請求書カード払い
  - name: テナントバイヤー管理
    tags:
      - テナントバイヤー
  - name: テナントバイヤー申請管理
    tags:
      - テナントバイヤー申請管理
  - name: バイヤープラットフォーム精算
    tags:
      - バイヤープラットフォーム報酬
  - name: Webhook
    tags:
      - Webhook設定
      - Webhook_通知仕様
