Stripe
Installing Stripe in Purchasely
Installation of Stripe in Purchase is performed in 4 steps
I. Installing the Stripe App
Go to the Purchasely's app listing on Stripe apps marketplace

If you have more than one Stripe account (for each application) then connect the account you want to associate with the application.
A Stripe application combines a Stripe account with only one Purchasely Application. If your Stripe account works with more than one Purchasely Application, please contact our support team via Intercom.
Read below on how to handle both Stripe "test" and "production" environments.
Click on install app. The list of authorizations required for the proper functioning of our application is then displayed.

Validate the authorizations requested

The installation is complete, you can proceed with the configuration.

II. Configuration of the Stripe app
Once the Stripe Purchasely app is installed you need to configure it. Go to the Stripe console in Settings > installed apps > Purchasely.


II.1. Associate with Purchasely
Once on the app configuration you need to associate it with your Purchasely account and app. To do this, start by clicking on "SIGN IN".

Select the Purchasely app you wish to link your Stripe account to.
Click on "NEXT".


II.2 Confirm Stripe app link with your mobile application
Once you have selected the application, you will be redirected to Stripe to finalise the configuration by clicking on "CONFIRM".

The app will appear as below when properly configured in Purchasely and Stripe.


III. Configuration of plans
In order for Purchasely to associate Stripe products, they must be defined in the plans. Also you must associate each Pricing Stripe to a Purchasely Plan otherwise the purchase will not be taken into account by Purchasely.
From the Stripe console, copy the API ID (price) ...

Then paste this ID into the corresponding plan:

Do not associate more than one Stripe Price to one given Purchasely plan if the Stripe Prices have different periodicicy, or different level of entitlement.
For such use cases, create another plan.
IV. Associating Stripe subscriptions to Purchasely
This last step allows Purchasely to retrieve and associate a purchase with a user.
The principle is the same as for the migration of an existing subscriber
To send us this information, simply call our API and provide it with
stripe_object_id
: the Stripe subscription IDstripe_price_id
: the Stripe Price Id for this subscription (ON STRIPE)user_id
: the user_id associated with the purchase, the same as you enter in the SDK during configuration.stripe_object_type
: the type of Stripe object sent, currently we only acceptsubscription
curl \
--request POST \
-i \
-H "Content-Type: application/json" \
-H "X-API-KEY:{{YOUR_API_KEY}}" \
-H "X-PLATFORM-TYPE:STRIPE" \
--data '{"stripe_object_id":"{{STRIPE_SUBSCRIPTION_ID}}","stripe_price_id":"{{STRIPE_PRICE_ID_FOR_THIS_SUBSCRIPTION}}", "user_id":"{{SAME_ID_AS_IN_SDK_CONFIGURATION}}", "stripe_object_type":"subscription"}' \
https://s2s.purchasely.io/receipts
Example request:
curl \
--request POST \
-i \
-H "Content-Type: application/json" \
-H "X-API-KEY:AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE" \
-H "X-PLATFORM-TYPE:STRIPE" \
--data '{"stripe_object_id":"sub_1MluxqJaEiB9UwXB34gmtzCB","stripe_price_id":"price_1MbKJHJaEiB9UwXBPt0fFq4O", "user_id":"jdo-cus_Msq9YfCiFkFzVx", "stripe_object_type":"subscription"}' \
https://s2s.purchasely.io/receipts

Last updated
Was this helpful?