Skip to main content

Credits

Methods for handling credits for the currently logged in customer.

getCreditSummary v1.19.0 read 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'] });

setApplyCreditsToNextCharge v1.19.0 write customers Types​

Enable or disable the automatic application of credits on a customer's next recurring charge.

import { setApplyCreditsToNextCharge } from '@rechargeapps/storefront-client';
await setApplyCreditsToNextCharge(session, { recurring: true });

listCreditAccounts v1.19.0 read credit accounts Types​

List credit accounts for the current logged in customer.

import { listCreditAccounts } from '@rechargeapps/storefront-client';
await listCreditAccounts(session, {
limit: 25,
sort_by: 'id-asc',
});