## useCheckout

The `useCheckout` hook returns a disjoint union describing the loading state:

* `{type: "loading"}`
* `{type: "error", error: { message: string }}`
* `{type: "success", checkout: object }`.

Upon success, it returns a [Session object](https://docs.stripe.com/js/custom_checkout/session_object.md) as well as actions to update the Checkout Session.

### Object properties

* `id` The ID of the Checkout Session.
* `billingAddress` Billing details of the Customer.
* `name` Full name.
* `address` Address.
* `country` Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
* `line1` Address line 1 (e.g., street, PO Box, or company name).
* `line2` Address line 2 (e.g., apartment, suite, unit, or building).
* `city` City, district, suburb, town, or village.
* `postal_code` ZIP or postal code.
* `state` State, county, province, or region.
* `businessName` The business name as configured in the Business Public Details settings of your Stripe account.
* `canConfirm` Whether the Checkout Session has collected enough data to confirm. Use this field to indicate to your customer if they can proceed, such as disabling the pay button.
* `currency` Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://docs.stripe.com/currencies.md).
* `currencyOptions` The currency options available on the Checkout Session when using [Adaptive Pricing](https://docs.stripe.com/checkout/custom-checkout/adaptive-pricing.md).
* `amount` A formatted string representing the total amount in the source currency, including currency symbols.
* `minorUnitsAmount` An integer representing the total amount in the source currency in the [smallest currency unit](https://docs.stripe.com/currencies.md#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency).
* `currency` Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
* `currencyConversion` Currency conversion details. This is only present for the customer currency.
* `fxRate` The exchange rate used to convert source currency amounts to customer currency amounts.
* `sourceCurrency` The creation currency of the Checkout Session before localization.
* `discountAmounts` The aggregate amounts calculated per discount for