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.
- ESM
- UMD
import { loginShopifyAppProxy, listSubscriptions } from '@rechargeapps/storefront-client';
const session = await loginShopifyAppProxy();
const subscriptions = await listSubscriptions(session, {
limit: 25,
sort_by: 'id-asc',
});
const session = await recharge.auth.loginShopifyAppProxy();
const subscriptions = await recharge.subscription.listSubscriptions(session, {
limit: 25,
sort_by: 'id-asc',
});
📄️ Auth
Methods to fetch a recharge session.
📄️ Addresses
Methods to interact with recharge addresses.
📄️ Bundles
Methods to work with Recharge bundles.
📄️ Bundle Selections
Methods to work with Recharge bundle selections.
📄️ Charges
Methods to work with Recharge charges.
📄️ Collections
Methods for handling collections.
📄️ Credits
Methods for handling credits for the currently logged in customer.
📄️ Customer
Methods for the current logged in customer.
📄️ Gifts
Methods for handling gifts for the currently logged in customer.
📄️ Metafields
Methods for handling metafields.
📄️ Onetimes
Methods for handling onetimes.
📄️ Orders
Methods for handling orders.
📄️ PaymentMethods
Methods for handling Payment Methods.
📄️ Plans
Methods for handling plans.
📄️ Products
Methods for handling products.
📄️ Store
The store API allows getting information that is at the store level instead of the customer level. These APIs contain information that is generic for all customers and do not contain any customer information.
📄️ Subscriptions
Methods for handling subscriptions.