How to add Shopify's payment update flow to your custom Customer Portal
If you run a custom customer portal on the Shopify Checkout Integration, there are two supported ways to let customers update their payment method: the frictionless payment form in the Recharge JavaScript SDK, or Shopify's payment update email sent through the Recharge API. In both, Shopify collects and vaults the card, so card details never pass through your portal.
- Shopify Checkout Integration
- Migrated Shopify Checkout Integration
Before you start
- You need a custom customer portal connected to your Recharge subscriptions, and access to the Recharge API or the Recharge JavaScript SDK.
- Building and maintaining a custom portal is outside the scope of Recharge Support. If you aren't working with a developer, Recharge recommends a certified Recharge partner.
Option 1: Frictionless payment form in the Recharge SDK
The frictionless payment form lets customers enter a new card directly on a page in your portal. The SDK hosts the card number and CVV fields, tokenizes the card, and saves it to the Shopify vault linked to the customer's Recharge account. This option requires Shopify Payments as your payment provider.
Customers can use it to add a new card, or to replace an existing Shopify Payments card by passing that card's Recharge payment method ID. The form can also set the new card as the default and apply it to some or all of the customer's subscription addresses.
To set it up:
- Turn on frictionless payment method updates for your store. See How to enable frictionless payment method updates.
- Have your developer add the form to your portal with the initFrictionlessPaymentV1 SDK method. See Frictionless payments usage in the SDK docs.
Option 2: Shopify's payment update email
Your portal can ask Shopify to email the customer a secure link to a Shopify-hosted page, where they update their card. Your portal never shows a card form; the customer finishes the update from their inbox.
To trigger the email, your backend calls the Recharge API's Send email notification endpoint (POST /customers/{id}/notifications) with the shopify_update_payment_information template type and the payment_method_id of the card to update. A common pattern is an "Update payment method" button in your portal that triggers the call and then tells the customer to check their email.
There is no API endpoint that returns a Shopify-hosted payment update URL for you to redirect customers to. The email is the supported way to send customers to that page.
Which option to choose
Use the frictionless form if you're on Shopify Payments and want customers to finish the update without leaving your portal. Use the payment update email if you aren't on Shopify Payments, or want the lightest build.
Frictionless SDK form |
Shopify payment update email |
|
| Payment provider | Shopify Payments only | Not limited to Shopify Payments |
| Where the customer updates the card | A form inside your portal | A Shopify-hosted page, from an email link |
| What your developer builds | A card form using the SDK | One API call from your backend |
| Where the card is vaulted | Shopify | Shopify |
3D Secure and European cards
No 3D Secure authentication runs when a customer saves or updates a card. Authentication happens later, when a recurring charge is processed.
If the customer's bank requires authentication for that charge, Shopify emails the customer a link to confirm the payment. The charge stays pending until the customer completes it, then goes through.
Most European cards require 3D Secure, so stores with European customers should expect some customers to get this Shopify email at renewal. For details, see Managing Shopify’s payment authentication with nextActionURL.
