Skip to main content

Creating a client

Printful offers 2 levels of access for a client, a Store client and an Account client.

Currently the SDK only offers support for Store Clients. Support for Account Clients is WIP🚧.

Store Level Client​

To instantiate a client, do the following:

import {createPrintfulStoreClient} from "printful-sdk-js";

const STORE_TOKEN = "YOUR STORE TOKEN";

const client = createPrintfulStoreClient(STORE_TOKEN);

Getting an access token​

Read the following guide on Prinful API Docs on Authentication.

IMPORTANT NOTE: It is advised to keep your API keys safe by storing them in a .env file and importing it into your project using a tool like dotenv or any equivalent you may have available in your project.

Submodules of Store Client​

After instantiation, client offers a multitude of submodules that correspond to the sub-APIs as described by the Printful API Documentation.

Below is a table mapping the SDK submodules to their respective sub-APIs.

NOTE: Parts of the HTTP responses are abstracted away by the SDK. If you would like to investigate further, you are welcome to dive into the source code.

SDK SubmodulePrintful Sub-API
client.oauthOAuth API
client.catalogCatalog API
client.productsProducts API
client.ordersOrders API
client.fileLibraryFile Library API
client.shippingRateShipping Rate API
client.ecommerceSyncEcommerce Platform Sync API
client.countryCodesCountry/State Code API
client.taxRateTax Rate API
client.webhookWebhook API
client.storeInformationStore Information API
client.mockupGeneratorMockup Generator API
client.warehouseProductsWarehouse Products API
client.reportsReports API
client.approvalSheetsApproval Sheets API

Account Level Client​

Support for Account Clients is WIP🚧.