import { Currency } from './Currency'; import { CheckoutSubmitType, OrderKind, PaymentType, ShippingMethodType } from './enums'; import { EventMap } from './Event'; export declare const addressInputFields: (keyof AddressInput)[]; export interface Checkout { test?: boolean; token: string; first_name?: string; last_name?: string; email?: string; phone?: string; completed: boolean; mode: PaymentType; requires_shipping: boolean; allow_promotion_codes: boolean; collect_phone_number: boolean; web_url?: string; success_url?: string; cancel_url?: string; submit_type: CheckoutSubmitType; shipping_address?: Address; billing_address?: Address; shipping_line?: string; discount_code?: string; currency: Currency; lines: CheckoutLine[]; total_discounts: number; total_shipping: number; total_tax: number; subtotal_price: number; total_price: number; shippingMethod?: ShippingMethod; shippingMethods: ShippingMethod[]; paymentOptions: CheckoutPaymentOption[]; error_messages: string[]; order?: CheckoutOrder; seats?: string[]; event_map?: EventMap; } export type PaymentMethodType = "in:card"; export type CheckoutLine = { id: string | number; name: string; price: number; quantity: number; total: number; unit_price: number; item_type: string; image?: PublicMedia; adjustable_quantity?: AdjustableQuantity; }; export type ShippingMethod = { id: string; name: string; description?: string; handle: string; price: number; type: ShippingMethodType; estimated_min_days?: number; estimated_max_days?: number; }; export type CheckoutPaymentOption = { name: string; description?: string; handle: string; express?: boolean; icon?: string; component?: string; data?: string; }; export type CheckoutOrder = { reference: string; email?: string; currency: Currency; total: number; }; export type CheckoutIntent = { /** * The checkout intent session token. */ session: string; /** * The Epoch time in seconds at which the intent will expire. */ expiry: number; /** * The URL to the Checkout. Redirect customers to this URL to take them to Checkout. */ url: string; }; export type CheckoutBookingSlot = { /** * `Y-m-d` formatted date */ date: string; /** * list of ISO string times in the slot. */ slots: CheckoutBookingSlotEntry[]; }; export type CheckoutBookingSlotEntry = { /** * The delivery date shown to the customer at checkout. * For products, this is when the product is prepared * and ready for fulfillment. At the end of the schedule. */ delivery: string; /** * The actual schedule time for the booking. */ schedule: string; }; type AdjustableQuantity = { enabled?: boolean; maximum?: number; minimum?: number; }; export type CheckoutCreateInput = { kind?: OrderKind; mode?: PaymentType; payment_method_types?: PaymentMethodType[]; success_url?: string; cancel_url?: string; client_reference?: string; cart?: string; use_cart?: boolean; customer?: string; email?: string; phone?: string; expires_at?: string; allow_promotion_codes?: boolean; create_customer?: boolean; collect_phone_number?: boolean; must_authenticate?: boolean; lines?: CheckoutLineItemInput[]; discounts?: string[]; seats?: string[]; submit_type?: CheckoutSubmitType; shipping_address?: AddressInput; billing_address?: AddressInput; billing_as_shipping?: boolean; shipping_as_billing?: boolean; }; export type CheckoutUpdateInput = { first_name?: string; last_name?: string; email?: string; phone?: string; shipping_address?: CheckoutHasShippingAddressUpdateInput; billing_address?: CheckoutHasBillingAddressUpdateInput; lines?: CheckoutHasItemsUpdateInput; discount?: CheckoutDiscountCodeUpdateInput; seats?: string[]; }; export type CheckoutContactUpdateInput = Pick; export type CheckoutCompleteInput = { payment_method?: string; options?: Record; }; export interface AddressInput { company?: string; description?: string; first_name?: string; last_name?: string; phone?: string; street: string; street_extra?: string; city: string; postal_code?: string; province_code?: string; country_code: string; latitude?: number; longitude?: number; is_public?: boolean; } export interface Address extends AddressInput { id: string; } type CheckoutHasShippingAddressUpdateInput = { set?: AddressInput; use_billing?: boolean; delete?: boolean; use?: string; }; type CheckoutHasBillingAddressUpdateInput = { set?: AddressInput; use_shipping?: boolean; delete?: boolean; use?: string; }; type CheckoutHasItemsUpdateInput = { set?: CheckoutLineItemInput[]; add?: CheckoutLineItemInput[]; update?: CheckoutLineItemUpdateInput[]; delete?: string[]; }; type CheckoutLineItemInput = { id: string; quantity?: number; properties?: Record; }; type CheckoutLineItemUpdateInput = { id: string; quantity: number; }; type CheckoutDiscountCodeUpdateInput = { set?: string[]; apply?: string[]; delete?: string[]; clear?: boolean; }; export type PublicMedia = { id: string; fqfn: string; name?: string; description?: string; type: string; src: string; srcset?: string; thumb?: string; alt?: string; height?: number | string; width?: number | string; aspectRatio?: number | string; }; export {};