POST /api/v2/server-side-api/purchase/paddle/token/validate/

Paddle の購入を検証する

Adapty ダッシュボードのアプリ設定に登録された Paddle の認証情報を使用して、指定された Paddle トークンで購入を検証します。 購入が有効な場合、Paddle からトランザクション履歴が、指定された customer_user_id を持つ Adapty のプロファイルにインポートされます。 この customer_user_id を持つプロファイルが存在しない場合は、新たに作成されます。

Request body

customer_user_idstringrequired

お客様のシステムにおけるユーザーの ID

paddle_tokenstringrequired

一意の購入を表す Paddle オブジェクトのトークン。 トランザクション ID(txn_...)またはサブスクリプション ID(sub_...)のいずれかを使用できます

Responses

購入が正常に検証されました

Schema
dataobjectrequired
app_idstringrequired

アプリの内部 ID

profile_idstringrequired

Adapty プロファイル ID

customer_user_idstringrequired

お客様のシステムにおけるユーザーの ID

total_revenue_usdnumberrequired

プロファイルで獲得した USD 換算の総収益を表す浮動小数点値

segment_hashstringrequired

内部パラメータ

timestampintegerrequired

レスポンス時刻(ミリ秒)。競合状態の解決に使用します

custom_attributesarray of objectrequired

プロファイルに設定できるカスタム属性は最大 30 個です

keystringrequired

キーは 30 文字以下の文字列である必要があります。英字、数字、ダッシュ、ピリオド、アンダースコアのみ使用できます

valuestring | numberrequired

属性値は 50 文字以下である必要があります。文字列と浮動小数点数のみ使用できます

access_levelsarray of objectrequired

アクセスレベルオブジェクトの配列。顧客がアクセスレベルを持たない場合は空配列

access_level_idstring

アクセスレベルの識別子

storestring

アクセスレベルが購入されたストア

store_product_idstring

ストアにおけるプロダクト ID

store_base_plan_idstring

ストアにおけるベースプラン ID

store_transaction_idstring

ストアにおけるトランザクション ID

store_original_transaction_idstring

ストアにおける元のトランザクション ID

offerallOf

プロモーションオファーまたは初回オファーが適用された場合のオファー詳細

categorystring

オファーのカテゴリ

One of: "introductory", "promotional", "offer_code", "win_back"

typestring

オファーの種別

One of: "free_trial", "pay_as_you_go", "pay_up_front"

idstring

オファー ID

starts_atstring

アクセスレベルの開始日時

purchased_atstring

アクセスレベルが購入された日時

originally_purchased_atstring

アクセスレベルが最初に購入された日時

expires_atstring

アクセスレベルの有効期限

renewal_cancelled_atstring

更新がキャンセルされた日時

billing_issue_detected_atstring

請求問題が検出された日時

is_in_grace_periodboolean

アクセスレベルがグレース期間中かどうか

cancellation_reasonstring

キャンセルの理由

subscriptionsarray of objectrequired

サブスクリプションオブジェクトの配列。顧客がサブスクリプションを持たない場合は空配列

storestring

サブスクリプションが購入されたストア

store_product_idstring

ストアにおけるプロダクト ID

store_base_plan_idstring

ストアにおけるベースプラン ID

store_transaction_idstring

ストアにおけるトランザクション ID

store_original_transaction_idstring

ストアにおける元のトランザクション ID

offerallOf

プロモーションオファーまたは初回オファーが適用された場合のオファー詳細

categorystring

オファーのカテゴリ

One of: "introductory", "promotional", "offer_code", "win_back"

typestring

オファーの種別

One of: "free_trial", "pay_as_you_go", "pay_up_front"

idstring

オファー ID

environmentstring

環境(サンドボックス、本番)

purchased_atstring

サブスクリプションが購入された日時

originally_purchased_atstring

サブスクリプションが最初に購入された日時

expires_atstring

サブスクリプションの有効期限

renewal_cancelled_atstring

更新がキャンセルされた日時

billing_issue_detected_atstring

請求問題が検出された日時

is_in_grace_periodboolean

サブスクリプションがグレース期間中かどうか

cancellation_reasonstring

キャンセルの理由

non_subscriptionsarray of objectrequired

非サブスクリプションオブジェクトの配列。顧客が購入履歴を持たない場合は空配列

purchase_idstring

購入の一意の識別子

storestring

購入が行われたストア

store_product_idstring

ストアにおけるプロダクト ID

store_base_plan_idstring

ストアにおけるベースプラン ID

store_transaction_idstring

ストアにおけるトランザクション ID

store_original_transaction_idstring

ストアにおける元のトランザクション ID

purchased_atstring

購入が行われた日時

environmentstring

環境(サンドボックス、本番)

is_refundboolean

返金かどうか

is_consumableboolean

消耗型アイテムの購入かどうか

Example
{
  "data": {
    "app_id": "14c3d623-2f3a-455a-aa86-ef83dff6913b",
    "profile_id": "3286abd3-48b0-4e9c-a5f6-ac0a006804a6",
    "customer_user_id": "[email protected]",
    "total_revenue_usd": 0,
    "segment_hash": "8f45947bad31ab0c",
    "timestamp": 1736436751469,
    "custom_attributes": [
      {
        "key": "favourite_sport",
        "value": "yoga"
      }
    ],
    "access_levels": [],
    "subscriptions": [
      {
        "purchase_id": "5a7ab471-2299-45f7-ad69-1d395c1256e3",
        "store": "app_store",
        "store_product_id": "1year.premium",
        "store_base_plan_id": null,
        "store_transaction_id": "30002109551456",
        "store_original_transaction_id": "30002109551456",
        "purchased_at": "2022-10-12T09:42:50+00:00",
        "environment": "Production",
        "is_refund": false,
        "is_consumable": false
      }
    ],
    "non_subscriptions": []
  }
}

リクエストが不正です

Schema
errorsarray of objectrequired
sourcestring

エラーの発生源

errorsarray of string

エラーメッセージの配列

error_codestringrequired

エラーの短縮名

status_codeintegerrequired

HTTP ステータスコード

Example
{
  "errors": [
    "No products found"
  ],
  "error_code": "no_products_found",
  "status_code": 400
}

認証エラー

Schema
errorsarray of objectrequired
sourcestring

エラーの発生源

errorsarray of string

エラーメッセージの配列

error_codestringrequired

エラーの短縮名

status_codeintegerrequired

HTTP ステータスコード

Example
{
  "errors": [
    "Invalid API key"
  ],
  "error_code": "unauthorized",
  "status_code": 401
}

内部サーバーエラー

Schema
errorsarray of objectrequired
sourcestring

エラーの発生源

errorsarray of string

エラーメッセージの配列

error_codestringrequired

エラーの短縮名

status_codeintegerrequired

HTTP ステータスコード