ShipAny Docs

Payment

Supported Providers

ProviderModesWebhook endpoint
StripeOne-time + subscriptionsPOST /api/payment/notify/stripe
PayPalOne-time + subscriptionsPOST /api/payment/notify/paypal
AlipayOne-timePOST /api/payment/notify/alipay
WeChat PayOne-time + subscriptionsPOST /api/payment/notify/wechat
CreemOne-time + subscriptionsPOST /api/payment/notify/creem

Credentials are configured in admin panel → Settings → Payment (e.g. stripe_secret_key, stripe_publishable_key, stripe_signing_secret; alipay_app_id / alipay_private_key / alipay_public_key; wechat_app_id / wechat_mch_id / wechat_api_v3_key …). Same-named env vars (STRIPE_SECRET_KEY etc.) work as fallbacks.

Pricing Catalog

Products live in src/config/pricing.ts — the server-side source of truth; prices sent from the client are ignored.

src/config/pricing.ts
{
  productId: 'starter_monthly',
  productName: 'Starter',
  description: 'Starter Monthly',
  type: PaymentType.SUBSCRIPTION,   // or PaymentType.ONE_TIME
  priceInCents: 900,
  currency: 'usd',
  credits: 5000,
  creditsValidDays: 30,
  plan: { name: 'starter', interval: 'month', intervalCount: 1 },
}

Default product keys: starter|pro|enterprise × monthly|yearly|lifetime.

Checkout Flow

  1. Client calls POST /api/payment/checkout with { product_id, payment_provider, redirect }
  2. Server validates the product against the catalog, creates an order, and returns { checkout_url }
  3. User pays on the provider's page, then returns via /api/payment/callback?order_no=...&redirect=...
  4. The provider's webhook (/api/payment/notify/[provider]) is the reliable completion path: it marks the order PAID, creates the subscription record if recurring, and grants credits

Always configure the webhook in the provider dashboard — the synchronous callback is only a fallback.