api

How To Use Printavo’s API – Updating Orders

An API is a way to pull and push data into one application from another.  We built an API to allow our customers to connect 3rd party applications on the web to Printavo which helps you be even more efficient.  Beware, this article might get a bit technical for some folks.

In this example, we’ll be updating an existing order using PUT to your Printavo account.  <a href=”http://blog.teamtreehouse.com/its-time-to-httparty” target=”_blank”>Read more</a> about sending data to APIs. Note that if you add an ID to a line item or fee attribute, it will update the existing object. If there’s no ID, a new object will be created.

Here’s is an example JSON object you would PUT to our API:

{
 "key": "your_api_key",
 "id": existing_order_id,
 "sales_tax": 10.0,
 "discount": 5.0,
 "discount_as_percentage": false,
 "customer_id": 91167,
 "user_id": 25,
 "orderstatus_id": 1546,
 "production_notes": "",
 "order_nickname": "",
 "formatted_due_date": "05/01/2016",
 "formatted_customer_due_date": "05/01/2016",
 "lineitems_attributes": [{
   "id": 1270394,
   "style_description": "Gildan 2000 100% Cotton 2",
   "taxable": true,
   "style_number": "G2000",
   "color": "White",
   "size_other": null,
   "size_yxs": null,
   "size_ys": null,
   "size_ym": null,
   "size_yl": null,
   "size_yxl": null,
   "size_xs": null,
   "size_s": null,
   "size_m": null,
   "size_l": 15,
   "size_xl": null,
   "size_2xl": null,
   "size_3xl": 30,
   "size_4xl": null,
   "size_5xl": null,
   "size_6xl": null,
   "unit_cost": 9.5
 }, {
   "id": 1270395,
   "style_description": "Gildan 2000 100% Cotton",
   "taxable": true,
   "style_number": "G2000",
   "color": "Blue",
   "size_other": null,
   "size_yxs": null,
   "size_ys": null,
   "size_ym": null,
   "size_yl": null,
   "size_yxl": null,
   "size_xs": null,
   "size_s": null,
   "size_m": null,
   "size_l": 40,
   "size_xl": 15,
   "size_2xl": null,
   "size_3xl": 1,
   "size_4xl": null,
   "size_5xl": null,
   "size_6xl": null,
   "unit_cost": 7.0
 }],
 "order_fees_attributes": [{
   "id": insert_existing_id
   "amount": 15.0,
   "description": "Shipping Fee",
   "taxable": true
 }]
 }

View full documentation

How To Use Printavo’s API – Creating Orders

An API is a way to pull and push data into one application from another.  We built an API to allow our customers to connect 3rd party applications on the web to Printavo which helps you be even more efficient.  Beware, this article might get a bit technical for some folks.

In this example, we’ll be POSTing a new order to your Printavo account.  Read more about sending data to APIs.

Here’s is an example JSON object you would POST to our API:

{
 "key": "your_api_key",
 "sales_tax": 10.0,
 "discount": 5.0,
 "discount_as_percentage": false,
 "customer_id": insert_customer_id,
 "user_id": insert_user_id,
 "orderstatus_id": insert_orderstatus_id,
 "production_notes": "",
 "order_nickname": "",
 "formatted_due_date": "05/01/2016",
 "formatted_customer_due_date": "05/01/2016",
 "lineitems_attributes": [{
    "style_description": "Gildan 2000 100% Cotton",
    "taxable": true,
    "style_number": "G2000",
    "color": "White",
    "size_other": null,
    "size_yxs": null,
    "size_ys": null,
    "size_ym": null,
    "size_yl": null,
    "size_yxl": null,
    "size_xs": null,
    "size_s": null,
    "size_m": null,
    "size_l": 15,
    "size_xl": null,
    "size_2xl": null,
    "size_3xl": 30,
    "size_4xl": null,
    "size_5xl": null,
    "size_6xl": null,
    "unit_cost": 6.5
 }, {
    "style_description": "Gildan 2000 100% Cotton",
    "taxable": true,
    "style_number": "G2000",
    "color": "Blue",
    "size_other": null,
    "size_yxs": null,
    "size_ys": null,
    "size_ym": null,
    "size_yl": null,
    "size_yxl": null,
    "size_xs": null,
    "size_s": null,
    "size_m": null,
    "size_l": 40,
    "size_xl": 15,
    "size_2xl": null,
    "size_3xl": 1,
    "size_4xl": null,
    "size_5xl": null,
    "size_6xl": null,
    "unit_cost": 5.0
 }],
 "order_fees_attributes": [{
    "amount": 15.0,
    "description": "Shipping Fee",
    "taxable": true
 }]
}

View full documentation

Printavo’s Pricing Matris & API Is Here

It’s an exciting day because we just pushed live a few new updates to Printavo:

  1. You can now assign tasks to users
  2. Screen printing pricing matrix.  Under My Account > Pricing Matrix, you can edit & customize your matrix.  By default we’ve loaded Sanmar’s updated individual, dozen & case pricing.  You can import your own full catalog now here.
  3. We now are a Zapier.com partner.  To get invited to our Zapier app, click here.  Zapier is an app that lets you automate inputting and getting data from Printavo to other apps on the web.  Ex. “automatically export all customers to Mailchimp”, “add orders to my Google Calendar” and more.
  4. We have an API that you can use to build custom functionality on top of Printavo.  For the developers out there, here’s our documentation.  Your API key is in My Account.

Hopefully, everyone is having a great New Year thus far. View past Printavo updates and a product video demo.