POST /api/v1/sdk/purchase/stripe/token/validate/

Validate Stripe purchase

Validates a purchase using the provided Stripe token using the credentials of Stripe in your App Settings inside Adapty Dashboard. If the purchase is valid, the transaction history is imported from Stripe to the profile in Adapty with the specified customer_user_id. If there was no profile with this customer_user_id before — it will be created.

Profile events are generated along the way and imported transactions are counted towards MTR.

Request body

dataobjectrequired
typestringrequired

The type of the resource

One of: "stripe_receipt_validation_result"

attributesobjectrequired
customer_user_idstringrequired

The ID of your user in your system

stripe_tokenstringrequired

Token of a Stripe object that represents a unique purchase. Could either be a token of Stripe's Subscription (sub_XXX) or Payment Intent (pi_XXX)

Responses

Purchase validated successfully

Schema
dataobjectrequired

Response data (null for successful validation)

Example
{
  "data": null
}

Bad request

Schema
errorsarray of objectrequired
detailstringrequired

Descriptive information about the error

sourceobjectrequired
pointerstringrequired

References the exact location in the request document causing the issue

statusstringrequired

HTTP status code

Example
{
  "errors": [
    {
      "detail": "none is not an allowed value",
      "source": {
        "pointer": "/data/attributes/stripe_token"
      },
      "status": "400"
    }
  ]
}

Unauthorized

Schema
errorsarray of objectrequired
sourcestring

Source of the error

errorsarray of string

Array of error messages

error_codestringrequired

Short error name

status_codeintegerrequired

HTTP status code

Internal server error

Schema
errorsarray of objectrequired
sourcestring

Source of the error

errorsarray of string

Array of error messages

error_codestringrequired

Short error name

status_codeintegerrequired

HTTP status code