Scrawn LogoScrawn Docs
SDK ReferenceFunctions

Collect Payments

Generate checkout links to collect payments from users

Overview

The collectPayment method generates a checkout link for users to complete their payment. This integrates with your configured payment provider (e.g., LemonSqueezy) to handle the payment flow.

Basic Usage

Generate a checkout link for a user:

import { biller } from "./scrawn/biller";

const checkoutLink = await biller.collectPayment("user-123");

Redirect them to the payment page:

// In your route handler (Express, Next.js, etc.)
res.redirect(checkoutLink);

In simple terms: Give me a payment link for user user-123 where they can go and pay all their outstanding amount (which is being tracked by scrawn).

Parameters

Prop

Type

Response

Prop

Type

Next Steps