---
title: "Create checkout"
method: POST
path: "/invoicingcheckoutservice/v1/checkouts"
tags: ["CHECKOUT"]
---

# Create checkout

`POST /invoicingcheckoutservice/v1/checkouts`

## Request

- Base URL: `https://sandbox.dev.clover.com`
- URL: `https://sandbox.dev.clover.com/invoicingcheckoutservice/v1/checkouts`
- Auth: OAuth 2
  - Authorization code: `https://sandbox.dev.clover.com/oauth/authorize`
  - Token URL: `https://sandbox.dev.clover.com/oauth/token`

> **Note:** To use this endpoint, please select the **API Sandbox server** (`https://apisandbox.dev.clover.com`) from the Base URL dropdown in the right panel.

Creates a hosted checkout payment object to connect an application. Use this endpoint to request a new checkout session for a customer transaction. For more information, see [Create a Hosted Checkout session request](https://docs.clover.com/dev/docs/creating-a-hosted-checkout-session).

## Headers

- `User-Agent` string, required
- `X-Clover-Merchant-Id` string, required

## Request body

- object
  - `pageConfigUuid` string: Optional. The universally unique identifier (UUID) for the page configuration. This is especially useful for merchants who operate multiple locations and need a distinct checkout experience for each location. If you do not provide this parameter, the page uses the default configuration for the merchant.
  - `customer` object: Customer details for the checkout. Note: 1- If merchant uses hosted checkout with the customer information feature enabled (HCO_CUSTOMER_INFO_FEATURE_ENABLED), then it is mandatory to enter the customer’s firstname, lastname, and email address information to create a hosted checkout session. The merchant can also customize which fields are required on the Merchant Dashboard > Account & Setup > Hosted Checkout > Customer Information > Customize. 2- If the merchant uses hosted checkout without enabling the customer information feature, then only the customer's first name or last name or email address is required to create a hosted checkout session.
    - `firstName` string: Customer's first name.
    - `lastName` string: Customer's last name.
    - `email` string: Customer's email address.
    - `phoneNumber` string: Customer's phone number.
    - `address` object: Customer's address.
      - `address1` string: First line for the customer's address.
      - `address2` string: Second line for the customer's address.
      - `state` string: State of the customer's address.
      - `city` string: City of the customer's address.
      - `country` string: Country of the customer's address.
      - `zip` string: Postal or ZIP code of the customer's address.
    - `customerMetaData` object
      - `businessName` string: Customer's business name.
  - `redirectUrls` object
    - `success` string: Link (URL) to redirect to after payment at checkout is successfully completed. If this link is not provided then the Clover hosted checkout displays a default confirmation page.
    - `failure` string: Link (URL) to redirect to when a payment is attempted but not completed.
    - `cancel` string: Link (URL) to redirect to when the customer leaves the checkout session before payment.
  - `shoppingCart` object, required
    - `lineItems` object[], required: Line items in the shopping cart.
      - `note` string: Description or note related to the item.
      - `price` integer, required: Unit price of the item.
      - `name` string, required: Item name.
      - `unitQty` integer, required: Item quantity.
      - `itemRefUuid` string: Universally unique identifier (UUID) or reference number of the item.
      - `taxRates` object[]
        - `rate` integer: Tax rate.
        - `taxAmount` integer: Tax amount.
        - `name` string: Tax name.
        - `id` string: Tax identifier.
    - `total` integer: Total amount for the items in the shopping cart, including tax and tip.
    - `subtotal` integer: Subtotal amount for the items in the shopping cart.

## Response `200`

Successful response. Checkout session created successfully.

- CreateCheckoutResponse
  - `href` string: Hosted reference identifier (ID).
  - `checkoutSessionId` string, uuid: Checkout session identifier.
  - `createdTime` string, date-time: Time of checkout.
  - `expirationTime` string, date-time: Checkout session expiry time.
  - `deletedTime` string, date-time: Time when checkout was deleted.

## Other responses

- `default`: Unexpected error.

---

[API](https://skmtc.dev/clover/apis/ecommerce-service-api.md) - [All operations](https://skmtc.dev/clover/apis/ecommerce-service-api/llms.txt) - [OpenAPI document](https://skmtc.dev/clover/apis/ecommerce-service-api/revisions/a0aeb344ed80?raw)
