Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Payments

StyleGrab uses Stripe for subscription billing.

Plans

PlanPriceExtractionsTeamsFeatures
Free$0/mo50/month1Basic extraction
Pro$29/mo1,000/month5Webhooks, diffing, priority
EnterpriseCustomUnlimitedUnlimitedSLA, dedicated support

Endpoints

Create Checkout Session

Start a Stripe checkout flow.

POST /api/payments/checkout

Request Body:

{
  "plan": "pro",
  "success_url": "https://yoursite.com/success",
  "cancel_url": "https://yoursite.com/cancel"
}

Response:

{
  "checkout_url": "https://checkout.stripe.com/c/pay/cs_test_..."
}

Redirect the user to checkout_url to complete payment.


Customer Portal

Get a link to the Stripe customer portal for managing subscriptions.

POST /api/payments/portal

Request Body:

{
  "return_url": "https://yoursite.com/dashboard"
}

Response:

{
  "portal_url": "https://billing.stripe.com/p/session/..."
}

The customer portal allows users to:

  • Update payment method
  • View invoices
  • Cancel subscription
  • Change plan

Subscription Status

Get the current subscription status.

GET /api/payments/status

Response:

{
  "plan": "pro",
  "status": "active",
  "current_period_end": "2024-02-15T00:00:00Z",
  "cancel_at_period_end": false,
  "usage": {
    "extractions_used": 342,
    "extractions_limit": 1000,
    "reset_date": "2024-02-01T00:00:00Z"
  }
}

Status Values

StatusDescription
activeSubscription is active
past_duePayment failed, retrying
canceledSubscription ended
trialingIn trial period

Stripe Webhooks

StyleGrab processes Stripe webhooks automatically. No action needed, but for reference:

EventAction
checkout.session.completedActivate subscription
invoice.paidRenew subscription
invoice.payment_failedMark as past due
customer.subscription.deletedDeactivate subscription

Usage Limits

When you exceed your plan’s extraction limit:

{
  "error": {
    "code": "usage_limit_exceeded",
    "message": "Monthly extraction limit reached (50/50). Upgrade to Pro for more.",
    "upgrade_url": "https://stylegrab.dev/pricing"
  }
}

Enterprise

For custom plans, volume discounts, or SLAs, contact sales@stylegrab.dev.

Enterprise features:

  • Unlimited extractions
  • Dedicated infrastructure
  • Custom SLA (99.9% uptime)
  • Priority support
  • SSO/SAML authentication
  • Audit logs