Skip to content

Stripe integration

Overview

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.

Info

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.

Prerequisites

You need an active Stripe account.

Preparing Stripe account

General

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.

API keys

  1. Register an account on https://stripe.com/ if you don't have one.
  2. Log in and go to "Developers" section.
  3. Navigate to "API keys".
  4. Remember the Publishable key.

  5. Click "Create restricted key".

  6. Enter "Project X" as key name.

  7. Enable the following permissions:

    Resource type Permission
    Customers Write
    Events Read
    PaymentIntents Write
    PaymentMethods Write
    SetupIntents Write

  8. Click "Create key".

  9. Click "Reveal key" on a newly created restricted key and remember it.

Webhook

  1. Go to "Webhooks" section and click "Add endpoint".

  2. Go to Project X API provider portal, navigate to Checkout → Payment integration and copy Stripe webhook URL from the form field.

  3. Paste it into Endpoint URL on Stripe.

  4. Select the following events:

  5. Click "Add events" and then "Add endpoint".

  6. Now, when the endpoint is added, click on its URL.

  7. On the endpoint page click "Reveal" to see the webhook signing secret. Remember it.

Configuring Project X

  1. Navigate to Checkout → Payment integration.
  2. Enter the values from Stripe into respective fields.

  3. Click "Save". That's it: Stripe integration is now set up.

All new subscriptions will use Stripe for payment processing.

Warning

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.