Prerequisites

To get the most out of this guide, you’ll need to:

Make sure you have the latest version of the Vercel CLI installed.

1. Create a Next.js function

Create a route file under app/api/ingest/route.ts if you’re using the App Router.

Then update the Endpoint URL with your Form URL.

route.ts
const ENDPOINT_URL = "https://api.formizee.com/v1/f/enp_123456";

export async function POST() {
	const res = await fetch(ENDPOINT_URL, {
		method: "POST",
		headers: {
			"Content-Type": "application/json",
		},
		body: JSON.stringify({
			name: "example",
			email: "[email protected]",
		}),
	});
	const data = await res.json();
	return new Response(JSON.stringify(data), {
		headers: {
			"Content-Type": "application/json",
		},
	});
}

2. Ingest submissions locally

pnpm run dev

Open the endpoint URL to ingest a submission: http://localhost:3000/api/ingest.

3. Ingest submissions in production

Deploy function to vercel

vercel

4. Try it yourself

Formizee Vercel Functions Example

See the full source code