headless-checkout-proxy

Proxy VTEX cart and checkout API calls through a BFF with server-side orderFormId management.

Updated Mar 27, 2026
One-click install
npx skills add https://github.com/exilonX/ap2 --skill headless-checkout-proxy-exilonx
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: headless-checkout-proxy
Source: https://github.com/exilonX/ap2/tree/main/.agents/skills/headless-checkout-proxy
Command: npx skills add https://github.com/exilonX/ap2 --skill headless-checkout-proxy-exilonx

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Headless VTEX storefronts often mishandle checkout by letting the browser call sensitive VTEX Checkout APIs directly, causing security risks, broken cart persistence, and inconsistent order placement.

Core Features & Use Cases

  • BFF-Proxied Checkout Operations: Ensures all checkout actions (cart create, item updates, profile/shipping/payment attachments, and order placement) are routed through a server-side BFF instead of client-side direct VTEX calls.
  • OrderForm Lifecycle & Session Safety: Manages orderFormId server-side and reuses existing carts to prevent accidental cart resets and cart manipulation.
  • Cookie Preservation for Correct Checkout State: Captures and forwards CheckoutOrderFormOwnership and checkout.vtex.com cookies between the BFF and VTEX on every request to maintain checkout continuity and ownership.

Use case: implementing a headless VTEX storefront checkout where a web chat or desktop agent UI must add items, attach shipping/payment, and place orders reliably without exposing OrderForm identifiers or sensitive customer data to the browser.

Quick Start

Use the headless-checkout-proxy skill to design your BFF endpoints so the frontend only calls your proxy for cart and checkout, while your server validates inputs, stores orderFormId in a server session, forwards required cookies to VTEX, and performs place → pay → process within the 5-minute window.

Frequently Asked Questions about headless-checkout-proxy

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I secure VTEX headless checkout APIs from the browser?

To secure a VTEX headless checkout, route all cart and checkout API calls through a server-side BFF proxy. This prevents direct client-side calls to sensitive VTEX Checkout APIs, mitigating security risks and protecting sensitive customer data.

How do I manage OrderForm lifecycle and sessions in a VTEX headless storefront?

Manage the VTEX OrderForm lifecycle by storing the `orderFormId` in a server-side session. Reusing existing carts through the BFF proxy prevents accidental cart resets and manipulation during item updates and order placement.

Do I need to forward cookies when proxying VTEX checkout operations through a BFF?

Yes, proxying VTEX checkout requires forwarding `CheckoutOrderFormOwnership` and `checkout.vtex.com` cookies between the BFF and VTEX on every request. This cookie preservation maintains checkout continuity and correct state.

What is the best way to handle place, pay, and process flows in a VTEX headless checkout?

The best way to handle synchronous VTEX order placement is to perform the place, pay, and process flow within a 5-minute window through a BFF proxy. This ensures strict input validation and reliable order placement.

Can I use a BFF proxy for VTEX checkout to attach shipping and payment data?

Yes, a BFF proxy can attach clientProfileData, shippingData, and paymentData to the VTEX OrderForm. The server validates inputs before forwarding these attachments to ensure checkout stability and security.