Customer
Methods for the current logged in customer.
getCustomer v1.0.0 read customers Types
Get the current customer.
- ESM
- UMD
import { getCustomer } from '@rechargeapps/storefront-client';
await getCustomer(session, { include: ['addresses'] });
await recharge.customer.getCustomer(session, { include: ['addresses'] });
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.
- 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');
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.
- 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.
- ESM
- UMD
import { getCreditSummary } from '@rechargeapps/storefront-client';
await getCreditSummary(session, { include: ['credit_details'] });
await recharge.customer.getCreditSummary(session, { include: ['credit_details'] });