Shipping Label Generation

This API allows you to instruct Teapplix to generate a shipping label for a single order, and return to you the relevant information including links to download the label PDF.

This is a HTTP REST API, typically sent to Teapplix as a HTTP POST. Notice it uses standard Teapplix authentication mechanism where the username and password must be passed as User=xxxx and Passwd=xxxx on the query string part.

URL Address
https://www.teapplix.com/h/[your Teapplix Account Name]/ea/api.pl&User=xxxx&Passwd=xxxx

e.g., if your Teapplix Account Name is cybertest, your url will be:

https://www.teapplix.com/h/cybertest/ea/api.pl?User=me@gmail.com&Passwd=password1234

Parameters (must be POST parameters)

  • Subaction - This indicates what action to take, use "label" (without the quotes, same below)
  • provider - shipping carrier, possible values:"endicia", "stamps", "ups", "fedex", "chinapost". (DHL please use "endicia")
  • id - order id in Teapplix
  • ship_method - Shipping method, must match Teapplix internal values from the weigth_table (here is a full list of the Teapplix ship methods for US Shipping Carrier , and All Shipping Carrier )
  • ship_weight - weight, in ounces for US and grams for China
  • dayadvance - (optional), if you need to generate future date labels, 1 for 1 day later, etc.
  • length, width, depth - (optional) dimension for your package. in inches
  • shipping_profile_id - (optional) shipping profile id. By default 1 ("Master Default" profile).

Example of a "curl" call to the label generation API:

curl -k -d Subaction='label' -d provider='' -d id='' -d ship_method='' -d ship_weight='' -d dayadvance='' -d length='' -d width='' -d depth='' -d shipping_profile_id='' "https://www.teapplix.com/h/[your Teapplix Account Name]/ea/api.pl&User=xxxx&Passwd=xxxx"

Return CSV
There are 2 lines in the return CSV:
OrderId,ShipDate,ShipCarrier,ShipMethod,WeightOz,TrackingNumber,Postage,Status,URLMessage
123456,2013/09/01,USPS,FIRST/RECTPARCEL,4,9499907123456123456781,1.86,1,https://www.teapplix.com/h/teapplix/ea/api.pl?Subaction=download&b=435

The parameters are described below:

  • OrderID - Order ID in Teappix
  • ShipDate - date on the shipping label
  • ShipCarrier - name of carrier
  • ShipMethod - shipping method
  • WeightOz - weight
  • TrackingNumber - tracking number
  • Postage - postage as returned by carrier to us
  • Status - status of shipping label generation, 1 for success and 0 for failure
  • URLMessage - For success this is the URL to download the label. For failure this is the error message

Downloading PDF
Once Teapplix generates your label, you can download the PDF via API using the returned URL like:
https://www.teapplix.com/h/[your Teapplix Account Name]/ea/api.pl?User=xxxx&Passwd=yyyy

Additional parameters must be "POST":

  • Subaction=download (this indicate to download the pdf)
  • b=435  -- this provides the batch id
  • clear_batch=435 -- this is optional, it should match the number provided with b= parameter.
    If clear_batch is provided, then the corresponding batch number will no longer display on Teapplix open orders as a batch that is not printed correctly, and may need to be reprinted.

The "clear_batch" parameter is optional, normally You can of course find it in Batch History.

Example of calling order downloading API using "curl":

curl -k -L -o label.pdf "https://www.teapplix.com/h/[your Teapplix Account Name]/ea/api.pl?User=xxxx&Passwd=xxxx" -d Subaction=download -d b=435 -d clear_batch=435