openapi: 3.0.0
info:
  title: rezio API ドキュメント - B2B パートナー
  description: '> **Beta（ベータ版）** — 本 API は現在ベータ版です。API プログラムは整備中で、ご利用は申請制です。仕様は変更される場合があり、変更は本ドキュメントでお知らせします。ご利用の申請は <a href="mailto:service@rezio.io">service@rezio.io</a> までご連絡ください。


    本ドキュメントは、rezio の予約システムをご利用の事業者と連携する必要がある事業者向けの B2B 連携用ドキュメントです。B2B API では、指定の店舗に対して商品の照会、販売可能な日付と予約枠の照会、予約情報の照会、予約の作成、予約のキャンセルを行えます。B2B API の開通は <a href="mailto:service@rezio.io">service@rezio.io</a> までお問い合わせください。<b>Store UUID</b>と<b>Distributor API Key</b>は仕入先の店舗から提供されます。'
  contact:
    name: rezio API Support
    email: service@rezio.io
  version: 0.0.17
servers:
- url: https://b2b.rezio.io
  description: Production
paths:
  /b2b/product:
    get:
      tags:
      - B2B
      summary: 販売可能な商品の照会
      operationId: getProducts
      responses:
        '200':
          $ref: '#/components/responses/product_list_response'
        '401':
          $ref: '#/components/responses/unauthorized_response'
      security:
      - X-Auth-Store: []
        X-Auth-Distr: []
  /b2b/{productUuid}/{salesOptionId}/sessions:
    get:
      tags:
      - B2B
      summary: 商品の販売可能な日付と予約枠の照会
      operationId: querySalesOption
      parameters:
      - $ref: '#/components/parameters/product_uuid_in_path'
      - $ref: '#/components/parameters/sales_option_uuid_in_path'
      - $ref: '#/components/parameters/start_date_in_query'
      - $ref: '#/components/parameters/end_date_in_query'
      responses:
        '200':
          $ref: '#/components/responses/query_sales_option_response'
        '401':
          $ref: '#/components/responses/unauthorized_response'
      security:
      - X-Auth-Store: []
        X-Auth-Distr: []
  /b2b/{productUuid}/bookingInfo:
    get:
      tags:
      - B2B
      summary: 予約情報の照会
      operationId: queryBookingInfo
      parameters:
      - $ref: '#/components/parameters/product_uuid_in_path'
      responses:
        '200':
          $ref: '#/components/responses/booking_response'
        '401':
          $ref: '#/components/responses/unauthorized_response'
      security:
      - X-Auth-Store: []
        X-Auth-Distr: []
  /b2b/order:
    post:
      tags:
      - B2B
      summary: 予約の作成
      operationId: orderProduct
      requestBody:
        $ref: '#/components/requestBodies/order_request_body'
      responses:
        '200':
          $ref: '#/components/responses/order_response'
        '401':
          $ref: '#/components/responses/unauthorized_response'
      security:
      - X-Auth-Store: []
        X-Auth-Distr: []
  /b2b/order/{orderNo}:
    get:
      tags:
      - B2B
      summary: 予約の照会
      operationId: getOrder
      parameters:
      - $ref: '#/components/parameters/order_number_in_path'
      responses:
        '200':
          $ref: '#/components/responses/get_order_response'
        '401':
          $ref: '#/components/responses/unauthorized_response'
      security:
      - X-Auth-Store: []
        X-Auth-Distr: []
  /b2b/{orderNo}/applyCancel:
    post:
      tags:
      - B2B
      summary: 予約のキャンセル
      operationId: applyCancel
      parameters:
      - $ref: '#/components/parameters/order_number_in_path'
      requestBody:
        $ref: '#/components/requestBodies/cancel_request_body'
      responses:
        '200':
          $ref: '#/components/responses/cancel_response'
        '401':
          $ref: '#/components/responses/unauthorized_response'
      security:
      - X-Auth-Store: []
        X-Auth-Distr: []
components:
  schemas:
    pickup_request:
      title: リクエスト 送迎データ
      properties:
        id:
          description: 送迎情報 ID（SYSTEM タイプで使用）
          type: string
          example: 2a9263c8-d98c-4121-b609-5a51755c6c1f
        request:
          description: 送迎の要望（CUSTOM タイプで使用）
          type: string
          example: 煙波大飯店 花蓮縣花蓮市中美路142號
        time:
          description: 送迎時間（CUSTOM タイプで使用、startTime ～ endTime の範囲内である必要あり）
          type: string
          example: '13:30'
      type: object
    pickup_response:
      title: レスポンス 送迎データ
      properties:
        id:
          description: 送迎情報ID
          type: string
          example: 2a9263c8-d98c-4121-b609-5a51755c6c1f
        type:
          description: '送迎タイプ: SYSTEM/ CUSTOM'
          type: string
          example: SYSTEM
        label:
          description: 送迎場所の説明
          type: string
          example: 花蓮火車站正門
        address:
          description: 送迎住所
          type: string
          example: 花蓮縣花蓮市國聯一路100號
        vehicle:
          description: 送迎車両 (CUSTOMタイプのみ使用)
          type: string
          example: 豪華轎車
        instructions:
          description: 送迎の詳細案内
          type: string
          example: 請在火車站右側等待區，找尋穿綠色背心的工作人員報到
        date:
          description: 送迎日
          type: string
          example: '2021-08-18'
        startTime:
          description: 送迎開始時間
          type: string
          example: '13:00'
        endTime:
          description: 送迎終了時間
          type: string
          example: '13:50'
        latitude:
          description: 送迎場所の座標の緯度
          type: string
          example: '23.9938653'
        longitude:
          description: 送迎場所の座標の経度
          type: string
          example: '121.6022198'
      type: object
    bookingInfo_result:
      title: 予約情報のレスポンスデータ
      properties:
        key:
          description: データキー
          type: string
          example: firstName
        title:
          description: 表示テキスト
          type: string
          example: 名
        type:
          description: 情報タイプ
          type: string
          example: string
        option:
          description: 選択可能な内容
          type: array
          items:
            description: 内容文字列
            type: string
            example: mobile
        required:
          description: 必須項目かどうか
          type: boolean
          example: true
      type: object
    bookingInfoType:
      title: 予約情報タイプと予約データ項目の対応
      description: "\n| type            \t|データ|例|\n|-----------------\t|------------------------------------------------------------------\t|--------------------------------------------------------------------\t|\n| string          \t| \"{key}\": \"{value}\"                                              \t| \"firstName\": \"name\"                                            \t|\n| email           \t| \"{key}\": \"{value}\"                                              \t| \"email\": \"test@test.test\"                                      \t|\n| date            \t| \"{key}\": \"Y-m-d\"                                             \t| \"birthday\": \"2021-01-01\"                                       \t|\n| datetime        \t| \"{key}\": \"Y-m-d H:i:s\"                                       \t| \"departureDateTime\": \"2021-12-20 10:20:00\"                     \t|\n| phone           \t| \"{key}\":{\"countryCode\":国番号, \"number\":\"電話番号\"}            \t| \"mobile\": {\"countryCode\":886, \"number\":\"987654321\"}        \t|\n| shoe            \t| \"{key}\":{\"type\":\"option内のカテゴリ\", \"value\":200}             \t| \"shoeSize_mm\": {\"type\":\"Man\", \"value\":275}                 \t|\n| bool            \t| \"{key}\": true                                                  \t| \"31a95a4e-a5e2-4b7c-8c5a-f7a417403b83\": false                    \t|\n| list            \t| \"{key}\":[\"{value1}\",\"{value2}\",\"{value3}\"]                        \t| \"a74aeff8-c350-467a-aa18-7d4a6ec6a412\": [\"A\",\"B\"]            \t|\n| duringItinerary \t| \"{key}\": {\"type\":\"option内の選択肢\", \"value\":\"対応するデータ\"} \t| \"contactAccount\": {\"type\":\"mobile\", \"value\":\"987654321\"} \t|"
      type: object
    error_code:
      title: エラーコード表
      description: "結果コード。成功は `S0000` です。業務エラーの場合も HTTP 200 で返却されるため、必ず本フィールドで成否を判断してください。\n\n|エラーコード|エラー原因|\n| ------------ \t| ---------------------------------\t                                                                |\n| V0001     \t|パラメータ不足|\n| V0002     \t|パラメータ形式の誤り|\n| E0002     \t|データなし|\n| F0001     \t|エラー発生（codeMessage を確認）|\n| B0001     \t|有料オプション(extras)の購入数量の誤り|\n| B0002     \t|この予約枠で販売可能な商品なし|\n| B0003     \t|送迎サービスの項目が未選択|\n| B0004     \t|選択した送迎サービスの項目に誤り|\n| B0005     \t|選択した送迎時間が送迎可能な範囲外|\n| B0006     \t|ガイドサービスの言語が未選択|\n| B0007     \t|選択した言語に誤り|\n| B0008     \t|予約情報の選択肢に誤り|\n| B0009     \t|必須項目の予約情報が未指定|\n| B0010     \t|purchaseContent のデータに誤り、項目なし|\n| B0011     \t|purchaseContent の購入数量に誤り|\n| B0012     \t|利用者情報の件数に誤り|\n| B0013     \t|購入した有料オプション(extras)の不存在|"
      type: string
      example: S0000
  responses:
    product_list_response:
      description: OK
      content:
        application/json:
          schema:
            properties:
              code:
                $ref: '#/components/schemas/error_code'
              codeMessage:
                description: レスポンスメッセージ
                type: string
                example: SUCCESS
              data:
                description: レスポンスデータ
                properties:
                  products:
                    description: 商品リスト
                    type: array
                    items:
                      properties:
                        id:
                          description: 商品 ID
                          type: string
                          example: 2c935076-ac44-41cf-943f-8e5fdd29bdf1
                        productCode:
                          description: 商品コード
                          type: string
                          example: MN8SEH
                        title:
                          description: 商品タイトル
                          type: string
                          example: '[測試票券] 花蓮｜滑翔傘飛行體驗、俯瞰壯麗的太平洋'
                        language:
                          description: ガイドサービスの言語
                          properties:
                            audioHeadset:
                              description: 音声ガイド機の言語
                              type: array
                              items:
                                description: 言語コード
                                type: string
                              example:
                              - en
                              - cmn
                            guide:
                              description: ガイドの対応言語
                              type: array
                              items:
                                description: 言語コード
                                type: string
                              example:
                              - en
                              - cmn
                            translation:
                              description: 観光ガイドの言語
                              type: array
                              items:
                                description: 言語コード
                                type: string
                              example:
                              - en
                              - cmn
                            written:
                              description: 印刷物の言語
                              type: array
                              items:
                                description: 表記言語コード
                                type: string
                              example:
                              - en-US
                              - ja-JP
                              - zh-CN
                              - zh-TW
                          type: object
                        extras:
                          description: 有料オプション
                          type: array
                          items:
                            properties:
                              id:
                                description: 有料オプションID
                                type: string
                                example: 9b2b7cfc-fd35-4481-8cb3-ef64caaff442
                              label:
                                description: 有料オプション名
                                type: string
                                example: GOPRO影片
                              priceType:
                                description: 有料オプションの種類：ORDER/QUANTITY<br><b>ORDER<b>：予約単位での購入（購入可能数量は最大 1）; <b>QUANTITY</b>：有料オプションの購入数量を指定して購入
                                type: string
                                example: ORDER
                              quantity:
                                description: 在庫数（-1 は無制限）
                                type: number
                                example: 1.0
                              price:
                                description: 価格
                                type: number
                                example: 500.0
                            type: object
                        salesOptions:
                          description: 商品のプラン一覧
                          type: array
                          items:
                            properties:
                              id:
                                description: プランID
                                type: string
                                example: c8873111-73ff-4218-b0cf-c40796f05e01
                              title:
                                description: プラン名
                                type: string
                                example: 滑翔傘飛行體驗＋GOPRO全程攝影
                            type: object
                      type: object
                type: object
            type: object
    query_sales_option_response:
      description: OK
      content:
        application/json:
          schema:
            properties:
              code:
                $ref: '#/components/schemas/error_code'
              codeMessage:
                description: レスポンスメッセージ
                type: string
                example: SUCCESS
              data:
                description: レスポンスデータ
                properties:
                  sessions:
                    description: 購入可能な予約枠の情報
                    properties:
                      id:
                        description: 予約枠ID
                        type: string
                        example: b3ca9362-22de-4a24-b9c7-2fb866624ca8
                      startDate:
                        description: 開始日
                        type: string
                        example: '2021-08-18'
                      startTime:
                        description: 開始時間
                        type: string
                        example: '14:00'
                      endDate:
                        description: 終了日
                        type: string
                        example: '2021-08-18'
                      endTime:
                        description: 終了時間
                        type: string
                        example: '15:00'
                      currencyCode:
                        description: 通貨記号
                        type: string
                        example: TWD
                      prices:
                        description: プランの販売価格
                        type: array
                        items:
                          properties:
                            id:
                              description: プラン料金ID
                              type: string
                              example: 76d2d935-4a55-4c09-80df-42311e7bbaa9
                            type:
                              description: '料金タイプ（区分／項目）: PERSON/ ITEM'
                              type: string
                              example: PERSON
                            label:
                              description: 名称
                              type: string
                              example: Participant
                            price:
                              description: 販売価格
                              type: number
                              example: 3000.0
                          type: object
                      quotaAvailable:
                        description: '在庫数 (-1: 無制限)'
                        type: number
                        example: 20.0
                      pickup:
                        description: 送迎情報
                        properties:
                          departure:
                            description: 往路の送迎情報
                            type: array
                            items:
                              $ref: '#/components/schemas/pickup_response'
                          return:
                            description: 復路の送迎情報
                            type: array
                            items:
                              $ref: '#/components/schemas/pickup_response'
                        type: object
                    type: object
                type: object
            type: object
    order_response:
      description: OK
      content:
        application/json:
          schema:
            properties:
              code:
                $ref: '#/components/schemas/error_code'
              codeMessage:
                description: レスポンスメッセージ
                type: string
                example: SUCCESS
              data:
                description: レスポンスデータ
                properties:
                  orderNo:
                    description: 予約番号
                    type: string
                    example: DS210713SN4361
                  currencyCode:
                    description: 通貨
                    type: string
                    example: TWD
                  totalAmount:
                    description: 支払金額
                    type: number
                    format: float
                    example: 3200.0
                  vouchers:
                    description: バウチャー情報（即時確定で、かつ rezio QR Code を利用する商品のみ、バウチャー情報をすぐに取得可能）
                    type: array
                    items:
                      properties:
                        qrCodeStr:
                          description: QR Code 文字列。標準 QR Code（ISO 18004）を生成してください
                          type: string
                          example: rezio://redeem?code=1234567890
                      type: object
                type: object
            type: object
    get_order_response:
      description: OK
      content:
        application/json:
          schema:
            properties:
              code:
                $ref: '#/components/schemas/error_code'
              codeMessage:
                description: レスポンスメッセージ
                type: string
                example: SUCCESS
              data:
                description: レスポンスデータ
                properties:
                  orderNo:
                    description: 予約番号
                    type: string
                    example: DS210713SN4361
                  status:
                    description: 予約ステータス：CANCELED / NEW_UNPAID / NEW_PAID / PENDING / CONFIRMED / CHECKIN / NO_SHOW / CANCELING / CANCEL_REQUESTED / DEPARTED
                    type: string
                    example: CONFIRMED
                  currencyCode:
                    description: 通貨
                    type: string
                    example: TWD
                  totalAmount:
                    description: 支払金額
                    type: number
                    format: float
                    example: 3200.0
                  vouchers:
                    description: バウチャー情報
                    type: array
                    items:
                      properties:
                        qrCodeStr:
                          description: QR Code 文字列。標準 QR Code（ISO 18004）を生成してください
                          type: string
                          example: rezio://redeem?code=1234567890
                        redeemTimes:
                          description: 認証済み回数
                          type: integer
                          example: 1
                        totalRedeemableTimes:
                          description: バウチャーの認証可能回数
                          type: integer
                          example: 1
                        status:
                          description: バウチャーステータス：<br>NONE：バウチャーなし / VALID：利用可能 / USED：認証済み / LOCKED：キャンセル処理待ち / INVALID：無効 / EXPIRED：期限切れ
                          type: string
                          example: USED
                          enum:
                          - NONE
                          - VALID
                          - USED
                          - LOCKED
                          - INVALID
                          - EXPIRED
                        usedAt:
                          description: 認証日時
                          type: string
                          example: '2021-07-21 10:01:00'
                        invalidAt:
                          description: 実際の無効化日時
                          type: string
                          example: ''
                        sessionStartAt:
                          description: 予約した予約枠の開始時間（チケット型は空値）
                          type: string
                          example: '2021-07-21 10:00:00'
                        sessionEndAt:
                          description: 予約した予約枠の終了時間（チケット型は空値）
                          type: string
                          example: '2021-07-21 12:00:00'
                        ticketStartAt:
                          description: チケット型の有効開始時間（一般商品は空値）
                          type: string
                          example: ''
                        ticketEndAt:
                          description: チケット型の有効終了時間（一般商品は空値）
                          type: string
                          example: ''
                      type: object
                type: object
            type: object
    cancel_response:
      description: OK
      content:
        application/json:
          schema:
            properties:
              code:
                $ref: '#/components/schemas/error_code'
              codeMessage:
                description: レスポンスメッセージ
                type: string
                example: SUCCESS
              data:
                description: レスポンスデータ
                type: object
            type: object
    booking_response:
      description: OK
      content:
        application/json:
          schema:
            properties:
              code:
                $ref: '#/components/schemas/error_code'
              codeMessage:
                description: レスポンスメッセージ
                type: string
                example: SUCCESS
              data:
                description: レスポンスデータ
                properties:
                  bookingInfo:
                    description: 予約情報
                    properties:
                      contact:
                        description: 予約者情報
                        type: array
                        items:
                          $ref: '#/components/schemas/bookingInfo_result'
                      order:
                        description: 代表者
                        type: array
                        items:
                          $ref: '#/components/schemas/bookingInfo_result'
                      participant:
                        description: 利用者情報
                        type: array
                        items:
                          $ref: '#/components/schemas/bookingInfo_result'
                    type: object
                type: object
            type: object
    unauthorized_response:
      description: 認証失敗（`X-Auth-Store` / `X-Auth-Distr` が未指定または誤り）
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                type: integer
                example: 401
                description: 固定で 401
              status:
                type: string
                example: error
                description: 固定で error
              message:
                type: string
                example: Unauthorized access
                description: エラー説明
  parameters:
    product_uuid_in_path:
      name: productUuid
      in: path
      description: 商品ID
      required: true
      schema:
        type: string
        example: 2c935076-ac44-41cf-943f-8e5fdd29bdf1
    sales_option_uuid_in_path:
      name: salesOptionId
      in: path
      description: プランID
      required: true
      schema:
        type: string
        example: c8873111-73ff-4218-b0cf-c40796f05e01
    start_date_in_query:
      name: startDate
      in: query
      description: 開始日
      required: true
      schema:
        type: string
        example: '2021-08-18'
    end_date_in_query:
      name: endDate
      in: query
      description: 終了日
      required: true
      schema:
        type: string
        example: '2021-08-19'
    order_number_in_path:
      name: orderNo
      in: path
      description: 予約番号
      required: true
      schema:
        type: string
        example: DS210709GC0272
  requestBodies:
    order_request_body:
      description: 予約の作成
      required: true
      content:
        application/json:
          schema:
            required:
            - productId
            - salesOptionId
            - sessionId
            - sessionDate
            - sessionTime
            - language
            - extras
            - pickup
            - purchaseContent
            - bookingInfo
            properties:
              productId:
                description: 商品ID
                type: string
                example: 2c935076-ac44-41cf-943f-8e5fdd29bdf1
              salesOptionId:
                description: プランID
                type: string
                example: c8873111-73ff-4218-b0cf-c40796f05e01
              sessionId:
                description: 予約枠ID
                type: string
                example: b3ca9362-22de-4a24-b9c7-2fb866624ca8
              sessionDate:
                description: 指定する予約枠の日付
                type: string
                example: '2021-08-18'
              sessionTime:
                description: 指定する予約枠の時間帯
                type: string
                example: '14:00'
              language:
                description: ガイドサービスの言語を指定（「販売可能な商品の照会」のガイドサービス言語内の項目に対応。対応する項目に値がある場合は必須項目）
                properties:
                  audioHeadset:
                    description: 指定言語 - 音声ガイド機
                    type: string
                    example: en
                  guide:
                    description: 指定言語 - ツアーガイド
                    type: string
                    example: en
                  translation:
                    description: 指定言語 - 観光ガイド
                    type: string
                    example: en
                  written:
                    description: 指定言語 - 印刷物
                    type: string
                    example: en-US
                type: object
              extras:
                description: 有料オプションの一覧。追加購入が不要な場合は [] を指定
                type: array
                items:
                  properties:
                    id:
                      description: 有料オプションID
                      type: string
                      example: 9b2b7cfc-fd35-4481-8cb3-ef64caaff442
                    quantity:
                      description: 有料オプションの購入数量（数値は >0、priceType = "ORDER" の場合は最大 1 まで）
                      type: number
                      example: 1.0
                  type: object
              pickup:
                description: 送迎データ
                properties:
                  departure:
                    $ref: '#/components/schemas/pickup_request'
                  return:
                    $ref: '#/components/schemas/pickup_request'
                type: object
              purchaseContent:
                description: 購入内容（購入する項目のみ指定（quantity > 0））
                type: array
                items:
                  properties:
                    id:
                      description: purchase content ID
                      type: string
                      example: 76d2d935-4a55-4c09-80df-42311e7bbaa9
                    quantity:
                      description: 購入数量
                      type: number
                      example: 1.0
                  type: object
              bookingInfo:
                description: 予約データ
                properties:
                  contact:
                    description: 予約者情報（予約情報の key 値によって変動）
                    type: array
                    items:
                      properties:
                        firstName:
                          type: string
                          example: Fiona
                      type: object
                  order:
                    description: 利用者代表（予約情報の key 値によって変動）
                    type: array
                    items:
                      properties:
                        firstName:
                          type: string
                          example: Lin
                      type: object
                  participant:
                    description: 利用者情報（予約情報の key 値によって変動）
                    type: array
                    items:
                      type: array
                      items:
                        properties:
                          firstName:
                            type: string
                            example: Fiona
                        type: object
                type: object
            type: object
    cancel_request_body:
      description: 予約のキャンセル
      required: true
      content:
        application/json:
          schema:
            required:
            - reason
            properties:
              reason:
                description: 予約キャンセルの理由
                type: string
                example: Reschedule my trip
            type: object
  securitySchemes:
    X-Auth-Store:
      type: apiKey
      description: '- 店舗の Store UUID を入力してください。'
      name: X-Auth-Store
      in: header
    X-Auth-Distr:
      type: apiKey
      description: '- Distributor API Key を入力してください。'
      name: X-Auth-Distr
      in: header
tags:
- name: B2B
  description: B2B
