Skip to main content
Create an order for a one-time product using a checkout session. After creating the order, redirect the buyer to the returned checkoutUrl to complete payment on the PSP-hosted page.
POST /v1/actions/onetime-order/create-order
Authentication: API Key

Request Body

FieldTypeRequiredDescription
checkoutSessionIdstringYesCheckout session ID (cs_ + UUID format)
billingDetailobjectYesFinal billing details for the order
buyerEmailstringNoBuyer’s email address
buyerIpstringNoBuyer’s IP address (used for tax jurisdiction)
successUrlstringNoOverride redirect URL after successful payment

Billing Detail Object

FieldTypeRequiredDescription
countrystringYesISO 3166-1 alpha-2 country code
isBusinessbooleanYesWhether this is a business purchase
postcodestringNoPostal or ZIP code
statestringConditionalRequired for US and CA
businessNamestringConditionalRequired when isBusiness is true
taxIdstringConditionalRequired for EU countries when isBusiness is true

Example Request

import { WaffoPancake } from "@waffo/pancake-ts";

const client = new WaffoPancake({
  merchantId: process.env.WAFFO_MERCHANT_ID!,
  privateKey: process.env.WAFFO_PRIVATE_KEY!,
});

const { checkoutUrl } = await client.orders.createOnetimeOrder({
  checkoutSessionId: "cs_550e8400-e29b-41d4-a716-446655440000",
  billingDetail: {
    country: "US",
    isBusiness: false,
    state: "CA",
    postcode: "94105",
  },
  buyerEmail: "customer@example.com",
});

// Redirect the buyer to complete payment
console.log(checkoutUrl);

Success Response

{
  "data": {
    "checkoutUrl": "https://checkout.waffo.ai/my-store-abc123/payment/ORDER_TOKEN"
  }
}

Response Fields

FieldTypeDescription
checkoutUrlstringPSP-hosted payment page URL. Redirect the buyer here to complete payment.

Errors

StatusMessageDescription
400Missing required fieldscheckoutSessionId or billingDetail is missing
400Invalid billingDetailBilling detail validation failed
404Session not foundNo checkout session matches the given ID
404Session expiredThe checkout session has expired
After calling this endpoint, redirect the buyer to the checkoutUrl. The hosted payment page handles payment collection, 3D Secure authentication, and redirects back to your successUrl upon completion.