The answer depends on the fact you're storing. Facts that originate in Stripe can only be copied out, and facts Stripe never receives have to live with you. Below: which data goes where, what querying Stripe on each request costs, how to keep a copy honest, and the five ways the two records drift. If you'd rather keep one record, skip to the order on Flint.
Where to start
Split the question by data
| Data | Stripe as the source of truth? | Why |
|---|
| Charge, refund, and dispute state | Yes. They originate in Stripe | Your database can only hold a copy, written from webhooks and fresh reads, never from your own request having returned. |
| Subscription status and entitlements | Yes, with a local copy for checks | Stripe holds the truth, but checking it on every request runs into the per-endpoint and read limits. Copy the few fields you gate on. |
| Customer identity | Split it | Your user row owns identity, and the Stripe Customer owns the payment profile. Store the cus_ ID on your row. Copying the email too gives one fact two owners. |
| Product catalog and prices | Either, with one writer | Catalogs fork when both the Dashboard and your admin can edit them. Pick the side that writes, and treat the other as read-only. |
| The order: items sold, fulfillment, stock | No | A Checkout Session is a payment with line items attached. It has no fulfillment state and no stock, and Stripe's fulfillment guide has you record fulfillment status yourself. |
| Application state in metadata | No | 50 keys of up to 500 characters, with no validation or transactions. Stripe's docs say to keep larger data in your own database and store its ID in metadata. |
Copy Stripe's payment state safely
Payment state is Stripe's to declare. A local copy stays correct under three rules, and each drift mode below breaks one of them.
Outcomes are read, never assumed. Your code records that it asked for a payment. Whether the payment succeeded enters your database only from a webhook or a fresh read of the object. The success redirect isn't proof: Stripe's fulfillment guide says customers aren't guaranteed to reach the success page.
Events are signals, not state. Stripe can deliver an event more than once and doesn't guarantee order, and its webhooks guide says not to order events by their created time. So record each event ID once, then read the object and write what the API returns:
// One handler writes your copy of Stripe's payment state.
// Checkout code records that it asked; only reads from Stripe
// record what happened.
const event = stripe.webhooks.constructEvent(rawBody, signature, secret);
await db.tx(async (t) => {
// Stripe can deliver an event more than once: record its ID
// in the same transaction as the write.
const first = await t.result(
`INSERT INTO processed_events (event_id) VALUES ($1)
ON CONFLICT DO NOTHING`,
[event.id],
);
if (first.rowCount === 0) return;
// Delivery is unordered, so the payload may be stale. Read the
// object and write what the API returns now.
const pi = await stripe.paymentIntents.retrieve(event.data.object.id);
await t.none(
`UPDATE payments SET status = $1, updated_at = now()
WHERE payment_intent_id = $2`,
[pi.status, pi.id],
);
});
Other writers exist. Refunds issued in the Dashboard, subscriptions canceled by support, payment methods changed in the customer portal, and disputes opened by the bank never pass through your code. Webhooks are the only complete feed of those changes, and a scheduled diff against the list endpoints catches deliveries that failed after Stripe's retries, which run for up to three days in live mode.
What querying Stripe on each request costs
The alternative to a copy is calling Stripe whenever you need a fact. Stripe's limits are sized for payment traffic:
- Live mode allows 100 requests a second across the account, shared with the payment requests that must not fail. Sandboxes allow 25.
- Most endpoints allow 25 requests a second, and every ID counts toward the same endpoint: retrieving 25 different subscriptions in one second uses the whole budget for that call. Search allows 20.
- By default, live mode allows 50 requests in progress at once, and list requests and expansions are the slow ones that use it up.
- Reads are allocated at an average of 500 per transaction over a rolling 30 days, with a minimum of 10,000 a month. Writes have no allocation.
The allocation ties your read budget to your sales, not your traffic. Take an app with 1,000 subscribers and about 1,000 payments a month: that allows 500,000 reads in 30 days. If the app checks the subscriber's plan in Stripe on every request, and each subscriber makes 50 requests a day, it needs 1,500,000 reads, three times the allocation, all of them counted against the 100 a second that renewals also use.
Search doesn't help on the request path. Stripe's docs say not to use it for read-after-write flows, because new data takes up to a minute to become searchable. For bulk reads, Stripe points to Sigma and Data Pipeline, which put your data in a warehouse for analytics, not for serving a page. That leaves a local copy for anything your app checks often: backfill from the list endpoints, webhooks for changes, and a scheduled reconciliation for what the webhooks missed.
The half Stripe can't hold
A store's record of a sale answers five questions: what was sold, what was paid, what was refunded against which items, what shipped, and what stock is left. Stripe answers the second. A Checkout Session carries line items, returned only when you expand them, and has no field for fulfillment. A refund is an amount against a payment, not a decision about items. Stock isn't tracked, and the object that once held orders was retired.
Stripe's fulfillment guide fills the gap with your code. Your fulfill_checkout function must handle being called more than once, even concurrently, for the same session; retrieve the session with line items expanded; check payment_status; and record fulfillment status. The guide also suggests saving the payment details and line items in your own database and updating your stock records. One sale then looks like this:
Your database becomes the record of the sale, Stripe stays the record of the money, and a cart ID in metadata joins them. Every later question crosses that join. Was this order refunded? Your rows for the items, Stripe for the money. Why does finance's export disagree with the database? Check both. The reconciliation job that compares the two becomes infrastructure your store depends on.
The five ways the copies drift
On Flint, the order is the one record
Flint is a payments API where the order holds the sale and its payment state together, and as a headless commerce API it keeps stock and fulfillment on the same order. Flint processes cards on Stripe, but you don't need a Stripe account or a mapping table: payment results land on the order. Create the order first, with your own ID in external_reference_id:
curl -X POST https://api.withflintpay.com/v1/orders \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-cart-1842" \
-d '{
"external_reference_id": "cart-1842",
"line_items": [{
"type": "custom",
"name": "Design workshop seat",
"quantity": 2,
"unit_price_money": {"amount": 45000, "currency": "USD"},
"fulfillment": {"requirement": "none"}
}],
"metadata": {"campaign": "spring-workshops"}
}'
Then collect it. Hosted checkout is one call, and your own payment form or an invoice pays the same order the same way:
curl -X POST https://api.withflintpay.com/v1/checkout-sessions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: checkout-cart-1842" \
-d '{
"type": "order",
"order_id": "ord_1kmn0aExample",
"redirects": {
"success_url": "https://example.com/thanks",
"cancel_url": "https://example.com/cart"
}
}'
Whichever way the buyer paid, the result is on the order, and your cart ID finds it without a metadata search:
curl "https://api.withflintpay.com/v1/orders?external_reference_id=cart-1842" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"data": [
{
"order_id": "ord_1kmn0aExample",
"external_reference_id": "cart-1842",
"version": 1792512240,
"status": "closed",
"closed_reason": "paid",
"payment_status": "paid",
"refund_status": "none",
"fulfillment_status": "not_applicable",
"pricing_amounts": {
"subtotal_money": {"amount": 90000, "currency": "USD"},
"total_money": {"amount": 90000, "currency": "USD"}
},
"settlement_amounts": {
"paid_money": {"amount": 90000, "currency": "USD"},
"refunded_money": {"amount": 0, "currency": "USD"},
"outstanding_money": {"amount": 0, "currency": "USD"}
},
"checkout_session_ids": ["cs_1kmn0aExample"],
"payment_intent_ids": ["pi_1kmn0aExample"],
"refund_ids": [],
"metadata": {"campaign": "spring-workshops"}
}
],
"request_id": "req_..."
}
One object answers the questions two systems answered before. payment_status says whether the money arrived, refund_status whether any went back, and settlement_amounts holds what was paid, refunded, and still outstanding next to the pricing_amounts the buyer agreed to. Full payment closes the order with closed_reason paid; a later refund moves refund_status and refunded_money without reopening it. The checkout_session_ids, payment_intent_ids, and refund_ids link every collection and refund to the order.
The rest of the sale rides on the same record. For goods that ship, fulfillment_status moves from not_fulfilled through partially_fulfilled to fulfilled as you record fulfillments; a service like this workshop seat is not_applicable. Refunds name line items, and Flint works out the tax and the order's refunded totals. When you track stock in Flint, inventory_reservation_id names the reservation holding the order's units.
Keep a local copy without the drift
You can still copy orders into your database, and the copy has one upstream record instead of two halves. Flint webhooks also arrive at least once and in no guaranteed order, but every order carries a version that increases with each change. A late snapshot can't overwrite a newer one, so the handler writes the payload it received without a second API call:
// Flint order events: order.created, order.updated, order.paid,
// order.closed, order.partially_refunded, order.refunded.
// verifyFlintWebhook is the JWT check from the Webhooks guide.
const event = await verifyFlintWebhook(rawBody, headers);
const order = event.data.object; // the order, as GET returns it
await db.tx(async (t) => {
const first = await t.result(
`INSERT INTO processed_events (event_id) VALUES ($1)
ON CONFLICT DO NOTHING`,
[event.webhook_event_id],
);
if (first.rowCount === 0) return;
// version increases with every change to the order, so a late
// snapshot never overwrites a newer one. No extra API call.
await t.none(
`INSERT INTO orders (order_id, cart_id, version, payment_status,
refund_status, fulfillment_status)
VALUES ($1, $2, $3, $4, $5, $6)
ON CONFLICT (order_id) DO UPDATE SET
version = EXCLUDED.version,
payment_status = EXCLUDED.payment_status,
refund_status = EXCLUDED.refund_status,
fulfillment_status = EXCLUDED.fulfillment_status
WHERE orders.version < EXCLUDED.version`,
[order.order_id, order.external_reference_id, order.version,
order.payment_status, order.refund_status, order.fulfillment_status],
);
});
order.paid fires when the order becomes fully paid on any surface: hosted checkout, a payment link, an invoice, or a direct API payment. That makes it the one fulfillment trigger. For reconciliation, list what changed since your last run and compare versions:
curl "https://api.withflintpay.com/v1/orders?updated_after=2026-10-27T00:00:00Z&page_size=100" \
-H "Authorization: Bearer YOUR_API_KEY"
Reads have their own rate limit class: 200 requests a second and 12,000 a minute for each merchant by default, separate from the budget that creates orders and checkouts, so a busy account page can't starve checkout. The budget is a rate, not a monthly allowance tied to your sales.
Stripe with your database, and Flint, side by side
| Stripe plus your database | Flint |
|---|
| What was sold | Your orders table; session line items behind an expand | line_items on the order |
| Whether money arrived | A column you write from webhooks and reads | payment_status and settlement_amounts on the order |
| Refunds against items | Amounts against a payment; item allocation is yours | Line-item refunds, with refunded totals on the order |
| Whether goods shipped | A column only you update | fulfillment_status on the order |
| Stock | Your counters and holds | Flint inventory, with a reservation per order |
| Join to your system | A metadata key, by convention | external_reference_id, filterable on GET /v1/orders |
| A late webhook | Retrieve the object on every event | Compare version and skip older snapshots |
| Read budget | Shares 100 a second with payments; 500 reads per transaction | Its own class, 200 a second per merchant |
Questions, answered
Should I use Stripe as my source of truth?
For charge, refund, dispute, and subscription state, yes: those facts originate in Stripe, and your database can only hold a copy written from webhooks and fresh reads. For orders, fulfillment, and stock, no: Stripe has no objects for them, and its fulfillment guide has you record fulfillment status in your own system.
Should I store Stripe data in my own database?
Store the IDs and the few fields you query or gate on, such as payment and subscription status. Write them only from webhooks and fresh API reads, and reconcile on a schedule. Calling Stripe on every request runs into its per-endpoint limit of 25 requests a second and its read allocation of 500 reads per transaction.
Can I use Stripe as my database?
No. The general-purpose storage on Stripe objects is metadata: 50 key-value pairs, keys up to 40 characters, values up to 500, with no validation or transactions, and Stripe doesn't read it outside Radar rules. Stripe's docs say to store larger data in your own database and keep its ID in metadata.
Can I call the Stripe API instead of keeping a local copy?
At low traffic. Live mode allows 100 requests a second across the account, shared with your payment traffic, and most endpoints allow 25 a second for all IDs together. Reads are also allocated at an average of 500 per transaction over a rolling 30 days, with a minimum of 10,000 a month. Search allows 20 reads a second and can lag writes by up to a minute.
How do I keep my database in sync with Stripe?
Use three parts together. Backfill history by paging through the list endpoints. Apply webhooks idempotently: record each event ID once, then retrieve the object and write what the API returns rather than trusting arrival order. Reconcile on a schedule by diffing Stripe's lists against your rows, because the events list only goes back 30 days.
Is there a tool that syncs Stripe to my database?
Stripe's Sigma and Data Pipeline put your Stripe data in a warehouse for analytics. For an operational copy, Stripe's GitHub organization hosts an open-source sync engine for Postgres that you deploy and run yourself; its README says to use it at your own risk and deploy it only internally. Any of these copies payment data only: the order still lives in your tables.
Where do orders live when you take payments with Stripe?
In your database. Stripe's fulfillment guide has your fulfillment function retrieve the session with line items expanded, check payment_status, and record fulfillment status, and suggests saving the line items and updating stock in your own system. Stripe stays the record for the money, joined to your order by a key you put in metadata.
Does Stripe have an Orders API?
No. The original Orders API was deprecated in October 2019 because it couldn't support Strong Customer Authentication. A new Orders API entered beta in May 2022, and Stripe removed it from its SDKs that November. A Checkout Session is the closest current object.
How does Flint keep the sale and the payment in one record?
On Flint, the order is the record. It holds the line items, pricing_amounts, payment_status, refund_status, fulfillment_status, and settlement_amounts, plus the IDs of every checkout session, payment, and refund against it. Flint processes cards on Stripe, but you don't need a Stripe account or a mapping table: payment results land on the order.
Sources
Accessed October 28, 2026.