Customer
Methods for the current logged in customer.
getCustomer v1.0.0 read customers Types
Get the current customer.
Include options are available v1.86.0: addresses, announcements, gift_purchases, memberships, metafields, payment_methods, punch_card_progress, referral_info, and subscriptions.
- ESM
- UMD
import { getCustomer } from '@rechargeapps/storefront-client';
await getCustomer(session, {
include: [
'addresses',
'announcements',
'gift_purchases',
'memberships',
'metafields',
'payment_methods',
'punch_card_progress',
'referral_info',
'subscriptions',
],
});
await recharge.customer.getCustomer(session, {
include: [
'addresses',
'announcements',
'gift_purchases',
'memberships',
'metafields',
'payment_methods',
'punch_card_progress',
'referral_info',
'subscriptions',
],
});
updateCustomer v1.0.0 write customers Types
Update the current customer.
- ESM
- UMD
import { updateCustomer } from '@rechargeapps/storefront-client';
await updateCustomer(session, { first_name: 'Test' });
await recharge.customer.updateCustomer(session, { first_name: 'Test' });
getDeliverySchedule v1.0.0 read customers Types
Get the delivery schedule for the current customer.
- ESM
- UMD
import { getDeliverySchedule } from '@rechargeapps/storefront-client';
await getDeliverySchedule(session, {
date_max: '2022-10-18',
});
await recharge.customer.getDeliverySchedule(session, {
date_max: '2022-10-18',
});
getCustomerPortalAccess v1.0.0 read customer portal access Types
Get the customer portal access details for a customer. Optional query params: page_destination, locale, and region_country.
- ESM
- UMD
import { getCustomerPortalAccess } from '@rechargeapps/storefront-client';
await getCustomerPortalAccess(session, { page_destination: 'overview' });
await recharge.customer.getCustomerPortalAccess(session, { page_destination: 'overview' });
getActiveChurnLandingPageURL v1.14.0 read customer portal access Types
Get the landing page URL for canceling a subscription. Takes a subscription ID and redirectURL to redirect the customer after completion of the landing page.
- ESM
- UMD
import { getActiveChurnLandingPageURL } from '@rechargeapps/storefront-client';
await getActiveChurnLandingPageURL(session, '1234', 'https://getrecharge.com');
await recharge.customer.getActiveChurnLandingPageURL(session, '1234', 'https://getrecharge.com');
getFailedPaymentMethodRecoveryLandingPageURL v1.32.0 read customer portal access Types
Get the landing page URL for recovering a failed payment method. The page automatically identifies the customer’s next scheduled charge and displays any issues with their payment method, such as an expired card or insufficient funds.
- ESM
- UMD
import { getFailedPaymentMethodRecoveryLandingPageURL } from '@rechargeapps/storefront-client';
await getFailedPaymentMethodRecoveryLandingPageURL(session);
await recharge.customer.getFailedPaymentMethodRecoveryLandingPageURL(session);
getGiftRedemptionLandingPageURL v1.15.0 read customer portal access Types
Get the landing page URL for gift redemption. Takes a gift ID and redirectURL to redirect the customer after completion of the landing page.
- ESM
- UMD
import { getGiftRedemptionLandingPageURL } from '@rechargeapps/storefront-client';
await getGiftRedemptionLandingPageURL(session, '1234', 'https://getrecharge.com');
await recharge.customer.getGiftRedemptionLandingPageURL(session, '1234', 'https://getrecharge.com');
sendCustomerNotification v1.8.0 write notifications Types
Send a notification to the customer by notification type and options.
- ESM
- UMD
import { sendCustomerNotification } from '@rechargeapps/storefront-client';
await sendCustomerNotification(session, 'SHOPIFY_UPDATE_PAYMENT_INFO', {
address_id: 1234,
payment_method_id: '1234',
});
await recharge.customer.sendCustomerNotification(session, 'SHOPIFY_UPDATE_PAYMENT_INFO', {
address_id: 1234,
payment_method_id: '1234',
});
getCreditSummary v1.14.0 read credit summary Types Deprecated
DEPRECATED: Please use getCreditSummary instead
Get the credit summary of the current logged in customer.
Optional query params: include and presentment_currency_code.
- ESM
- UMD
import { getCreditSummary } from '@rechargeapps/storefront-client';
await getCreditSummary(session, { include: ['credit_details'], presentment_currency_code: 'CAD' });
await recharge.customer.getCreditSummary(session, {
include: ['credit_details'],
presentment_currency_code: 'CAD',
});