Get Paid (Payment Links)
What is in a payment link?
A payment link is a Loop-hosted payment page that allows a customer to purchase one or many products, start a subscriptions or pay an invoice. Your customers click a button on your site and get redirected to a payment page hosted by Loop. Payment links are designed to be a customizable and reduce your development time.
To create a payment link, merchants define the Stripe products (using Stripe’s price-ids
) they would like the customer to see and purchase. Payment links can be created with no-code by using the company dashboard or by calling the Checkout Sessions Endpoint.
Payment links can:
- Take an immediate payment for an invoice, product purchase, or subscription purchase and record the customer, invoice, and subscription in Stripe
- Take immediate payment for an existing Stripe subscription and set future invoices for that subscription to be paid by crypto
- Collect a payment method to charge a customer in the future for an existing Stripe subscription or invoice
Payment links are completely configurable. Below we outline the various configurations a payment link can have, from free trials to acceptable tokens to pre-filled coupons and emails.
Payment links vs. checkout sessions
Payment links refer to general-purpose links that are reusable and not tied to a specific customer, subscription or invoice. When a payment link is opened, a new checkout session is created. This session represents a specific customer's payment session as they pay for purchases or subscriptions. A new session is created each time a customer attempts to pay.
Sessions may have custom parameters or be generic so that they are the same for each customer. Regardless, every session has a unique URL that is generated when the customer begins checking out. Sessions are valid only for 14 days and connect be reused once a payment has confirmed. Conversely, payment links are ever-green and can continue to generate new sessions when clicked on by a customer.
What happens during the checkout process?
When a customer uses a payment link, Loop will:
- Create a new customer in Stripe or find an existing customer
- Tell Stripe about the product(s) being purchased
- Stripe creates an invoice based on the billing settings associated with the products and/or subscription purchased
- Loop charges the customer onchain based on the Stripe bill and checkout session settings
- Loop marks the invoice in Stripe as
paid
, adding thetx hash
,wallet address
andamount
to the invoice's metadata and saves this data in our backend for easy querying
These steps happen within a matter of seconds, with any delays due to chain confirmation times. The customer will be held on the payment page until the payment is confirmed.
Important Notes
- Every checkout session will be a unique ID regardless if the details are the same
- By default checkout sessions expire in 14 days
- Currently, the tokens that a payment link can be paid with are defined at the product level. By default all items accept USDC on the networks that are deployed for your account. If you’d like to accept additional tokens, you can add them while creating the payment link on the dashboard or via API call to the update
_items_
endpoint for all the products contained in the link. A link for multiple products will accept the subset of tokens that both products accept. - To apply a free trial to a subscription, you must set this as a parameter in the checkout sessions creation. This can be done with no-code or by API.
Architecture
The base URL for all Loop payment links is:
checkout.loopcrypto.xyz/<checkout-sessions-id>
Where a checkout-session-id looks like cs_01jtnkb6gafqfvhq4j37xydxdr
This id
is provided in the response to the Checkout Sessions enpoint and the full link is provided on the company dashboard.

For demo accounts, the environment is defined by adding demo
to the link:
demo.checkout.loopcrypto.xyz/<checkout-sessions-id>
Verion 1 link archeticture
V1 of Loop payment links had the format:
checkout.loopcrypto.xyz/<entity-id>/<item-id>
These link are automatically converted to the latest version.
Creating a payment link
No-code

Loop’s dashboard makes it easy to create a payment link. You can create two types of links:
- General purpose link: For new customers. Reusable across multiple customers, like on your website or in marketing emails.
- Link for a specific customer: Tied to an existing customer in Stripe. Useful for sending personalized links or managing subscriptions.
Loop’s dashboard will guide you through creating a payment link.
For Developers
Payment links can be made by calling the Checkout Sessions endpoint.
Required parameters
Links must either contain elements
, externalSubscriptionId
or an externalInvoiceId
. These inputs are mutually exclusive. This is the only required field.
Below we go through some example links to help outline how to use the endpoint.
Take payment for a new subscription or purchase
To take a payment for a new subscription or purchase, you will need to define the element(s). An element is the Stripe products (sometimes referred to as items in Loop) the customer is purchasing. Elements are defined by using either Stripe’s price-id
or Loop’s internal item-id
. You can combine multiple items in one payment link.
In Stripe, price-ids
can be found under Product Catalogue -> Products -> Price, in the top right corner. They started with price_
When combining multiple products with recurring payment terms, the combination of products must follow Stripe rules for a valid subscription. Thus, the products must have the same payment frequency (e.g. monthly payments). Products that take a one-time payment can be combined with any frequency.
To take a payment for an existing Stripe customer, pass in the externalCustomerId
along with the elements.
The externalCustomerId
looks like cus_SEQNcTSJ7jSktU
. This id can be found by clicking on the specific customer you want to charge, under details.
<h4>To take a payment for a new subscription that you want to start on a specific date<h4>
To take a payment for a new subscription that you want to start on a specific date (e.g. Jan 1), use the billDate
in conjunction with the elements.
Switch an existing Stripe customer with an existing Stripe subscription to crypto
To switch an existing Stripe customer with an existing Stripe subscription to pay in crypto, create a link using the externalSubscriptionId
. There is no need to pass in any elements, invoice-id/number or customer-id - we will automatically grab the products for you based on the subscription's details.
Please note, if you just made a new subscription in Stripe and Stripe just made the 1st invoice, you must finalize that first invoice in Stripe before sending the payment link. When you do this, Stripe will set the due date to midnight UTC in your account's timezone. Loop collects on payments based on Stripe's due date. Thus, if you want this payment to be collected immediately, set the payInvoiceImmediately: true
.
Example sub-id: sub_1RJwTRPRR297Cb62I2FSWjgi
When switching a customer from fiat to crypto, Loop will charge the customer on the billDate
for the next upcoming invoice, using the exact due date to the minute.
If you are modifying a subscription (i.e. changing the products), resetting the billing cycle, and moving the customer to crypto, you should use the payInvoiceImmediately
in conjunction with the sub-id
. The payInvoiceImmediately
parameter will ignore the Stripe bill date and process the invoice immediately. This is important because when you reset the billing cycle, Stripe will finalize the invoice in 1 hour and by default set the bill date to midnight UTC (it will display the bill 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). Thus, if you want to get paid immediately, you can override this by using the payInvoiceImmediately: true
parameter.
Charging for an invoice that is not tied to a Stripe subscription
To charge for an invoice that is not tied to a Stripe subscription, you can create a Checkout Session using either the externalInvoiceId
or the externalInvoiceNumber
.
Example externalInvoiceId: in_1RJwTRPRR297Cb62OuQn6ogQ
Example externalInvoiceNumber: A3XRD8ZK-0004
Additional parameters
Loop provides several additional parameters:
Parameter | Description |
---|---|
freeTrialDays | Only for subscriptions. If provided, the Stripe subscription will be created with this trial period. |
couponCode | If provided, the coupon will automatically be applied to the payment link. We only support certain coupon parameters defined here |
If provided, the customer will not be able to change this email. If a Stripe customer does not exist, it will be created with this email. | |
referenceId | This will be included in all webhooks |
cartEnabled | Enable or disable cart on the checkout page |
Metadata | Info that will be included on the Agreement Created webhook (Loop webhook) that is sent when someone uses the payment link to attach a payment method |
minimumAllowanceAmount | By default loop requires payers to have enough to make the first payment made via loop. You can require an amount higher than the 1st payment using this parameter. |
minimumBalanceAmount | By default loop requires the customer to have enough to cover the first payment made via loop, you can require a higher amount using this parameter. |
Updated 9 days ago