Skip to content

Does Stripe have an Orders API?

No. Stripe has shipped two Orders APIs and retired both: the original in October 2019, and the beta that replaced it in May 2022, removed from Stripe's SDKs that November. New Stripe integrations start at Checkout Sessions or PaymentIntents, and the record of what was sold lives in your own database. On Flint, the order is the API's core object: line items priced from your catalog, totals computed for you, and refunds by item, with Stripe processing the cards.
Verified against official documentationReviewed Send a correction (opens in a new tab)

Two Orders APIs, both retired

WhenWhat happened
October 2019Stripe deprecates the original Orders API because it does not work with Strong Customer Authentication.
May 2022Stripe opens a new Orders API as a beta. Its SDK migration guides call it the replacement for the legacy API and note it does not yet support order returns.
November 15, 2022stripe-node 11.0.0 ships with two lines on the subject: "Remove Orders resource" and "Remove SKU resource."
Todaydocs.stripe.com/api/orders returns a 404, and stripe.com/docs/orders redirects to the Payment Element page.

The original: /v1/orders, SKUs, and order returns

The first Orders API was a commerce layer inside Stripe. An order held line items and a status that moved as it was paid and fulfilled. SKUs described what was for sale, and a SKU's inventory attribute could hold a finite count that Stripe decremented at purchase. Order returns refunded items on the order. Stripe deprecated the API in October 2019 because, in its SDK migration guides' words, it "does not work with Strong Customer Authentication." The last releases that support it are stripe-node v8.222.0 and stripe-python v2.76.0.

The replacement: the 2022 Orders beta

In May 2022 Stripe opened a new Orders API as a beta. The SDKs shipped it as the replacement for the legacy resource, with one gap noted: it "does not yet support Order returns." stripe-node 11.0.0, released November 15, 2022, removed it. Its migration guide gives the change two lines, "Remove Orders resource" and "Remove SKU resource," and no replacement. A tutorial or SDK binding that calls /v1/orders today describes an API you can't call.

Two other Stripe APIs called orders

A search for the Stripe Orders API mostly returns these. Neither records a sale to your customers:

NameEndpointWhat it is
Climate orders/v1/climate/ordersA purchase of carbon removal through Stripe Climate, paid from your Stripe balance.
Terminal hardware orders/v1/terminal/hardware_ordersYour purchase of card readers from Stripe, shipped to you.
The retired order object/v1/ordersStill described by pre-2020 tutorials and third-party SDK bindings. The API reference it points to returns a 404.

What Stripe offers instead

Stripe's documentation starts new integrations at one of two APIs. It recommends the Checkout Sessions API "for most integrations": it takes line items, computes tax, discounts, and shipping, and collects the payment. The PaymentIntents API takes a final amount, and Stripe's description of it is that you "build all checkout logic yourself, including tax calculation, discounts, shipping."

Either way, what Stripe keeps is the payment. A refund names a Charge or PaymentIntent and an amount, not the items that came back.

What you build yourself on Stripe

The work the order object did moved into your application. Stripe's fulfillment guide describes a fulfill_checkout function that runs from the checkout.session.completed webhook and your success page, and asks it to:

  • handle being called "multiple times, possibly concurrently" for the same session, and fulfill only once;
  • retrieve the session "with the line_items property expanded" and check its payment_status;
  • "Record fulfillment status" for the session;
  • and, depending on your business, "Save a copy of the payment details and line items in your own database" and "Update inventory or stock records."

That is an orders table, a fulfillment state machine, and a stock counter, kept in step with Stripe by webhooks. Refunds by item are yours too: you work out each item's share of discounts and tax and send Stripe the amount. Stripe as your source of truth covers the architecture and where it drifts, Stripe inventory tracking the stock counter, and refunding a line item the refund math.

Orders on Flint

Flint is a payments API with orders built in, running on Stripe's card processing. The order is the first call, and everything after it, from checkout to refunds, refers to its order_id. Your server stores that ID; Flint keeps the record.

One sale on Flint, from order to refundResponse
Your serverFlintBuyerPOST /v1/orders with variant IDsOrder with line items and totalsPOST /v1/checkout-sessionsHosted checkout urlRedirect to the urlPays the order totalorder.paid webhookPOST /v1/refunds for one item
  1. Your server sends POST /v1/orders with variant IDs to Flint
  2. Flint returns Order with line items and totals to Your server
  3. Your server sends POST /v1/checkout-sessions to Flint
  4. Flint returns Hosted checkout url to Your server
  5. Your server sends Redirect to the url to Buyer
  6. Buyer sends Pays the order total to Flint
  7. Flint sends order.paid webhook to Your server
  8. Your server sends POST /v1/refunds for one item to Flint

Create the order from your catalog

Where Stripe had SKUs, Flint has product variants, each with its own price and SKU. An order line names a variant and a quantity, and Flint copies the name, price, SKU, and tax settings from the catalog, so no price travels from your code. inventory_routing_source says which Location supplies stock for variants that track it.

cURL
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": "variant", "variant_id": "var_1kmn0aExample", "quantity": 1 },
      { "type": "variant", "variant_id": "var_2kmn0aExample", "quantity": 2 }
    ],
    "inventory_routing_source": { "type": "fixed_location", "location_id": "loc_1kmn0aExample" }
  }'
JSON
{
  "data": {
    "order_id": "ord_1kmn0aExample",
    "status": "open",
    "payment_status": "unpaid",
    "external_reference_id": "cart_1842",
    "line_items": [
      {
        "order_line_item_id": "li_1kmn0aExample",
        "variant_id": "var_1kmn0aExample",
        "name": "Canvas tote",
        "sku": "TOTE-NAT",
        "quantity": 1,
        "unit_price_money": { "amount": 3000, "currency": "USD" },
        "subtotal_money": { "amount": 3000, "currency": "USD" }
      },
      {
        "order_line_item_id": "li_2kmn0aExample",
        "variant_id": "var_2kmn0aExample",
        "name": "Enamel pin",
        "sku": "PIN-ENAMEL",
        "quantity": 2,
        "unit_price_money": { "amount": 1000, "currency": "USD" },
        "subtotal_money": { "amount": 2000, "currency": "USD" }
      }
    ],
    "pricing_amounts": {
      "subtotal_money": { "amount": 5000, "currency": "USD" },
      "total_money": { "amount": 5000, "currency": "USD" }
    },
    "settlement_amounts": {
      "paid_money": { "amount": 0, "currency": "USD" },
      "outstanding_money": { "amount": 5000, "currency": "USD" }
    }
  }
}
The order's pricing_amounts
  • Canvas toteline_items[0].subtotal_money
    1 at $30.00
    $30.00
  • Enamel pinline_items[1].subtotal_money
    2 at $10.00
    $20.00
  • Totalpricing_amounts.total_money
    $50.00

pricing_amounts is what the order costs, and settlement_amounts is what has happened to the money: paid, outstanding, refunded. Discounts, delivery charges, tax, and tips land in the same totals when the order has them, and Flint recomputes the totals whenever the order changes. The catalog guide sets up products and variants, and the inventory guide covers how stock is held.

Collect the order

A checkout session collects one order on Flint's hosted page. You send the order_id, not an amount: checkout charges what the order owes.

cURL
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" }
  }'
JSON
{
  "data": {
    "checkout_session_id": "cs_1kmn0aExample",
    "order_id": "ord_1kmn0aExample",
    "status": "open",
    "url": "https://checkout.withflintpay.com/checkout/cs_1kmn0aExample#checkout_token=tok_example"
  }
}

Send the buyer to url exactly as returned. If any variant tracks stock, Flint holds it when payment begins and commits it when payment succeeds; if stock can't cover the order, the payment fails before the card is charged. When the order is paid in full, Flint sends order.paid with the order in data.object: line items, totals, and payment_status of paid. Fulfill from that event. The same order can also be paid from your own payment form or an invoice, and each fires the same event.

Refund an item, not an amount

One pin arrives damaged. Name the line item and the quantity, and Flint computes the refund, including the unit's share of any discount and tax:

cURL
curl -X POST https://api.withflintpay.com/v1/refunds \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: refund-cart-1842-pin" \
  -d '{
    "refund_type": "targets",
    "order_id": "ord_1kmn0aExample",
    "reason": "defective_product",
    "line_items": [
      { "order_line_item_id": "li_2kmn0aExample", "quantity": 1 }
    ]
  }'
JSON
{
  "data": {
    "refund_id": "ref_1kmn0aExample",
    "order_id": "ord_1kmn0aExample",
    "amount_money": { "amount": 1000, "currency": "USD" },
    "line_item_allocations": [
      {
        "order_line_item_id": "li_2kmn0aExample",
        "quantity": 1,
        "refunded_money": { "amount": 1000, "currency": "USD" }
      }
    ]
  }
}
The order's settlement_amounts after the refund
  • Paidsettlement_amounts.paid_money
    $50.00
  • Refundedsettlement_amounts.refunded_money
    One enamel pin
    −$10.00
  • Net collectedsettlement_amounts.net_collected_money
    $40.00

The order now reads refund_status partially_refunded, the pin line shows refunded_quantity 1, and Flint sends order.partially_refunded. Every step lands on the order's activity timeline, so support can see what happened without reading your logs. The refunds guide covers partial amounts, restocking fees, and refunding shipping charges.

The order object's jobs, then and now

What you needStripe Checkout Sessions and PaymentIntentsFlint orders
Line items on a record you can read laterOn the Checkout Session. The fulfillment guide lists saving the line items in your own database as your job.On the order, from GET /v1/orders/{order_id} for as long as the order exists.
TotalsCheckout Sessions computes them. With PaymentIntents you pass a final amount and build tax, discounts, and shipping yourself.pricing_amounts, computed from catalog prices, discounts, charges, tax, and tips.
Fulfillment stateStripe's fulfillment guide has your code record fulfillment status for each Checkout Session.fulfillment_status on the order, moved by its fulfillments.
RefundsAn amount against a Charge or PaymentIntent.Line items by ID and quantity. Flint computes the amount, with each unit's share of discounts and tax.
StockUpdating inventory records is listed as your fulfillment function's job.Held when payment begins and committed when it succeeds. Too little stock fails the payment before the card is charged.

Flint sets up the Stripe account your business processes on, so there's no Stripe account to connect. If you're moving an existing integration, Migrating from Stripe maps PaymentIntents, Checkout Sessions, invoices, and subscriptions to their Flint equivalents, and the Orders API reference has every field.

Questions, answered

Does Stripe have an Orders API?

No. Stripe deprecated the original Orders API in October 2019, and the beta that replaced it in May 2022 was removed from Stripe's SDKs in November 2022. docs.stripe.com/api/orders returns a 404. New Stripe integrations start at the Checkout Sessions or PaymentIntents API.

Why was the Stripe Orders API deprecated?

Stripe's SDK migration guides say it deprecated the original Orders API in October 2019 because it does not work with Strong Customer Authentication. For the 2022 beta, Stripe published no reason: the stripe-node 11.0.0 migration guide lists the removal of the Orders and SKU resources and nothing else.

What should I use instead of the Stripe Orders API?

On Stripe, the Checkout Sessions API carries line items into a hosted or embedded payment, and the PaymentIntents API takes a final amount. Neither keeps an order you operate on afterward: the fulfillment guide has your code save the line items, record fulfillment status, and update stock, and a refund is an amount against the payment. An API with orders built in, such as Flint's, keeps that record for you.

What happened to Stripe SKUs and order returns?

They went with the Orders API. SKU objects carried a price and an inventory attribute that could hold a stock count, and order returns refunded items on an order. stripe-node 11.0.0 removed the SKU resource with the Orders resource, and Stripe's Products and Prices have no stock count. On Flint, product variants carry the price and SKU, and an order line names a variant.

Are Stripe Climate orders and Terminal hardware orders the same thing?

No. Climate orders buy carbon removal through Stripe Climate, and Terminal hardware orders buy card readers from Stripe. Neither records a sale to your customers.

Does Flint have an Orders API?

Yes. POST /v1/orders takes line items and returns the order with its totals computed. Hosted checkout, your own payment form, and invoices all pay that order, the order.paid webhook says when it is paid in full, and POST /v1/refunds refunds line items by ID and quantity. Stripe processes the cards underneath, on a Stripe account Flint sets up for your business.

Sources