テスト購入を行う(サンドボックスのみ)
サンドボックス専用(それ以外は404)。必要なスコープ: products:write。本文なし。購入者はキーの所有者本人(サインイン用メールアドレス)で、リクエストでは指定できない。購入権が無ければテストカードで決済を確定して202(pending)。注文・購入権は本番と同じWebhookでできるため、購入権ができるまで同じ要求を打ち直す。処理中の決済があれば新たに決済しない。購入権が既にあれば決済せず200(completed)と、OTPなしで発行するワンタイムコード(handoff_code。有効60秒・1回きり)を返す。コードはログ・出力に出さない。
/products/{product_id}/test-purchaseAuthorizationBearer トークン · header必須管理画面または CLI の cozeni login で発行したクリエイターAPIキー。購入者認証には使わない。
product_idstring必須購入権がある。入場の確認用のワンタイムコード(限定ページの商品のみ)と、商品の種類(access_type)・付与された設定値(metadata)を含む。
statusstring必須completedhandoff_codestring | null必須expires_ininteger必須access_typestring必須pagefeaturefilemetadataExternalFeatureFlagMetadata必須機能フラグの設定値。50件まで。キーは1〜40字の英数字・_・-(proto は不可)。値は文字列(1〜500字)・数値・真偽値。URLやAPIキーなどの秘匿情報は入れない。
決済は済んだ(または処理中)。Webhook による購入権の付与を待つ。
statusstring必須pendinginvalid_input。未知フィールド、無効なcursor・入力を含む。
errorobject必須プロパティを表示プロパティを非表示
codestring必須messagestring必須request_idstring必須unauthorized。失効、期限切れ、環境違いを含む。
errorobject必須プロパティを表示プロパティを非表示
codestring必須messagestring必須request_idstring必須insufficient_scope。
errorobject必須プロパティを表示プロパティを非表示
codestring必須messagestring必須request_idstring必須not_found(サンドボックス以外)/ product_not_found(他人の商品・存在しない商品)。
errorobject必須プロパティを表示プロパティを非表示
codestring必須messagestring必須request_idstring必須creator_not_ready(売上の受け取り先が未登録・販売者の情報が未承認など。blockers は GET /account の sales.blockers と同じ)/ product_archived / checkout_link_disabled / subscription_not_supported(サブスクの商品はテスト購入できない)。
errorobject必須プロパティを表示プロパティを非表示
codestring必須creator_not_readymessagestring必須request_idstring必須blockersExternalSalesBlocker[]必須プロパティを表示プロパティを非表示
ExternalSalesBlocker の配列codestring必須review_not_submittedreview_pendingstripe_not_connectedstripe_onboarding_incompletestripe_verification_pendingaction_urlstring<uri>必須codestring必須review_rejectedaction_urlstring<uri>必須rejectionobject必須プロパティを表示プロパティを非表示
reason_codestring必須tokushoho_missing_contacttokushoho_unreachablewebsite_unreachabledescription_insufficientprohibited_contentothernotestring | null必須errorobject必須プロパティを表示プロパティを非表示
codestring必須messagestring必須request_idstring必須rate_limited。
errorobject必須プロパティを表示プロパティを非表示
codestring必須messagestring必須request_idstring必須internal。
errorobject必須プロパティを表示プロパティを非表示
codestring必須messagestring必須request_idstring必須stripe_error。Stripe の処理に失敗した。打ち直せる。
errorobject必須プロパティを表示プロパティを非表示
codestring必須messagestring必須request_idstring必須unavailable。
errorobject必須プロパティを表示プロパティを非表示
codestring必須messagestring必須request_idstring必須