Skip to content

Billing

4-tier developer subscription from €9.99/mo to €129/mo. See Pricing for the full model.

Developer Billing

Developers subscribe once to access the API. The subscription covers all their businesses.

POST /v1/developer/billing/checkout

Create a Stripe Checkout session to subscribe.

bash
curl -X POST https://api.availengine.com/v1/developer/billing/checkout \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"plan": "starter"}'

Returns:

json
{
  "checkout_url": "https://checkout.stripe.com/..."
}

Redirect the developer to checkout_url. On success they're sent to /developer?subscription=success.

POST /v1/developer/billing/portal

Open the Stripe Customer Portal to manage payment method, view invoices, or cancel.

bash
curl -X POST https://api.availengine.com/v1/developer/billing/portal \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Returns:

json
{
  "portal_url": "https://billing.stripe.com/..."
}

Stripe Connect

For businesses that want to accept deposits directly into their own Stripe account.

POST /v1/billing/connect/onboard

Create or reuse a Stripe Express connected account. Returns an onboarding URL — the business owner completes setup on Stripe's hosted page.

bash
curl -X POST https://api.availengine.com/v1/billing/connect/onboard \
  -H "Authorization: Bearer avail_live_YOUR_KEY"

Returns:

json
{
  "onboarding_url": "https://connect.stripe.com/..."
}

On completion, the owner is redirected to /dashboard?stripe=connected.

GET /v1/billing/connect/status

Check the status of the business's Stripe Connect account.

bash
curl https://api.availengine.com/v1/billing/connect/status \
  -H "Authorization: Bearer avail_live_YOUR_KEY"
json
{
  "connected": true,
  "details_submitted": true,
  "payouts_enabled": true,
  "connect_id": "acct_1ABC..."
}
FieldDescription
connectedA Connect account exists
details_submittedOwner completed Stripe onboarding
payouts_enabledAccount can receive transfers
connect_idStripe account ID

Stripe Webhooks

POST /webhooks/stripe

Stripe sends events here. AvailEngine handles:

EventAction
checkout.session.completedActivates developer subscription, confirms deposit bookings
checkout.session.expiredCancels pending deposit bookings
customer.subscription.updatedSyncs subscription state
customer.subscription.deletedMarks subscription cancelled
invoice.payment_succeededClears past-due status
invoice.payment_failedSets past_due — API returns 402
payment_intent.succeededConfirms deposit payment
payment_intent.payment_failedMarks deposit as failed
payment_intent.amount_capturable_updatedMoves deposit to held status
account.updatedSyncs Stripe Connect account status

Never call this endpoint directly — it's for Stripe server-to-server communication. Verify signatures with STRIPE_WEBHOOK_SECRET.

Released under the MIT License.