Skip to main content

Overview

The API section encapsulates data that is retrieved via the Recharge API. The caller must first retrieve a session and pass it to all subsequent API functions. The caller is currently responsible for securely storing the session. For additional details on some of these functions see the Recharge API version 2021-11.

Authentication

Your level of authentication access is determined by the Recharge Storefront Token used and the authenticated customer. If you try to access a function without appropriate scopes you will receive a 401.

Examples of the different levels of access required for a SDK method are denoted as follows:

read customerswrite subscriptions

Please read Auth for the full documentation on authentication and examples.

Example workflow

Get session and make another API call.

import { loginShopifyAppProxy, listSubscriptions } from '@rechargeapps/storefront-client';
const session = await loginShopifyAppProxy();
const subscriptions = await listSubscriptions(session, {
limit: 25,
sort_by: 'id-asc',
});