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",
},
});curl -X POST "https://api.priceos.com/v1/customers/customer_123/checkout" \
-H "x-api-key: PRICEOS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"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"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Customers
Checkout
Create a Stripe checkout session for a customer using a Stripe product key, with an optional Stripe price ID override.
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",
},
});curl -X POST "https://api.priceos.com/v1/customers/customer_123/checkout" \
-H "x-api-key: PRICEOS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"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"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Body
application/json