CargoLabs Docs

Quote to checkout

Drive a buyer from product catalog to a paid policy from your own server.

The SDK does all of this for you inside a modal. Use this flow directly when you want to build your own quote UI, quote on behalf of a buyer from a back-office tool, or charge a saved card without a hosted checkout page.

All endpoints on this page are POST, take a JSON body, and live under:

https://api.coverport.io/public-quote

Who is the buyer?

CoverPort issues policies to a buyer account. The quote endpoints identify the buyer with two fields:

  • cognito_accnt_uuid: the buyer's CoverPort account id
  • access_token: a short-lived token for that buyer

You get both by connecting the buyer to your agent with the buyer connect endpoints. Keep the token server-side.

Connect a buyer

Before quoting, make sure the buyer exists and is linked to your agent slug.

POST https://api.coverport.io/coverport-seller-invites/checkIfBuyerExists
{ "buyer_email": "dispatch@acme-freight.com", "seller_slug": "your-agent-slug", "query_param": "your-attribution-code" }

If the buyer does not exist, create and link them:

POST https://api.coverport.io/coverport-seller-invites/newConnect
{
  "buyer_first_name": "Dana",
  "buyer_last_name": "Reyes",
  "buyer_email": "dispatch@acme-freight.com",
  "seller_slug": "your-agent-slug",
  "query_param": "your-attribution-code"
}
Response
{ "buyer_already_exists": false, "objectOfInsertedIds": {  } }

seller_slug and query_param are what attribute the eventual sale to you. Your slug is shown in the developer portal.

1. Load the catalog

POST /public-quote/adminGetApprovedClientProducts
{
  "cognito_root_account_uuid": "3c1e…",
  "connected_ins_products_pagination_response_length_limit": 10,
  "selected_table_page": 0
}
Response (abridged)
{
  "rich_ins_product_pagination_total_approved_products": 3,
  "rich_ins_product_pagination_total_approved_products_pages": 1,
  "rich_ins_product_pagination_selected_page": 0,
  "rich_ins_product_pagination_response_limit_per_page": 10,
  "rich_ins_product_array_of_objects": [
    {
      "product_line_meta_data": {
        "product_line_id": 318,
        "product_line_array_of_agreements": [  ]
      },
      "…": "dropdown options, numeric ranges, named-insured and certificate-holder questions"
    }
  ]
}

Each product comes with the question template the buyer must answer. Render those questions in your UI; the answers go back in the next step.

2. Validate answers and create the checkout

POST /public-quote/adminValidateBuyerResponses
{
  "cognito_accnt_uuid": "3c1e…",
  "access_token": "eyJra…",
  "selected_product_lines_to_purchase": [
    {
      "product_line_template_id": 318,
      "product_line_is_trip_excess_product": true,
      "…": "the buyer's answers, keyed as returned in the template"
    }
  ]
}

The response is a Stripe Checkout Session plus two CoverPort fields:

Response (abridged)
{
  "id": "cs_live_a1B2…",
  "url": "https://checkout.stripe.com/c/pay/cs_live_a1B2…",
  "payment_intent": "pi_3Q7…",
  "amount_total": 5900,
  "currency": "usd",
  "product_line_data": [ { "product_line_id": 318, "product_line_is_trip_excess_product": true } ],
  "certificate_coverage_datetimes": [  ]
}

Validation failures come back as a non-200 with the reason in the body. Show the buyer the message and let them correct their answers.

3. Collect payment

You have three options.

Send the buyer to the url from step 2. Stripe collects the card and returns them to the success URL configured on your agent.

4. Policy issuance

When Stripe confirms payment, CoverPort generates one certificate of insurance per covered unit (per day or per trip, depending on the product), stores the PDFs, and records them against the purchase. This takes a few seconds. Fetch them with the certificates endpoints, keyed by the payment_intent from step 2.

Sequence

  1. Your server checks whether the buyer exists and connects them to your agent.
  2. Your server loads the catalog and renders the question templates.
  3. Your server posts the buyer's answers; CoverPort creates a Stripe Checkout Session (or subscription invoice) and returns it.
  4. The buyer pays by redirect, emailed link, or a saved card charged from your server.
  5. Stripe notifies CoverPort; CoverPort issues the certificates.
  6. Your server fetches the certificates by payment intent.

On this page