Skip to main content
Anchor to CustomerPaymentMethod

CustomerPaymentMethod

object

Requires read_customers access scope. Also: Requires read_customer_payment_methods scope.

A customer's saved payment method. Stores the payment instrument details and billing information for recurring charges.

The payment method supports types included in the CustomerPaymentInstrument union.

•Customer

The customer to whom the payment method belongs.

•ID!
non-null

The ID of this payment method.

•CustomerPaymentInstrument

The instrument for this payment method.

•PaymentMandateResourceConnection!
non-null

The mandates associated with the payment method.

Arguments

•Int

The first n elements from the paginated list.

•String

The elements that come after the specified cursor.

•Int

The last n elements from the paginated list.

•String

The elements that come before the specified cursor.

•Boolean
Default:false

Reverse the order of the underlying list.


•DateTime

The time that the payment method was revoked.

•CustomerPaymentMethodRevocationReason

The revocation reason for this payment method.

Anchor to subscriptionContractssubscriptionContracts
•SubscriptionContractConnection!
non-null

List Subscription Contracts.

Arguments

•Int

The first n elements from the paginated list.

•String

The elements that come after the specified cursor.

•Int

The last n elements from the paginated list.

•String

The elements that come before the specified cursor.

•Boolean
Default:false

Reverse the order of the underlying list.



Was this section helpful?

•query

Returns a vaulted customer payment method by its ID, including the instrument type (credit card, PayPal, etc.), billing address, and current status. Optionally includes revoked payment methods. Use this to look up a specific saved payment method for a customer — for example, to check whether a subscription's payment method is still valid or to display stored payment details.

Arguments

•ID!
required

The ID of the CustomerPaymentMethod to return.

•Boolean
Default:false

Whether to show the customer's revoked payment method.



Was this section helpful?

•mutation

Creates a credit card payment method for a customer using a session id. These values are only obtained through card imports happening from a PCI compliant environment. Please use customerPaymentMethodRemoteCreate if you are not managing credit cards directly.

Arguments

•ID!
required

The ID of the customer.

•MailingAddressInput!
required

The billing address.

•String!
required

The Cardserver session ID. Obtained by storing card data with Shopify's Cardsink. Exchanging raw card data for a session ID must be done in a PCI complaint environment.


•mutation

Updates an existing vaulted credit card payment method for a customer, including billing address and card details. Requires a valid cardserver session from a PCI-compliant environment. Use this when a customer's card details have changed (e.g., new expiration date or replacement card) and ongoing subscriptions or saved payment methods need to be updated.

Arguments

•ID!
required

The ID of the customer payment method.

•MailingAddressInput!
required

The billing address.

•String!
required

The Cardserver session ID.


•mutation

Creates a vaulted PayPal billing agreement for a customer, enabling recurring charges through PayPal. The billing agreement ID (starting with 'B-') must be obtained from PayPal. Once created, this payment method can be used for subscription billing or future order payments without requiring the customer to re-authenticate with PayPal.

Arguments

•ID!
required

The ID of the customer.

•MailingAddressInput

The billing address.

•String!
required

The billing agreement ID from PayPal that starts with 'B-' (for example, B-1234XXXXX).

•Boolean
Default:false

Whether the PayPal billing agreement is inactive.


•mutation

Updates the billing address associated with a customer's vaulted PayPal billing agreement. Use this when a customer's billing information has changed and their PayPal payment method record in Shopify needs to be updated accordingly.

Arguments

•ID!
required

The ID of the customer payment method.

•MailingAddressInput!
required

The billing address.


•mutation

Creates a customer payment method using identifiers from remote payment gateways like Stripe, Authorize.Net, or Braintree. Imports existing payment methods from external gateways and associates them with Customer objects in Shopify.

The operation processes payment methods asynchronously. The returned CustomerPaymentMethod initially has incomplete details while Shopify validates and processes the remote gateway information. Use the customerPaymentMethod query to retrieve the payment method status until all details are available or the payment method is revoked.

Learn more about migrating customer payment methods from remote gateways.

Arguments

•ID!
required

The ID of the customer.

•CustomerPaymentMethodRemoteInput!
required

Remote gateway payment method details.

Anchor to disableAddressValidationdisableAddressValidation
•Boolean
Default:false

Disables the requirement for a billing address on the remote payment method.



Was this section helpful?

•interface

Was this section helpful?