Skip to main content

Understanding One Time Payments

A one time payment represents a single transaction between you and your customer. When a customer makes a one time payment, they are charged once for the full amount of the purchase.

Key Concepts

Payment Status

A payment can be in different states throughout its lifecycle:
  • Pending: The payment has been initiated but not yet completed
  • Paid: The payment has been successfully processed
  • Refunded: The payment has been refunded to the customer
  • Partially Refunded: The payment has been partially refunded to the customer

Creating a One Time Payment

To create a one time payment:
  1. Create a one-time product in your Creem dashboard (set billing type to “one-time”)
  2. Generate a checkout session for the payment
  3. Direct your customer to the checkout URL
  • Next.js
  • TypeScript SDK
  • Better Auth
  • REST API
"use client"; // Optional: Works with server components

import { CreemCheckout } from "@creem_io/nextjs";

export function BuyButton() {
  return (
    <CreemCheckout
      productId="prod_YOUR_PRODUCT_ID"
      metadata={{
        customerId: "cust_123",
        source: "web"
      }}
    >
      <button>Buy Now</button>
    </CreemCheckout>
  );
}

Next.js SDK Documentation

Learn more about the Next.js adapter and advanced features.

Handling Successful Payments

After a successful payment, users are redirected to your success_url with payment details as query parameters:
https://yoursite.com/success?checkout_id=ch_xxx&order_id=ord_xxx&customer_id=cust_xxx&product_id=prod_xxx
Query parameterDescription
checkout_idThe ID of the checkout session created for this payment.
order_idThe ID of the order created after successful payment.
customer_idThe customer ID, based on the email that executed the successful payment.
product_idThe product ID that the payment is related to.
request_idOptional. The request/reference ID you provided when creating this checkout.
signatureAll previous parameters signed by Creem using your API-key, verifiable by you.
For production applications, we recommend using Webhooks to handle payment events.

Managing Payments

Creem provides several payment management features:
  • Refund payments: Process full or partial refunds directly through the Creem Dashboard
  • Payment history: View detailed transaction history
  • Payment metadata: Add custom data to payments for tracking
  • Custom fields: Collect additional information during checkout