Create Subscription Order
Create a subscription order using a checkout session. Requires a checkout session created via Create Checkout Session.
POST /v1/actions/subscription-order/create-order
Authentication: API Key
Request Body
| Field | Type | Required | Description |
|---|
checkoutSessionId | string | Yes | UUID of the checkout session |
billingDetail | object | Yes | Billing details (see below) |
buyerEmail | string | No | Buyer’s email address |
buyerIp | string | No | Buyer’s IP address |
successUrl | string | No | Override redirect URL on success |
Billing Detail
| Field | Type | Required | Description |
|---|
country | string | Yes | ISO 3166-1 alpha-2 country code |
isBusiness | boolean | Yes | Whether this is a business purchase |
state | string | Conditional | Required for US, CA |
postcode | string | No | Postal/ZIP code |
businessName | string | No | Business name (when isBusiness: true) |
taxId | string | No | Tax ID (required for EU B2B) |
Example Request
curl -X POST https://waffo-pancake-auth-service.vercel.app/v1/actions/subscription-order/create-order \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY_TOKEN" \
-d '{
"checkoutSessionId": "session-uuid",
"billingDetail": {
"country": "US",
"isBusiness": false,
"state": "CA",
"postcode": "94105"
},
"buyerEmail": "customer@example.com"
}'
Success Response
{
"data": {
"checkoutUrl": "https://checkout.waffo.ai/store-slug/checkout/token"
}
}
Redirect the buyer to checkoutUrl to complete payment. The checkout session locks the product version, pricing, and currency at creation time.
Cancel Subscription
Cancel an active subscription. The subscription enters canceling status and remains active until the end of the current billing period, when it transitions to canceled.
POST /v1/actions/subscription-order/cancel-order
Authentication: API Key
Request Body
| Field | Type | Required | Description |
|---|
orderId | string | Yes | UUID of the subscription order |
Example Request
curl -X POST https://waffo-pancake-auth-service.vercel.app/v1/actions/subscription-order/cancel-order \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY_TOKEN" \
-d '{"orderId": "subscription-order-uuid"}'
Success Response
{
"data": {
"orderId": "subscription-order-uuid",
"status": "canceling"
}
}
The subscriber retains access until the end of the current billing period. The status changes from canceling to canceled when the period ends. No further charges will be made.
Change Product
Change a subscription to a different product (upgrade/downgrade).
POST /v1/actions/subscription-order/change-product
Authentication: API Key
This endpoint is not yet implemented (returns 501). It will be available in a future release.
Request Body
| Field | Type | Required | Description |
|---|
orderId | string | Yes | UUID of the current subscription order |
targetProductId | string | Yes | UUID of the target subscription product |
Reactivate Subscription
Reactivate a canceled subscription.
POST /v1/actions/subscription-order/reactivate-order
Authentication: API Key
This endpoint is not yet implemented (returns 501). It will be available in a future release.
Request Body
| Field | Type | Required | Description |
|---|
orderId | string | Yes | UUID of the subscription order |
productName | string | Yes | Product name for confirmation |
Subscription Status Values
| Status | Description |
|---|
pending | Subscription created, awaiting first payment |
active | Active and billing normally |
trialing | In free trial period |
canceling | Cancellation requested, active until period end |
past_due | Payment failed, retrying |
canceled | Subscription ended, no further billing |
expired | Subscription expired |