KitAI

Orders & Payments

PayPal and Stripe one-time purchase flow.

Overview

shipkit uses a one-time purchase model:

  • Order = entitlement record
  • Payment log = reconciliation record

Orders and payments live on the same billing page for both users and admins.

Products

  • Free
  • Lifetime (one-time purchase)

Core APIs

// Create an order (returns PayPal or Stripe checkout URL)
POST /api/orders/create

// Capture after approval (PayPal token or Stripe session_id)
POST /api/orders/capture

// Current entitlement
GET /api/orders/current

// Orders and payment logs
GET /api/orders

PayPal configuration

PAYPAL_CLIENT_ID=your_client_id
PAYPAL_CLIENT_SECRET=your_client_secret
PAYPAL_WEBHOOK_ID=your_webhook_id
PAYPAL_MODE=sandbox # sandbox | live

Stripe configuration

STRIPE_SECRET_KEY=your_stripe_secret_key
STRIPE_WEBHOOK_SECRET=your_stripe_webhook_secret

Payment flow

  1. Client calls POST /api/orders/create with provider paypal or stripe
  2. User approves and is redirected back with token (PayPal) or session_id (Stripe)
  3. Client calls POST /api/orders/capture
  4. Webhook syncs order and payment logs

Webhook events

Stripe webhooks: /api/webhooks/stripe

Stripe:

  • checkout.session.completed
  • checkout.session.async_payment_succeeded
  • checkout.session.async_payment_failed
  • charge.refunded

PayPal:

  • CHECKOUT.ORDER.APPROVED
  • PAYMENT.CAPTURE.COMPLETED
  • PAYMENT.CAPTURE.DENIED
  • PAYMENT.CAPTURE.REFUNDED

Billing page

/dashboard/billing shows:

  • Access status (Free / Lifetime)
  • Orders (read-only)
  • Payment logs (read-only)

On this page