# BUYCheckout Class Reference

Inherits from | BUYObject : NSObject
Conforms to | BUYSerializable
Declared in | BUYCheckout.h

## Overview

The checkout object. This is the main object that you will interact with when creating orders on Shopify.

Note: Do not create a BUYCheckout object directly. Use initWithCart: to transform a BUYCart into a BUYCheckout.

## Other Methods

### `email`

The customer’s email address

`@property (nonatomic, copy) NSString *email`

#### Declared In

`BUYCheckout.h`

### `token`

Unique token for the checkout on Shopify

`@property (nonatomic, copy, readonly) NSString *token`

#### Declared In

`BUYCheckout.h`

### `cartToken`

Unique token for a cart which can be used to convert to a checkout

`@property (nonatomic, copy, readonly) NSString *cartToken`

#### Declared In

`BUYCheckout.h`

### `requiresShipping`

States whether or not the fulfillment requires shipping

`@property (nonatomic, assign, readonly) BOOL requiresShipping`

#### Declared In

`BUYCheckout.h`

### `taxesIncluded`

States whether or not the taxes are included in the price

`@property (nonatomic, assign, readonly) BOOL taxesIncluded`

#### Declared In

`BUYCheckout.h`

### `currency`

The three letter code (ISO 4217) for the currency used for the payment

`@property (nonatomic, copy, readonly) NSString *currency`

#### Declared In

`BUYCheckout.h`

### `subtotalPrice`

Price of the order before shipping and taxes

`@property (nonatomic, strong, readonly) NSDecimalNumber *subtotalPrice`

#### Declared In

`BUYCheckout.h`

### `totalTax`

The sum of all the taxes applied to the line items in the order

`@property (nonatomic, strong, readonly) NSDecimalNumber *totalTax`

#### Declared In

`BUYCheckout.h`

### `totalPrice`

The sum of all the prices of all the items in the order, taxes and discounts included

`@property (nonatomic, strong, readonly) NSDecimalNumber *totalPrice`

#### Declared In

`BUYCheckout.h`

### `paymentSessionId`

The Payment Session ID associated with a credit card transaction

`@property (nonatomic, strong, readonly) NSString *paymentSessionId`

#### Declared In

`BUYCheckout.h`

### `paymentURL`

URL to the payment gateway

`@property (nonatomic, strong, readonly) NSURL *paymentURL`

#### Declared In

`BUYCheckout.h`

### `reservationTime`

Reservation time on the checkout in seconds. Setting to @0 and updating the checkout will release inventory reserved by the checkout (when product inventory is not infinite).

`@property (nonatomic, strong) NSNumber *reservationTime`

#### Discussion

300 seconds is default and maximum. `reservationTime` is reset to @300 on every `updateCheckout:completion:` call.

Note: This can also be done with `removeProductReservationsFromCheckout:completion` found in the BUYClient.

#### Declared In

`BUYCheckout.h`

### `reservationTimeLeft`

Reservation time remaining on the checkout in seconds

`@property (nonatomic, strong, readonly) NSNumber *reservationTimeLeft`

#### Declared In

`BUYCheckout.h`

### `paymentDue`

Amount of payment due on the checkout

`@property (nonatomic, strong, readonly) NSDecimalNumber *paymentDue`

#### Declared In

`BUYCheckout.h`

### `lineItems`

Array of BUYLineItem objects in the checkout Note: These are different from BUYCartLineItems in that the line item objects do not include the BUYProductVariant

`@property (nonatomic, readonly, copy) NSArray<__kindofBUYLineItem*> *lineItems`

#### Declared In

`BUYCheckout.h`

### `taxLines`

Array of tax line objects on the checkout

`@property (nonatomic, readonly, copy) NSArray<BUYTaxLine*> *taxLines`

#### Declared In

`BUYCheckout.h`

### `billingAddress`

The mailing address associated with the payment method

`@property (nonatomic, strong) BUYAddress *billingAddress`

#### Declared In

`BUYCheckout.h`

### `shippingAddress`

The mailing address to where the order will be shipped

`@property (nonatomic, strong) BUYAddress *shippingAddress`

#### Declared In

`BUYCheckout.h`

### `shippingRate`

The shipping rate chosen for the checkout

`@property (nonatomic, strong) BUYShippingRate *shippingRate`

#### Declared In

`BUYCheckout.h`

### `shippingRateId`

Shipping rate identifier

`@property (nonatomic, readonly) NSString *shippingRateId`

#### Declared In

`BUYCheckout.h`

### `discount`

A discount added to the checkout Only one discount can be added to a checkout. Call `updateCheckout:completion:` after adding a discount to apply the discount code to the checkout.

`@property (nonatomic, strong) BUYDiscount *discount`

#### Declared In

`BUYCheckout.h`

### `giftCards`

An array of BUYGiftCard objects applied to the checkout

`@property (nonatomic, strong, readonly) NSArray<BUYGiftCard*> *giftCards`

#### Declared In

`BUYCheckout.h`

### `channelId`

Channel ID where the checkout was created

`@property (nonatomic, strong) NSString *channelId`

#### Declared In

`BUYCheckout.h`

### `marketingAttribution`

Attributions for the checkout, containing the application name and platform (defaults to applicationName set on the BUYClient, and “iOS” respectively

`@property (nonatomic, strong) NSDictionary *marketingAttribution`

#### Declared In

`BUYCheckout.h`

### `webCheckoutURL`

URL which is used for completing checkout. It is recommended to open the URL in Safari to take advantage of its autocompletion and credit card capture capabilities

`@property (nonatomic, strong, readonly) NSURL *webCheckoutURL`

#### Declared In

`BUYCheckout.h`

### `webReturnToURL`

The URL Scheme of the host app. Used to return to the app from the web checkout

`@property (nonatomic, strong) NSString *webReturnToURL`

#### Declared In

`BUYCheckout.h`

### `webReturnToLabel`

The button title that will appear after checkout to return to the host app. Defaults to “Return to ‘application’”, where ‘application’ is the `applicationName` set on the BUYClient

`@property (nonatomic, strong) NSString *webReturnToLabel`

#### Declared In

`BUYCheckout.h`

### `createdAtDate`

Creation date of the checkout

`@property (nonatomic, copy, readonly) NSDate *createdAtDate`

#### Declared In

`BUYCheckout.h`

### `updatedAtDate`

Last updated date for the checkout

`@property (nonatomic, copy, readonly) NSDate *updatedAtDate`

#### Declared In

`BUYCheckout.h`

### `privacyPolicyURL`

The website URL for the privacy policy for the checkout

`@property (nonatomic, strong, readonly) NSURL *privacyPolicyURL`

#### Declared In

`BUYCheckout.h`

### `refundPolicyURL`

The website URL for the refund policy for the checkout

`@property (nonatomic, strong, readonly) NSURL *refundPolicyURL`

#### Declared In

`BUYCheckout.h`

### `termsOfServiceURL`

The website URL for the terms of service for the checkout

`@property (nonatomic, strong, readonly) NSURL *termsOfServiceURL`

#### Declared In

`BUYCheckout.h`

### `sourceName`

The name of the source of the checkout: “mobile_app”

`@property (nonatomic, copy, readonly) NSString *sourceName`

#### Declared In

`BUYCheckout.h`

### `sourceIdentifier`

The unique identifier for the source: the channelId

`@property (nonatomic, copy, readonly) NSString *sourceIdentifier`

#### Declared In

`BUYCheckout.h`

### `creditCard`

Credit card stored on the checkout

`@property (nonatomic, strong, readonly) BUYMaskedCreditCard *creditCard`

#### Declared In

`BUYCheckout.h`

### `customerId`

Customer ID associated with the checkout

`@property (nonatomic, copy, readonly) NSString *customerId`

#### Declared In

`BUYCheckout.h`

### `note`

An optional note attached to the order

`@property (nonatomic, copy) NSString *note`

#### Declared In

`BUYCheckout.h`

### `order`

The BUYOrder for a completed checkout

`@property (nonatomic, strong, readonly) BUYOrder *order`

#### Declared In

`BUYCheckout.h`

### `partialAddresses`

Flag used to inform server that the shipping address is partially filled, suitable to retrieve shipping rates with partial shipping addresses provided by PKPaymentAuthorizationViewController. Note: This should only ever be set to YES. Setting it to NO throws an exception.

`@property (nonatomic, assign) BOOL partialAddresses`

#### Declared In

`BUYCheckout.h`

### `– init`

It is recommended to instantiate a checkout with a cart, or cart token

`- (instancetype)init`

#### Return Value

Checkout

#### Declared In

`BUYCheckout.h`

### `– initWithCart:`

Creates a new checkout

`- (instancetype)initWithCart:(BUYCart *)cart`

#### Parameters

`cart` | a Cart with line items on it

#### Return Value

a checkout object

#### Declared In

`BUYCheckout.h`

### `– initWithCartToken:`

Creates a new checkout

`- (instancetype)initWithCartToken:(NSString *)cartToken`

#### Parameters

`cartToken` | a token for a previously created cart

#### Return Value

a checkout object

#### Declared In

`BUYCheckout.h`

### `– hasToken`

Helper method to determine if there is a valid token on the checkout

`- (BOOL)hasToken`

#### Return Value

YES if the token is valid

#### Declared In

`BUYCheckout.h`

### `)`

The unique order ID

`@property (nonatomic, copy, readonly) NSNumber *DEPRECATED_MSG_ATTRIBUTE ( "Available on the BUYOrder object" )`

#### Declared In

`BUYCheckout.h`

## ApplePay Methods

### `– buy_summaryItems`

Returns an array of summary items for all Apple Pay requests. Will use ‘PAY TOTAL’ as the summary label. Apple recommends including the business name in the summary label, so it is recommended to use `buy_summaryItemsWithShopName` instead.

`- (nonnull NSArray<PKPaymentSummaryItem*> *)buy_summaryItems`

#### Declared In

`BUYApplePayAdditions.h`

### `– buy_summaryItemsWithShopName:`

Returns an array of summary items for all Apple Pay requests using the shop name in the “PAY” section

`- (nonnull NSArray<PKPaymentSummaryItem*> *)buy_summaryItemsWithShopName:(nullable NSString *)shopName`

#### Parameters

`shopName` | the shops name

#### Return Value

An array of PKPaymentSummaryItems

#### Declared In

`BUYApplePayAdditions.h`