Anchor to section titled 'undefined'

customerPaymentMethodRemoteCreate
mutation

Requires write_customers access scope. Also: Requires write_customer_payment_methods scope.

Create a payment method from remote gateway identifiers.


Anchor to customerId
customerId
required

The ID of the customer.

Remote gateway payment method details.


Was this section helpful?

The list of errors that occurred from executing the mutation.


Was this section helpful?
Hide code
Mutation reference
Copy
mutation customerPaymentMethodRemoteCreate($customerId: ID!, $remoteReference: CustomerPaymentMethodRemoteInput!) {
  customerPaymentMethodRemoteCreate(customerId: $customerId, remoteReference: $remoteReference) {
    customerPaymentMethod {
      # CustomerPaymentMethod fields
    }
    userErrors {
      field
      message
    }
  }
}
Hide code
Input
Copy
{
  "customerId": "gid://shopify/<objectName>/10079785100",
  "remoteReference": {
    "authorizeNetCustomerPaymentProfile": {
      "customerPaymentProfileId": "<your-customerPaymentProfileId>",
      "customerProfileId": "<your-customerProfileId>"
    },
    "braintreePaymentMethod": {
      "customerId": "<your-customerId>",
      "paymentMethodToken": "<your-paymentMethodToken>"
    },
    "stripePaymentMethod": {
      "customerId": "<your-customerId>",
      "paymentMethodId": "<your-paymentMethodId>"
    }
  }
}
input CustomerPaymentMethodRemoteInput {
  authorizeNetCustomerPaymentProfile: RemoteAuthorizeNetCustomerPaymentProfileInput
  braintreePaymentMethod: RemoteBraintreePaymentMethodInput
  stripePaymentMethod: RemoteStripePaymentMethodInput
}

input RemoteAuthorizeNetCustomerPaymentProfileInput {
  customerPaymentProfileId: String
  customerProfileId: String!
}

input RemoteBraintreePaymentMethodInput {
  customerId: String!
  paymentMethodToken: String
}

input RemoteStripePaymentMethodInput {
  customerId: String!
  paymentMethodId: String
}