TanqoryDocs

tanqoryExtCustomerPaymentMethodSetupStart

  • Mutation
  • Storefront

Opens the store's card provider's own page where the customer adds a card (the card number goes only to the provider). With subscriptionContractId (one of theirs) the new card pays that subscription; with makeDefault it becomes the default. With replacesPaymentMethodId (one of their own saved methods, the one a "update your payment method" email names) the new card replaces it: it pays that method's subscriptions, becomes the default if the old one was, and the old one is revoked. The provider sends the customer back to /account/subscriptions?card_setup=<session id> (for a replacement, /account/payment_methods/<old id>/update?card_setup=<session id>); finish with tanqoryExtCustomerPaymentMethodSetupFinish. Needs Customer.tanqoryExtSubscriptionSelfService. Private token only.

Arguments

ArgumentTypeRequiredDefault
customerAccessTokenString!Required
subscriptionContractIdIDOptional
makeDefaultBooleanOptional
replacesPaymentMethodIdIDOptional

Returns

TanqoryExtCustomerPaymentMethodSetupStartPayload!

FieldTypeDescription
urlString

The card provider's own page to open; the customer types the card there and comes back to /account/subscriptions.

userErrors[CustomerUserError!]!

Example request

A starting point: required arguments as variables and a few fields of the result. Replace the placeholders.

Set STORE_ID and TANQORY_STOREFRONT_TOKEN in your environment first (Make your first API call).

curl
curl -X POST "https://$STORE_HOST/api/v1/stores/$STORE_ID/2026-10/graphql" \
  -H "X-Tanqory-Storefront-Access-Token: $TANQORY_STOREFRONT_TOKEN" \
  -H "Content-Type: application/json" \
  --data '{"query":"mutation TanqoryExtCustomerPaymentMethodSetupStart($customerAccessToken: String!) {\n  tanqoryExtCustomerPaymentMethodSetupStart(customerAccessToken: $customerAccessToken) {\n    url\n    userErrors {\n      code\n      field\n      message\n    }\n  }\n}","variables":{"customerAccessToken":""}}'

Built from commit 0cac88ece6de · API version 2026-10