RevKeen Docs
Using RevKeen

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

  1. Create a Checkout Session -- Your server creates a session with line items and redirect URLs.
  2. Redirect to Checkout -- Redirect the customer to the hosted checkout page.
  3. Customer Pays -- Customer enters payment details on the secure page.
  4. Confirmation -- Customer is redirected to your success URL with session details.
  5. Webhook (Optional) -- Receive a checkout.session.completed webhook.

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

ModeDescriptionUse Case
paymentOne-time paymentSingle purchases, one-time fees
subscriptionRecurring paymentSubscriptions, memberships
setupSave payment method onlyCollect 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

ElementDescription
Product infoName, description, image, price
Email fieldCustomer email (required)
Billing addressAddress for the invoice (configurable)
Payment formCard details or other payment methods
Discount codeOptional promo code field
Custom fieldsAny additional fields you configure
Terms checkboxAccept terms and conditions

Supported Payment Methods

MethodDescription
Credit/Debit CardsVisa, Mastercard, American Express, Discover
ACH Bank TransferDirect bank payments (US)
Apple PayOne-tap payments on Apple devices (Safari on macOS/iOS)
Google PayOne-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

  1. Go to Settings > Checkout Appearance
  2. Scroll to Wallet Payment Methods
  3. Toggle Apple Pay and/or Google Pay on
  4. Click Save

Device Compatibility

MethodSupported Devices
Apple PaySafari on macOS, iOS, and iPadOS with Apple Pay configured
Google PayChrome, 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:

  1. Customer enters their email address
  2. Checkout detects saved cards and shows Express checkout and Pay manually options
  3. Customer selects Express checkout
  4. If the customer has a trusted device (returning browser), their saved cards appear immediately
  5. Otherwise, a 6-digit verification code is sent to their email
  6. After verification, saved cards are displayed
  7. 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:

ProtectionDetail
Email verification6-digit OTP sent to the customer's email before showing saved cards
Trusted deviceVerified browsers are remembered for 30 days (skips OTP on return visits)
CVV re-entryCustomer must re-enter their card's CVV for every saved card payment
Rate limitingMax 3 verification attempts per code, 3 codes per 15 minutes
Credential on FileAll saved card charges comply with card network CoF rules

Success and Cancel URLs

Configure where customers go after checkout:

URL TypeWhen Used
Success URLAfter successful payment
Cancel URLIf customer abandons checkout

URL parameters available on success redirect:

  • checkout_id -- Checkout session ID
  • customer_id -- Customer ID
  • order_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=SUMMER20

Security

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 (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.

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

Via Dashboard

  1. Navigate to Product > Checkout Links
  2. Click + New Link
  3. Select one or more products/prices to include
  4. Configure options (quantity, discounts, custom fields)
  5. Customize the checkout appearance (optional)
  6. 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_xxx

Configuration Options

OptionDescriptionDefault
allow_quantityLet customers choose quantityfalse
allow_discount_codesShow discount code input fieldfalse
collect_billing_addressRequire full billing addressfalse
is_business_purchaseCollect business informationfalse
success_urlRedirect after successful paymentRevKeen success page
cancel_urlRedirect if customer cancelsNone

What Happens After Checkout

When a customer completes checkout through a link:

  1. Customer record created (if new) or matched (if existing)
  2. Order or Subscription created depending on price type
  3. Invoice generated for the purchase
  4. Payment processed via your payment gateway
  5. Confirmation email sent to customer
  6. Webhooks fired for your integrations
  7. Customer redirected to success page

Tracking and Analytics

RevKeen tracks performance metrics for each checkout link:

MetricDescription
ViewsNumber of times the checkout page was loaded
Sessions StartedNumber of checkout sessions initiated
CompletionsNumber of successful purchases
Conversion RateCompletions / Views percentage
RevenueTotal revenue from the link
Abandonment RateSessions started but not completed

Checkout Customization

Customize your checkout pages to match your brand and optimize for conversions.

Branding Options

OptionDescription
LogoYour logo displayed at the top
Primary ColorButton and accent color
Background ColorPage background
Button TextCustomize the pay button text
FaviconBrowser tab icon

Accessing Customization

  1. Go to Settings > General
  2. Scroll to Checkout Appearance
  3. Configure your branding options
  4. Preview changes in real-time
  5. Save your settings

Form Field Configuration

Control which fields appear on checkout:

FieldOptions
EmailAlways required
NameRequired, optional, or hidden
PhoneRequired, optional, or hidden
Billing AddressFull address, country only, or hidden
Shipping AddressRequired, 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:

  1. Go to Settings > Custom Fields
  2. Create a field with entity type "Checkout"
  3. Choose the field type (text, select, etc.)
  4. Mark as required if needed
  5. 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:

  1. Go to Checkout Appearance
  2. Enable Terms Checkbox
  3. Enter checkbox text and link to your terms
  4. 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
  1. Create dedicated links for campaigns -- Use separate links for different marketing channels to track performance.
  2. Use metadata for attribution -- Add campaign, source, or medium to link metadata for detailed analytics.
  3. Set custom success URLs -- Redirect to your own thank-you page for upsells or next steps.
  4. Enable discount codes for promotions -- Allow customers to apply discounts during checkout for special offers.

On this page