> ## Documentation Index
> Fetch the complete documentation index at: https://docs.craveup.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Stripe Payments

> Set up Stripe Connect for payment processing in your storefront.

Crave uses [Stripe Connect](https://stripe.com/connect) to process payments. Each restaurant connects their own Stripe account to receive payouts directly. This guide covers the full Stripe setup.

## How it works

<Steps>
  <Step title="Crave creates a Connect account">
    When you sign up, Crave provisions a Stripe Connect Express account for your organization.
  </Step>

  <Step title="Complete Stripe onboarding">
    Stripe collects your bank details, identity verification, and tax information.
  </Step>

  <Step title="Storefront collects payment">
    Your storefront uses Stripe.js with the connected account to securely collect card details.
  </Step>

  <Step title="Stripe processes the charge">
    Funds are routed to your connected Stripe account after Crave's platform fee.
  </Step>
</Steps>

## Prerequisites

* A Crave account with at least one location
* A bank account for payouts
* Government-issued ID for verification (Stripe requirement)

## Complete Stripe onboarding

1. In the Dashboard, go to **Settings > Payments**
2. Click **Complete Stripe Setup**
3. Stripe's embedded onboarding form collects:
   * Business type (individual, company, non-profit)
   * Business address and phone
   * Bank account or debit card for payouts
   * Identity verification (SSN or ID upload)
   * Tax information (EIN or SSN)
4. Once submitted, Stripe verifies your information (usually instant, sometimes 1-2 business days)

<Tip>
  You can start building your storefront immediately. Stripe onboarding only needs to be complete before accepting real payments.
</Tip>

## Storefront integration

Your storefront only needs the **Stripe publishable key** on the client. The secret key and connected account routing are handled by Crave's backend.

### Environment setup

```env filename=".env.local" theme={null}
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_live_your_key
```

For test mode, use the test publishable key (`pk_test_...`).

### Payment flow

```tsx filename="app/checkout/page.tsx" theme={null}
import { loadStripe } from '@stripe/stripe-js';
import { Elements } from '@stripe/react-stripe-js';

// 1. Create payment intent via Crave API
const payment = await storefront.payments.createIntent(locationId, cartId);

// 2. Initialize Stripe with the restaurant's connected account
const stripePromise = loadStripe(
  process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY!,
  { stripeAccount: payment.stripeAccountId }
);

// 3. Wrap checkout UI with Elements provider
<Elements stripe={stripePromise} options={{ clientSecret: payment.clientSecret }}>
  <PaymentForm />
</Elements>
```

For the full implementation, see the [Accept Payments guide](/guides/accept-payments).

## Testing

In test mode, Crave automatically uses Stripe's test environment:

| Card                  | Scenario           |
| --------------------- | ------------------ |
| `4242 4242 4242 4242` | Successful payment |
| `4000 0000 0000 3220` | 3D Secure required |
| `4000 0000 0000 0002` | Card declined      |

Toggle test/live mode from the Dashboard under **Settings > Developer > Mode**.

## Payout schedule

Stripe pays out to your bank account on a rolling basis:

| Region | Default schedule  |
| ------ | ----------------- |
| US     | 2 business days   |
| UK/EU  | 7 business days   |
| Other  | Varies by country |

View payout details in the Stripe Dashboard linked from **Settings > Payments > View in Stripe**.

## Platform fees

Crave charges a platform fee per transaction, deducted before payout. The fee depends on your plan:

| Plan       | Fee           |
| ---------- | ------------- |
| Starter    | 3.5% + \$0.30 |
| Pro        | 2.5% + \$0.30 |
| Enterprise | Custom        |

This is in addition to Stripe's standard processing fee (2.9% + \$0.30 for US cards).

## Troubleshooting

### "Stripe onboarding incomplete"

* Return to **Settings > Payments** and click **Complete Stripe Setup**
* Stripe may need additional documents for verification
* Check your email for messages from Stripe

### Payments failing in production

* Verify you're using the **live** publishable key (`pk_live_...`), not the test key
* Ensure the restaurant's Stripe Connect account is fully verified
* Check the Stripe Dashboard for declined payment details

<Snippet file="need-help.mdx" />
