ORBCART DOCUMENTATION
The order page
Give every buyer, guests included, their order from any device through a secret link, without an account.
After the purchase, the buyer's order lives behind a link. The link carries a secret, so it works for guests, on any device, and without an account. You host the page; OrbCart provides the link and what is on it.
1. Name the page
Add orderPage to the Channel: the address of the page that shows an order. The link to an order is
this address and the order's token as its last segment.
de: {
currency: "EUR",
pricesIncludeTax: true,
locale: "de-DE",
orderPage: "https://shop.example.com/orders",
},An Order now carries its link:
order.url; // https://shop.example.com/orders/ord_…_secret_…
order.token; // ord_…_secret_…quote.accept() returns the Order, so the storefront can send the buyer there right after paying.
Your confirmation email reads it from the Order the same way:
const order = await admin.orders.get(event.subject);
await mail.send({ to: order.contact.email, data: { number: order.number, orderUrl: order.url } });The link does not change for as long as the Order exists, so every message you send about it can carry it.
2. Show the order
Build a route that takes the token as its last segment and reads the Order with it. No key is needed: the token opens exactly this Order.
import { CommerceError } from "@orbcart/client";
import { OrderPage } from "@orbcart/react";
import type { Route } from "./+types/orders.$token";
export async function loader({ params }: Route.LoaderArgs) {
try {
return { order: await commerce.order(params.token) };
} catch (error) {
if (error instanceof CommerceError) throw new Response(null, { status: 404 });
throw error;
}
}
export default function Order({ loaderData: { order } }: Route.ComponentProps) {
return <OrderPage order={order} />;
}<OrderPage> shows what was bought and paid, where it goes, how far it is, and the tracking of what
shipped, in the language of the Order. Put your own content after it, such as a link to your support,
as its children. Prefer your own design? commerce.order(token) returns the Order; show its amounts
as they are.
What the buyer sees
The snapshot, the payment method, the shipments with tracking and the refunds. The buyer never sees what only you see: the payment provider's references, the history, issues and notes.
Treat the link like the order
Whoever holds the link sees the order, including the delivery address. Keep it out of logs and
analytics, and send Referrer-Policy: strict-origin-when-cross-origin or stricter with the page.
Opening the order with the token never changes anything.
A token that opens no Order, or was cut short in an email client, refuses with a CommerceError
(order_not_found, or credential_invalid). Show the buyer the way to your support instead of an
error page.