# OrbCart

OrbCart runs the purchase, from Cart to Order, and asks your systems for prices and stock. What it does, what it leaves to you and where to start.

OrbCart is the transaction layer of a shop: Cart, checkout, tax, shipping, payment and Order. It has no catalog. Your products, prices and stock stay in the systems that own them, and OrbCart asks those systems whenever a buyer needs a binding answer.

A whole purchase is four calls. `shipTo` is the buyer's address and `payment` is the card field on your page:

```ts
import { createCommerce } from "@orbcart/client";

const commerce = createCommerce({ url: "http://localhost:8787", key: "pk_test_..." });

const cart = await commerce.cart();
await cart.add("BACKPACK-30-GREEN");
const quote = await cart.quote({ shipTo, contact: { email: "anna@example.com" } });
const result = await quote.pay({ payment });
```

When the card goes through, `result.status` is `"ordered"`. The [quickstart](/docs/get-started/orbcart) runs these lines against a complete example shop in about ten minutes.

## What OrbCart does

- **Signs the price.** The buyer pays exactly the [Quote](/docs/cart/concepts#quote) they agreed to, or sees the new one first. A Quote expires after at most 30 minutes.
- **Takes the payment.** Stripe, Adyen, Mollie, PAYONE, PayPal and Amazon Pay sit behind one configuration, with [express checkout](/docs/shop/express-checkout). A provider timeout is `unknown` and resolved by asking again, never a double charge.
- **Prices the delivery and the tax.** [Shipping](/docs/shop/shipping) rules per country, EU VAT for all 27 member states, [discounts](/docs/shop/discounts) and gift cards.
- **Hands over the Order.** Your ERP gets every paid Order [exactly once](/docs/integrate/erp-order-handoff), and your systems hear what happened through signed [Order events](/docs/integrate/order-events).
- **Serves AI agents through the same door.** An [agent](/docs/shop/agents) buys for a shopper over UCP, under the rules of your storefront.

## What OrbCart leaves to you

| OrbCart does not               | Who does                                                                                                                        |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------- |
| Hold products, prices or stock | Your systems, through the [offers contract](/docs/integrate/offers), or OrbCatalog.                                                  |
| Render the shop                | Your storefront, in any framework. A [React checkout](/docs/shop/react-checkout) and an [order page](/docs/shop/order-page) are included. |
| Send emails                    | Your systems. OrbCart says [which email is due](/docs/integrate/buyer-emails).                                                       |
| Run on someone else's servers  | You do: a Worker in your own Cloudflare account. See [deployment](/docs/run/deployment).                                             |

[What makes OrbCart different](/docs/cart/why-orbcart) compares this with shop platforms, headless suites and a build of your own, and says when something else fits better.

## Change what you need

Everything in OrbCart changes in one of three ways, from shallow to deep. [Extend OrbCart](/docs/shop/extend) maps every extension point.

| Depth     | You                                                          | Example                                                            |
| --------- | ------------------------------------------------------------ | ------------------------------------------------------------------ |
| Configure | Set values per market in the [Channel](/docs/shop/configuration). | Shipping rules, discounts, legal texts, payment methods.           |
| Compose   | Arrange and restyle the parts of the checkout.               | [A checkout with a page per step](/docs/shop/checkout-steps).           |
| Replace   | Answer a contract with your own code.                        | [Prices and stock from your ERP](/docs/integrate/erp-prices-and-stock). |

## With OrbCatalog

OrbCart needs none of its siblings. If you run OrbCatalog, the catalog answers the offers and inventory contracts for you, with no code in your Worker. [Connect the products](/docs/run/connect-the-products) shows the configuration.

## Next steps

| You want to                         | Read                                                                |
| ----------------------------------- | ------------------------------------------------------------------- |
| See it run                          | [Quickstart](/docs/get-started/orbcart)                                  |
| Understand the model                | [Concepts](/docs/cart/concepts), then [How it works](/docs/cart/how-it-works) |
| Build the storefront side           | [Carts](/docs/shop/carts)                                                |
| Connect your ERP or pricing service | [Offers](/docs/integrate/offers)                                         |
| Copy a complete example             | [Recipes](/docs/shop/recipes)                                            |
| Know what works today               | [Project status](/docs/cart/status)                                      |