Sign up buyers
Put a "Get insured" form on your own site. Buyers are created, connected to you, and offered your products.
Use this to sign drivers or fleets up for CoverPort without them leaving your platform. Your page collects a name and email, your server makes one call, and CoverPort creates the buyer's account, connects it to your agent, offers them your products, and emails them a sign-in link.
If you would rather not write any code, link to your hosted page instead: https://www.cargolabs.com/<your-slug> has this form built in.
Look a buyer up
GET /api/buyers?email=dispatch@acme-freight.comReturns the buyer if you have already signed them up, or an empty list. It changes nothing and sends no email, so it is safe to call whenever you need a buyer's id.
{ "data": [{ "id": "9f1c4e2a-3b7d-4c1e-8f2a-5d6b7c8e9f01", "email": "dispatch@acme-freight.com", "firstName": "Dana", "lastName": "Reyes" }], "page": 0, "limit": 1, "total": 1, "hasMore": false }An empty list does not mean the person has no CoverPort account: they may buy through someone else. You only see buyers connected to you.
Sign a buyer up
POST /api/buyers{ "email": "dispatch@acme-freight.com", "firstName": "Dana", "lastName": "Reyes" }| Situation | Response | What happens |
|---|---|---|
| New email | 201, created: true | An account is created and connected to you. The buyer is emailed a temporary password for https://buy.coverport.io. |
| Email that already has an account | 200, created: false | The buyer is connected to you and emailed that they now have access to your products. |
| New email, no name | 422 name_required | Nothing is created. Ask for the name and send the request again. |
{ "id": "9f1c4e2a-3b7d-4c1e-8f2a-5d6b7c8e9f01", "email": "dispatch@acme-freight.com", "firstName": "Dana", "lastName": "Reyes", "created": true }Keep the id: you need it to list the buyer's products and to quote them.
Campaigns
To attribute buyers to a campaign or partner page, create a code in the seller console under Landing page settings and send it as campaignCode. The buyer is offered that code's products instead of your default set, and their sales are reported against the campaign.
Server-side example
Keep the API key on your server. Your page posts the form to your own endpoint, which calls CoverPort.
export async function POST(req: Request) {
const { firstName, lastName, email } = await req.json();
const res = await fetch('https://api.coverport.io/api/buyers', {
method: 'POST',
headers: {
'x-api-key': process.env.COVERPORT_API_KEY!,
'CoverPort-Version': '2026-11-20',
'Content-Type': 'application/json',
},
body: JSON.stringify({ email, firstName, lastName }),
});
const body = await res.json();
if (res.status === 400 || res.status === 422) return Response.json({ error: body.error.message }, { status: 400 });
if (!res.ok) return Response.json({ error: 'Signup is unavailable. Try again shortly.' }, { status: 502 });
return Response.json({ buyerId: body.id, created: body.created });
}Use created to pick your confirmation copy: true means "check your inbox for a temporary password", false means "you already have a CoverPort account; sign in at buy.coverport.io".
Behaviour to plan for
Signing up sends email
POST /buyers emails the buyer every time it creates or connects an account. Call it once per form submission, debounce your submit button, and use GET /buyers for lookups. Send an Idempotency-Key (for example your sign-up form's submission id) so a retry or a double submit returns the first answer instead of emailing again; see Retrying safely.
- Sign-ups are capped at 30 an hour and 100 a day per key, because each one sends an email. Over the cap,
POST /buyersreturns429 signup_limitwith aRetry-Afterheader and creates nothing. Lookups are never capped. If your volume needs more, email api-support@coverport.io. - It can take a few seconds for a new account: it creates a login, a payment profile, and the buyer's product list. Use a client timeout of at least 30 seconds and show a spinner.
- No test mode. These calls create real accounts and send real email. Test with inboxes you control, and tell us which addresses to remove afterwards.
- Email is the sign-in. It is stored lower-case;
Dana@Acme.comanddana@acme.comare the same buyer.