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/ordersPayPal configuration
PAYPAL_CLIENT_ID=your_client_id
PAYPAL_CLIENT_SECRET=your_client_secret
PAYPAL_WEBHOOK_ID=your_webhook_id
PAYPAL_MODE=sandbox # sandbox | liveStripe configuration
STRIPE_SECRET_KEY=your_stripe_secret_key
STRIPE_WEBHOOK_SECRET=your_stripe_webhook_secretPayment flow
- Client calls
POST /api/orders/createwith providerpaypalorstripe - User approves and is redirected back with
token(PayPal) orsession_id(Stripe) - Client calls
POST /api/orders/capture - Webhook syncs order and payment logs
Webhook events
Stripe webhooks: /api/webhooks/stripe
Stripe:
checkout.session.completedcheckout.session.async_payment_succeededcheckout.session.async_payment_failedcharge.refunded
PayPal:
CHECKOUT.ORDER.APPROVEDPAYMENT.CAPTURE.COMPLETEDPAYMENT.CAPTURE.DENIEDPAYMENT.CAPTURE.REFUNDED
Billing page
/dashboard/billing shows:
- Access status (Free / Lifetime)
- Orders (read-only)
- Payment logs (read-only)