Skip to content

Latest commit

 

History

History
305 lines (298 loc) · 71.3 KB

File metadata and controls

305 lines (298 loc) · 71.3 KB

CheckoutPublicConfirmed

Checkout session data retrieved using the client secret after confirmation.

It contains a customer session token to retrieve order information right after the checkout.

Example Usage

import { CheckoutPublicConfirmed } from "@polar-sh/sdk/models/components/checkoutpublicconfirmed.js";

let value: CheckoutPublicConfirmed = {
  id: "<value>",
  createdAt: new Date("2025-10-16T08:53:32.833Z"),
  modifiedAt: new Date("2025-10-03T07:14:55.008Z"),
  paymentProcessor: "stripe",
  status: "confirmed",
  clientSecret: "<value>",
  url: "https://sparkling-populist.com",
  expiresAt: new Date("2026-12-12T22:31:01.424Z"),
  successUrl: "https://usable-pronoun.org/",
  returnUrl: "https://uncomfortable-plastic.net/",
  embedOrigin: "<value>",
  amount: 225800,
  discountAmount: 525026,
  netAmount: 116234,
  taxAmount: 102222,
  taxBehavior: null,
  totalAmount: 569061,
  currency: "Rial Omani",
  allowTrial: true,
  activeTrialInterval: null,
  activeTrialIntervalCount: 262989,
  trialEnd: new Date("2024-06-25T10:45:05.990Z"),
  organizationId: "<value>",
  productId: "<value>",
  productPriceId: "<value>",
  discountId: "<value>",
  allowDiscountCodes: false,
  requireBillingAddress: false,
  isDiscountApplicable: true,
  isFreeProductPrice: true,
  isPaymentRequired: false,
  isPaymentSetupRequired: false,
  isPaymentFormRequired: true,
  customerId: null,
  isBusinessCustomer: true,
  customerName: "<value>",
  customerEmail: "<value>",
  customerIpAddress: "<value>",
  customerBillingName: "<value>",
  customerBillingAddress: null,
  customerTaxId: "<id>",
  paymentProcessorMetadata: {
    "key": "<value>",
    "key1": "<value>",
  },
  billingAddressFields: {
    country: "disabled",
    state: "optional",
    city: "required",
    postalCode: "required",
    line1: "disabled",
    line2: "optional",
  },
  products: [
    {
      id: "<value>",
      createdAt: new Date("2025-02-13T04:30:30.659Z"),
      modifiedAt: new Date("2026-06-05T00:30:49.100Z"),
      trialInterval: "day",
      trialIntervalCount: 895059,
      name: "<value>",
      description:
        "rationalize well grimy unscramble pish excitedly er bleakly",
      visibility: "private",
      recurringInterval: "year",
      recurringIntervalCount: 769170,
      meterInterval: "week",
      meterIntervalCount: 614635,
      isRecurring: true,
      isArchived: true,
      organizationId: "<value>",
      prices: [
        {
          createdAt: new Date("2025-09-06T19:35:45.622Z"),
          modifiedAt: new Date("2025-10-22T12:34:26.724Z"),
          id: "<value>",
          source: "catalog",
          amountType: "metered_unit",
          priceCurrency: "<value>",
          taxBehavior: "location",
          isArchived: false,
          productId: "<value>",
          unitAmount: "<value>",
          capAmount: 621451,
          meterId: "<value>",
          meter: {
            id: "<value>",
            name: "<value>",
            unit: "scalar",
            customLabel: "<value>",
            customMultiplier: 471087,
          },
        },
      ],
      benefits: [
        {
          id: "<value>",
          createdAt: new Date("2024-01-22T00:59:04.968Z"),
          modifiedAt: new Date("2024-05-30T13:40:06.041Z"),
          type: "github_repository",
          description:
            "cautiously however competent distorted gosh incidentally legislature tall across",
          selectable: true,
          deletable: true,
          isDeleted: true,
          organizationId: "<value>",
        },
      ],
      medias: [
        {
          id: "<value>",
          organizationId: "<value>",
          name: "<value>",
          path: "/var/yp",
          mimeType: "<value>",
          size: 772025,
          storageVersion: null,
          checksumEtag: "<value>",
          checksumSha256Base64: "<value>",
          checksumSha256Hex: "<value>",
          lastModifiedAt: new Date("2025-10-14T04:04:24.781Z"),
          version: "<value>",
          service: "product_media",
          isUploaded: false,
          createdAt: new Date("2026-03-20T16:38:16.465Z"),
          sizeReadable: "<value>",
          publicUrl: "https://esteemed-coal.com",
        },
      ],
    },
  ],
  product: {
    id: "<value>",
    createdAt: new Date("2026-03-18T10:51:44.563Z"),
    modifiedAt: new Date("2025-07-09T19:59:35.997Z"),
    trialInterval: "month",
    trialIntervalCount: 98258,
    name: "<value>",
    description: "seagull mmm once lest aha suddenly cycle",
    visibility: "draft",
    recurringInterval: "year",
    recurringIntervalCount: 848883,
    meterInterval: "week",
    meterIntervalCount: 907112,
    isRecurring: true,
    isArchived: true,
    organizationId: "<value>",
    prices: [],
    benefits: [
      {
        id: "<value>",
        createdAt: new Date("2024-01-22T00:59:04.968Z"),
        modifiedAt: new Date("2024-05-30T13:40:06.041Z"),
        type: "github_repository",
        description:
          "cautiously however competent distorted gosh incidentally legislature tall across",
        selectable: true,
        deletable: true,
        isDeleted: true,
        organizationId: "<value>",
      },
    ],
    medias: [
      {
        id: "<value>",
        organizationId: "<value>",
        name: "<value>",
        path: "/var/yp",
        mimeType: "<value>",
        size: 772025,
        storageVersion: null,
        checksumEtag: "<value>",
        checksumSha256Base64: "<value>",
        checksumSha256Hex: "<value>",
        lastModifiedAt: new Date("2025-10-14T04:04:24.781Z"),
        version: "<value>",
        service: "product_media",
        isUploaded: false,
        createdAt: new Date("2026-03-20T16:38:16.465Z"),
        sizeReadable: "<value>",
        publicUrl: "https://esteemed-coal.com",
      },
    ],
  },
  productPrice: {
    createdAt: new Date("2024-09-23T13:04:20.497Z"),
    modifiedAt: new Date("2026-04-11T22:57:29.689Z"),
    id: "<value>",
    source: "ad_hoc",
    amountType: "metered_unit",
    priceCurrency: "<value>",
    taxBehavior: "inclusive",
    isArchived: true,
    productId: "<value>",
    unitAmount: "<value>",
    capAmount: 982258,
    meterId: "<value>",
    meter: {
      id: "<value>",
      name: "<value>",
      unit: "scalar",
      customLabel: "<value>",
      customMultiplier: 471087,
    },
  },
  prices: {
    "key": [],
    "key1": [],
  },
  discount: {
    duration: "repeating",
    type: "fixed",
    basisPoints: 1000,
    id: "<value>",
    name: "<value>",
    code: "<value>",
  },
  organization: {
    createdAt: new Date("2024-01-14T17:51:08.613Z"),
    modifiedAt: new Date("2025-06-21T13:25:28.290Z"),
    id: "<value>",
    name: "<value>",
    slug: "<value>",
    avatarUrl: "https://brown-massage.info/",
    prorationBehavior: "prorate",
    allowCustomerUpdates: false,
  },
  attachedCustomFields: [],
  customerSessionToken: "<value>",
};

Fields

Field Type Required Description
id string ✔️ The ID of the object.
createdAt Date ✔️ Creation timestamp of the object.
modifiedAt Date ✔️ Last modification timestamp of the object.
customFieldData Record<string, components.CheckoutPublicConfirmedCustomFieldData> Key-value object storing custom field values.
paymentProcessor components.PaymentProcessor ✔️ N/A
status "confirmed" ✔️ N/A
clientSecret string ✔️ Client secret used to update and complete the checkout session from the client.
url string ✔️ URL where the customer can access the checkout session.
expiresAt Date ✔️ Expiration date and time of the checkout session.
successUrl string ✔️ URL where the customer will be redirected after a successful payment.
returnUrl string ✔️ When set, a back button will be shown in the checkout to return to this URL.
embedOrigin string ✔️ When checkout is embedded, represents the Origin of the page embedding the checkout. Used as a security measure to send messages only to the embedding page.
amount number ✔️ Amount in cents, before discounts and taxes.
seats number Predefined number of seats (works with seat-based pricing only)
minSeats number Minimum number of seats (works with seat-based pricing only)
maxSeats number Maximum number of seats (works with seat-based pricing only)
discountAmount number ✔️ Discount amount in cents.
netAmount number ✔️ Amount in cents, after discounts but before taxes.
taxAmount number ✔️ Sales tax amount in cents. If null, it means there is no enough information yet to calculate it.
taxBehavior components.TaxBehavior ✔️ Tax behavior of the checkout. inclusive means the price includes tax, exclusive means tax is added on top. If null, tax is not yet calculated.
totalAmount number ✔️ Amount in cents, after discounts and taxes.
currency string ✔️ Currency code of the checkout session.
allowTrial boolean ✔️ Whether to enable the trial period for the checkout session. If false, the trial period will be disabled, even if the selected product has a trial configured.
activeTrialInterval components.TrialInterval ✔️ Interval unit of the trial period, if any. This value is either set from the checkout, if trial_interval is set, or from the selected product.
activeTrialIntervalCount number ✔️ Number of interval units of the trial period, if any. This value is either set from the checkout, if trial_interval_count is set, or from the selected product.
trialEnd Date ✔️ End date and time of the trial period, if any.
organizationId string ✔️ ID of the organization owning the checkout session.
productId string ✔️ ID of the product to checkout.
productPriceId string ✔️ : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

ID of the product price to checkout.
discountId string ✔️ ID of the discount applied to the checkout.
allowDiscountCodes boolean ✔️ Whether to allow the customer to apply discount codes. If you apply a discount through discount_id, it'll still be applied, but the customer won't be able to change it.
requireBillingAddress boolean ✔️ Whether to require the customer to fill their full billing address, instead of just the country. Customers in the US will always be required to fill their full address, regardless of this setting. If you preset the billing address, this setting will be automatically set to true.
isDiscountApplicable boolean ✔️ Whether the discount is applicable to the checkout. Typically, free and custom prices are not discountable.
isFreeProductPrice boolean ✔️ Whether the product price is free, regardless of discounts.
isPaymentRequired boolean ✔️ Whether the checkout requires payment, e.g. in case of free products or discounts that cover the total amount.
isPaymentSetupRequired boolean ✔️ Whether the checkout requires setting up a payment method, regardless of the amount, e.g. subscriptions that have first free cycles.
isPaymentFormRequired boolean ✔️ Whether the checkout requires a payment form, whether because of a payment or payment method setup.
customerId string ✔️ N/A
isBusinessCustomer boolean ✔️ Whether the customer is a business or an individual. If true, the customer will be required to fill their full billing address and billing name.
customerName string ✔️ Name of the customer.
customerEmail string ✔️ Email address of the customer.
customerIpAddress string ✔️ N/A
customerBillingName string ✔️ N/A
customerBillingAddress components.Address ✔️ N/A
customerTaxId string ✔️ N/A
locale string N/A
paymentProcessorMetadata Record<string, string> ✔️ N/A
billingAddressFields components.CheckoutBillingAddressFields ✔️ N/A
products components.CheckoutProduct[] ✔️ List of products available to select.
product components.CheckoutProduct ✔️ Product selected to checkout.
productPrice components.CheckoutPublicConfirmedProductPrice ✔️ : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Price of the selected product.
prices Record<string, components.CheckoutPublicConfirmedPrices[]> ✔️ Mapping of product IDs to their list of prices.
discount components.CheckoutPublicConfirmedDiscount ✔️ N/A
organization components.CheckoutOrganization ✔️ N/A
attachedCustomFields components.AttachedCustomField[] ✔️ N/A
customerSessionToken string ✔️ N/A