- Print
Integration with Shippo's API
Introduction
Shippo is a multi-carrier shipping API and web-app that includes carriers like USPS, DHL, FedEx amongst many others. Customers can get shipping rates, print labels, automate international documents, track shipments, and facilitate returns.
Purpose
This integration highlights how one can leverage Tulip's HTTP connector functions to integrate with Shippo's API to automate creating shipments, getting a variety of rates from a range of carriers, choosing the best rate & finally creating & printing a shipment label along with the option to track the shipments. All of this can be done from your Tulip Application. Depending on different use cases, integration with Tulip can be leveraged to have control over one's supply-chain operation & have real-time visibility in shipping out packages.
API Doc
Pre-Requisites
Create an account on Shippo's website & generate API Tokens that would be used as Authorization headers in all the calls made to Shippo's API. Shippo lets you generate a Test & a Live Token. Test token could be leveraged to make test HTTP calls with the API & design your Tulip application, once the app is ready, tokens can be switched & the apps can be deployed in production to generate shipment labels, transactions in real-time.
Tulip Connection Details
Tulip's HTTP connector needs to be configured with the following details in order to establish a connection with Shippo.
- Running On: Cloud Connector Host
- Host : api.goshippo.com
- Port:443
- TLS:Yes
- Shippo Tokens as Authorization Header can be passed via Connector Function
Connector Function
Create Shipment
Purpose
- This connector function creates a new shipment by doing a POST call to Shippo's API with sender details, receiver details & the package details being part of the Request Body.
- On successful creation, Shippo returns a JSON object which includes the status of the shipment created along with a choice of rates from different vendors that users can leverage to move forward with & initiate a transaction. Users can select the right rate, have the rate IDs stored in Tulip variables which would be dynamically passed to create the transaction to generate the Shipment label in the corresponding connector function.
Endpoint
- HTTP POST call to the endpoint: https://api.goshippo.com:443/shipments/
Authorization Header
In-order to Authenticate with Shippo's API, Shippo's HTTP Token needs to be passed into the request header. Following is the format
Authorization : ShippoToken (
Required Input
The following are the Input parameters that are passed in the Request Body where JSON is the content type.
- Senders Name, Street, City, State, Zip Code, Country.
- Receivers Name, Street, City, State, Zip Code, Country
- Package's Dimensions - Length, Breadth, Width & Weight
Required Output Extractor
A lot of information is returned for the Shipment object created, however, the important fields to be extracted are mentioned below
- Status: Indicates if the Shipment is created successfully
- Shipment ID: Can be referenced to get the details of the Shipment created.
- Rate Options: Array of objects indicating different options of the rate provided by different vendors. Rate ID is the important key amongst others to be extracted which would be passed to create the actual transaction for this shipment.
Create Transaction
Purpose
- This connector function creates the transaction after choosing the vendor & the final rate from the different options that were returned on creating a new shipment in the previous connector function.
- A successful transaction is established by doing a POST HTTP call to Shippo's endpoint by passing the ID associated with the rate decided. On a successful call, Shippo returns a JSON object which includes the Status of the transaction, Tracking ID, Shipping Label & the tracking URL amongst other information. The Shipping label returned could directly be printed from the Tulip App itself.
Endpoint
- HTTP POST call to the endpoint: https://api.goshippo.com:443/transactions/
Authorization Header
In-order to Authenticate with Shippo's API, Shippo's HTTP Token needs to be passed into the request header. Following is the format
Authorization : ShippoToken (
Required Input
The following are the Input parameters that are passed in the Request Body where JSON is the content type.
- Rate ID: Passing the ID of the rate chosen to move forward with in order to create a successful transaction.
Required Output Extractor
A lot of information is returned for the Shipment object created, however, the important fields to be extracted are mentioned below
- Status: Indicates if the transaction is created successfully
- Transaction ID: Can be referenced to get the details of the transaction executed.
- Tracking Number: To track the shipment
- Tracking URL: The chosen vendor's tracking page URL
- Label URL: Shipping Label which could be embedded within the Tulip Application for printing