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.
- ESM
- UMD
import { getCreditSummary } from '@rechargeapps/storefront-client';
await getCreditSummary(session, { include: ['credit_details'] });
await recharge.credit.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.
- ESM
- UMD
import { setApplyCreditsToNextCharge } from '@rechargeapps/storefront-client';
await setApplyCreditsToNextCharge(session, { recurring: true });
await recharge.credit.setApplyCreditsToNextCharge(session, { recurring: true });
listCreditAccounts v1.19.0 read credit accounts Types
List credit accounts for the current logged in customer.
- ESM
- UMD
import { listCreditAccounts } from '@rechargeapps/storefront-client';
await listCreditAccounts(session, {
limit: 25,
sort_by: 'id-asc',
});
await recharge.credit.listCreditAccounts(session, {
limit: 25,
sort_by: 'id-asc',
});