Skip to main content

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.

Base URL
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"
}
FieldTypeDescription
enabledbooleanWhether Stripe checkout is configured and active.
lease_centsintegerOne-time device lease amount in cents (e.g. 24900 = $249).
monthly_centsintegerMonthly subscription amount in cents (e.g. 5000 = $50).
currencystringISO 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
}
FieldTypeRequiredDescription
namestringNoCustomer name (max 120 chars).
emailstringNoCustomer email (max 160 chars). Pre-fills the Stripe Checkout email.
couponstringNoStripe coupon ID (case-insensitive, normalized to lowercase).
sourcestringNoAttribution source (default: plans).
contains_phibooleanNoMust 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"
}
FieldTypeDescription
okbooleanAlways true on success.
subscription_idstringInternal subscription ID for tracking.
checkout_urlstringURL the client should redirect to (Stripe Checkout).
lease_centsintegerOne-time device lease in cents.
monthly_centsintegerMonthly subscription in cents.
currencystringISO currency code.

Errors

StatusMeaning
400Invalid coupon code.
503Checkout is not configured (Stripe keys or Price IDs missing).
502Stripe 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)

PropertyValue
Coupon IDalphaprime
Discount100% 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:

  1. Verifies the Stripe signature.
  2. Routes to Tara or Merlin based on metadata.product.
  3. Extracts all caregiver, recipient, shipping, and phone details from the Stripe payload.
  4. Updates the subscription record from pending to paid.

Extracted fields

FieldSource in Stripe payload
Emailcustomer_details.email
Namecustomer_details.name
Phonecustomer_details.phone
Recipient namecustom_fields[recipient_name].text.value
Living situationcustom_fields[living_situation].dropdown.value
Primary concerncustom_fields[primary_concern].dropdown.value
Shipping addressshipping_details.address (formatted as string)
Recipient ZIPshipping_details.address.postal_code
Stripe subscription IDsubscription
Stripe customer IDcustomer

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