1.0.5 • Published 4 months ago

printful-ts v1.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
4 months ago

printful-ts is a Typescript implmentation client liblary for Printful API,

printful offers a range of print on demand products and services

Requirements

To use this package you will need a Printful Token Key

Install

npm install printful-ts

Or

yarn add printful-ts

Usage

import PrintFulAPI from 'printful-ts';

const token = 'YOUR_API_ACCESS';
const printful = new PrintFulAPI(token);

// get scope
const scope = printful.auth.getScope();
// get categories
const categories: Category[] = printful.catelog.getCategories()
// get products
const products: Product[] = printful.catelog.getProducts(categories[0].id)
// get single product
const productId = products[9].id
const product: ProductInfo = printful.catelog.getProduct(productId)
// get variants
const variantId = product.variants[0].id
const variant: VariantInfo = printful.catelog.getVariant(variantId)
// add printfile
const new_file = new NewFileData('image', 'https://path_to_image.com');
const result: File = printful.file.addNewFile(new_file);
// generate mockup
const print_file_ids = [12345, 67890]
const mockupOptions: MockUpOptions = new MockUpOptions(print_file_ids, 'png');

Methods

Here is an overview of the methods available

auth

  • getScope

catalog

  • getProducts
  • getVariant
  • getProductSizeGuide
  • getCategories
  • getCategory

file

  • addNewFile
  • getFile
  • getThreadColors

mockup

  • newTask
  • getPrintFiles
  • getProductTemplate
  • getTaskResult

orders

  • createNewOrder
  • getOrderData
  • cancekOrder
  • updateOrderData
  • estimateOrderCosts

products

  • createSyncProduct
  • getSyncProducts
  • getSyncProduct
  • modifySyncProduct
  • deleteSyncProduct

shipping

  • calculateShippingRates

store

  • changePackingSlip
  • getStoresInfo
  • getStoreInfo

sync

  • getListOfSyncProducts
  • getSyncProduct
  • deleteSyncProduct
  • getSyncVariant
  • modifySyncVariant
  • deleteSyncVariant

tax

  • getCountries

template

  • getProductTemplate
  • deleteProductTemplate

Disclaimer

This package is no officially maintained by Printful, Use at your own risk, the links on this page pointing to Printful may result in a little kickback

License

This project is licensed under the MIT License

1.0.5

4 months ago

1.0.2

5 months ago

1.0.1

5 months ago

1.0.4

5 months ago

1.0.3

5 months ago

1.0.0

5 months ago