ORBCART DOCUMENTATION
Connect your data
Your systems know the goods. One function tells OrbCart.
offers is the one required contract. OrbCart passes the Cart's Lines and asks
what you can sell. You return Offers. No catalog migration required.
Start with one Offer
This complete Worker entry point offers one backpack, with delivery to Germany and card payments through Stripe:
import { defineCommerce } from "@orbcart/runtime";
export * from "@orbcart/runtime/objects";
export default defineCommerce({
channels: {
de: {
currency: "EUR",
pricesIncludeTax: true,
locale: "de-DE",
shipping: {
DE: [{ id: "standard", title: "Standard delivery", price: 495 }],
},
payments: { card: "stripe" },
},
},
offers: async (lines, { currency }) =>
lines
.filter((line) => line.reference === "BACKPACK-30-GREEN")
.map((line) => ({
reference: line.reference,
title: "Trail backpack · 30 L · Green",
price: { amount: 8990, currency },
taxCategory: "standard",
shipping: { weightInGrams: 950 },
})),
});The backpack costs €89.90 including tax. Delivery costs €4.95. A reference not
returned by offers is unavailable; never invent a fallback price.
This file defines commerce behavior, not infrastructure. Start from the Nordgrat environment for Worker bindings and test credentials.
Replace the fixed data
Inside offers, fetch current prices and product facts from your systems, then
map them to the same Offer shape. Fetch a batch for the supplied Lines rather than
making one network request per field.
Keep these rules:
- Return unit prices. OrbCart applies quantity, discounts and tax.
- Use integer minor units. EUR
8990is €89.90. - Include
shippingfor physical goods. Without it, goods do not need delivery. - Fail honestly. An unavailable system is not an empty catalog. Don't catch a network error and return
[].
Nordgrat's examples/nordgrat/src/offers.ts shows the full connection: prices from
one service, titles and shipping facts from another.
Add only what you need
| Contract | Responsibility |
|---|---|
offers | Current prices and facts. Required. |
inventory | Check or reserve stock. Without it, stock does not limit a purchase. |
deliverOrder | Hand the Order to your ERP. Delivery can be retried; deduplicate by Order ID. |
Keep product imagery, search and category pages in your storefront. OrbCart is the transaction layer, not another product database.