Skip to main content
POST
Start a hosted checkout

Body

Starts a hosted checkout. In a form post, nest fields with brackets: items[0][id], items[0][amount], metadata[account].

portal_id
string<uuid>
required

The portal GroGov gave you for hosted checkout

reference_id
string
required

Your reference for this checkout. It comes back on the result.

Required string length: 1 - 64
Example:

"INV-10293"

items
object[]
required
Required array length: 1 - 100 elements
label
string

A heading shown to the payer. Must not contain a URL.

Required string length: 1 - 80
Example:

"Court fees"

payer_name
string

Shown on the confirm step and pre-fills the cardholder name, which the payer can change. The payment records the name the payer submits.

Maximum string length: 200
payer_email
string<email>

Stored with the payment when the payer does not enter an email of their own. Not shown to the payer; the emailed receipt goes to the address the payer enters.

payer_phone
string

Stored with the payment when the payer does not enter a phone of their own. Not shown to the payer.

Maximum string length: 50
return_url
string<uri>

Where the payer goes after paying. Must be https and on the portal's allowlist. Defaults to the portal's configured return address.

Example:

"https://partner.example.com/checkout/return"

cancel_url
string<uri>

Where the payer goes on cancellation or a failed request. Must be https and on the portal's allowlist. Defaults to the portal's configured cancel address.

Example:

"https://partner.example.com/checkout/cancel"

expires_at
string<date-time>

When the checkout link stops working. An ISO 8601 time in the future, ending in Z or a UTC offset. Defaults to the portal's link lifetime, 24 hours unless the agency set another; a later time is shortened to that lifetime, not refused.

metadata
object

Your own data, at most 8 KB as JSON. It is stored with the checkout and not shown to the payer.

Response

303

Always a redirect. On success, to the checkout page. On failure, to cancel_url with HostedCheckoutFailedResult parameters, or to the GroGov error page with ?code=<HostedCheckoutErrorCode> when there is no usable cancel_url.