Skip to main content
There are two ways to start a checkout. Both create the checkout and redirect the payer to it. Neither needs an API key. The examples use the sandbox at https://apistagepc.grogov.us. The full schemas are in the API Reference: Start a hosted checkout and Open a hosted checkout from a launch link.

Post a form

Put a form on your page that posts to the intake. The payer’s browser follows the redirect to the checkout. Nest fields with brackets: items[0][id].

Send JSON from your server

You can send the same fields as JSON from your backend. Do not follow the redirect: read its Location header and send the payer there.
Node.js
The answer is always a 303 redirect, never a JSON body, including on failure. A failure points at your cancel_url or the GroGov error page; see Errors. A launch link carries the checkout in its query string. Each time someone opens it, a new checkout is created, so you can reuse one link. Anyone who has the link can start a checkout with it. Number the items from 1 with item<N>_ fields:
(The line breaks are for reading. A real link is one line.)
  • Each item takes item<N>_id, item<N>_description, item<N>_amount, and optionally item<N>_quantity and item<N>_category. item<N>_amount_cents works in place of item<N>_amount. Bracket names such as items[0][id] also work.
  • For a single item, you can send description and amount, with optional item_id (default ITEM-001) and quantity.
  • The top-level fields are the same as in a post. A launch link cannot carry metadata, or the items’ required and metadata.
  • URL-encode every value.

Show the checkout in an iframe

Use the launch link as the iframe’s src and add embed=iframe:
If the agency has set allowed origins for the portal, the checkout only shows inside a page from one of them. Ask for your site’s origin to be added, as in Onboarding.

Fields

Each item: The total is the sum of amount × quantity over all items. The service fee is added on top of it at checkout.

Errors

When a request fails, no checkout is created and the payer is redirected:
  • To your cancel_url with error=validation_error, detail=<code>, and a sig when the portal has a signing secret. See Results and signatures.
  • To the GroGov error page with ?code=<code> when there is no usable cancel_url: no portal_id or an unknown one, a cancel_url that is not allowed, or a server error.
Only the first problem is reported. Fix it and try again to see the next one.