BusinessPlus Connect (Developer)
Storefront Security & Integration Checklist
Ensure your headless BusinessPlus integration conforms to the platform's security model and protects customer data, pricing authority, and operational credentials.
The 10 Headless Security Commandments
Review and enforce these ten rules before launching any custom storefront:
- 1. Never Expose Your Secret API Key in the Browser: Your Secret Site API Key grants privileged access to create orders and view customer records. Keep it strictly inside backend server code (Next.js Route Handlers, Node.js controllers, Laravel, etc.).
- 2. Never Prefix Secrets with NEXT_PUBLIC_ or VITE_: Framework prefixes such as NEXT_PUBLIC_ and VITE_ bundle values into client-accessible JavaScript files visible in browser developer tools.
- 3. Add Secrets to Your Hosting Provider Dashboard: Add BUSINESSPLUS_API_KEY directly into the project environment variable settings of your hosting provider (Vercel, Netlify, Cloudflare Pages, AWS Amplify).
- 4. Never Trust Client-Side Prices: The browser cart is solely for user interface presentation. Do not submit unit prices to POST /v1/orders. BusinessPlus always re-resolves prices server-side.
- 5. Never Infer Payment Success from Browser Redirects: A redirect from the hosted payment page does not prove settlement. Your backend must query GET /v1/orders/:id with x-api-key to verify payment_status === "paid".
- 6. Respect commerce.mode Rules: Never bypass commerce.mode = "quote" in frontend code. Direct orders for quote items will be rejected with ITEM_REQUIRES_QUOTE at the database level.
- 7. Always Provide an Idempotency Key (order_request_id): Supply a valid UUIDv4 for order_request_id and preserve it across transient network retries to prevent duplicate orders or multiple charges.
- 8. Configure Authorized External Domains in Dashboard: Add your custom storefront domain to Dashboard -> Settings -> Domains. Unlisted domains will be rejected by CORS and payment return URL validation.
- 9. Validate Customer Contact Data Server-Side: Sanitize phone numbers, validate email syntax, and truncate excessively long text inputs before dispatching requests to BusinessPlus.
- 10. Enforce HTTPS Across All Environments: BusinessPlus rejects unencrypted HTTP requests. All API endpoints and return URLs must use HTTPS in staging and production.