Stripe integration is one of two options offered by Project X for payment collection.
Project X Billing Engine is fully integrated with Stripe and all you need to do in order to start accepting payments is to set up a Stripe account and configure Project X.
You don't have to create products/prices/customer accounts in Stripe — Project X does that automatically.
In contrast to API marketplaces, Project X doesn't act as a middleman in the payment process.
All payments are made directly to your Stripe account.
Project X Billing Engine automatically calculates amounts due, initiates payments and tracks the status of each payment in order to enable or disable access for customers to your API.
Project X doesn't use Stripe Billing or any Stripe product other than payment processing, which guarantees the lowest fees possible.
For each subscription that uses Stripe as payment provider, Project X automatically issues invoices at the beginning of each billing period. It then attempts automatic collection of the payment and, if the attempt fails, the customer can pay the invoice manually.
The first invoice in the subscription has to always be paid manually in order for Project X to configure for the customer a new payment method in Stripe, which will later be used to automatically collect recurring payments.
Unlike Stripe Billing, Project X allows having prices with different billing periods within a single subscription.
E.g., you can bill a flat fee of $5 each month, and charge for usage every week. Project X is able to handle these cases correctly.
You need an active Stripe account.
Preparing Stripe account¶
For Project X to successfully manage your Stripe payments, the following data is required:
- Publishable key
- Secret key
- Webhook signing secret
Project X stores this information in encrypted form, you won't be able to see it again once it's saved.
Follow the steps below to obtain the necessary credentials.
- Register an account on https://stripe.com/ if you don't have one.
- Log in and go to "Developers" section.
- Navigate to "API keys".
Remember the Publishable key.
Click "Create restricted key".
Enter "Project X" as key name.
Enable the following permissions:
Resource type Permission Customers Write Events Read PaymentIntents Write PaymentMethods Write SetupIntents Write
Click "Create key".
Click "Reveal key" on a newly created restricted key and remember it.
Go to "Webhooks" section and click "Add endpoint".
Go to Project X API provider portal, navigate to Checkout → Payment integration and copy Stripe webhook URL from the form field.
Paste it into Endpoint URL on Stripe.
Select the following events:
Click "Add events" and then "Add endpoint".
Now, when the endpoint is added, click on its URL.
On the endpoint page click "Reveal" to see the webhook signing secret. Remember it.
Configuring Project X¶
- Navigate to Checkout → Payment integration.
Enter the values from Stripe into respective fields.
Click "Save". That's it: Stripe integration is now set up.
All new subscriptions will use Stripe for payment processing.
If you decide to erase Stripe credentials from Project X, keep in mind that payments for the active subscriptions will not be processed anymore.
It means, all subscriptions made with Stripe will eventually be canceled as unpaid.