Skip to main content
Create a subscription order using a checkout session. Requires a session created via Create Checkout Session with productType: "subscription".
POST /v1/actions/subscription-order/create-order
Authentication: API Key

Request Body

FieldTypeRequiredDescription
checkoutSessionIdstringYesCheckout Session ID (cs_ + UUID format)
billingDetailobjectYesBilling details for tax calculation
buyerEmailstringNoBuyer’s email address
buyerIpstringNoBuyer’s IP address (for tax calculation)
successUrlstringNoOverride redirect URL on success

Billing Detail

FieldTypeRequiredDescription
countrystringYesISO 3166-1 alpha-2 country code
isBusinessbooleanYesWhether this is a business purchase
statestringConditionalRequired for US, CA
postcodestringNoPostal/ZIP code
businessNamestringConditionalRequired when isBusiness: true
taxIdstringConditionalTax ID (required for EU B2B exemption)

Example Request

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

Success Response (200)

{
  "data": {
    "checkoutUrl": "https://waffo.ai/store/my-store/checkout/token"
  }
}

Response Fields

FieldTypeDescription
checkoutUrlstringRedirect URL for the buyer to complete payment
Redirect the buyer to checkoutUrl to complete payment. The checkout page handles payment collection, tax calculation, and 3D Secure authentication. The session locks the product version, pricing, and currency.

Error Responses

StatusDescription
400Missing required fields / invalid billing detail
401Authentication failed
404Checkout session not found or expired
500Internal server error