Getting paid by an existing Stripe customer for a new Stripe subscription

The instructions on this page assume that you already have a Customer record created in Stripe.

There are two ways to do this:

  1. (Preferred) Let Loop create the subscription for you by simply passing in the customerId in the payment link
  2. Create the subscription yourself in Stripe and follow the "change a subscription to pay by Loop directions" directions, with additional steps noted in the section below

Allowing Loop to create the subscription in Stripe is the preferred method if you'd like immediate payment for your subscription.

Loop creates a subscription for an existing customer

To have Loop create the subscription in Stripe, you simply need to create a checkout link with the items that you would like in the subscription and append to the end the Stripe customerId. When a customer users this link, Loop will create the subscription with the included products in Stripe and charge the customer immediately for payment.

To find, the customerIdhead to the individual customer's page within your Stripe account. You should see the Id on the right side of the page.

Creating the link

You can create a checkout link using the Loop dashboard, adding in the products that should be included in this subscription. Then, you will need to manually append to the end ?customerId=<customerId>.

If you are appending multiple functionalities together (including multiple items), the first functionality requires the "?" and the other functionalities are appended with an "&" in place of the "?". See more here.

Here is the link's structure:

<https://checkout.loopcrypto.xyz/><entity-id>/<item-id>?customerId=<customerId>

Here is an example link:

https://demo.checkout.loopcrypto.xyz/9b303194-2156-46ef-bae7-fd35150e3bbc/2d021f28-0d57-4793-9262-cce50b256174?customerId=cus_R62wNwwZFH1j1X

Loop will show an error message on the checkout page if the customerId is invalid.


Creating the subscription yourself in Stripe

If your subscription requires quantities, taxes or you would not like to collect payment immediately, you can follow "change a subscription to pay by Loop directions" directions, with one additional step - you must finalize the bill for the first invoice. If you do not complete this step before the customer goes through the checkout process, the payment will not confirm.

When you finalize the invoice, Stripe will set the due date to midnight UTC (it will display the due date in your account's timezone - i.e. you may see a time that is the next day or before midnight if your account is not in UTC) and be when Loop will process the payment.

Thus, if you want to get paid immediately (i.e. not wait until midnight UTC) you must use Stripe's Update Invoice endpoint to set the due_date to now and then you must finalize the invoice, either using Stripe's endpoint or on Stripe's dashboard.