INTEGRATION GUIDESCustom D2C Websites & Apps

D2C Website Integration Guides & SDKs

Step-by-step guides and ready-to-use production code snippets for integrating custom D2C websites, mobile apps, and backend services with Softymize.

Next.js App Router (Route Handler / Server Action)

app/api/checkout/route.tsTypeScript
import { NextResponse } from 'next/server';
export async function POST(request: Request) {
const order = await request.json();
fetch('https://api.softymize.com/api/v1/events', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Softymize-API-Key': process.env.SOFTYMIZE_API_KEY!,
'Idempotency-Key': `ORD-${order.id}`
},
body: JSON.stringify({
event: 'order.created',
customer: { name: order.name, phone: order.phone },
data: { order_id: order.id, total: order.total }
})
});
return NextResponse.json({ success: true });
}