Tara checkout
The Tara checkout API creates a Stripe Checkout session for a Tara subscription: a $249 one-time device lease plus a $50/month recurring subscription. All caregiver and recipient details (phone, shipping address, recipient name, living situation, primary concern) are captured directly on the Stripe Checkout page.
These endpoints live on the consumer-facing site at https://sevah.ai.
https://sevah.ai
Check if checkout is enabled
GET /api/tara/checkout-config
Returns whether Stripe checkout is configured and the display amounts.
No authentication required. This endpoint is called by the public /plans page to decide whether to show the checkout form or a fallback contact card.
Response
{
"enabled": true,
"lease_cents": 24900,
"monthly_cents": 5000,
"currency": "usd"
}
| Field | Type | Description |
|---|---|---|
enabled | boolean | Whether Stripe checkout is configured and active. |
lease_cents | integer | One-time device lease amount in cents (e.g. 24900 = $249). |
monthly_cents | integer | Monthly subscription amount in cents (e.g. 5000 = $50). |
currency | string | ISO currency code (always usd). |
Start a checkout session
POST /api/tara/checkout
Content-Type: application/json
Creates a Stripe Checkout session and returns the URL the customer should be redirected to. The subscription intent is persisted in the database before the Stripe call, so it survives a network failure.
Request body
{
"name": "Dana Reyes",
"email": "dana@example.com",
"coupon": "alphaprime",
"source": "plans",
"contains_phi": false
}
| Field | Type | Required | Description |
|---|---|---|---|
name | string | No | Customer name (max 120 chars). |
email | string | No | Customer email (max 160 chars). Pre-fills the Stripe Checkout email. |
coupon | string | No | Stripe coupon ID (case-insensitive, normalized to lowercase). |
source | string | No | Attribution source (default: plans). |
contains_phi | boolean | No | Must be false for public requests (default). |
Response (200)
{
"ok": true,
"subscription_id": "a37c2adf7c9d411bbcbf4deb9703f14e",
"checkout_url": "https://checkout.stripe.com/c/pay/cs_live_...",
"lease_cents": 24900,
"monthly_cents": 5000,
"currency": "usd"
}
| Field | Type | Description |
|---|---|---|
ok | boolean | Always true on success. |
subscription_id | string | Internal subscription ID for tracking. |
checkout_url | string | URL the client should redirect to (Stripe Checkout). |
lease_cents | integer | One-time device lease in cents. |
monthly_cents | integer | Monthly subscription in cents. |
currency | string | ISO currency code. |
Errors
| Status | Meaning |
|---|---|
400 | Invalid coupon code. |
503 | Checkout is not configured (Stripe keys or Price IDs missing). |
502 | Stripe API call failed. |
Stripe Checkout page
When the customer visits the checkout_url, Stripe collects:
- Customer name and email (Stripe native)
- Phone number (Stripe
phone_number_collection) - Shipping/delivery address (US addresses, Stripe
shipping_address_collection) - Care recipient name (custom field:
recipient_name) - Recipient's living situation (custom field dropdown:
living_situation)- Lives alone / Lives with spouse-partner / Lives with family / Assisted living
- Main concern for parent (custom field dropdown:
primary_concern)- Companionship / Safety and check-ins / Medication reminders / Memory and cognitive support / Staying connected with family
- Card and billing details (Stripe native)
Coupon codes
Coupons are applied server-side as Stripe Checkout Session discounts. The coupon ID is normalized to lowercase before sending to Stripe (Stripe coupon IDs are case-sensitive slugs).
Alpha Prime (beta tester coupon)
| Property | Value |
|---|---|
| Coupon ID | alphaprime |
| Discount | 100% off for 6 months (repeating) |
| First invoice | $0 (waives $249 device lease + first $50 month) |
| Months 2-6 | $0 (subscription waived) |
| Month 7+ | $50/month resumes |
| Total savings | $549 per beta tester |
Webhook: checkout.session.completed
When payment succeeds, Stripe fires a checkout.session.completed webhook to POST /api/stripe/webhook. The webhook is authenticated via HMAC-SHA256 signature verification (not bearer token).
The webhook handler:
- Verifies the Stripe signature.
- Routes to Tara or Merlin based on
metadata.product. - Extracts all caregiver, recipient, shipping, and phone details from the Stripe payload.
- Updates the subscription record from
pendingtopaid.
Extracted fields
| Field | Source in Stripe payload |
|---|---|
customer_details.email | |
| Name | customer_details.name |
| Phone | customer_details.phone |
| Recipient name | custom_fields[recipient_name].text.value |
| Living situation | custom_fields[living_situation].dropdown.value |
| Primary concern | custom_fields[primary_concern].dropdown.value |
| Shipping address | shipping_details.address (formatted as string) |
| Recipient ZIP | shipping_details.address.postal_code |
| Stripe subscription ID | subscription |
| Stripe customer ID | customer |
Rate limits
POST /api/tara/checkout: 10 requests per minute per IP.GET /api/tara/checkout-config: No rate limit (public config endpoint).- Stripe webhook: Signature-verified, no rate limit.
Curl example
# Check if checkout is enabled
curl https://sevah.ai/api/tara/checkout-config
# Start a checkout session
curl --silent --show-error \
--header 'Content-Type: application/json' \
--data '{"name":"Dana Reyes","email":"dana@example.com","coupon":"alphaprime","source":"plans"}' \
https://sevah.ai/api/tara/checkout