Checkout
Create checkout links, customize the payment experience, and track conversions
Checkout Sessions provide a hosted payment page that handles payment collection, card validation, and 3D Secure authentication. They are the fastest way to start accepting payments. This page covers checkout sessions, hosted checkout, checkout links, and customization.
How It Works
- Create a Checkout Session -- Your server creates a session with line items and redirect URLs.
- Redirect to Checkout -- Redirect the customer to the hosted checkout page.
- Customer Pays -- Customer enters payment details on the secure page.
- Confirmation -- Customer is redirected to your success URL with session details.
- Webhook (Optional) -- Receive a
checkout.session.completedwebhook.
Creating a Checkout Session
const session = await client.checkout.sessions.create({
// Associate with an existing customer (optional)
customerId: 'cus_xxxxxxxx',
// Line items to purchase
lineItems: [
{
productId: 'prod_xxxxxxxx',
quantity: 1,
},
],
// Where to redirect after checkout
successUrl: 'https://yourapp.com/success?session_id={CHECKOUT_SESSION_ID}',
cancelUrl: 'https://yourapp.com/cancel',
// Optional: Allow promo codes
allowPromotionCodes: true,
// Optional: Collect billing address
billingAddressCollection: 'required',
});
// Redirect customer to checkout
return redirect(session.data.url);session = client.checkout.sessions.create(
customer_id="cus_xxxxxxxx",
line_items=[
{"product_id": "prod_xxxxxxxx", "quantity": 1}
],
success_url="https://yourapp.com/success?session_id={CHECKOUT_SESSION_ID}",
cancel_url="https://yourapp.com/cancel",
allow_promotion_codes=True,
billing_address_collection="required"
)
return redirect(session.data.url)The
{CHECKOUT_SESSION_ID}placeholder in your success URL will be replaced with the actual session ID.
Session Modes
| Mode | Description | Use Case |
|---|---|---|
payment | One-time payment | Single purchases, one-time fees |
subscription | Recurring payment | Subscriptions, memberships |
setup | Save payment method only | Collect card for future use |
Subscription Checkout
For recurring products, the session automatically creates a subscription:
const session = await client.checkout.sessions.create({
mode: 'subscription',
customerId: 'cus_xxxxxxxx',
lineItems: [
{
productId: 'prod_monthly_plan',
quantity: 1,
},
],
subscriptionData: {
trialDays: 14,
},
successUrl: 'https://yourapp.com/welcome',
cancelUrl: 'https://yourapp.com/pricing',
});Handling Success
When a customer completes checkout, they are redirected to your success URL. Retrieve the session to verify payment:
// In your success page handler
const sessionId = searchParams.get('session_id');
const session = await client.checkout.sessions.retrieve(sessionId);
if (session.data.paymentStatus === 'paid') {
// Payment successful - fulfill the order
const customerId = session.data.customerId;
const subscriptionId = session.data.subscriptionId;
await fulfillOrder(session.data);
}Important: Don't rely solely on the success redirect. Use webhooks to handle payment confirmation for critical fulfillment logic.
Hosted Checkout
RevKeen Hosted Checkout provides secure, professionally designed payment pages that handle all the complexity of collecting payments while maximizing conversion rates.
What is Hosted Checkout?
Hosted Checkout is a complete payment page hosted by RevKeen:
- Fully managed -- No code required
- PCI compliant -- Handles sensitive card data securely
- Mobile optimized -- Works on any device
- Conversion optimized -- Designed for maximum conversions
- Customizable -- Match your brand
Checkout Page Elements
| Element | Description |
|---|---|
| Product info | Name, description, image, price |
| Email field | Customer email (required) |
| Billing address | Address for the invoice (configurable) |
| Payment form | Card details or other payment methods |
| Discount code | Optional promo code field |
| Custom fields | Any additional fields you configure |
| Terms checkbox | Accept terms and conditions |
Supported Payment Methods
| Method | Description |
|---|---|
| Credit/Debit Cards | Visa, Mastercard, American Express, Discover |
| ACH Bank Transfer | Direct bank payments (US) |
| Apple Pay | One-tap payments on Apple devices (Safari on macOS/iOS) |
| Google Pay | One-tap payments on devices with Google Pay configured |
Available payment methods depend on your gateway configuration. Apple Pay and Google Pay must be enabled in Settings > Checkout Appearance.
Apple Pay and Google Pay
RevKeen supports Apple Pay and Google Pay as additional payment methods on your hosted checkout pages. When enabled, customers see wallet tabs alongside the standard card payment form.
Enabling Wallet Payments
- Go to Settings > Checkout Appearance
- Scroll to Wallet Payment Methods
- Toggle Apple Pay and/or Google Pay on
- Click Save
Device Compatibility
| Method | Supported Devices |
|---|---|
| Apple Pay | Safari on macOS, iOS, and iPadOS with Apple Pay configured |
| Google Pay | Chrome, Safari, Firefox, and Edge on devices with Google Pay |
The wallet tabs automatically appear only on supported devices. Customers on unsupported devices will see the standard card payment form.
Limitations
- Auto-charge subscriptions -- Apple Pay cannot be used for subscriptions with automatic renewal billing. Customers will be prompted to use a card instead.
- Card vaulting -- Wallet tokens are one-time use and cannot be saved for future payments.
Returning Customers and Saved Cards
When a returning customer enters their email, the checkout detects whether they have saved cards on file and presents two checkout paths:
Express Checkout (Saved Card)
Customers can pay quickly using a previously saved card. For security, saved cards are only shown after the customer verifies their identity:
- Customer enters their email address
- Checkout detects saved cards and shows Express checkout and Pay manually options
- Customer selects Express checkout
- If the customer has a trusted device (returning browser), their saved cards appear immediately
- Otherwise, a 6-digit verification code is sent to their email
- After verification, saved cards are displayed
- Customer selects a card, enters the CVV, and completes payment
After a successful email verification, the browser is remembered as a trusted device for 30 days. The customer won't need to verify again on future visits from the same browser.
Manual Payment (New Card)
Always available alongside express checkout. Customers can enter new card details without any verification. This ensures nobody is blocked if email delivery is slow or they prefer to use a different card.
Saved Card Security
Saved card access is protected by multiple security layers:
| Protection | Detail |
|---|---|
| Email verification | 6-digit OTP sent to the customer's email before showing saved cards |
| Trusted device | Verified browsers are remembered for 30 days (skips OTP on return visits) |
| CVV re-entry | Customer must re-enter their card's CVV for every saved card payment |
| Rate limiting | Max 3 verification attempts per code, 3 codes per 15 minutes |
| Credential on File | All saved card charges comply with card network CoF rules |
Success and Cancel URLs
Configure where customers go after checkout:
| URL Type | When Used |
|---|---|
| Success URL | After successful payment |
| Cancel URL | If customer abandons checkout |
URL parameters available on success redirect:
checkout_id-- Checkout session IDcustomer_id-- Customer IDorder_id-- Order ID (for one-time)subscription_id-- Subscription ID (for recurring)
Pre-filling Customer Data
Pre-fill checkout fields using URL parameters:
https://checkout.revkeen.com/pay/xyz123
?email=john@example.com
&name=John%20Doe
&discount=SUMMER20Security
Hosted checkout provides enterprise-grade security:
- PCI DSS Level 1 -- Highest level of compliance
- HTTPS everywhere -- All traffic encrypted
- 3D Secure -- Additional authentication when required
- Fraud detection -- Built-in fraud prevention
- Session timeouts -- Automatic expiration
- Saved card verification -- Email OTP + CVV required before using saved cards
- Trusted device cookies -- Secure, HttpOnly cookies scoped per merchant and customer
Checkout Links
Checkout Links (also called Payment Links) are shareable URLs that let you accept payments without writing any code. Share them via email, social media, QR codes, or embed them on your website.
What is a Checkout Link?
A Checkout Link is a pre-configured URL that opens a hosted checkout page. When a customer clicks the link, they see your product details, enter their payment information, and complete the purchase.
Example checkout link: https://checkout.revkeen.com/l/pl_abc123xyz
Use Cases
- Email campaigns -- Include payment links in marketing emails for direct conversion
- Social media -- Share links on Twitter, LinkedIn, or Instagram bio
- QR codes -- Generate QR codes for in-person events or printed materials
- Invoices -- Include payment links in custom invoices or proposals
Creating Checkout Links
Via Dashboard
- Navigate to Product > Checkout Links
- Click + New Link
- Select one or more products/prices to include
- Configure options (quantity, discounts, custom fields)
- Customize the checkout appearance (optional)
- Save and copy the link URL
Via API
const link = await client.paymentLinks.create({
priceId: 'price_xxxxxxxx',
// Optional settings
allowQuantity: true,
allowDiscountCodes: true,
collectBillingAddress: true,
successUrl: 'https://yoursite.com/thank-you',
cancelUrl: 'https://yoursite.com/checkout-cancelled',
metadata: {
campaign: 'summer-sale',
source: 'email'
}
});
console.log(link.data.url); // https://checkout.revkeen.com/l/pl_xxxConfiguration Options
| Option | Description | Default |
|---|---|---|
allow_quantity | Let customers choose quantity | false |
allow_discount_codes | Show discount code input field | false |
collect_billing_address | Require full billing address | false |
is_business_purchase | Collect business information | false |
success_url | Redirect after successful payment | RevKeen success page |
cancel_url | Redirect if customer cancels | None |
What Happens After Checkout
When a customer completes checkout through a link:
- Customer record created (if new) or matched (if existing)
- Order or Subscription created depending on price type
- Invoice generated for the purchase
- Payment processed via your payment gateway
- Confirmation email sent to customer
- Webhooks fired for your integrations
- Customer redirected to success page
Tracking and Analytics
RevKeen tracks performance metrics for each checkout link:
| Metric | Description |
|---|---|
| Views | Number of times the checkout page was loaded |
| Sessions Started | Number of checkout sessions initiated |
| Completions | Number of successful purchases |
| Conversion Rate | Completions / Views percentage |
| Revenue | Total revenue from the link |
| Abandonment Rate | Sessions started but not completed |
Checkout Customization
Customize your checkout pages to match your brand and optimize for conversions.
Branding Options
| Option | Description |
|---|---|
| Logo | Your logo displayed at the top |
| Primary Color | Button and accent color |
| Background Color | Page background |
| Button Text | Customize the pay button text |
| Favicon | Browser tab icon |
Accessing Customization
- Go to Settings > General
- Scroll to Checkout Appearance
- Configure your branding options
- Preview changes in real-time
- Save your settings
Form Field Configuration
Control which fields appear on checkout:
| Field | Options |
|---|---|
| Always required | |
| Name | Required, optional, or hidden |
| Phone | Required, optional, or hidden |
| Billing Address | Full address, country only, or hidden |
| Shipping Address | Required, optional, or hidden |
Fewer fields typically increase conversion rates. Only collect information you actually need.
Custom Fields
Add your own fields to collect additional information:
- Go to Settings > Custom Fields
- Create a field with entity type "Checkout"
- Choose the field type (text, select, etc.)
- Mark as required if needed
- The field appears on all checkouts (or specific ones)
Examples of custom checkout fields:
- T-shirt size for merchandise
- Company name for B2B sales
- Purchase order number
- How did you hear about us?
- License plate (parking services)
Discount Code Field
Configure the promo code field:
- Show always -- Field visible by default
- Show on click -- "Have a promo code?" link
- Hide -- No discount field shown
- Pre-apply -- Auto-apply a specific discount
Terms and Conditions
Add required agreement checkboxes:
- Go to Checkout Appearance
- Enable Terms Checkbox
- Enter checkbox text and link to your terms
- Optionally add a privacy policy link
Example checkbox text:
I agree to the [Terms of Service](https://yoursite.com/terms)
and [Privacy Policy](https://yoursite.com/privacy)Product Display Options
Configure how products appear on checkout:
- Product image -- Show/hide product image
- Description -- Show/hide product description
- Quantity selector -- Allow customers to adjust quantity
- Price breakdown -- Show subtotal, taxes, discounts
Subscription-Specific Options
For recurring products:
- Billing frequency -- Show monthly/yearly toggle
- Trial messaging -- Customize trial period text
- Future billing -- Show when next charge occurs
- Cancellation policy -- Display cancellation terms
Confirmation Page
Customize the post-purchase experience:
- Success message -- Thank you text
- Next steps -- What happens next
- Call to action -- Button to your site or portal
- Custom redirect -- Redirect to your own page
Mobile Optimization
Checkout is automatically optimized for mobile:
- Responsive layout for all screen sizes
- Touch-friendly input fields
- Mobile payment methods (Apple Pay, Google Pay)
- Numeric keyboard for card numbers
- Auto-zoom prevention
Checkout Link Best Practices
- Create dedicated links for campaigns -- Use separate links for different marketing channels to track performance.
- Use metadata for attribution -- Add campaign, source, or medium to link metadata for detailed analytics.
- Set custom success URLs -- Redirect to your own thank-you page for upsells or next steps.
- Enable discount codes for promotions -- Allow customers to apply discounts during checkout for special offers.
Related
- Subscriptions -- Learn about subscription lifecycle management
- Payments and Refunds -- Handle payment processing
- Customer Portal -- Post-purchase experience