コンテンツにスキップ
Docs
Esc
↑↓移動↵開く⌘Jプレビュー

テスト購入を返金する(サンドボックスのみ)

サンドボックス専用(それ以外は404)。必要なスコープ: products:write。本文なし。キーの所有者本人が購入者の、その商品の成立済みの注文をすべて返金する。購入権の失効は返金のWebhookの経路で行う(この要求ではDBを書かない)。対象が無ければ200(nothing_to_refund)で、打ち直しても失敗しない。

POST/products/{product_id}/test-purchase/refund
認証
AuthorizationBearer トークン · header必須

管理画面または CLI の cozeni login で発行したクリエイターAPIキー。購入者認証には使わない。

パスパラメーター
product_idstring必須
最小長 1 · 最大長 200
レスポンス
200

返金を依頼した(refunded)、または対象が無い(nothing_to_refund)。

statusstring必須
許可される値:refundednothing_to_refund
refund_countinteger必須
最小 0
400

invalid_input。未知フィールド、無効なcursor・入力を含む。

errorobject必須
プロパティを表示
codestring必須
messagestring必須
request_idstring必須
401

unauthorized。失効、期限切れ、環境違いを含む。

errorobject必須
プロパティを表示
codestring必須
messagestring必須
request_idstring必須
403

insufficient_scope。

errorobject必須
プロパティを表示
codestring必須
messagestring必須
request_idstring必須
404

not_found(サンドボックス以外)/ product_not_found(他人の商品・存在しない商品)。

errorobject必須
プロパティを表示
codestring必須
messagestring必須
request_idstring必須
409

creator_not_ready(売上の受け取り先が未登録・販売者の情報が未承認など。blockers は GET /account の sales.blockers と同じ)/ product_archived / checkout_link_disabled / subscription_not_supported(サブスクの商品はテスト購入できない)。

いずれか:
ExternalSalesBlockedError
errorobject必須
プロパティを表示
codestring必須
許可される値:creator_not_ready
messagestring必須
request_idstring必須
blockersExternalSalesBlocker[]必須
プロパティを表示
ExternalSalesBlocker の配列
いずれか 1 つ:
object
codestring必須
許可される値:review_not_submittedreview_pendingstripe_not_connectedstripe_onboarding_incompletestripe_verification_pending
action_urlstring<uri>必須
object
codestring必須
許可される値:review_rejected
action_urlstring<uri>必須
rejectionobject必須
プロパティを表示
reason_codestring必須
許可される値:tokushoho_missing_contacttokushoho_unreachablewebsite_unreachabledescription_insufficientprohibited_contentother
notestring | null必須
ExternalError
errorobject必須
プロパティを表示
codestring必須
messagestring必須
request_idstring必須
429

rate_limited。

errorobject必須
プロパティを表示
codestring必須
messagestring必須
request_idstring必須
500

internal。

errorobject必須
プロパティを表示
codestring必須
messagestring必須
request_idstring必須
502

stripe_error。Stripe の処理に失敗した。打ち直せる。

errorobject必須
プロパティを表示
codestring必須
messagestring必須
request_idstring必須
503

unavailable。

errorobject必須
プロパティを表示
codestring必須
messagestring必須
request_idstring必須
リクエスト
curl -X POST 'https://api.cozeni.net/external/v1/products/string/test-purchase/refund' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json'
レスポンス
{
  "status": "refunded",
  "refund_count": 0
}

このページは役に立ちましたか?