Prerequisites
- Node.js v14+
- No SDK required — this example uses the CrediBill HTTP API via server-side requests (App Router)
Full Script (API-first)
- Next.js (App Router)
- cURL
/api/demo/create-customer with body:
Usage (server-side only): POST JSON to /api/demo/create-customer with body:- Prefer calling the CrediBill API from your server (App Router or serverless functions) so secret keys remain confidential.
- For frontend data fetching patterns, see the React + TanStack Query examples in other guides.