注文取得

指定した注文の詳細情報を取得します。

注文は unique_key で指定できます。 注文状態・注文日時、購入者・配送先、注文明細とオプション、送料・割引・手数料を含む金額の内訳、部分発送履歴を含む配送情報、決済トランザクション、ショップメモをまとめて返します。

呼び出し元のショップに属さない注文は 404 を返します。 取得による注文情報の変更や通知の送信はありません。

GET /api/orders/{unique_key}
スコープ orders.read

リクエスト例

curl
curl -X GET "https://apiv2.thebase.com/api/orders/<unique_key>" \
  -H "Authorization: Bearer <your-token>"

パラメータ

unique_key OrderUniqueKey · path 必須
注文の一意キー(16 桁の半角英数字)。小文字は大文字として扱います。

レスポンス

200 取得成功

200 のレスポンスボディ(application/json):

  • unique_keystring必須
    注文の一意キー。注文詳細の取得に使う識別子です。
  • statusstring必須
    注文状態を表す文字列。値は固定された列挙ではありません。現在の仕様で返る主な値は 'ordered'(発送待ち)、'unpaid'(入金待ち)、'unshippable'(対応開始前)、'dispatched'(発送済み)、'cancelled'(キャンセル済み)、'shipping'、'arrived' です。今後の機能追加により、新しい値が返る場合があります。
  • ordered_atstring (date-time)必須
    注文日時(RFC 3339, 秒精度 UTC)
  • cancelled_atstring (date-time)必須nullable
    キャンセル日時(RFC 3339, 秒精度 UTC)。未キャンセルは null です。
  • modified_atstring (date-time)必須
    注文の最終更新日時(RFC 3339, 秒精度 UTC)
  • viastring必須
    注文経路。記録が無い場合は 'default' です。
  • remarkstring必須nullable
    購入者が入力した備考
  • add_commentstring必須nullable
    ショップから注文者へのメッセージ
  • shop_memoOrderShopMemo必須
    • textstring必須
      ショップメモ本文。未入力の場合は空文字列です。
  • mail_magazine_opt_inboolean必須nullable
    メールマガジン購読の同意。購入時に同意を取得していない注文は null です。
  • customerOrderCustomer必須
    • nameOrderCustomerName必須
      • firststring必須
        名
      • laststring必須
        姓
      • first_kanastring必須nullable
        名(カナ)。未登録時は null です。
      • last_kanastring必須nullable
        姓(カナ)。未登録時は null です。
    • mail_addressstring必須
      購入時に登録されたメールアドレス。未登録時は空文字です。
    • addressOrderCustomerAddress必須
      • countrystring必須
        国名。日本国内であれば 'Japan' です。
      • country_codestring必須nullable
        国コード(ISO 3166-1 alpha-2)。国コードを特定できない場合は null です。
      • zip_codestring必須
        郵便番号。ハイフンの有無は保存時のままです。
      • prefecturestring必須
        都道府県
      • addressstring必須
        市区町村・番地
      • address2string必須
        建物名・部屋番号など
      • telstring必須nullable
        電話番号。未登録時は null です。
  • shippingOrderShipping必須
    • nameOrderShippingName必須
      • firststring必須nullable
        名。配送先未登録時は null です。
      • laststring必須nullable
        姓。配送先未登録時は null です。
    • addressOrderShippingAddress必須
      • countrystring必須nullable
        国名。配送先未登録時は null です。
      • country_codestring必須nullable
        国コード(ISO 3166-1 alpha-2)。未登録または国コードを特定できない場合は null です。
      • zip_codestring必須nullable
        郵便番号。配送先未登録時は null です。
      • prefecturestring必須nullable
        都道府県。配送先未登録時は null です。
      • addressstring必須nullable
        市区町村・番地。配送先未登録時は null です。
      • address2string必須nullable
        建物名・部屋番号など。配送先未登録時は null です。
      • telstring必須nullable
        電話番号。未登録時は null です。
  • subscriptionOrderSubscription必須nullable
    定期便情報。通常注文では null です。
    • unique_keystring必須nullable
      定期便の一意キー。未取得時は null です。
    • repeat_numberinteger必須nullable
      何回目の配送か
    • repeat_timesinteger必須nullable
      配送回数の総数
  • referrerOrderReferrer必須nullable
    流入元情報。記録が無い注文は null です。
    • site_domainstring必須nullable
      流入元ドメイン
    • site_paramstring必須nullable
      流入元から引き継ぐ値
  • item_countinteger必須
    注文に含まれる商品の点数(キャンセル明細を除いた各明細の数量の合計)
  • amountsOrderAmounts必須
    • subtotalinteger必須
      商品合計(円)。明細 total の合計です。
    • shipping_feeinteger必須
      送料(円)。無料は 0 です。
    • cod_feeinteger必須
      代引手数料(円)。対象外は 0 です。
    • totalinteger必須
      注文合計(円)。クーポン・送料・代引手数料・金額調整を反映した値です。
    • coupon_discountOrderCouponDiscount必須
      • amountinteger必須
        クーポン割引額(円)。割引なしは 0 です。
      • notestring必須nullable
        割引メモ(クーポンコード等)
      • allocates_balance_logboolean必須
        売上残高ログの金額配分に含めるクーポン割引かどうか
    • coin_discountOrderCoinDiscount必須
      • amountinteger必須
        コイン割引額(円)。割引なしは 0 です。
      • notestring必須nullable
        割引メモ
    • adjustmentOrderAmountAdjustment必須
      • amountinteger必須
        金額調整(円)。調整なしは 0 です。
    • service_chargeOrderServiceCharge必須
      • collected_feeinteger必須
        BASE 徴収手数料(円)。未徴収の注文は 0 です。
      • fee_type"base" | "payid_app"必須
        手数料種別(base / payid_app)
    • additional_chargesOrderAdditionalCharge[]必須
      追加料金の内訳。無い場合は空配列です。
      • namestring必須nullable
        追加料金の種別名
      • collected_feeinteger必須nullable
        追加料金額(円)
  • linesOrderLine[]必須
    注文明細。古い順(id 昇順)に並びます。
    • idinteger必須
      注文明細 ID
    • item_idinteger必須
      商品 ID
    • variation_idinteger必須nullable
      種類 ID。種類を持たない場合は null です。
    • titlestring必須
      商品名。注文時点の情報です。
    • variationstring必須nullable
      種類名。注文時点の情報です。
    • item_identifierstring必須nullable
      商品コード
    • variation_identifierstring必須nullable
      種類コード
    • barcodestring必須nullable
      JAN / GTIN
    • priceinteger必須
      単価(円)
    • amountinteger必須
      数量
    • item_totalinteger必須
      商品分小計(円)。商品単価と数量から算出した金額です。
    • option_totalinteger必須
      オプション分小計(円)。オプション単価の合計に数量を掛けた金額です。
    • totalinteger必須
      明細合計(円)。item_total と option_total の合計です。
    • tax_mode"standard" | "reduced"必須
      税区分。standard=標準税率、reduced=軽減税率。実際の税率は consumption_tax_rate を参照してください。
    • consumption_tax_rateinteger必須
      消費税率(%)
    • consumption_total_taxinteger必須
      明細に含まれる消費税額(円)
    • statusstring必須
      明細の状態。部分発送・部分キャンセルに対応するため、注文全体の状態とは別に明細ごとに保持します。
    • shipping_methodstring必須nullable
      明細ごとの配送方法名。サイズ別配送(shipping_lines)利用時は null です。
    • shipping_feeinteger必須
      明細ごとの送料(円)。サイズ別配送利用時は 0 です。
    • shipping_start_onstring (date)必須nullable
      予約商品の発送予定開始日(YYYY-MM-DD)。予約商品以外は null です。
    • shipping_end_onstring (date)必須nullable
      予約商品の発送予定終了日(YYYY-MM-DD)。未設定は null です。
    • modified_atstring (date-time)必須
      明細の最終更新日時(RFC 3339, 秒精度 UTC)
    • optionsOrderLineOption[]必須
      明細に紐づくオプション。無い場合は空配列です。
      • option_idinteger必須
        オプション ID
      • option_variation_idinteger必須
        オプション選択肢 ID
      • namestring必須
        オプション名
      • typestring必須
        オプションの入力形式を表す文字列。値は固定された列挙ではありません。現在の仕様では 'select'(選択式)または 'form'(自由入力式)を返します。今後の機能追加により、新しい値が返る場合があります。
      • valuestring必須nullable
        オプションに指定された値。現在の仕様では、type が 'select' の場合は選択肢名、'form' の場合は入力内容を返します。値がない場合は null です。
      • priceinteger必須
        オプション単価(円)
      • tax_mode"standard" | "reduced"必須
        税区分。standard=標準税率、reduced=軽減税率
      • consumption_tax_rateinteger必須
        消費税率(%)
  • shipping_linesOrderShippingLine[]必須
    サイズ別配送ラインの送料配分。利用しない注文は空配列です。
    • order_line_idsinteger[]必須
      この配送ラインに含まれる明細 ID(OrderLine.id)の配列
    • shipping_methodstring必須nullable
      配送方法名(サイズ込み)。未設定は null です。
    • shipping_feeinteger必須
      この配送ラインの送料(円)
  • deliveryOrderDelivery必須
    • shipping_methodstring必須nullable
      注文全体に設定された配送方法名。サイズ別配送(shipping_lines)利用時は null です。
    • delivery_company_idinteger必須
      注文全体の配送業者 ID。未指定は 0 です。
    • tracking_numberstring必須nullable
      注文全体の伝票番号
    • delivery_datestring (date)必須nullable
      配送希望日(YYYY-MM-DD)。未指定は null です。
    • delivery_time_zonestring必須nullable
      配送希望時間帯(4 桁。例: '1214' = 12 時-14 時)。未指定は null です。
    • dispatched_atstring (date-time)必須nullable
      最終発送日時(RFC 3339, 秒精度 UTC)。未発送は null です。
    • dispatchesOrderDispatch[]必須
      部分発送の履歴。古い順に並びます。
      • idinteger必須
        発送履歴 ID
      • delivery_company_idinteger必須nullable
        配送業者 ID。未指定は null です。
      • tracking_numberstring必須nullable
        追跡番号。未指定は null です。
      • commentstring必須nullable
        発送コメント
      • dispatched_atstring (date-time)必須
        発送日時(RFC 3339, 秒精度 UTC)
      • order_line_idsinteger[]必須
        この発送に含まれる明細 ID の配列。部分発送に対応するため、複数の明細 ID を含む場合があります。
  • paymentOrderPayment必須
    • methodstring必須nullable
      注文確定時の決済手段。未確定は null です。
    • transactionsOrderPaymentTransaction[]必須
      決済トランザクション履歴
      • methodstring必須
        決済手段(creditcard / cvs / paypal / paypay など)
      • collected_feeinteger必須nullable
        決済で徴収された手数料(円)。取得できない場合は null です。
      • statusstring必須nullable
        決済ステータス。取得できない場合は null です。
      • transaction_idstring必須nullable
        外部決済の取引 ID。取得できない場合は null です。
      • amountinteger必須nullable
        取引金額(円)。取得できない場合は null です。
      • occurred_atstring (date-time)必須nullable
        取引発生日時(RFC 3339, 秒精度 UTC)。取得できない場合は null です。
  • membership_rewardsOrderMembershipReward[]必須
    メンバーシップ特典。特典が無い注文では空配列です。
    • namestring必須
      特典名
    • statusstring必須
      特典の発送状態
  • balance_logsOrderBalanceLog[]必須
    売上残高ログ。売上確定・キャンセル・配送料・差額・販売パートナー精算分を含みます。
    • textstring必須
      ログの説明文
    • amountinteger必須
      残高の増減額(円)。プラスは増加、マイナスは減少を表します。
    • created_atstring (date-time)必須
      ログ発生日時(RFC 3339, 秒精度 UTC)
  • order_groupOrderGroup必須nullable
    販売パートナー / セレクトショップ注文の精算情報。精算情報を表示できる注文(ブランド報酬の対象注文、またはグループ内の発送が完了したセレクトショップ注文)でのみ返します。精算対象外の販売パートナー注文や通常注文では null です。
    • order_chargeOrderGroupCharge必須
      • collected_feeinteger必須nullable
        注文グループの徴収手数料(円)
    • payment_transactionOrderGroupPaymentTransaction必須
      • collected_feeinteger必須nullable
        注文グループの決済手数料(円)
      • statusstring必須nullable
        注文グループの決済ステータス
    • brand_chargeOrderGroupBrandCharge必須nullable
      ブランド報酬。該当しない場合は null です。
      • reward_feeinteger必須
        ブランド報酬(円)
  • _linksobject必須
    このリソースに関連する操作へのリンク集合。リソースの状態やトークンのスコープによってリンクの有無は変わりません。
    • dispatch_orderLink必須
      • hrefstring (uri)必須
        エンドポイントの絶対 URL
      • method"GET" | "POST" | "PUT" | "DELETE"必須
        エンドポイントを呼び出す際に使う HTTP メソッド
      • document_hrefstring (uri)必須
        ドキュメントサイト上でこのエンドポイントを説明するページの URL
    • cancel_orderLink必須
      • hrefstring (uri)必須
        エンドポイントの絶対 URL
      • method"GET" | "POST" | "PUT" | "DELETE"必須
        エンドポイントを呼び出す際に使う HTTP メソッド
      • document_hrefstring (uri)必須
        ドキュメントサイト上でこのエンドポイントを説明するページの URL
    • update_orderLink必須
      • hrefstring (uri)必須
        エンドポイントの絶対 URL
      • method"GET" | "POST" | "PUT" | "DELETE"必須
        エンドポイントを呼び出す際に使う HTTP メソッド
      • document_hrefstring (uri)必須
        ドキュメントサイト上でこのエンドポイントを説明するページの URL
    • update_order_customerLink必須
      • hrefstring (uri)必須
        エンドポイントの絶対 URL
      • method"GET" | "POST" | "PUT" | "DELETE"必須
        エンドポイントを呼び出す際に使う HTTP メソッド
      • document_hrefstring (uri)必須
        ドキュメントサイト上でこのエンドポイントを説明するページの URL
    • update_order_shippingLink必須
      • hrefstring (uri)必須
        エンドポイントの絶対 URL
      • method"GET" | "POST" | "PUT" | "DELETE"必須
        エンドポイントを呼び出す際に使う HTTP メソッド
      • document_hrefstring (uri)必須
        ドキュメントサイト上でこのエンドポイントを説明するページの URL
    • update_order_deliveryLink必須
      • hrefstring (uri)必須
        エンドポイントの絶対 URL
      • method"GET" | "POST" | "PUT" | "DELETE"必須
        エンドポイントを呼び出す際に使う HTTP メソッド
      • document_hrefstring (uri)必須
        ドキュメントサイト上でこのエンドポイントを説明するページの URL
    • update_order_shop_memoLink必須
      • hrefstring (uri)必須
        エンドポイントの絶対 URL
      • method"GET" | "POST" | "PUT" | "DELETE"必須
        エンドポイントを呼び出す際に使う HTTP メソッド
      • document_hrefstring (uri)必須
        ドキュメントサイト上でこのエンドポイントを説明するページの URL

エラー

エラーは application/problem+json の Problem 形式で返します。 認証・スコープ・予期しない内部エラーなど、すべてのエンドポイントに共通のエラーと 構造・判別方法は エラーレスポンス を参照してください。

このエンドポイントが返すその他のエラーは次のとおりです。

400 /errors/request/invalid-params 1 つ以上のパスパラメータがエンドポイントのスキーマを満たさない場合に返します。
404 /errors/orders/not-found 指定した注文が存在しない、または呼び出し元から参照できない場合に返します。