@@ -531,18 +531,69 @@ export interface CheckoutAddressChangeStartResponse {
531531 errors ?: CheckoutResponseError [ ] ;
532532}
533533
534+ /**
535+ * Card brand identifiers for payment instruments.
536+ * Matches Storefront API card brand values.
537+ */
538+ export type CardBrand =
539+ | 'VISA'
540+ | 'MASTERCARD'
541+ | 'AMERICAN_EXPRESS'
542+ | 'DISCOVER'
543+ | 'DINERS_CLUB'
544+ | 'JCB'
545+ | 'MAESTRO'
546+ | 'UNKNOWN' ;
547+
548+ /**
549+ * Expiry date for a payment instrument.
550+ */
551+ export interface ExpiryInput {
552+ /** Month (1-12) */
553+ month : number ;
554+ /** Four-digit year */
555+ year : number ;
556+ }
557+
558+ /**
559+ * Display fields for a payment instrument shown to the buyer.
560+ */
561+ export interface CartPaymentInstrumentDisplayInput {
562+ /** Last 4 digits of the card number */
563+ last4 : string ;
564+ /** Card brand (e.g., VISA, MASTERCARD) */
565+ brand : CardBrand ;
566+ /** Name of the cardholder */
567+ cardHolderName : string ;
568+ /** Card expiry date */
569+ expiry : ExpiryInput ;
570+ }
571+
572+ /**
573+ * Input type for creating/updating payment instruments, aligned with Storefront API.
574+ * Display fields are grouped separately from the billing address.
575+ *
576+ * @see https://shopify.dev/docs/api/storefront/latest/input-objects/CartPaymentInstrumentInput
577+ */
578+ export interface CartPaymentInstrumentInput {
579+ /** Unique identifier for this payment instrument */
580+ externalReference : string ;
581+ /** Display information for the payment instrument */
582+ display : CartPaymentInstrumentDisplayInput ;
583+ /** Billing address for the payment instrument */
584+ billingAddress : MailingAddressInput ;
585+ }
586+
534587/**
535588 * Event emitted when the buyer intends to change their payment method.
536589 */
537- /** Unique identifier for this event instance */
538590export interface CheckoutPaymentMethodChangeStart {
591+ /** Unique identifier for this event instance */
539592 id : string ;
540593 /** Type of payment change event */
541- type : string ;
594+ type : 'paymentMethodChangeStart' ;
595+ /** Cart state with current payment instruments */
542596 cart ?: {
543- paymentInstruments ?: Array < {
544- type : string ;
545- details ?: any ;
546- } > ;
597+ paymentInstruments ?: CartPaymentInstrumentInput [ ] ;
547598 } ;
548599}
0 commit comments