Skip to main content
POST
/
v1
/
customers
/
{customerId}
/
checkout
Node.js
import { PriceOS } from "priceos";
import type { MyFeatures } from "./priceos.types";

const priceos = new PriceOS<MyFeatures>(process.env.PRICEOS_API_KEY!);

const session = await priceos.customers.createCheckout("customer_123", {
  productKey: "starter_monthly",
  successUrl: "https://app.acme.com/billing/success",
  customerInfo: {
    name: "Alex Johnson",
    email: "alex@acme.com",
  },
});
{
  "url": "https://checkout.stripe.com/c/pay/cs_test_123"
}

Headers

x-api-key
string
required

API key from your PriceOS dashboard.

Path Parameters

customerId
string
required

Internal customer ID.

Body

application/json
productKey
string
required

Product key from your PriceOS dashboard. Must reference a Stripe product (not a custom product).

stripePriceId
string | null

Optional Stripe price ID. When provided, it must be active and belong to the selected Stripe product.

successUrl
string<uri>

Optional checkout success redirect URL.

cancelUrl
string<uri>

Optional checkout cancel redirect URL.

metadata
object

Optional metadata to attach to the Stripe checkout session.

customerInfo
object

Optional customer info used when creating/updating the customer.

checkoutParams
object

Optional Stripe Checkout Session params to merge into the request.

Response

Checkout session

url
string<uri>
required

Stripe checkout URL.