Skip to main content
POST
/
v1
/
checkout-links
TypeScript SDK
import { Solifyn } from 'solifyn';

const solifyn = new Solifyn({ apiKey: 'your_private_api_key_here' });

// Create a new shareable checkout link
const link = await solifyn.checkoutLinks.create({
  productId: 'prod_019e56a1...',
  title: 'Summer Sale Link',
  allowQuantityChange: true
});
console.log('Checkout Link Created:', link);
{
  "id": "chk_123",
  "quantity": 1,
  "showDiscounts": true,
  "createdAt": "2025-01-01T12:00:00Z",
  "updatedAt": "2025-01-01T12:00:00Z",
  "title": "Winter Bundle Checkout",
  "productId": "prod_123",
  "collectionId": "col_123",
  "customerName": "John Doe",
  "customerEmail": "customer@example.com",
  "addressLine1": "123 Main St",
  "city": "New York",
  "state": "NY",
  "postalCode": "10001",
  "country": "US",
  "redirectUrl": "https://example.com/success",
  "cancelUrl": "https://example.com/cancel"
}

Authorizations

Authorization
string
header
required

Authenticate requests using your standard bearer API key (e.g. YOUR_API_KEY).

Body

application/json
productId
string
required

Product database/Whop ID to sell

Maximum string length: 50
Example:

"prod_123"

title
string

The friendly display title of this checkout link

Maximum string length: 100
Example:

"Winter Bundle Checkout"

collectionId
string

Optional collection database ID to sell

Maximum string length: 50
Example:

"col_123"

customerName
string

Prefilled customer name for checkout inputs

Maximum string length: 100
Example:

"John Doe"

customerEmail
string

Prefilled customer email for checkout inputs

Maximum string length: 255
Example:

"customer@gmail.com"

addressLine1
string

Prefilled customer billing address line 1

Maximum string length: 255
Example:

"123 Main St"

city
string

Prefilled customer billing city

Maximum string length: 100
Example:

"San Francisco"

state
string

Prefilled customer billing state

Maximum string length: 100
Example:

"CA"

postalCode
string

Prefilled customer billing zip/postal code

Maximum string length: 20
Example:

"94111"

country
string

Prefilled customer billing country (2-letter ISO)

Maximum string length: 10
Example:

"US"

quantity
object

Override quantity for checkout session

Example:

1

redirectUrl
string

The absolute URL to redirect to upon successful payment completion

Maximum string length: 2048
Example:

"https://mysite.com/success"

cancelUrl
string

The absolute URL to redirect to if a customer cancels the payment

Maximum string length: 2048
Example:

"https://mysite.com/cancel"

showDiscounts
boolean
default:true

Whether to display discount input form fields on checkout screen

Example:

true

Response

201 - application/json

Checkout link created successfully.

id
string<uuid>
required

The checkout link ID

Example:

"chk_123"

quantity
number
required

Quantity to purchase

Example:

1

showDiscounts
boolean
required

Whether to show discounts on the checkout page

Example:

true

createdAt
string<date-time>
required

Timestamp when the link was created

Example:

"2025-01-01T12:00:00Z"

updatedAt
string<date-time>
required

Timestamp when the link was last updated

Example:

"2025-01-01T12:00:00Z"

title
string | null

The title of the checkout link

Example:

"Winter Bundle Checkout"

productId
string | null

The linked Product ID

Example:

"prod_123"

collectionId
string | null

The linked Collection ID

Example:

"col_123"

customerName
string | null

Pre-filled customer name

Example:

"John Doe"

customerEmail
string | null

Pre-filled customer email

Example:

"customer@example.com"

addressLine1
string | null

Pre-filled address line 1

Example:

"123 Main St"

city
string | null

Pre-filled city

Example:

"New York"

state
string | null

Pre-filled state

Example:

"NY"

postalCode
string | null

Pre-filled postal code

Example:

"10001"

country
string | null

Pre-filled country

Example:

"US"

redirectUrl
string | null

URL to redirect to after successful payment

Example:

"https://example.com/success"

cancelUrl
string | null

URL to redirect to if payment is cancelled

Example:

"https://example.com/cancel"