# printful-client

> Printful API Wrapper in TypeScript

Latest version **0.2.0** (published 2026-02-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install printful-client
pnpm add printful-client
yarn add printful-client
bun add printful-client
```

## Health

**Score 55/100 (C)** — status: stable.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2026-02-01 |
| First published | 2022-06-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 46.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Gerardo Renovales |
| Maintainers | grenovales |
| Keywords | prinful |

## Links

- npm: https://www.npmjs.com/package/printful-client
- npm.io page: https://npm.io/package/printful-client

## Dependencies (1)

- [cross-fetch](https://npm.io/package/cross-fetch.md) ^4.1.0

## Recent versions

- 0.2.0 (latest) — 2026-02-01
- 0.1.0 — 2026-01-31
- 0.0.3 — 2022-07-02
- 0.0.2 — 2022-06-27
- 0.0.1 — 2022-06-25

## README

# printful-client

Request wrapper for Printful, with authorization management. **Not to be used client-side**.

## Install


```bash
# Npm:
npm install printful-client

# Yarn:
yarn add printful-client

# Pnpm: 💝
pnpm add printful-client
```

### Get Product  

```js
const { PrintfulClient } = require("printful-client");
const printful = new PrintfulClient("PRINTFUL_API_TOKEN");

printful.products.get("PRODUCT_ID").then((response: Response) => {
  response.json().then((value) => {
    console.log(JSON.stringify(val));
  });
});
```

### Get all store products 🛍 
```js
const { PrintfulClient } = require("printful-client");
const printful = new PrintfulClient("PRINTFUL_API_TOKEN");

printful.products.getAll().then((response: Response) => {
  response.json().then((val) => {
    console.log(JSON.stringify(val));
  });
});
```
### Get product variant 👕  
```js
const { PrintfulClient } = require("printful-client");
const printful = new PrintfulClient("PRINTFUL_API_TOKEN");

printful.products.variants.get("VARIANT_ID").then((response: Response) => {
  response.json().then((val) => {
    console.log(JSON.stringify(val));
  });
});
```

### Calculate Shipping Rate 📦 
```js
const shippingRequest = {
  recipient: {
    address1: "5246 US Hwy 98 N",
    city: "Lakeland",
    country_code: "US",
    state_code: "FL",
    zip: "33809"
  },
  items: [
    {
      variant_id: "11566",
      quantity: 10
    },
  ],
  currency: "USD",
  locale: "en_US",
};

printful.shipping.calculate(shippingRquest).then((response: Response) => {
  response.json().then((val) => {
    console.log(JSON.stringify(val));
  });
});
```

### Get Tax Rate 😢 
```js
const taxRequest = {
  recipient: {
    "country_code": "US",
    "state_code": "FL",
    "city": "Lakeland",
    "zip": "33809"
  }
};

printful.tax.getRate(taxRequest).then((response: Response) => {
  response.json().then((val) => {
    console.log(JSON.stringify(val));
  });
});
```

### Request JSON with error handling
`requestJson` parses the JSON body and throws a `PrintfulApiError` on non-2xx responses.

```js
const { PrintfulClient } = require("printful-client");

const printful = new PrintfulClient("PRINTFUL_API_TOKEN");

printful
  .requestJson("/products")
  .then((data) => {
    console.log(JSON.stringify(data));
  })
  .catch((error) => {
    console.error(error.status, error.message);
  });
```
Refer to the [Printful API Documentation](https://developers.printful.com/docs/)

## Links

- [License (MIT)](LICENSE)

## Contributions

**New contributors welcome!** just create a PR 😎

## Todo
- Re-organize types 
- Add more endpoints
- Unit testing

---
_Source: https://npm.io/package/printful-client · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
