Creating a hosted checkout session
To start a hosted checkout experience in your app, you must make two API calls. First, request a new session by sending a POST request to the /invoicingcheckoutservice/v1/checkouts
endpoint. Then, use the returned token
to display the checkout page by making a GET request to the /invoicingcheckoutservice/v1/checkouts/{checkoutSessionId}
endpoint. Ensure the request does not carry any query string values.


- Construct a
CreateCheckoutRequest
with the following required information:customer.firstName
customer.lastName
customer.phoneNumber
customer.email
shoppingCart
- Set the required
X-Clover-Merchant-Id
header with the value of the merchant UUID. - Set the
Authorization
header with a valid OAuth token. - Send the POST request to
{baseUrl}/invoicingcheckoutservice/v1/checkouts
.
The response includes the following elements:
href
- A URL for the checkout sessioncheckoutSessionId
- A unique session identifiercreatedTime
- Time the session was created (in Unix time)expirationTime
- Time when the checkout session will expire (in Unix time)
If you have configured webhooks, one is sent when the customer finishes checkout.
Checkout session timeout
Hosted checkout sessions are intended to be short-lived. Session tokens expire 15 minutes after creation.
Updated 6 months ago
Did this page help you?