Storefront API checkout uses the same buyer-facing checkout concepts as the Scalev-hosted storefront. A browser storefront can prepare delivery options, compute the checkout summary, create a guest order, read the public order, and create or reuse payment instructions without a merchant backend. The Storefront API is designed so your storefront can render its own payment page. Use the public order and payment responses to show buyer-facing instructions directly in your UI.Documentation Index
Fetch the complete documentation index at: https://docs.scalev.com/llms.txt
Use this file to discover all available pages before exploring further.
payment_url is still returned as a hosted fallback for storefronts that have not implemented a method-specific renderer or for provider flows that must open a hosted payment page.
Guest checkout flow
- Read or create the guest cart and store
X-Scalev-Guest-Token. - Ask the buyer for delivery location and postal code when the cart contains physical items.
- Call
POST /public/checkout/shipping-options. - Let the buyer select a shipping option.
- Call
POST /public/checkout/summary. - Call
POST /public/guest-checkoutwith buyer details and the selected checkout fields. - Read the order with
GET /public/orders/{secret_slug}. - Call
POST /public/orders/{secret_slug}/paymentand render the returned payment data on your own payment page.
Shipping options
X-Scalev-Guest-Token resolves a non-empty guest cart, Scalev uses that cart. Otherwise, send direct variant items:
items[] supports variants. Bundle checkout is supported through the guest cart.
Response:
Checkout summary
shipping_cost.
shipping_cost: "0".
Discount code check
X-Scalev-Guest-Token resolves a non-empty cart, the API uses that cart as the item source. Otherwise, provide items[]. Unknown or ineligible codes return a normal validation response with is_eligible: false and discount_code: null.
Guest checkout
Create the order with:shipping_cost as the source of truth.
The response includes order_secret_slug, public_order_url, and payment_url.
Payment instructions
After checkout, call:- Render the order’s method-specific instructions from
payment_method,sub_payment_method,epayment_provider, andpg_payment_info. - For provider-hosted methods, open the provider URL from
pg_payment_infowhen the provider requires a redirect. - Use
payment_urlonly as a fallback to the Scalev-hosted payment page when your storefront does not yet support that method or provider response shape. - Poll the public order when the method needs gateway data that may not exist immediately.
Method rendering
The Scalev-hosted success page is the reference implementation for method-specific rendering. A Storefront API storefront can replace that page by applying the samepg_payment_info mappings in its own UI.
The hosted success page first derives a small display model from the current Xendit/default pg_payment_info. This is not a separate API response shape. It is a useful reference if your storefront wants one payment renderer instead of branching directly on raw provider payload fields:
| Display value | Source field |
|---|---|
qrString | pg_payment_info.qr_string or pg_payment_info.payment_method.qr_code.channel_properties.qr_string |
vaNumber | pg_payment_info.payment_method.virtual_account.channel_properties.virtual_account_number or pg_payment_info.payment_method.over_the_counter.channel_properties.payment_code |
vaAccountHolder | pg_payment_info.payment_method.virtual_account.channel_properties.customer_name or pg_payment_info.payment_method.over_the_counter.channel_properties.customer_name |
invoiceUrl | pg_payment_info.invoice_url or pg_payment_info.redirect_url |
qrImageUrl | Generate a QR image from qrString in your frontend when you need a downloadable QR image. |
gopay, dana, linkaja, shopeepay, and ovo, choose an action URL from pg_payment_info.actions: mobile prefers url_type WEB or DEEPLINK; desktop prefers MOBILE or DEEPLINK.
Set renderUrlAs to button for invoice, card, and all mobile views. For other desktop views, render the URL as a QR code.
bank_transfer:
Display the order total, manual bank transfer accounts, expiry countdown when enabled, and a payment-confirmation link to /o/{secret_slug}?showPaymentConfirmation=true. The hosted page gets bank accounts from the store payment_accounts where method is bank_transfer and the method is still active. pg_payment_info can be {}.
cod:
Display the COD success body and do not show a payment countdown. Payment creation may return an empty pg_payment_info.
Virtual account (va):
Render the virtual account bank/channel from sub_payment_method, the vaNumber, and the optional vaAccountHolder. Show a copy button and a payment tutorial link. Known bank codes include BRI, MANDIRI, PERMATA, BNI, BCA, MAYBANK, CIMB, BNC, DANAMON, BSI, AG, BJB, SAHABAT_SAMPOERNA, ARTAJASA, BMI, and BTN.
QRIS (qris):
Render a QR code from qrString. Also offer a QR download action from qrImageUrl and show mobile instructions for saving or screenshotting the QR image before paying in a QRIS app. If QR generation fails or qrString is missing, show a retry action that calls the public payment endpoint again.
E-wallets except OVO (gopay, dana, linkaja, shopeepay):
Use invoiceUrl from provider actions. On mobile, open it as a button/deep link. On desktop, render the invoiceUrl as a QR code when renderUrlAs is qr_code; otherwise open it as a button. If no URL can be mapped, send the buyer back to the public order page.
OVO (ovo):
Show an instruction to check the OVO app tied to the buyer phone number. The hosted success component does not render OVO through the same e-wallet QR component.
Card (card) and invoice/hosted payment (invoice):
Open the mapped invoiceUrl as a button/redirect. The hosted success page redirects automatically when invoiceUrl exists and renderUrlAs is button.
Alfamart and Indomaret:
Render vaNumber as No Pembayaran, show vaAccountHolder when present, and provide a copy action.
Polling and status checks
For e-payment methods (gopay, card, invoice, va, qris, ovo, dana, shopeepay, linkaja, alfamart, and indomaret), the hosted success page waits for pg_payment_info to appear by refetching the public order up to 15 times with a 1.5 second delay.
For pending unpaid orders with card, invoice, shopeepay, dana, qris, linkaja, gopay, bank_transfer, indomaret, and alfamart, the hosted success page then refreshes the public order every 5 seconds while waiting for payment confirmation.
For va, bank_transfer, qris, alfamart, and indomaret, it also shows a manual “check payment status” action.
Authenticated customer checkout
Customer checkout endpoints stay under:Authorization: Bearer <customer_access_token>, not the Storefront API key. Their runtime response shapes match the guest checkout preparation shapes for addresses, payment methods, shipping options, summary, and confirm responses.
