Customer Payment Method
Requires access scope. Also: Requires scope.
Anchor to FieldsFields
- customer (Customer)
- id (ID!)
- instrument (CustomerPaymentInstrument)
- mandates (PaymentMandateResourceConnection!)
- revokedAt (DateTime)
- revokedReason (CustomerPaymentMethodRevocationReason)
- subscriptionContracts (SubscriptionContractConnection!)
- Anchor to customercustomer•Customer
The customer to whom the payment method belongs.
- •ID!non-null
The ID of this payment method.
- Anchor to instrumentinstrument•Customer
Payment Instrument The instrument for this payment method.
- Anchor to mandatesmandates•Payment
Mandate Resource Connection! non-null The mandates associated with the payment method.
- Anchor to firstfirst•Int
The first
nelements from the paginated list.- Anchor to afterafter•String
The elements that come after the specified cursor.
- Anchor to lastlast•Int
The last
nelements from the paginated list.- Anchor to beforebefore•String
The elements that come before the specified cursor.
- Anchor to reversereverse•BooleanDefault:false
Reverse the order of the underlying list.
Arguments
- Anchor to revokedAtrevoked•Date
At Time The time that the payment method was revoked.
- Anchor to revokedReasonrevoked•Customer
Reason Payment Method Revocation Reason The revocation reason for this payment method.
- Anchor to subscriptionContractssubscription•Subscription
Contracts Contract Connection! non-null List Subscription Contracts.
- Anchor to firstfirst•Int
The first
nelements from the paginated list.- Anchor to afterafter•String
The elements that come after the specified cursor.
- Anchor to lastlast•Int
The last
nelements from the paginated list.- Anchor to beforebefore•String
The elements that come before the specified cursor.
- Anchor to reversereverse•BooleanDefault:false
Reverse the order of the underlying list.
Arguments
Anchor to QueriesQueries
- customerPaymentMethod (CustomerPaymentMethod)
- •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.
- •ID!required
The ID of the CustomerPaymentMethod to return.
- Anchor to showRevokedshow•Boolean
Revoked Default:false Whether to show the customer's revoked payment method.
Arguments
- •ID!
Anchor to MutationsMutations
- customerPaymentMethodCreditCardCreate (CustomerPaymentMethodCreditCardCreatePayload)
- customerPaymentMethodCreditCardUpdate (CustomerPaymentMethodCreditCardUpdatePayload)
- customerPaymentMethodPaypalBillingAgreementCreate (CustomerPaymentMethodPaypalBillingAgreementCreatePayload)
- customerPaymentMethodPaypalBillingAgreementUpdate (CustomerPaymentMethodPaypalBillingAgreementUpdatePayload)
- customerPaymentMethodRemoteCreate (CustomerPaymentMethodRemoteCreatePayload)
- •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.
- Anchor to customerIdcustomer•ID!
Id required The ID of the customer.
- Anchor to billingAddressbilling•Mailing
Address Address Input! required The billing address.
- Anchor to sessionIdsession•String!
Id 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.
Arguments
- •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.
- •ID!required
The ID of the customer payment method.
- Anchor to billingAddressbilling•Mailing
Address Address Input! required The billing address.
- Anchor to sessionIdsession•String!
Id required The Cardserver session ID.
Arguments
- •ID!
- Anchor to customerPaymentMethodPaypalBillingAgreementCreatecustomer•mutation
Payment Method Paypal Billing Agreement Create 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.
- Anchor to customerIdcustomer•ID!
Id required The ID of the customer.
- Anchor to billingAddressbilling•Mailing
Address Address Input The billing address.
- Anchor to billingAgreementIdbilling•String!
Agreement Id required The billing agreement ID from PayPal that starts with 'B-' (for example,
).- Anchor to inactiveinactive•BooleanDefault:false
Whether the PayPal billing agreement is inactive.
Arguments
- Anchor to customerPaymentMethodPaypalBillingAgreementUpdatecustomer•mutation
Payment Method Paypal Billing Agreement Update 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.
- •ID!required
The ID of the customer payment method.
- Anchor to billingAddressbilling•Mailing
Address Address Input! required The billing address.
Arguments
- •ID!
- •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
Customerobjects in Shopify.The operation processes payment methods asynchronously. The returned
initially has incomplete details while Shopify validates and processes the remote gateway information. Use thequery 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.
- Anchor to customerIdcustomer•ID!
Id required The ID of the customer.
- Anchor to remoteReferenceremote•Customer
Reference Payment Method Remote Input! required Remote gateway payment method details.
- Anchor to disableAddressValidationdisable•Boolean
Address Validation Default:false Disables the requirement for a billing address on the remote payment method.
Arguments