Step-by-step guide to implement a Checkout Session endpoint using the Next.js App Router API routes
redirectUrl
to send your customer to Monime’s hosted checkout.
https://api.monime.io
· Auth: Bearer token · Required headers: Monime-Space-Id
, Idempotency-Key
.env.local
:
app/api/checkout/route.ts
:
lineItems
(price.value × quantity
, where value
is in SLE minor units).callbackState
is optional and is echoed back via callbacks for correlation.Idempotency-Key
(e.g., UUID) per logical attempt.successUrl
to a Next.js API route that will:
app/api/checkout/success/route.ts
:
successUrl
query (e.g., orderId
).lineItems
is non-empty and URLs are absoluteMonime-Space-Id
Idempotency-Key
only to retry the same logical request