Skip to main content

Customer

Methods for the current logged in customer.

getCustomer v1.0.0 read customers Types

Get the current customer.

import { getCustomer } from '@rechargeapps/storefront-client';
await getCustomer(session, { include: ['addresses'] });

updateCustomer v1.0.0 write customers Types

Update the current customer.

import { updateCustomer } from '@rechargeapps/storefront-client';
await updateCustomer(session, { first_name: 'Test' });

getDeliverySchedule v1.0.0 read customers Types

Get the delivery schedule for the current customer.

import { getDeliverySchedule } from '@rechargeapps/storefront-client';
await 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.

import { getCustomerPortalAccess } from '@rechargeapps/storefront-client';
await getCustomerPortalAccess(session);

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.

import { getActiveChurnLandingPageURL } from '@rechargeapps/storefront-client';
await getActiveChurnLandingPageURL(session, '1234', 'https://rechargepayments.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.

import { getGiftRedemptionLandingPageURL } from '@rechargeapps/storefront-client';
await getGiftRedemptionLandingPageURL(session, '1234', 'https://rechargepayments.com');

sendCustomerNotification v1.8.0 write notifications Types

Send a notification to the customer.

import { sendCustomerNotification } from '@rechargeapps/storefront-client';
await sendCustomerNotification(session, 'SHOPIFY_UPDATE_PAYMENT_INFO', {
address_id: 1234,
payment_method_id: '1234',
});

getCreditSummary v1.14.0 read customer credit summary Types

Get the credit summary of the current logged in customer.

import { getCreditSummary } from '@rechargeapps/storefront-client';
await getCreditSummary(session, { include: ['credit_details'] });