The Checkout Object

A checkout represents a custom checkout page. Checkouts can be used to customize the checkout experience for a specific variant/product without having to create a new product in the dashboard.


A checkout belongs to a Store and is associated with a Variant.

Attributes

store_id

The ID of the store this checkout belongs to.


variant_id

The ID of the variant associated with this checkout.


custom_price

If the value is not null, this represents a positive integer in cents representing the custom price of the variant.


product_options

An object containing any overridden product options for this checkout. Possible options include:

  • name - A custom name for the product
  • description - A custom description for the product
  • media - An array of image URLs to use as the product’s media
  • redirect_url - A custom URL to redirect to after a successful purchase
  • receipt_button_text - A custom text to use for the order receipt email button
  • receipt_link_url - A custom URL to use for the order receipt email button
  • receipt_thank_you_note - A custom thank you note to use for the order receipt email
  • enabled_variants - An array of variant IDs to enable for this checkout. If this is empty, all variants will be enabled.

checkout_options

An object containing checkout options for this checkout. Possible options include:

  • embed - If true, show the checkout overlay
  • media - If false, hide the product media
  • logo - If false, hide the store logo
  • desc - If false, hide the product description
  • discount - If false, hide the discount code field
  • subscription_preview - If false, hide the “You will be charged…” subscription preview text
  • background_color - A custom hex color to use for the background of the checkout page.
  • headings_color - A custom hex color to use for the headings on the checkout page.
  • primary_text_color - A custom hex color to use for the primary text on the checkout page.
  • secondary_text_color - A custom hex color to use for the secondary text on the checkout page.
  • links_color - A custom hex color to use for the links on the checkout page.
  • borders_color - A custom hex color to use for the borders on the checkout page.
  • checkbox_color - A custom hex color to use for the checkboxes on the checkout page.
  • active_state_color - A custom hex color to indicate an active state on the checkout page.
  • button_color - A custom hex color to use for the checkout button.
  • button_text_color - A custom hex color to use for the text within the checkout button.
  • terms_privacy_color - A custom hex color to use for the terms and privacy text on the checkout page.
  • dark deprecated - If true, use the dark theme. This has been deprecated in favor of the color options.

checkout_data

An object containing any prefill or custom data to be used in the checkout. Possible options include:

  • email - A pre-filled email address
  • name - A pre-filled name
  • billing_address.country - A pre-filled billing address country in a ISO 3166-1 alpha-2 format
  • billing_address.zip - A pre-filled billing address zip/postal code
  • tax_number - A pre-filled tax number
  • discount_code - A pre-filled discount code
  • custom - An object containing any custom data to be passed to the checkout
  • variant_quantities - A list containing quantity data objects

preview

If preview is passed as true in the request, the Checkout object will contain a preview object. This contains pricing information for the checkout, including tax, any discount applied, and the total price.

The preview object is only available when the checkout is created.

Values returned:

  • currency - The ISO 4217 currency code of the store (e.g. USD, GBP, etc).
  • currency_rate - If the store currency is USD, this will always be 1.0. Otherwise, this is the currency conversion rate used to determine the price of the checkout in USD at the time of purchase.
  • subtotal - A positive integer in cents representing the subtotal of the checkout in the store currency.
  • discount_total - A positive integer in cents representing the total discount value applied to the checkout in the store currency.
  • tax - A positive integer in cents representing the tax applied to the checkout in the store currency.
  • total - A positive integer in cents representing the total price of the checkout in the store currency.
  • subtotal_usd - A positive integer in cents representing the subtotal of the checkout in USD.
  • discount_total_usd - A positive integer in cents representing the total discount value applied to the checkout in USD.
  • tax_usd - A positive integer in cents representing the tax applied to the checkout in USD.
  • total_usd - A positive integer in cents representing the total price of the checkout in USD.
  • subtotal_formatted - A human-readable string representing the subtotal of the checkout in the store currency (e.g. $9.99).
  • discount_total_formatted - A human-readable string representing the total discount value applied to the checkout in the store currency (e.g. $9.99).
  • tax_formatted - A human-readable string representing the tax applied to the checkout in the store currency (e.g. $9.99).
  • total_formatted - A human-readable string representing the total price of the checkout in the store currency (e.g. $9.99).

expires_at

An ISO 8601 formatted date-time string indicating when the checkout expires. Can be null if the checkout is perpetual.


created_at

An ISO 8601 formatted date-time string indicating when the object was created.


updated_at

An ISO 8601 formatted date-time string indicating when the object was last updated.


test_mode

A boolean indicating if the object was created within test mode.


url

The unique URL to access the checkout. Note: for security reasons, download URLs are signed. If the checkout expires_at is set, the URL will expire after the specified time.

{
    "type": "checkouts",
    "id": "ac470bd4-7c41-474d-b6cd-0f296f5be02a",
    "attributes": {
      "store_id": 1,
      "variant_id": 1,
      "custom_price": null,
      "product_options": {
        "name": "",
        "description": "",
        "media": [],
        "redirect_url": "",
        "receipt_button_text": "",
        "receipt_link_url": "",
        "receipt_thank_you_note": "",
        "enabled_variants": []
      },
      "checkout_options": {
        "embed": false,
        "media": true,
        "logo": true,
        "desc": true,
        "discount": true,
        "skip_trial": false,
        "subscription_preview": true,
        "button_color": "#7047EB"
      },
      "checkout_data": {
        "email": "",
        "name": "",
        "billing_address": [],
        "tax_number": "",
        "discount_code": "",
        "custom": [],
        "variant_quantities": []
      },
      "expires_at": null,
      "created_at": "2024-10-14T12:36:27.000000Z",
      "updated_at": "2024-10-14T12:36:27.000000Z",
      "test_mode": false,
      "url": "https://my-store.lemonsqueezy.com/checkout/custom/ac470bd4-7c41-474d-b6cd-0f296f5be02a?signature=ee3fd20c5bac48fe5e976cb106e743bc3f6f330540f8003ab331d638e2ce3b8b"
    },
    "relationships": {
      "store": {
        "links": {
          "related": "https://api.lemonsqueezy.com/v1/checkouts/ac470bd4-7c41-474d-b6cd-0f296f5be02a/store",
          "self": "https://api.lemonsqueezy.com/v1/checkouts/ac470bd4-7c41-474d-b6cd-0f296f5be02a/relationships/store"
        }
      },
      "variant": {
        "links": {
          "related": "https://api.lemonsqueezy.com/v1/checkouts/ac470bd4-7c41-474d-b6cd-0f296f5be02a/variant",
          "self": "https://api.lemonsqueezy.com/v1/checkouts/ac470bd4-7c41-474d-b6cd-0f296f5be02a/relationships/variant"
        }
      }
    },
    "links": {
      "self": "https://api.lemonsqueezy.com/v1/checkouts/ac470bd4-7c41-474d-b6cd-0f296f5be02a"
    }
  }
}

Was this page helpful?