# Overview

The ShipHawk API provides a simple way to integrate our shipping services into your existing systems. You can call the API from your online shopping cart, customer relationship management system, ERP, or order management system.

The API supports standalone use cases such as parcel label printing, as well as more powerful functions to enable shipping process automation from rating to delivery, and beyond. Access endpoints that enable rating, booking, dispatch, tracking, and reconciliation to automate eCommerce workflows, as well as more traditional offline sales channels.

Examples are shown on the right side of the page. We show examples using cURL, a universal tool for getting and sending data using the URL syntax. We also show examples in Ruby, Python, and Java.

## API Principles

Our API design incorporates REST principles. Each endpoint corresponds to a resource.

The standard HTTP verbs GET, POST, and DELETE are used to retrieve, create, update, and delete these resources. We forgo the use of the HTTP PUT and PATCH verbs and use POST for both creating and updating resources. If you POST to the endpoint for a specific resource (rather than the collection), the existing resource will be updated with any attributes sent in the request. Attributes not specified in the request will retain their existing values.

All API endpoints send and receive JSON data. The API documentation lists the JSON data type for each attribute (number, string, boolean, array, object, or null).

Make sure to set your Content-Type header to 'application/json' when sending in POST requests with JSON data. The API will also accept 'application/x-www-form-urlencoded' data with no content header by default.

## HTTPS

## Authentication

ShipHawk uses key-based authentication. Pass your API Key in the X-Api-Key Header or as a param in an HTTP request.

```
curl --request GET 'https://shiphawk.com/api/v4/user' \
            --header 'Content-Type: application/json' \
            --header 'x-api-key: YOUR_API_KEY'
```

`Examples: GET /api/v4/users?api_key={YOUR_API_KEY}`

## API Hosts Block

Production: https://shiphawk.com

Sandbox: https://sandbox.shiphawk.com

# API Integration

The following is intended to provide an example of an end-to-end implementation of the ShipHawk API
along with some helpful considerations to guide your ultimate implementation.

## Integration Example

We'll see how various ShipHawk API endpoints are used together to provide a complete solution
for common use cases.

Aviato is a fast-growing, nimble E-commerce company. Aviato sells products ranging from small shims to large widgets.
Some of Aviato's products are prepackaged and only require shipping documentation; others are loose and need packing
or palleting before shipping.

Aviato wants to achieve the following business objectives with ShipHawk:

- Accurate shipping costs on demand, even if products are not packed
- Order fulfillment optimization: choosing the right carrier and service, always
- Visibility for customers and Aviato staff, with real-time tracking

Aviato will use the ShipHawk API to accomplish these objectives.

### 1\. Synchronize Product Data For Shipping

First, Aviato will load its products into the ShipHawk PMS (Product Management System). You can store product data in
the ShipHawk PMS for customer-facing rates, to use as line items or SKUs in orders, or in packages when making shipments.

Each product is associated with an item type, indicating how ShipHawk needs to treat them when rating or shipping. Items
that must ship with a parcel carrier (FedEx, UPS, etc.) are `parcels`. Items that must ship with a freight carrier are `handling units`.
And, when you don't know how a product should ship, they are `unpacked` items.

Aviato will need to provide as much information as possible for each product to streamline their shipping process.
This includes length, width, height, weight, freight class, and harmonization codes (HS codes).

_Note: For International shipments, Country of Origin is also required._

Additionally, Aviato needs to keep their product catalog up to date. As changes occur, Aviato will need to update their
product catalog in the ShipHawk PMS to ensure ShipHawk has accurate data.

### 2\. Configure Policies

Now that products are synchronized, Aviato is ready to set up their business automation rules. ShipHawk's business automation
rules are Rating Rules and Shipping Policies.

Scenario: Aviato makes good margins on their products and are able to subsidize shipping for any order over $100.00. They want their
customers to receive free shipping when cart values are over $100.00. They also want to show transparent pricing when orders are
less than $100.00.

Aviato creates a Rating Rule that uses an 'Order Criteria' of 'Order Value' and an 'Action' of 'Create Table Rate' to create a flat
rate of $0.00. This will present itself as 'Free Shipping' to the end user.

Regardless of what the customer pays, Aviato always wants to use the cheapest service available to fulfill orders. This is
the default behavior for ShipHawk. At order creation, ShipHawk will always attempt to use the cheapest available carrier
and service.

If Aviato wants to change this scenario, they can add another Rating Rule. For example, they might give customers the
option to select one of two flat rates: 'Standard Shipping' or 'White Glove'. They would then create a new Shipping
Policy that would use the selected option to decide which carrier and service level should be used to fulfill this order.

### 3\. Display Rates To End Users

Aviato is building an improved eCommerce workflow. The most common implementation gives them the ability to access and display rates
from ShipHawk on their product details page, shopping cart, and at checkout. To do this, Aviato need to decide how and where they
capture their customer’s shipping destination zip code. It's important to think of a non-intrusive way of capturing this information.

After determining the appropriate user experience, Aviato will use their product SKU along with their customer's destination zip
to access rates in real time from ShipHawk. Aviato will set the `apply_rules` API parameter in their rate request to `true` so that
all of their Rules apply to every rating request. This allows them to change Rules on demand to improve the user experience or
test new shipping options.

### 4\. Synchronize Order Data

Rates are fantastic. But in the end commerce is about shipping Orders. Once live on ShipHawk, Aviato will book all Orders allowing
their warehouse or fulfillment team to process Orders from the ShipHawk web portal. Once processed, ShipHawk begins post-order
optimization and queues Shipments for fulfillment.

### 5\. Create Shipments For Orders (Fulfillment)

Once Aviato has their orders successfully added to ShipHawk, the next step is to create a Shipment from those Orders. With ShipHawk
it's incredibly easy. Aviato has the choice of using ShipHawk's API endpoints or using the ShipHawk web portal. Via the web portal,
they'd confirm that product dimensions and other information is correct. Then, they'd select carrier and service level. Then, they'd
select the green "SHIP" button in the upper right corner of the screen.

If Aviato is using ShipHawk's API, they would use the [Create Shipment](https://docs.shiphawk.com/#create-a-new-shipment) endpoint to create their shipments.
All processes can be automated using our simple REST-style APIs.

Once booked, Aviato can navigate to the shipment details page and confirm the details of their successfully booked shipment.

Next, Aviato will want to track the status and progress of their shipments.

### 6\. Track And Trace Shipments

Once a shipment is booked and ready for pickup, customers will want to know where their order is: Has it shipped, is it in transit, etc.
ShipHawk has multiple options for accessing tracking information. First, use of our Track Shipment API endpoint and webhooks allow for
complete automation to send tracking updates to your customers as they take place.

ShipHawk also provides a branded tracking page, allowing customers to keep their buyers completely up to date. If desired, we automatically
send custom, branded tracking emails that include a link to our tracking page.

Every customer is different. And while not everyone is like Aviato, ShipHawk has a solution for you. If you have a unique use case, custom ERP,
or home built shopping cart solution, ShipHawk can make your shipping channel run smoothly.

# Common Rating Use Cases

The following describes some common use cases for shipping rates and some helpful
considerations for your API implementation.

Multi-carrier rating lets you find the right carrier and service level, whether you
need to optimize for cost, time, service level, carrier type, or even limit rates to
a specific carrier. ShipHawk lets you make these decisions in real-time.

It starts with the right information. Rates are most accurate when complete product
details are provided. Whether your products can be shipped parcel or freight, domestic or
international, you'll want to make sure that you have the right information available to
rate (and ultimately book) your shipments.

While you can often access rates from carriers with weight or dimensions, we highly recommend
that you store as much information as possible with your products, including: length, width, height,
weight, freight class and harmonization codes (HTC) and country of origin (manufacture) for
international shipments.

Before making rate requests, you will want to address the following:

- Ensure that [Your Account](https://docs.shiphawk.com/#your-account) is configured appropriately
- [Synchronize your product SKUs](https://docs.shiphawk.com/#1-synchronize-product-data-for-shipping) to simplify your rate requests
- Decide whether you need Rating Rules to mark up, subsidize or simplify the rates you choose to show your customers
- Determine whether you have any special Shipping Policies that you need to consider

When implementing rating, make sure to consider the following:

- Are my SKUs already [populated](https://docs.shiphawk.com/#1-synchronize-product-data-for-shipping) in ShipHawk?
- Do I have a UI or mechanism to capture the customer's destination zip or postal code, or country?
- Do I need to apply Rating Rules to these requests (`"apply_rules": true`)?
- Do I need to store the rate response ID so that I can later book the shipment using this rate?

## Case 1. Rating For eCommerce: PDP, Cart, Checkout

Every business has a different approach to presenting shipping rates to customers. Some show costs transparently;
some subsidize shipping through margin; and some use shipping as a way to increase revenue.

ShipHawk helps businesses present rates to their customers however desired:

- Transparent, Flat, Free, Subsidized or Marked Up
- Rule-based changes to rates
- Masked carrier/service names to simplify customer experience
- Show aggregated rates
- Show line-item rates that might include shipping, packing, pickup, carrier or 3rd party insurance
- Create and use backup rates, to ensure rates are always displayed, even when real-time rates are not available

## Case 2. Rating For Sales Teams: Rates For POs

Whether B2C or B2B, providing your customers shipping rates for offline orders (telephone, mail order, manual,
chat, etc.) is always necessary. ShipHawk allows your team to leverage the Web Portal to shop rates manually.
The ShipHawk API can be used to streamline this process with your internal business systems - ERP, CRM, etc.

Customers expect information quickly; ShipHawk provides you information rapidly so you can:

- Provide customers accurate rates on demand
- Create price consistency between your online and offline experiences
- Make your sales team more efficient
- Reduce friction in the offline purchasing process

## Case 3. Rating For The Back Office: Order Processing

ShipHawk uses the [Proposed Shipment](https://docs.shiphawk.com/#proposed-shipment-resources) to rate orders as they are processed.
While [Rating Rules](https://docs.shiphawk.com/#rating-rule-resources) are only applicable for the
[Rate Request](https://docs.shiphawk.com/#rate-request-object) object, [Shipping Policies](https://docs.shiphawk.com/#shipping-policy-resources) are used to
rate orders as they flow in from your customers. Shipping Policies allow you to configure business logic around
order processing so that you can restrict carriers, carrier types, or service levels used for processing specific
orders or products; or, you can let ShipHawk figure it out for you.

# Your Account

This guide is designed to help provide a basic overview of your ShipHawk account, the use of
the ShipHawk Sandbox testing environment, your API keys, and security.

## Sandbox And Production Environments

In addition to the Production ShipHawk environment, customers can use our shared Sandbox environment.
These two environments are in many cases identical; however, the Sandbox environment might have newer,
less thoroughly tested functionality installed. The ShipHawk Sandbox environment is shared
by multiple ShipHawk customers.

The Sandbox and Production environments can be accessed by means of API endpoints, as well as by means of the
ShipHawk Web Portal, so that you can test and validate from all user perspectives.

To access the Sandbox web portal, go to: [https://sandbox.shiphawk.com/login](https://sandbox.shiphawk.com/login)

To access the Production web portal, go to: [https://shiphawk.com/login](/content/login/index.html)

## API Keys

Your ShipHawk account has two unique API Keys: one for the ShipHawk Sandbox environment, and one
for the ShipHawk Production environment. These keys are unique to their environments, and will result
in authentication failures (403 Forbidden) if used in the incorrect environment.

Sandbox uses the Sandbox subdomain for its API calls: https://sandbox.shiphawk.com/api

Production uses the primary ShipHawk domain for its API calls: https://shiphawk.com/api

## Account Security

- Keep private information secure
- Do not reuse passwords with ShipHawk and other applications or services
- Keep your computer and browser up to date
- Beware of scams and phishing

## Questions

If you have any questions, please contact your account manager, send us an email (support@shiphawk.com), or contact our sales team.

# Going Live Checklist

We want everyone using using ShipHawk to be successful. That's why we've put together this
high level checklist to ensure that you get off to a great start. Use the following information
to properly set up your account, validate your implementation, and prepare your operation for a
successful launch.

## Account Checklist

The following section provides a general overview for setting up your ShipHawk account.
The steps are the same whether you are using ShipHawk via our API, Web Portal or a platform extension:

- Configure production carrier settings (parcel and freight)
- Set default insurance settings
- Create any predefined packages or material that your warehouse team might need for shipment processing
- Create and enable Rating Rules based on business needs for in-cart rating
- Create and enable Shipping Policies for post-order processing automation
- Confirm all necessary users are added with appropriate permission levels
- Confirm label printers and dimensioners are configured properly

## Integration Checklist

The following section provides a general overview for making sure that your ShipHawk
integration is complete and functioning properly:

- Confirm proper authentication with ShipHawk's Production environment
- Grant Web Portal access to your team
- Ensure your relevant use cases are met
- Handle edge cases
- Review API error handling
- Review logging
- Ensure you're not relying on the ShipHawk Sandbox environment
- Specify production Webhook and callback URLs
- Change and secure API keys (Production and Sandbox)

## Launch Checklist

The following section gives a general overview for getting your team ready to launch with the ShipHawk system:

- Prepare to educate your customer service and shipping teams
- Prepare to educate your customers, buyers, sellers, and vendors
- With freight shipping, be prepared for missed pickups when not using guaranteed services
- Be prepared to prevent and manage fraudulent damage or missing item shipment claims
- Subscribe to the [ShipHawk status page](http://status.shiphawk.com/)

# Addresses

## Address Resources

### Address Object

Address objects represent an origin or destination of a shipment and are required in order to get rates and book shipments. They can also be saved to the address book so that frequently used addresses can be stored for search or retrieval at a later time.

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | String |  |
| `code` | String | A unique reference for this address. This field is indexed so that you can search for addresses by this code using the List all Addresses endpoint. The code may have numbers, letters, underscores, and dashes. |
| `name` | String | `Usually Required` Not required when `company` is present or when rating. The name of the contact person at this address. |
| `company` | String | `Usually Required` Not required when `name` is present or when rating. |
| `street1` | String | `Usually Required` Not required when rating. |
| `street2` | String | Apt or suite #, mailstop, etc |
| `city` | String | `Usually Required` Not required when rating. City or town. |
| `state` | String | `Usually Required` Not required when rating. 2-digit state or province required for US and Canadian addresses. |
| `zip` | String | `required` Zip or postal code. |
| `country` | String | A 2-digit ISO country code. Default: `US` |
| `phone_number` | String | `Usually Required` Not required when rating. |
| `email` | String |  |
| `is_residential` | Boolean | Default: `false` |
| `is_warehouse` | Boolean |  |
| `address_type` | Enum | Options:<br>- billing<br>- mailing<br>- physical<br>- origin<br>- destination<br>- catalog\_sale<br>- bol |
| `validated` | Boolean |  |

### Booking Address Object

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | String |  |
| `name` | String |  |
| `company` | String |  |
| `street1` | String |  |
| `street2` | String |  |
| `city` | String |  |
| `state` | String |  |
| `zip` | String |  |
| `country` | String |  |
| `phone_number` | String |  |
| `email` | String |  |
| `is_residential` | Boolean |  |
| `is_warehouse` | Boolean |  |
| `address_type` | String |  |
| `code` | String |  |

### Check Address Response

Objects represent the extended structure of address to validate initial input params

| Attribute | Type | Description |
| --- | --- | --- |
| `corrected` | Boolean | Indicates if address was changed (should be true even if the only change was that system added a default location type) |
| `deliverable` | Boolean | Indicates if the address can be used for delivery |
| `address` | [SuggestedAddress](https://docs.shiphawk.com/#suggested-address-response) | Suggested Address Response object |

### Suggested Address Response

Suggested Address Response object, including country/location type/etc fields added by the system from defaults...

| Attribute | Type | Description |
| --- | --- | --- |
| `country` | String |  |
| `state` | String |  |
| `city` | String |  |
| `zipcode` | String |  |
| `street1` | String |  |
| `street2` | String |  |
| `location_type` | String |  |

## Address API Endpoints

### Create an Address

```
curl -H "Content-Type: application/json" -X POST -d '
{
  "name": "Shiphawk",
  "street1": "925 De La Vina St #300",
  "city": "SANTA BARBARA",
  "state": "CA",
  "zip": "93101"
}' 'https://sandbox.shiphawk.com/api/v4/addresses?api_key=YOUR_API_KEY'

# Example Response
{
    "id": "adr_ddstab0m",
    "name": "Shiphawk",
    "company": null,
    "street1": "925 De La Vina St #300",
    "street2": null,
    "city": "SANTA BARBARA",
    "state": "CA",
    "zip": "93101",
    "country": "US",
    "phone_number": null,
    "email": null,
    "is_residential": false,
    "is_warehouse": false,
    "address_type": null,
    "validated": false,
    "code": null
}
```

```
require 'net/http'
require 'uri'
require 'json'

uri = URI.parse('https://sandbox.shiphawk.com/api/v4/addresses?api_key=YOUR_API_KEY')

address =
'{
  "name": "Shiphawk",
  "street1": "925 De La Vina St #300",
  "city": "SANTA BARBARA",
  "state": "CA",
  "zip": "93101"
}'

# Create the HTTP objects
request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
request.body = address

# Send the request
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
  http.request(request)
end

puts response.body
```

```
import requests
import json

url = 'https://sandbox.shiphawk.com/api/v4/addresses'
headers = {'X-Api-Key': 'YOUR_API_KEY'}
payload = {
  "name": "Shiphawk",
  "street1": "925 De La Vina St #300",
  "city": "SANTA BARBARA",
  "state": "CA",
  "zip": "93101"
}

r = requests.post(url, headers=headers, json=payload)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;
import javax.json.*;
import javax.script.*;

public class PostRequests {
    public static void main(String [] args)
    {
        try{
            sendPost();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendPost() throws IOException {
        JsonObject personObject = Json.createObjectBuilder()
                .add("name", "Shiphawk")
                .add("street1", "925 De La Vina St #300")
                .add("city", "SANTA BARBARA")
                .add("state", "CA")
                .add("zip", "93101")
                .build();
        try{
            // For formatting json object to be readable
            ScriptEngineManager manager = new ScriptEngineManager();
            ScriptEngine scriptEngine = manager.getEngineByName("JavaScript");
            scriptEngine.put("jsonString", personObject.toString());
            scriptEngine.eval("result = JSON.stringify(JSON.parse(jsonString), null, 2)");
            String prettyPrintedJson = (String) scriptEngine.get("result");

//'adr_KHsx29g8' is an example address id.
            URL url = new URL("https://sandbox.shiphawk.com/api/v4/addresses?api_key=YOUR_API_KEY");
            HttpURLConnection con = (HttpURLConnection) url.openConnection();
            con.setRequestMethod("POST");
            con.setRequestProperty("Content-Type", "application/json");
            con.setDoOutput(true);
            OutputStream os = con.getOutputStream();
            os.write(personObject.toString().getBytes());
            os.flush();
            os.close();

int responseCode = con.getResponseCode();

if(responseCode == HttpURLConnection.HTTP_CREATED || responseCode == HttpURLConnection.HTTP_OK){
                BufferedReader in = new BufferedReader(
                  new InputStreamReader(con.getInputStream()));
                String inputLine;
                StringBuffer content = new StringBuffer();
                while ((inputLine = in.readLine()) != null) {
                    content.append(inputLine);
                }
                in.close();
                System.out.println(content.toString());
            }
            else{
                System.out.println("POST request failed. Code was " + responseCode);
                System.out.println("Body form:\n" +  prettyPrintedJson);
            }
        } catch(NullPointerException ex){
            ex.printStackTrace(System.out);
        } catch(ScriptException ex){
            ex.printStackTrace(System.out);
        }
    }
}
```

> Request: POST /api/v4/addresses

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| name | String |  |
| street1 | String |  |
| city | String |  |
| state | String |  |
| zip | String |  |

> Response [address-object](https://docs.shiphawk.com/#address-object)

### Retrieve an Address

```
# 'adr_ddstab0m' is an example address id.
curl -H "Content-Type: application/json" -X GET
'https://sandbox.shiphawk.com/api/v4/addresses/adr_ddstab0m?api_key=YOUR_API_KEY'

```
require 'net/http'

#'adr_1pEZY2F9' is an example address id.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/addresses/adr_1pEZY2F9?api_key=YOUR_API_KEY')
response = Net::HTTP.get(uri)

puts response
```

```
import requests

#'adr_1pEZY2F9' is an example address id.
url = 'https://sandbox.shiphawk.com/api/v4/addresses/adr_1pEZY2F9'
headers = {'X-Api-Key': 'YOUR_API_KEY'}

r = requests.get(url, headers=headers)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;

public class GetRequests {
  public static void main(String [] args)
  {
    try{
      sendGet();
    }
    catch(IOException ex){
      ex.printStackTrace(System.out);
    }
  }
  private static void sendGet() throws IOException {
    // 'adr_W7NQxx48' is an example address id.
    URL url = new URL("https://sandbox.shiphawk.com/api/v4/addresses/adr_W7NQxx48?api_key=YOUR_API_KEY");
    HttpURLConnection con = (HttpURLConnection) url.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();

if(responseCode == HttpURLConnection.HTTP_OK){
      BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
      String inputLine;
      StringBuffer content = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
          content.append(inputLine);
      }
      in.close();
      System.out.println(content.toString());
    }
    else{
      System.out.println("GET request failed. Code was " + responseCode);
    }
  }
}
```

> Request: GET /api/v4/addresses/:id

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String | address id |

> Response: [address-object](https://docs.shiphawk.com/#address-object)

### Retrieve an Address by code

```
curl -H "Content-Type: application/json" -X POST 'https://sandbox.shiphawk.com/api/v4/addresses/codes?api_key=YOUR_API_KEY&codes=12345'

# Example Response
[\
    {\
        "id": "adr_eMktm1xl",\
        "name": "Kiara Montross",\
        "company": null,\
        "street1": "316 nw 57th street",\
        "street2": null,\
        "city": "Newport",\
        "state": "OR",\
        "zip": "97365",\
        "country": "US",\
        "phone_number": "8776358125",\
        "email": "moab31@yahoo.com",\
        "is_residential": true,\
        "is_warehouse": false,\
        "address_type": "destination",\
        "validated": false,\
        "code": "12345"\
    },\
    ...\
]
```

```
require 'net/http'

uri = URI.parse('https://sandbox.shiphawk.com/api/v4/addresses/codes?api_key=YOUR_API_KEY&codes=12345')

# Create the HTTP objects
request = Net::HTTP::Post.new(uri.request_uri)

# Send the request
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
  http.request(request)
end

puts response.body
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;

public class PostRequestsSimple {
  public static void main(String [] args)
  {
    try{
      sendPost();
    }
    catch(IOException ex){
      ex.printStackTrace(System.out);
    }
  }
  private static void sendPost() throws IOException {
    URL url = new URL("https://sandbox.shiphawk.com/api/v4/addresses/codes?api_key=YOUR_API_KEY&codes=12345");
    HttpURLConnection con = (HttpURLConnection) url.openConnection();
    con.setRequestMethod("POST");
    con.setRequestProperty("Content-Type", "application/json");

int responseCode = con.getResponseCode();

if(responseCode == HttpURLConnection.HTTP_CREATED){
      BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
      String inputLine;
      StringBuffer content = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
          content.append(inputLine);
      }
      in.close();
      System.out.println(content.toString());
    }
    else{
      System.out.println("POST request failed. Code was " + responseCode);
    }
  }
}
```

```
import requests

url = 'https://sandbox.shiphawk.com/api/v4/addresses/codes?codes=12345'
headers = {'X-Api-Key': 'YOUR_API_KEY'}

r = requests.post(url, headers=headers)
```

> Request: POST /api/v4/addresses/codes?codes=12345

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| code | Integer | Address code |

> Response: [address-object](https://docs.shiphawk.com/#address-object)

### Update an Address

```
# 'adr_ddstab0m' is an example address id.
curl -H "Content-Type: application/json" -X POST -d '
{
  "name": "ShiphawkV2"
}' 'https://sandbox.shiphawk.com/api/v4/addresses/adr_ddstab0m?api_key=YOUR_API_KEY'

# Example Response
{
    "id": "adr_ddstab0m",
    "name": "ShiphawkV2",
    "company": null,
    "street1": "316 nw 57th street",
    "street2": null,
    "city": "Newport",
    "state": "OR",
    "zip": "97365",
    "country": "US",
    "phone_number": "8776358125",
    "email": "moab31@yahoo.com",
    "is_residential": false,
    "is_warehouse": false,
    "address_type": "destination",
    "validated": false,
    "code": "12345"
}
```

```
require 'net/http'
require 'uri'
require 'json'

#'adr_1pEZY2F9' is an example address id.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/addresses/adr_1pEZY2F9?api_key=YOUR_API_KEY')

address =
'{
  "name": "ShiphawkV2"
}'

# Create the HTTP objects
request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
request.body = address

# Send the request
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
  http.request(request)
end

puts response.body
```

```
import requests
import json

#'adr_1pEZY2F9' is an example address id.
url = 'https://sandbox.shiphawk.com/api/v4/addresses/adr_1pEZY2F9'
headers = {'X-Api-Key': 'YOUR_API_KEY'}
payload = {
  "name": "ShiphawkV2"
}

r = requests.post(url, headers=headers, json=payload)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;
import javax.json.*;
import javax.script.*;

public class PostRequests {
    public static void main(String [] args)
    {
        try{
            sendPost();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendPost() throws IOException {
        JsonObject personObject = Json.createObjectBuilder()
                .add("name", "ShiphawkV2")
                .build();
        try{
            // For formatting json object to be readable
            ScriptEngineManager manager = new ScriptEngineManager();
            ScriptEngine scriptEngine = manager.getEngineByName("JavaScript");
            scriptEngine.put("jsonString", personObject.toString());
            scriptEngine.eval("result = JSON.stringify(JSON.parse(jsonString), null, 2)");
            String prettyPrintedJson = (String) scriptEngine.get("result");

//'adr_RRYrcqPa' is an example address id.
            URL url = new URL("https://sandbox.shiphawk.com/api/v4/addresses/adr_RRYrcqPa?api_key=YOUR_API_KEY");
            HttpURLConnection con = (HttpURLConnection) url.openConnection();
            con.setRequestMethod("POST");
            con.setRequestProperty("Content-Type", "application/json");
            con.setDoOutput(true);
            OutputStream os = con.getOutputStream();
            os.write(personObject.toString().getBytes());
            os.flush();
            os.close();

int responseCode = con.getResponseCode();

> Request: POST /api/v4/addresses/:id

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String | address id |
| name | String | address name |

> Response: [address-object](https://docs.shiphawk.com/#address-object)

### Delete an Address

```
# 'adr_ddstab0m' is an example address id.
curl --request DELETE \
  --url https://sandbox.shiphawk.com/api/v4/addresses/adr_ddstab0m?api_key=YOUR_API_KEY
```

```
require 'net/http'

#'adr_1pEZY2F9' is an example address id.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/addresses/adr_1pEZY2F9?api_key=YOUR_API_KEY')

# Create the HTTP objects
request = Net::HTTP::Delete.new(uri.request_uri)

# Send the request
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
  http.request(request)
end

puts response.body
```

```
import requests

#'adr_1pEZY2F9' is an example address id.
url = 'https://sandbox.shiphawk.com/api/v4/addresses/adr_1pEZY2F9'
headers = {'X-Api-Key': 'YOUR_API_KEY'}

r = requests.delete(url, headers=headers)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;

public class DeleteRequests {
  public static void main(String [] args)
  {
    try{
      sendDelete();
    }
    catch(IOException ex){
      ex.printStackTrace(System.out);
    }
  }
  private static void sendDelete() throws IOException {
    // 'adr_KHsx29g8' is an example address id.
    URL url = new URL("https://sandbox.shiphawk.com/api/v4/addresses/adr_KHsx29g8?api_key=YOUR_API_KEY");
    HttpURLConnection con = (HttpURLConnection) url.openConnection();
    con.setRequestMethod("DELETE");
    int responseCode = con.getResponseCode();

if(responseCode == HttpURLConnection.HTTP_NO_CONTENT || responseCode == HttpURLConnection.HTTP_OK){
      BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
      String inputLine;
      StringBuffer content = new StringBuffer();
      while ((inputLine = in.readLine()) != null) {
          content.append(inputLine);
      }
      in.close();
      System.out.println(content.toString());
    }
    else{
      System.out.println("DELETE request failed. Code was " + responseCode);
    }
  }
}
```

> Request: DELETE /api/v4/addresses/:id

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String | Address id |

> Response: no content

### Validate an Address

```
curl -H "Content-Type: application/json" -X POST -d '
{
"addresses":
 [\
   {\
     "street1": "1420 GARDINER LN",\
     "city": "Louisville",\
     "state": "KY",\
     "zip": "40231"\
   },\
   {\
     "street1": "26 Castilian Dr",\
     "city": "Goleta",\
     "state": "CA",\
     "zip": "93117"\
    }\
  ]
}' 'https://sandbox.shiphawk.com/api/v4/addresses/validate?api_key=YOUR_API_KEY'

# Example Response
{
"valid": false,
"non_deliverable_addresses": [\
 {\
   "street1": "1 Infinite",\
   "city": "Cupertins",\
   "state": "WA",\
   "zipcode": "95014",\
   "suggestions": [\
     {\
       "street1": "1 Infinite Loop",\
       "city": "Cupertino",\
       "state": "CA",\
       "zipcode": "95014"\
     }\
   ]\
 }\
]
}
```

```
require 'net/http'
require 'uri'
require 'json'

uri = URI.parse('https://sandbox.shiphawk.com/api/v4/addresses/validate?api_key=YOUR_API_KEY')

address =
'{
"addresses":
 [\
   {\
     "street1": "1420 GARDINER LN",\
     "city": "Louisville",\
     "state": "KY",\
     "zip": "40231"\
   },\
   {\
     "street1": "26 Castilian Dr",\
     "city": "Goleta",\
     "state": "CA",\
     "zip": "93117"\
    }\
  ]
}'

# Create the HTTP objects
request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
request.body = address

# Send the request
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
  http.request(request)
end

puts response.body
```

```
import requests
import json

url = 'https://sandbox.shiphawk.com/api/v4/addresses/validate'
headers = {'X-Api-Key': 'YOUR_API_KEY'}
payload = {
"addresses":
 [\
   {\
     "street1": "1420 GARDINER LN",\
     "city": "Louisville",\
     "state": "KY",\
     "zip": "40231"\
   },\
   {\
     "street1": "26 Castilian Dr",\
     "city": "Goleta",\
     "state": "CA",\
     "zip": "93117"\
    }\
  ]
}

r = requests.post(url, headers=headers, json=payload)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;
import javax.json.*;
import javax.script.*;

public class PostRequests {
    public static void main(String [] args)
    {
        try{
            sendPost();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendPost() throws IOException {
        JsonObject personObject = Json.createObjectBuilder()
                .add("addresses", Json.createArrayBuilder()
                    .add(Json.createObjectBuilder()
                        .add("street1", "1420 GARDINER LN")
                        .add("city", "Lousville")
                        .add("state", "KY")
                        .add("zip", "40231")
                        )
                    .add(Json.createObjectBuilder()
                        .add("street1", "26 Castilian Dr")
                        .add("city", "Goleta")
                        .add("state", "CA")
                        .add("zip", "93117")
                        )
                    )
                .build();
        try{
            // For formatting json object to be readable
            ScriptEngineManager manager = new ScriptEngineManager();
            ScriptEngine scriptEngine = manager.getEngineByName("JavaScript");
            scriptEngine.put("jsonString", personObject.toString());
            scriptEngine.eval("result = JSON.stringify(JSON.parse(jsonString), null, 2)");
            String prettyPrintedJson = (String) scriptEngine.get("result");

URL url = new URL("https://sandbox.shiphawk.com/api/v4/addresses/validate?api_key=YOUR_API_KEY");
            HttpURLConnection con = (HttpURLConnection) url.openConnection();
            con.setRequestMethod("POST");
            con.setRequestProperty("Content-Type", "application/json");
            con.setDoOutput(true);
            OutputStream os = con.getOutputStream();
            os.write(personObject.toString().getBytes());
            os.flush();
            os.close();

int responseCode = con.getResponseCode();

> Request: POST /api/v4/addresses/validate

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| addresses | Array [\[address-object\]](https://docs.shiphawk.com/#address-object) |  |

> Response: Array [\[address-object\]](https://docs.shiphawk.com/#address-object)

### List all Addresses

```
curl -H "Content-Type: application/json" -X GET 'https://sandbox.shiphawk.com/api/v4/addresses/search?api_key=YOUR_API_KEY&q='

# Example Response
[\
    {\
        "id": "adr_eMktm1xe",\
        "name": "Kiara Montross",\
        "company": null,\
        "street1": "316 nw 57th street",\
        "street2": null,\
        "city": "Newport",\
        "state": "OR",\
        "zip": "97365",\
        "country": "US",\
        "phone_number": "8776358125",\
        "email": "moab31@yahoo.com",\
        "is_residential": true,\
        "is_warehouse": false,\
        "address_type": "destination",\
        "validated": false,\
        "code": null\
    },\
    ...\
]
```

```
require 'net/http'

uri = URI.parse('https://sandbox.shiphawk.com/api/v4/addresses/search?api_key=YOUR_API_KEY&q=')
response = Net::HTTP.get(uri)

puts response
```

```
import requests

url = 'https://sandbox.shiphawk.com/api/v4/addresses/search'
headers = {'X-Api-Key': 'YOUR_API_KEY'}

r = requests.get(url, headers=headers)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;

public class GetRequests {
  public static void main(String [] args)
  {
    try{
      sendGet();
    }
    catch(IOException ex){
      ex.printStackTrace(System.out);
    }
  }
  private static void sendGet() throws IOException {
    // 'adr_W7NQxx48' is an example address id.
    URL url = new URL("https://sandbox.shiphawk.com/api/v4/addresses?api_key=YOUR_API_KEY&q=");
    HttpURLConnection con = (HttpURLConnection) url.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();

> Request: GET /api/v4/addresses/search
>
> Response: Array [\[address-object\]](https://docs.shiphawk.com/#address-object)

### Retrieve Address Count

```
curl -H "Content-Type: application/json" -X GET 'https://sandbox.shiphawk.com/api/v4/addresses/counts?api_key=YOUR_API_KEY&q='

# Example Response
{
    "is_warehouse": 5,
    "is_not_warehouse": 1443405
}
```

```
require 'net/http'

uri = URI.parse('https://sandbox.shiphawk.com/api/v4/addresses/counts?api_key=YOUR_API_KEY&q=')
response = Net::HTTP.get(uri)

puts response
```

```
import requests

url = 'https://sandbox.shiphawk.com/api/v4/addresses/counts'
headers = {'X-Api-Key': 'YOUR_API_KEY'}

r = requests.get(url, headers=headers)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;

public class GetRequests {
  public static void main(String [] args)
  {
    try{
      sendGet();
    }
    catch(IOException ex){
      ex.printStackTrace(System.out);
    }
  }
  private static void sendGet() throws IOException {
    // 'adr_W7NQxx48' is an example address id.
    URL url = new URL("https://sandbox.shiphawk.com/api/v4/addresses/counts?api_key=YOUR_API_KEY&q=");
    HttpURLConnection con = (HttpURLConnection) url.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();

> Request: GET /api/v4/addresses/counts

### Address Validate

> Request: POST /api/v4/addresses/validate

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| addresses | Array\[ [AddressForValidation](https://docs.shiphawk.com/#addressforvalidation-object)\] | List of addresses to validate |

#### AddressForValidation Object

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| street1 | String |  |
| street2 | String |  |
| city | String |  |
| state | String |  |
| zip | String |  |
| is\_po\_box | Boolean |  |
| is\_residential | Boolean |  |
| country | String |  |

### Address Check

> Request: POST /api/v4/addresses/check

Address to check

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| country | String |  |
| city | String |  |
| state | String |  |
| zip | String |  |
| street1 | String |  |
| street2 | String |  |
| is\_po\_box | Boolean |  |
| is\_residential | Boolean |  |

> Response [check-address-response](https://docs.shiphawk.com/#check-address-response)

# Batches

Small unpacked items must be packed prior to shipping. ShipHawk estimates the packing materials required and provides rates based on the estimated weight and dimensions of the resulting packages.

For larger items (such as furniture or lab equipment), ShipHawk provide rates for Blanket Wrap carriers and compares those rates against the cost to pack and ship with a traditional LTL or Home Delivery carrier.

## Batch Resources

### Batch Object

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | string | `required` |
| `name` | string | `required` |
| `items_count` | integer | Number of orders in this batch |
| `created_at` | date |  |
| `created_by` | string |  |

## Batch API Endpoints

### Retrieve Batches List

```
curl -H "Content-Type: application/json" -X GET
'https://sandbox.shiphawk.com/api/v4/batches?api_key=YOUR_API_KEY'

# Example Response
[\
    {\
        "id": "bat_23zjfqaB",\
        "name": "Batch #1",\
        "items_count": 0,\
        "created_at": "2018-12-04T21:26:18+00:00",\
        "created_by": "NVShipper38 NVShipper38"\
    },\
    {\
        "id": "bat_gdgWDBSZ",\
        "name": "Batch #1",\
        "items_count": 0,\
        "created_at": "2018-12-15T14:48:23+00:00",\
        "created_by": "Keith Wilson"\
    },\
    {\
        "id": "bat_htJXZ6zw",\
        "name": "Batch #1",\
        "items_count": 0,\
        "created_at": "2018-12-17T17:12:03+00:00",\
        "created_by": "NVshipper2  NVshipper2"\
    }\
]
```

```
require 'net/http'

uri = URI.parse('https://sandbox.shiphawk.com/api/v4/batches?api_key=YOUR_API_KEY')
response = Net::HTTP.get(uri)
puts response
```

```
import requests

url = 'https://sandbox.shiphawk.com/api/v4/batches'
headers = {'X-Api-Key': 'YOUR_API_KEY'}

r = requests.get(url, headers=headers)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;

public class GetRequests {
    public static void main(String [] args)
    {
        try{
            sendGet();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendGet() throws IOException {
        URL url = new URL("https://sandbox.shiphawk.com/api/v4/batches?api_key=YOUR_API_KEY");
        HttpURLConnection con = (HttpURLConnection) url.openConnection();
        con.setRequestMethod("GET");
        int responseCode = con.getResponseCode();

> Request: GET /api/v4/batches
>
> Response: Array [\[batch-object\]](https://docs.shiphawk.com/#batch-object)

### Create a Batch

```
curl -H "Content-Type: application/json" -X POST
'https://sandbox.shiphawk.com/api/v4/batches?api_key=YOUR_API_KEY'

# Example Response
{
    "id": "bat_DhmbwcwE",
    "name": "Batch #3",
    "items_count": 0,
    "created_at": "2019-01-22T19:53:27+00:00",
    "created_by": "Roni Rae-Staples"
}
```

```
require 'net/http'
require 'uri'
require 'json'

uri = URI.parse('https://sandbox.shiphawk.com/api/v4/batches?api_key=YOUR_API_KEY')

# Create the HTTP objects
request = Net::HTTP::Post.new(uri.request_uri)

# Send the request
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
    http.request(request)
end

puts response.body
```

```
import requests

url = 'https://sandbox.shiphawk.com/api/v4/batches'
headers = {'X-Api-Key': 'YOUR_API_KEY'}

r = requests.post(url, headers=headers)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;

public class PostRequestsSimple {
    public static void main(String [] args)
    {
        try{
            sendPost();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendPost() throws IOException {
        URL url = new URL("https://sandbox.shiphawk.com/api/v4/batches?api_key=YOUR_API_KEY");
        HttpURLConnection con = (HttpURLConnection) url.openConnection();
        con.setRequestMethod("POST");
        con.setRequestProperty("Content-Type", "application/json");

int responseCode = con.getResponseCode();

> Request: POST /api/v4/batches
>
> Response: [batch-object](https://docs.shiphawk.com/#batch-object)

### Retrieve a Batch

```
# 'bat_2VTmjr7x' is an example batch id.
curl -H "Content-Type: application/json" -X GET
'https://sandbox.shiphawk.com/api/v4/batches/bat_2VTmjr7x?api_key=YOUR_API_KEY'

# Example Response
{
    "id": "bat_2VTmjr7x",
    "name": "Batch #2",
    "items_count": 0,
    "created_at": "2019-01-22T19:53:22+00:00",
    "created_by": "Roni Rae-Staples"
}
```

```
require 'net/http'

#'bat_XBryhqba' is an example batch id.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/batches/bat_XBryhqba?api_key=YOUR_API_KEY')
response = Net::HTTP.get(uri)

puts response
```

```
import requests

#'bat_XBryhqba' is an example batch id.
url = 'https://sandbox.shiphawk.com/api/v4/batches/bat_XBryhqba'
headers = {'X-Api-Key': 'YOUR_API_KEY'}

r = requests.get(url, headers=headers)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;

public class GetRequests {
    public static void main(String [] args)
    {
        try{
            sendGet();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendGet() throws IOException {
        // 'bat_mMppjwpG' is an example batch id.
        URL url = new URL("https://sandbox.shiphawk.com/api/v4/batches/bat_mMppjwpG?api_key=YOUR_API_KEY");
        HttpURLConnection con = (HttpURLConnection) url.openConnection();
        con.setRequestMethod("GET");
        int responseCode = con.getResponseCode();

> Request: GET /api/v4/batches/:id

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String | Batch id |

> Response: [batch-object](https://docs.shiphawk.com/#batch-object)

### Update a Batch

```
# 'bat_2VTmjr7x' is an example batch id.
curl -H "Content-Type: application/json" -X POST -d '{
  "name" : new name
}' 'https://sandbox.shiphawk.com/api/v4/batches/bat_2VTmjr7x?api_key=YOUR_API_KEY'

# Example Response
{
    "id": "bat_2VTmjr7x",
    "name": "new name",
    "items_count": 0,
    "created_at": "2019-01-22T19:53:22+00:00",
    "created_by": "Roni Rae-Staples"
}
```

```
require 'net/http'
require 'uri'
require 'json'

# 'bat_XBryhqba' is an example batch id.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/batches/bat_XBryhqba?api_key=YOUR_API_KEY')

rate =
'{
    "name": "Changed"
 }'

# Create the HTTP objects
request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
request.body = rate

# Send the request
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
    http.request(request)
end

puts response.body
```

```
import requests
import json

# 'bat_XBryhqba' is an example batch id.
url = 'https://sandbox.shiphawk.com/api/v4/batches/bat_XBryhqba'
headers = {'X-Api-Key': 'YOUR_API_KEY'}
payload = {
    "name": "New Name"
 }

r = requests.post(url, headers=headers, json=payload)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;
import javax.json.*;
import javax.script.*;

public class PostRequests {
    public static void main(String [] args)
    {
        try{
            sendPost();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendPost() throws IOException {
        JsonObject personObject = Json.createObjectBuilder()
                .add("name", "new name")
                .build();
        try{
            // For formatting json object to be readable
            ScriptEngineManager manager = new ScriptEngineManager();
            ScriptEngine scriptEngine = manager.getEngineByName("JavaScript");
            scriptEngine.put("jsonString", personObject.toString());
            scriptEngine.eval("result = JSON.stringify(JSON.parse(jsonString), null, 2)");
            String prettyPrintedJson = (String) scriptEngine.get("result");

//'bat_2QvQe0FN' is an example batch id.
            URL url = new URL("https://sandbox.shiphawk.com/api/v4/batches/bat_2QvQe0FN?api_key=YOUR_API_KEY");
            HttpURLConnection con = (HttpURLConnection) url.openConnection();
            con.setRequestMethod("POST");
            con.setRequestProperty("Content-Type", "application/json");
            con.setDoOutput(true);
            OutputStream os = con.getOutputStream();
            os.write(personObject.toString().getBytes());
            os.flush();
            os.close();

int responseCode = con.getResponseCode();

> Request: POST /api/v4/batches/:id

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String | Batch id |

> Response: [batch-object](https://docs.shiphawk.com/#batch-object)

### Delete a Batch

```
# 'bat_2VTmjr7x' is an example batch id.
curl --request DELETE \
  --url https://sandbox.shiphawk.com/api/v4/batches/bat_2VTmjr7x?api_key=YOUR_API_KEY
```

```
require 'net/http'

#'bat_2M4VVTw0' is an example batch id.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/batches/bat_2M4VVTw0?api_key=YOUR_API_KEY')

# Create the HTTP objects
request = Net::HTTP::Delete.new(uri.request_uri)

# Send the request
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
    http.request(request)
end

puts response.body
```

```
import requests

#'bat_2M4VVTw0' is an example batch id.
url = 'https://sandbox.shiphawk.com/api/v4/batches/bat_2M4VVTw0'
headers = {'X-Api-Key': 'YOUR_API_KEY'}

r = requests.delete(url, headers=headers)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;

public class DeleteRequests {
    public static void main(String [] args)
    {
        try{
            sendDelete();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendDelete() throws IOException {
        // 'bat_mMppjwpG' is an example batch id.
        URL url = new URL("https://sandbox.shiphawk.com/api/v4/batches/bat_mMppjwpG?api_key=YOUR_API_KEY");
        HttpURLConnection con = (HttpURLConnection) url.openConnection();
        con.setRequestMethod("DELETE");
        int responseCode = con.getResponseCode();

> Request: DELETE /api/v4/batches/:id

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String | Batch id |

> Response: no content

# Child Account Users

## Child Account Users Api Endpoint

> /api/v4/child\_accounts/:child\_account\_id/users

### Child Account Retrieve Users

```
#chd_BfEkFMR is an example child account id
curl -X GET 'https://sandbox.shiphawk.com/api/v4/child_accounts/chd_BfEkFMR/users?api_key=YOUR_API_KEY'
```

> Request: GET /api/v4/child\_accounts/:child\_account\_id/users

Supports: [Pagination](https://docs.shiphawk.com/#pagination-params)

> Response: Array\[ [User](https://docs.shiphawk.com/#user-object)\]

### Child Account Retrieve Users Count

```
#chd_BfEkFMR is an example child account id
curl -X GET 'https://sandbox.shiphawk.com/api/v4/child_accounts/chd_BfEkFMR/users/count?api_key=YOUR_API_KEY'
```

> Request: GET /api/v4/child\_accounts/:child\_account\_id/users/count

No params

> Example Response:
> { "all": 10 }

### Child Account Create User

```
#chd_BfEkFMR is an example child account id
curl -H "Content-Type: application/json" -X POST -d '
{
  “email”: “mikel@shiphawk.com”,
  “password”: “MwLtNFV”,
  “first_name”: “Mikel”,
  “last_name”: “Richardson”,
  “warehouse_ids”: ["mc_n7nJ5XjQ"]
}’ ‘https://sandbox.shiphawk.com/api/v4/child_accounts/chd_BfEkFMR/users?api_key=YOUR_API_KEY'
```

> Request: POST /api/v4/child\_accounts/:child\_account\_id/users

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| email | String |  |
| password | String |  |
| first\_name | String |  |
| last\_name | String |  |
| warehouse\_ids | Array\[String\] | Would assign user to specific Warehouse(s) |

> Response: [User](https://docs.shiphawk.com/#user-object)

### Child Account Destroy Users

```
#chd_BfEkFMR is an example child account id, usr_PwGnDEMK is an example user id
curl -X DELETE 'https://sandbox.shiphawk.com/api/v4/child_accounts/chd_BfEkFMR/users?api_key=YOUR_API_KEY'
```

> Request: DELETE /api/v4/child\_accounts/:child\_account\_id/users

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| ids | Array\[String\] |  |

> Response: no content

### Child Account Retrieve User

```
#chd_BfEkFMR is an example child account id, usr_PwGnDEMK is an example user id
curl -X GET 'https://sandbox.shiphawk.com/api/v4/child_accounts/chd_BfEkFMR/users/usr_PwGnDEMK?api_key=YOUR_API_KEY'
```

> Request: GET /api/v4/child\_accounts/:child\_account\_id/users/:id
>
> Response: [User](https://docs.shiphawk.com/#user-object)

### Child Account Update User

```
#chd_BfEkFMR is an example child account id, usr_PwGnDEMK is an example user id
curl -H "Content-Type: application/json" -X POST -d '
{
  “email”: “mikel@shiphawk.com”,
  “password”: “MwLtNFV”,
  “first_name”: “Mikel”,
  “last_name”: “Richardson”,
  "print_driver": "qztray",
  "dimensioner_driver": "qztray",
  “warehouse_ids”: ["mc_n7nJ5XjQ"]
}’ ‘https://sandbox.shiphawk.com/api/v4/child_accounts/chd_BfEkFMR/users/usr_PwGnDEMK/?api_key=YOUR_API_KEY'
```

> Request: POST /api/v4/child\_accounts/:child\_account\_id/users/:id

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| email | String |  |
| password | String |  |
| first\_name | String |  |
| last\_name | String |  |
| print\_driver | Enum | Options:<br>- qztray<br>- printnode |
| dimensioner\_driver | Enum | Options:<br>- qztray<br>- printnode |
| warehouse\_ids | Array\[String\] |  |

### Child Account Destroy User

```
#chd_BfEkFMR is an example child account id, usr_PwGnDEMK is an example user id
curl -X DELETE 'https://sandbox.shiphawk.com/api/v4/child_accounts/chd_BfEkFMR/users/usr_PwGnDEMK/?api_key=YOUR_API_KEY'
```

> Request: DELETE /api/v4/child\_accounts/:child\_account\_id/users/:id
>
> Response: no content

# Child Accounts

## Child Account Resources

### Child Account Object

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String |  |
| company\_name | String |  |
| company\_logo | String |  |
| name | String |  |
| owner\_id | String |  |
| owner\_email | String |  |
| is\_disabled | Boolean |  |
| created\_at | DateTime |  |
| last\_sign\_in\_at | DateTime |  |
| last\_month\_labels\_count | Integer |  |
| total\_lifetime\_labels\_count | Integer |  |
| direct\_lifetime\_labels\_count | Integer |  |
| return\_lifetime\_labels\_count | Integer |  |
| daily\_shipments\_limit | Integer |  |
| allow\_manual\_orders | Boolean |  |
| allow\_order\_import\_csv | Boolean |  |
| allow\_manual\_shipments | Boolean |  |
| allow\_shipments\_import\_csv | Boolean |  |
| lock\_billing\_details | Boolean |  |
| store\_hash | String |  |

## Child Accounts API Endpoints

### Create Child Account

```
curl -H "Content-Type: application/json" -X POST -d '
{
  “email”: “mikel@shiphawk.com”,
  “first_name”: “Mikel”,
  “last_name”: “Richardson”,
  “password”: “MwLtNFV”,
  “company_name”: “Shiphawk”,
}’ ‘https://sandbox.shiphawk.com/api/v4/child_accounts/chd_BfEkFMR/?api_key=YOUR_API_KEY'
```

> Request: POST /api/v4/child\_accounts

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| email | String | `required` |
| first\_name | String | `required` |
| last\_name | String | `required` |
| password | String | `required` |
| company\_name | String | `required` |

> Response: [Child Account Object](https://docs.shiphawk.com/#child-account-object)

### Retrieve All Child Accounts

```
curl -X GET 'https://sandbox.shiphawk.com/api/v4/child_accounts?api_key=YOUR_API_KEY'
```

> Request: GET /api/v4/child\_accounts

No params

> Response Array [\[ChildAccount\]](https://docs.shiphawk.com/#child-account-object)

### Retrieve Counts of enabled/disabled Child Accounts

```
curl -X GET 'https://sandbox.shiphawk.com/api/v4/child_accounts/counts?api_key=YOUR_API_KEY&q='
```

> Request: GET /api/v4/child\_accounts/counts?q=

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| q | String | Search query string |

> Example Response: { enabled: 10, disabled: 3 }

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| enabled | Integer |  |
| disabled | Integer |  |

### Retrieve Child Account

```
curl -X GET 'https://sandbox.shiphawk.com/api/v4/child_accounts/chd_BfEkFMR/?api_key=YOUR_API_KEY'
```

> Request: GET /api/v4/child\_accounts/:id

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String | Child account id |

> Response [ChildAccount](https://docs.shiphawk.com/#child-account-object)

### Update Child Account

```
curl -H "Content-Type: application/json" -X POST -d '
{
  “company_name”: “Example, Inc”,
  “daily_shipments_limit”: “5”,
  “is_disabled”: false,
  “allow_manual_orders”: true,
  “allow_order_import_csv”: false,
  “allow_manual_shipments”: true,
  “allow_shipments_import_csv”: false,
  “lock_billing_details”: false
}’ ‘https://sandbox.shiphawk.com/api/v4/child_accounts/chd_BfEkFMR/?api_key=YOUR_API_KEY'
```

> Request: POST /api/v4/child\_accounts/:id

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| company\_name | String | `required` |
| daily\_shipments\_limit | Integer | `required` |
| is\_disabled | Boolean | `required` |
| allow\_manual\_orders | Boolean | `required` |
| allow\_order\_import\_csv | Boolean | `required` |
| allow\_manual\_shipments | Boolean | `required` |
| allow\_shipments\_import\_csv | Boolean | `required` |
| lock\_billing\_details | Boolean | `required` |

> Response [ChildAccount](https://docs.shiphawk.com/#child-account-object)

# Documents

## Document Resources

### Document Object

A document is the paperwork required by a particular carrier in order to ship a set of goods. For parcel carriers, a shipping label is needed. For LTL carriers, a bill of lading is needed. For international shipments, a commercial invoice and Internal Transaction Number (ITN) may be needed.

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | string |  |
| `customer_uploaded` | boolean |  |
| `type` | string | The document types are: `bol``signed_bol``pod``address_label``waybill``carrier_doc``image``other` |
| `extension` | string |  |
| `code` | string |  |
| `url` | string | A URL link to a pdf version of the document |
| `meta_data` | hash |  |
| `created_at` | float |  |

## Document API Endpoints

### Create a Document on the Shipment

```
# `shp_nhMNNzwQ` is an example shipment id.
curl -X POST -d '
{
    "files": "path_to_file"
}' 'https://sandbox.shiphawk.com/api/v4/shipments/shp_nhMNNzwQ/documents?api_key=YOUR_API_KEY'
```

```
require 'net/http'
require 'uri'
require 'json'

# 'shp_10RCpAYY' is an example shipment id.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/shipments/shp_10RCpAYY/documents?api_key=YOUR_API_KEY')

document =
'{
    "files": "path_to_file"
}'

# Create the HTTP objects
request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
request.body = document

# Send the request
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
    http.request(request)
end

puts response.body
```

```
import requests
import json

# 'shp_10RCpAYY' is an example shipment id.
url = 'https://sandbox.shiphawk.com/api/v4/shipments/shp_10RCpAYY/documents'
headers = {'X-Api-Key': 'YOUR_API_KEY'}
payload = {
    "files": "path_to_file"
}

r = requests.post(url, headers=headers, json=payload)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;
import javax.json.*;
import javax.script.*;

public class PostRequests {
    public static void main(String [] args)
    {
        try{
            sendPost();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendPost() throws IOException {
        JsonObject personObject = Json.createObjectBuilder()
                .add("files", "path_to_file")
                .build();
        try{
            // For formatting json object to be readable
            ScriptEngineManager manager = new ScriptEngineManager();
            ScriptEngine scriptEngine = manager.getEngineByName("JavaScript");
            scriptEngine.put("jsonString", personObject.toString());
            scriptEngine.eval("result = JSON.stringify(JSON.parse(jsonString), null, 2)");
            String prettyPrintedJson = (String) scriptEngine.get("result");

// 'shp_Zm7B5cVm' is an example shipment id.
            URL url = new URL("https://sandbox.shiphawk.com/api/v4/shipments/shp_Zm7B5cVm/documents?api_key=YOUR_API_KEY");
            HttpURLConnection con = (HttpURLConnection) url.openConnection();
            con.setRequestMethod("POST");
            con.setRequestProperty("Content-Type", "application/json");
            con.setDoOutput(true);
            OutputStream os = con.getOutputStream();
            os.write(personObject.toString().getBytes());
            os.flush();
            os.close();

int responseCode = con.getResponseCode();

> Request: POST /api/v4/shipments/:id/documents

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| files | String | path to file |
| id | String | shipment id |

> Response: [document-object](https://docs.shiphawk.com/#document-object)

### Retrieve a Document From the Shipment

```
# `shp_nhMNNzwQ` is an example shipment id, `doc_zVv5N3hX` is an example document id.
curl -X GET 'https://sandbox.shiphawk.com/api/v4/shipments/shp_nhMNNzwQ/documents/doc_zVv5N3hX?api_key=YOUR_API_KEY'

# Example Response
{
    "id": "doc_zVv5N3hX",
    "customer_uploaded": false,
    "type": "Other",
    "extension": "ZPL",
    "code": "other",
    "url": "https://shiphawk-assets-qa.s3.amazonaws.com/uploads/package_label_5c7fff4e324e6f1c98e4.zpl?AWSAccessKeyId=AKIAIGBEYNQ6VGNFN2GQ&Signature=koAh%2BiGwztnGjDDiJp/zu3CfOMM%3D&Expires=1864550533",
    "meta_data": {},
    "created_at": "2019-01-17T20:25:46.530+00:00",
    "filename": "package_label_5c7fff4e324e6f1c98e4.zpl"
}
```

```
require 'net/http'

# 'shp_10RCpAYY' is an example shipment id and 'doc_aM5pCQ2A' is an example documents id.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/shipments/shp_10RCpAYY/documents/doc_aM5pCQ2A?api_key=YOUR_API_KEY')
response = Net::HTTP.get(uri)

puts response
```

```
import requests

# 'shp_10RCpAYY' is an example shipment id and 'doc_aM5pCQ2A' is an example documents id.
url = 'https://sandbox.shiphawk.com/api/v4/shipments/shp_10RCpAYY/documents/doc_aM5pCQ2A'
headers = {'X-Api-Key': 'YOUR_API_KEY'}

r = requests.get(url, headers=headers)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;

public class GetRequests {
    public static void main(String [] args)
    {
        try{
            sendGet();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendGet() throws IOException {
        // 'shp_Zm7B5cVm' is an example shipment id, 'doc_3rkcPwbh' is an example document id.
        URL url = new URL("https://sandbox.shiphawk.com/api/v4/shipments/shp_Zm7B5cVm/documents/doc_3rkcPwbh?api_key=YOUR_API_KEY&q=");
        HttpURLConnection con = (HttpURLConnection) url.openConnection();
        con.setRequestMethod("GET");
        int responseCode = con.getResponseCode();

> Request: GET /api/v4/shipments/:id/documents/:id

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String | shipment id |
| id | String | document id |

> Response: [document-object](https://docs.shiphawk.com/#document-object)

### Update Document Type of Document on the Shipment

```
#`shp_nhMNNzwQ` is an example shipment id, `doc_q04Sx49Z` is an example document id.
curl -H "Content-Type: application/json" -X POST -d '
{
"type":"other"
}' 'https://sandbox.shiphawk.com/api/v4/shipments/shp_nhMNNzwQ/documents/doc_q04Sx49Z?api_key=YOUR_API_KEY'
`POST https://sandbox.shiphawk.com/api/v4/shipments/:id/documents/:id?api_key=YOUR_API_KEY`

# Example Response
{
    "id": "doc_zVv5N3hX",
    "customer_uploaded": false,
    "type": "Other",
    "extension": "ZPL",
    "code": "other",
    "url": "https://shiphawk-assets-qa.s3.amazonaws.com/uploads/package_label_5c7fff4e324e6f1c98e4.zpl?AWSAccessKeyId=AKIAIGBEYNQ6VGNFN2GQ&Signature=eUpEyVE9ry964u8gtK05z8463T4%3D&Expires=1864550316",
    "meta_data": {},
    "created_at": "2019-01-17T20:25:46.530+00:00",
    "filename": "package_label_5c7fff4e324e6f1c98e4.zpl"
}
```

```
require 'net/http'
require 'uri'
require 'json'

#'shp_10RCpAYY' is an example shipment id and 'doc_aM5pCQ2A' is an example document id.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/shipments/shp_10RCpAYY/documents/doc_aM5pCQ2A?api_key=YOUR_API_KEY')

document =
'{
    "type":"other"
}'

# Create the HTTP objects
request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
request.body = document

# Send the request
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
    http.request(request)
end

puts response.body
```

```
import requests
import json

url = 'https://sandbox.shiphawk.com/api/v4/shipments/shp_10RCpAYY/documents/doc_aM5pCQ2A'
headers = {'X-Api-Key': 'YOUR_API_KEY'}
payload = {
    "type":"other"
}

r = requests.post(url, headers=headers, json=payload)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;
import javax.json.*;
import javax.script.*;

public class PostRequests {
    public static void main(String [] args)
    {
        try{
            sendPost();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendPost() throws IOException {
        JsonObject personObject = Json.createObjectBuilder()
                .add("type", "other")
                .build();
        try{
            // For formatting json object to be readable
            ScriptEngineManager manager = new ScriptEngineManager();
            ScriptEngine scriptEngine = manager.getEngineByName("JavaScript");
            scriptEngine.put("jsonString", personObject.toString());
            scriptEngine.eval("result = JSON.stringify(JSON.parse(jsonString), null, 2)");
            String prettyPrintedJson = (String) scriptEngine.get("result");

// 'shp_Zm7B5cVm' is an example shipment id, 'doc_3rkcPwbh' is an example document id.
            URL url = new URL("https://sandbox.shiphawk.com/api/v4/shipments/shp_Zm7B5cVm/documents/doc_3rkcPwbh?api_key=YOUR_API_KEY");
            HttpURLConnection con = (HttpURLConnection) url.openConnection();
            con.setRequestMethod("POST");
            con.setRequestProperty("Content-Type", "application/json");
            con.setDoOutput(true);
            OutputStream os = con.getOutputStream();
            os.write(personObject.toString().getBytes());
            os.flush();
            os.close();

int responseCode = con.getResponseCode();

> Request: POST /api/v4/shipments/:id/documents/:id

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| type | String | The document types are: bol signed\_bol pod address\_label waybill carrier\_doc image other |
| id | String | shipment id |
| id | String | document id |

> Response: [document-object](https://docs.shiphawk.com/#document-object)

### Delete a Document from the Shipment

```
#'shp_nhMNNzwQ' is an example shipment id and 'doc_q04Sx49Z' is an example document id.
curl -X DELETE 'https://sandbox.shiphawk.com/api/v4/shipments/shp_nhMNNzwQ/documents/doc_q04Sx49Z?api_key=YOUR_API_KEY'
```

```
require 'net/http'

#'shp_nhMNNzwQ' is an example shipment id and 'doc_zVv5N3hX' is an example document id.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/shipments/shp_nhMNNzwQ/documents/doc_zVv5N3hX?api_key=YOUR_API_KEY')

# Create the HTTP objects
request = Net::HTTP::Delete.new(uri.request_uri)

# Send the request
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
    http.request(request)
end

puts response.body
```

```
import requests

#'shp_nhMNNzwQ' is an example shipment id and 'doc_zVv5N3hX' is an example document id.
url = 'https://sandbox.shiphawk.com/api/v4/shipments/shp_nhMNNzwQ/documents/doc_zVv5N3hX'
headers = {'X-Api-Key': 'YOUR_API_KEY'}

r = requests.delete(url, headers=headers)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;

public class DeleteRequests {
    public static void main(String [] args)
    {
        try{
            sendDelete();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendDelete() throws IOException {
        // 'shp_Zm7B5cVm' is an example shipment id, 'doc_3rkcPwbh' is an example document id.
        URL url = new URL("https://sandbox.shiphawk.com/api/v4/shipments/shp_Zm7B5cVm/documents/doc_3rkcPwbh?api_key=YOUR_API_KEY");
        HttpURLConnection con = (HttpURLConnection) url.openConnection();
        con.setRequestMethod("DELETE");
        int responseCode = con.getResponseCode();

> Request: DELETE /api/v4/shipments/:id/documents/:id
>
> Response: no content

### Email Shipping Documents

```
#`shp_nhMNNzwQ` is an example shipment id, assuming shipment has requested documents.
curl -H "Content-Type: application/json" -X POST -d '
{
"documents": "doc_zVv5N3hX"
}' 'https://sandbox.shiphawk.com/api/v4/shipments/shp_nhMNNzwQ/documents/email?api_key=YOUR_API_KEY'
```

```
require 'net/http'
require 'uri'
require 'json'

#'shp_10RCpAYY' is an example shipment id.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/shipments/shp_10RCpAYY/documents/email?api_key=YOUR_API_KEY')

document =
'{
    "documents": "doc_zVv5N3hX"
}'

# Create the HTTP objects
request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
request.body = document

# Send the request
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
    http.request(request)
end

puts response.body
```

```
import requests
import json

#'shp_10RCpAYY' is an example shipment id.
url = 'https://sandbox.shiphawk.com/api/v4/shipments/shp_10RCpAYY/documents/email'
headers = {'X-Api-Key': 'YOUR_API_KEY'}
payload = {
    "documents": "doc_zVv5N3hX"
}

r = requests.post(url, headers=headers, json=payload)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;
import javax.json.*;
import javax.script.*;

public class PostRequests {
    public static void main(String [] args)
    {
        try{
            sendPost();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendPost() throws IOException {
        JsonObject personObject = Json.createObjectBuilder()
                .add("documents", "doc_0nc6ZSGW")
                .build();
        try{
            // For formatting json object to be readable
            ScriptEngineManager manager = new ScriptEngineManager();
            ScriptEngine scriptEngine = manager.getEngineByName("JavaScript");
            scriptEngine.put("jsonString", personObject.toString());
            scriptEngine.eval("result = JSON.stringify(JSON.parse(jsonString), null, 2)");
            String prettyPrintedJson = (String) scriptEngine.get("result");

// 'shp_Zm7B5cVm' is an example shipment id.
            URL url = new URL("https://sandbox.shiphawk.com/api/v4/shipments/shp_Zm7B5cVm/documents/email?api_key=YOUR_API_KEY");
            HttpURLConnection con = (HttpURLConnection) url.openConnection();
            con.setRequestMethod("POST");
            con.setRequestProperty("Content-Type", "application/json");
            con.setDoOutput(true);
            OutputStream os = con.getOutputStream();
            os.write(personObject.toString().getBytes());
            os.flush();
            os.close();

int responseCode = con.getResponseCode();

> Request: POST /api/v4/shipments/:id/documents/email

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| documents | String |  |

### Retrieve a List of Shipment's Documents

```
#'shp_nhMNNzwQ' is an example shipment id.
curl -X GET 'https://sandbox.shiphawk.com/api/v4/shipments/shp_nhMNNzwQ/documents?api_key=YOUR_API_KEY'

# Example Response
[\
    {\
        "id": "doc_dz3fhBMC",\
        "customer_uploaded": false,\
        "type": "Packing Slip",\
        "extension": "PDF",\
        "code": "packing_slip",\
        "url": "https://shiphawk-assets-qa.s3.amazonaws.com/uploads/packing_slip_8c5ed7e2f552ac8dfa97f97b4597a9e2.pdf?AWSAccessKeyId=AKIAIGBEYNQ6VGNFN2GQ&Signature=VOPDM5VjkhbaSHDfsVG00j5GAnY%3D&Expires=1864552092",\
        "meta_data": {},\
        "created_at": "2019-01-29T23:35:37.589+00:00",\
        "filename": "packing_slip_8c5ed7e2f552ac8dfa97f97b4597a9e2.pdf"\
    },\
    {\
        "id": "doc_BGT54Etg",\
        "customer_uploaded": false,\
        "type": "Package Labels Combined",\
        "extension": "PDF",\
        "code": "package_labels_combined",\
        "url": "https://shiphawk-assets-qa.s3.amazonaws.com/uploads/package_labels_combined_20190129-1340-1a2evvy.pdf?AWSAccessKeyId=AKIAIGBEYNQ6VGNFN2GQ&Signature=bXsqXXpGvToR9D0hIH9hOMl%2B3s0%3D&Expires=1864552092",\
        "meta_data": {},\
        "created_at": "2019-01-17T201-29T23:35:32.559+00:00",\
        "filename": "package_labels_combined_20190129-1340-1a2evvy.pdf"\
    }\
]
```

```
require 'net/http'

#'shp_10RCpAYY' is an example shipment id.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/shipments/shp_10RCpAYY/documents?api_key=YOUR_API_KEY&q=')
response = Net::HTTP.get(uri)

puts response
```

```
import requests

#'shp_10RCpAYY' is an example shipment id.
url = 'https://sandbox.shiphawk.com/api/v4/shipments/shp_10RCpAYY/documents'
headers = {'X-Api-Key': 'YOUR_API_KEY'}

r = requests.get(url, headers=headers)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;

public class GetRequests {
    public static void main(String [] args)
    {
        try{
            sendGet();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendGet() throws IOException {
        // 'shp_Zm7B5cVm' is an example shipment id.
        URL url = new URL("https://sandbox.shiphawk.com/api/v4/shipments/shp_Zm7B5cVm/documents?api_key=YOUR_API_KEY&q=");
        HttpURLConnection con = (HttpURLConnection) url.openConnection();
        con.setRequestMethod("GET");
        int responseCode = con.getResponseCode();

> Request: GET /api/v4/shipments/:id/documents

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String | shipment id |

> Response: Array [\[document-object\]](https://docs.shiphawk.com/#document-object)

# Handling Units

## Handling Unit Resources

### Handling Unit Object

A handling unit is a physical unit consisting of packaging materials (load carriers/packing material) and the goods contained on/in it. Examples include: `pallet``carton``crate`.

Handling units are primarily used for rating freight shipments, although the `rates` endpoint will also return parcel rates if the `can_ship_parcel` flag is `true`.

| Attribute | Type | Description |
| --- | --- | --- |
| `type` | String | `required` Use value `handling_unit` |
| `handling_unit_type` | Enum | `required` Options:<br>- pallet<br>- carton<br>- box<br>- crate<br>- bag |
| `length` | Float | `required`. Limited to one decimal place. |
| `width` | Float | `required`. Limited to one decimal place. |
| `height` | Float | `required`. Limited to one decimal place. |
| `dimension_uom` | String | Options: <br>- in<br>- cm<br> Default: `in` |
| `weight` | Float | `required`. Limited to one decimal place. |
| `weight_uom` | String | Options: <br>- lb<br>- kg<br> Default: `lb` |
| `value` | integer | `required` The total value of the contents in US Dollars, rounded to the nearest whole dollar. |
| `freight_class` | String | NMFC freight class codes: `50``55``60``65``70``77.5``85``92.5``100``110``125``150``175``200``250``300``400``500` |
| `nmfc` | String | The National Motor Freight Classification code. Default value will be calculated based on density (this can affect rating accuracy). |
| `description` | String | A description of the handling unit's contents. Typically this should be the name of the NMFC commodity, but can also be a more generic description. This attribute will be printed on the Bill of Lading (BOL). |
| `package_type` | String | `required for pallets` Describes the type of packages contained in or on the handling unit. The package types are: `carton``box``crate``bag` |
| `package_quantity` | integer | `required for pallets` The number of packages contained in or on the handling unit. No mix or matching allowed. |
| `product_sku` | String | Only use this field if you have integrated with our _Product Service_ |
| `optimize_packing` | boolean | If `true`, we will attempt to palletize prior to rating. Default: `false` |
| `sscc_serial_references` | Array | list of assigned Serial Shipping Container Codes (SSCC) |

# Job Trackers

## Job Tracker Resources

### Job Tracker Response Object

```
{
    "id": "skjob_mh7vQtVQ",
    "error_message": null,
    "meta": {},
    "meta_search": {},
    "status": "unprocessed",
    "type": null,
    "created_at": "2020-10-05T08:21:06.378+00:00",
    "started_at": null,
    "finished_at": null
}
```

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| `id` | String | unikey key identifier |
| `error_message` | String | Show error message if something went wrong |
| `meta` | Hash | A free form hash that can store additional information |
| `meta_search` | Hash | A free form hash that can store additional information |
| `status` | String | Available statuses: unprocessed, in\_progress, finished, failed |
| `type` | String | How object was created, e.g. ApiRequestSearch |
| `created_at` | DateTime | When object was created |
| `updated_at` | DateTime | When object was updated |
| `finished_at` | DateTime | When object was finished |

## Job Tracker API Endpoints

### Retrieve a Job Tracker Object

```
#'skjob_mh7vQtVQ' is an example job tracker id.
curl -X GET 'https://sandbox.shiphawk.com/api/v4/job_trackers/skjob_mh7vQtVQ?api_key=YOUR_API_KEY'
```

```
require 'net/http'

#'skjob_mh7vQtVQ' is an example order id.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/job_trackers/skjob_mh7vQtVQ?api_key=YOUR_API_KEY')
response = Net::HTTP.get(uri)

puts response
```

```
import requests

url = 'https://sandbox.shiphawk.com/api/v4/job_trackers/skjob_mh7vQtVQ'
headers = {'X-Api-Key': 'YOUR_API_KEY'}

r = requests.get(url, headers=headers)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;

public class GetRequests {
    public static void main(String [] args)
    {
        try{
            sendGet();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendGet() throws IOException {
        //'skjob_mh7vQtVQ' is an example order id.
        URL url = new URL("https://sandbox.shiphawk.com/api/v4/job_trackers/skjob_mh7vQtVQ?api_key=YOUR_API_KEY");
        HttpURLConnection con = (HttpURLConnection) url.openConnection();
        con.setRequestMethod("GET");
        int responseCode = con.getResponseCode();

if(responseCode == HttpURLConnection.HTTP_OK){
            BufferedReader in = new BufferedReader(
              new InputStreamReader(con.getInputStream()));
            String inputLine;
            StringBuffer content = new StringBuffer();
            while ((inputLine = in.readLine()) != null) {
                content.append(inputLine);
            }
            in.close();
            System.out.println(content.toString());
        }
        else{
            System.out.println("GET request failed.");
        }
    }
}
```

> Request: `GET https://sandbox.shiphawk.com/api/v4/job_trackers/:id`

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String | `required` |

> Response: [Job Tracker](https://docs.shiphawk.com/#job-tracker-response-object)

# Material Containers

## Material Container Resources

### Material Container Request Object

```
# Create:
{
   "name": "TEST #1",
   "packing_type": "pallet",
   "length": "10",
   "width": "10",
   "height": "10",
   "dimension_uom": "in",
   "weight": "10",
   "weight_uom": "lb",
   "warehouse_public_ids": []
}

# Update:
{
   "is_active": "false",
   "warehouse_public_ids": ["whs_8MXd7Phd"],
   "name": "Super XL Art Box"
}
```

Used when creating or updating Material Container. Parameters are optional unless noted.

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| `name` | String |  |
| `packing_type` | String | Packing type ("box", "pallet", "envelope") |
| `length` | Float |  |
| `width` | Float |  |
| `height` | Float |  |
| `dimension_uom` | String | Options: <br>- in<br>- cm<br> Default: `in` |
| `weight` | Float |  |
| `weight_uom` | String | Options: <br>- lb<br>- kg<br> Default: `lb` |
| `max_weight` | Float |  |
| `max_stack_height` | Float |  |
| `is_active` | Boolean |  |
| `warehouse_public_ids` | Array | List of Warehouses ( id ) |

### Material Container Search Request Object

Used for search/filtering.

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| `query` | String | Name of material container |
| `statuses` | Array\[Boolean\] | Include active/not active materials containers |
| `packing_types` | Array\[String\] | List of packing types ("parcel", "carton", "box", "pallet", etc.) |
| `warehouse_public_ids` | Array\[String\] | List of warehouse ids |
| `carrier_ids` | Array\[String\] | List of carrier ids, add 'custom\_carrier\_id' to list if you want custom carrier containers |

### Material Container Bulk Update Request Object

```
{
    "packing_types": ["box"],
    "carrier_id": ["with_custom_carrier"],
    "update_filter": {
      "is_active": "true"
    }
}
```

Used for update of a Material containers.

It can include `Material Container Search Request Object`. The app will use those params to identify what objects should be updated
when `public_ids` is not set.

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| `public_ids` | Array\[String\] | List of ShipHawk MaterialContainer public identifier |
| `update_filter` | Hash | `required`, Object:<br>{<br>`is_active`: Boolean<br>`warehouse_public_ids`: Array\[String\]<br>} |

### Material Container Response Object

```
{
    "id": "mc_817t4wBv",
    "carrier": null,
    "carrier_container_name": null,
    "name": "TEST #1",
    "packing_type": "pallet",
    "length": 10.0,
    "width": 10.0,
    "height": 10.0,
    "dimension_uom": "in",
    "weight": 10.0,
    "weight_uom": "lb",
    "max_weight": null,
    "max_stack_height": 96.0,
    "is_active": false,
    "warehouses": []
}
```

Returned from MaterialContainer creation, updating, fetching, and so on.

| Attributes | Type | Description |
| --- | --- | --- |
| `id` | String | ShipHawk MaterialContainer public identifier. |
| `carrier` | Hash | Material Container Carrier Response Object |
| `carrier_container` | Hash | Material Container Carrier Container Response Objects |
| `name` | String |  |
| `packing_type` | String | Packing type ("box", "pallet", "envelope") |
| `length` | Float |  |
| `width` | Float |  |
| `height` | Float |  |
| `dimension_uom` | String |  |
| `weight` | Float |  |
| `weight_uom` | String |  |
| `max_weight` | Float |  |
| `max_stack_height` | Float |  |
| `is_active` | Boolean |  |
| `warehouses` | Array | List of Material Container Warehouses Response Objects |

### Material Container Carrier Container Response Objects

| Attribute | Type | Description |
| --- | --- | --- |
| `container` | String |  |
| `type` | String |  |

### Material Container Warehouses Response Objects

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | String | ShipHawk warehouse public identifier |
| `code` | String |  |

### Material Container Carrier Response object

| Attribute | Type | Description |
| --- | --- | --- |
| `code` | String |  |
| `name` | String |  |

## Material Container API Endpoints

### List all Material Containers

```
curl -X GET 'https://sandbox.shiphawk.com/api/v4/materials/containers' -H 'X-User-Email:YOUR_ACCOUNT_EMAIL' -H 'X-User-Token: YOUR_ACCOUNT_TOKEN'

# Example Response
List of Material Containers Response Object
```

> Request: GET /api/v4/materials/containers
>
> Response: Array [\[material-container-response-object\]](https://docs.shiphawk.com/#material-container-response-object)

### Search for Material Containers

```
# 'whs_8MXd7Phd' is a warehouse id
# Inside `carrier_id` you can specify `with_custom_carrier` - means include own materials

curl -X GET 'https://sandbox.shiphawk.com/api/v4/materials/containers?per_page=10&page=1&query=Express&packing_types[]=box&carrier_ids[]=3&warehouse_public_ids[]=whs_8MXd7Phd&statuses[]=false&carrier_ids[]=18&statuses[]=true' -H 'X-User-Email:YOUR_ACCOUNT_EMAIL' -H 'X-User-Token: YOUR_ACCOUNT_TOKEN'

# Example Response
List of Material Containers Response Object
```

> Request: GET /api/v4/materials/containers?per\_page=10&page=1&query=Express&packing\_types\[\]=box&carrier\_ids\[\]=3&warehouse\_public\_ids\[\]=whs\_8MXd7Phd&statuses\[\]=false&carrier\_ids\[\]=18&statuses\[\]=true

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| query | String | Name of material container |
| packing\_type | String | Packing type ("box", "pallet", "envelope") |
| carrier\_ids | Array\[String\] | List of carrier ids, add 'custom\_carrier\_id' to list if you want custom carrier containers |
| warehouse\_public\_ids | Array | List of Warehouses ( id ) |
| statuses | Array\[Boolean\] | Include active/not active materials containers |

> Response: Array [\[material-container-response-object\]](https://docs.shiphawk.com/#material-container-response-object)

### Create a Material Container

```
curl -X POST -H "X-User-Email: YOUR_ACCOUNT_EMAIL" -H "X-User-Token: YOUR_ACCOUNT_TOKEN" -H "Content-Type: application/json" -d '
{
    "name": "Material container name",
    "length": "10",
    "width": "10",
    "height": "10",
    "weight": "10",
    "warehouse_public_ids": []
}' 'https://sandbox.shiphawk.com/api/v4/materials/containers'

# Example Response
Material Container Response Object
```

> Request: POST /api/v4/materials/containers

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| name | String |  |
| length | Float |  |
| width | Float |  |
| weight | Float |  |
| warehouse\_public\_id | Array\[String\] | List of warehouse ids |

> Response: [material-container-response-object](https://docs.shiphawk.com/#material-container-response-object)

### Update a Material Container

```
#'mc_y4W6Trgy' is an example material container id.

curl -X POST -H "X-User-Email: YOUR_ACCOUNT_EMAIL" -H "X-User-Token: YOUR_ACCOUNT_TOKEN" -H "Content-Type: application/json" -d '
{
    "name": "Super XL Art Box"
    "is_active": "false",
    "warehouse_public_ids": ["whs_8MXd7Phd"]
}' 'https://sandbox.shiphawk.com/api/v4/materials/containers/mc_y4W6Trgy'

# Example Response
Material Container Response Object
```

> Request: POST /api/v4/materials/containers

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| name | String |  |
| is\_active | Boolean |  |
| warehouse\_public\_ids | Array\[String\] | List of warehouse ids |

> Response: [material-container-response-object](https://docs.shiphawk.com/#material-container-response-object)

### Update bulk of Material Containers by public id

Inside public\_ids, you have to specify public ids of material containers that should be updated.

Inside `update_filter` you specify the value that should be updated.

```
curl -X POST -H "X-User-Email: YOUR_ACCOUNT_EMAIL" -H "X-User-Token: YOUR_ACCOUNT_TOKEN" -H "Content-Type: application/json" -d '
{
   "public_ids": ["mc_n7nJ5XjQ"],
   "update_filter": {
     "is_active":"true",
     "warehouse_public_ids": ["whs_8MXd7Phd"]
   }
}' 'https://sandbox.shiphawk.com/api/v4/materials/containers/bulk_update'

# Example Response
Status: 204
```

> Request: POST /api/v4/materials/containers/bulk\_update

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| public\_ids | Array\[String\] | List of ShipHawk MaterialContainer public identifier |
| update\_filter | Hash | required, Object: { is\_active: Boolean warehouse\_public\_ids: Array\[String\]} |
| warehouse\_public\_ids | Array\[String\] | List of warehouse ids |

### Update bulk of Material Containers by filter

Inside `update_filter` you specify the value that should be updated.
You can remove `public_ids` and add filters from Search for Material Containers.

```
curl -X POST -H "X-User-Email: YOUR_ACCOUNT_EMAIL" -H "X-User-Token: YOUR_ACCOUNT_TOKEN" -H "Content-Type: application/json" -d '
{
   "packing_types": ["box"],
   "carrier_id": ["with_custom_carrier"],
   "update_filter": {
     "is_active":"true",
   },
}' 'https://sandbox.shiphawk.com/api/v4/materials/containers/bulk_update'

# Example Response
Status: 204
```

> Request: POST /api/v4/materials/containers/bulk\_update

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| packing\_types | Array\[String\] |  |
| carrier\_id | String |  |
| update\_filter | Hash | required, Object: { is\_active: Boolean warehouse\_public\_ids: Array\[String\]} |

> Response: http response

### Delete a Material Container

```
# 'mc_n7nJ5XjQ' is an example of material container id

curl -H "Content-Type: application/json" -H 'X-User-Email: YOUR_ACCOUNT_EMAIL' -H 'X-User-Token: YOUR_ACCOUNT_TOKEN' -X DELETE -d '
{
   "public_ids": ["mc_n7nJ5XjQ"],
   "destroy_filter": {}
}' 'https://sandbox.shiphawk.com/api/v4/materials/containers'

# Example Response
Status: 204
```

> Request: DELETE /api/v4/materials/containers

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| public\_ids | Array\[String\] | List of ShipHawk MaterialContainer public identifier |
| destroy\_filter | Hash |  |

> Response: http response

### Delete bulk of Material Containers

```
# 'destroy_filter' is equal to Search for Material Containers params
# NOTE: As a client you can remove only own material containers

curl -H "Content-Type: application/json" -H 'X-User-Email: YOUR_ACCOUNT_EMAIL' -H 'X-User-Token: YOUR_ACCOUNT_TOKEN' -X DELETE -d '
{
   "public_ids": [],
   "destroy_filter": {
     "query": "Express"
   }
}' 'https://sandbox.shiphawk.com/api/v4/materials/containers'

# Example Response
Status: 204
```

> Request: DELETE /api/v4/materials/containers

> Response: http response

### Retrieve a statistic of Material Containers

```
curl -X GET 'https://sandbox.shiphawk.com/api/v4/materials/containers/statistic' -H 'X-User-Email:YOUR_ACCOUNT_EMAIL' -H 'X-User-Token: YOUR_ACCOUNT_TOKEN'

# Example Response
{
  "packing_types": [\
    {\
      "label": "box",\
      "count": 9\
    },\
    {\
      "label": "envelope",\
      "count": 157\
    }\
  ],
  "statuses": [\
    {\
      "label": "enabled",\
      "count": 110\
    },\
    {\
      "label": "disabled",\
      "count": 56\
    }\
  ],
  "warehouses": [\
    {\
      "label": "whs_FZvTNdRY",\
      "count": 1\
    }\
  ],
  "carriers": [\
    {\
      "label": null,\
      "count": 111\
    },\
    {\
      "label": 233,\
      "count": 22\
    },\
    {\
      "label": 2,\
      "count": 7\
    },\
    {\
      "label": 3,\
      "count": 15\
    },\
    {\
      "label": 18,\
      "count": 11\
    }\
  ]
}
```

> Request GET /api/v4/materials/containers/statistic

### Retrieve a filtered statistic of Material Containers

```
# params are equal to Search for Material Containers params

curl -X GET 'https://sandbox.shiphawk.com/api/v4/materials/containers/statistic?query=Express&packing_types[]=box&carrier_ids[]=3,18&warehouse_ids[]=273&statuses[]=false' -H 'X-User-Email:YOUR_ACCOUNT_EMAIL' -H 'X-User-Token: YOUR_ACCOUNT_TOKEN'

# Example Response
{
    "packing_types": [],
    "statuses": [\
        {\
            "label": "enabled",\
            "count": 13\
        },\
        {\
            "label": "disabled",\
            "count": 0\
        }\
    ],
    "warehouses": [],
    "carriers": []
}
```

> Request: GET /api/v4/materials/containers/statistic?query=Express&packing\_types\[\]=box&carrier\_ids\[\]=3,18&warehouse\_ids\[\]=273&statuses\[\]=false

### Material Containers Import

Upload csv file with material containers

```
curl -X POST -H "X-User-Email: YOUR_ACCOUNT_EMAIL" -H "X-User-Token: YOUR_ACCOUNT_TOKEN" -H "Content-Type: application/json" -d '
{
    "file": "path_to_CSV_file"
}' 'https://sandbox.shiphawk.com/api/v4/materials/containers_import'

# Example Response
Status 201
```

> Request: POST /api/v4/materials/containers\_import

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| file | String |  |

> Response: http response

```
# Parameters for CSV file:

public_id,is_active,name,packing_type,length,width,height,weight,max_weight,max_stack_height,warehouse_codes
mc_xxx,true,Test,box,2,2,2,7,20,22,"111111,222222"
```

### Material Containers Export

Export csv file with material export

```
curl -X POST -H "X-User-Email: YOUR_ACCOUNT_EMAIL" -H "X-User-Token: YOUR_ACCOUNT_TOKEN" -H "Content-Type: application/json" -d '
{
    "file": "path_to_CSV_file"
}' 'https://sandbox.shiphawk.com/api/v4/materials/containers_export'

# Example Response
Content-Disposition: attachment
Content-Type: text/csv

# File:
public_id,is_active,name,packing_type,length,width,height,weight,max_weight,max_stack_height,warehouse_codes
mc_MT4py3Y9,true,"4"" Deep Telescopic Art Box",box,37.0,4.0,60.0,4.92,40.0,96.0,
```

> Request: POST /api/v4/materials/containers\_export

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| file | String |  |

> Response: http response

### Material Containers Barcodes Generate

Export pdf file with material containers barcodes

Note: `warehouse_ids` is optional

```
# 'mc_n7nJ5XjQ' is an example of warehouse public id

curl -X POST -H "X-User-Email: YOUR_ACCOUNT_EMAIL" -H "X-User-Token: YOUR_ACCOUNT_TOKEN" -H "Content-Type: application/json" -d '
{
    "warehouse_ids": ["mc_n7nJ5XjQ"]
}' 'https://sandbox.shiphawk.com/api/v4/materials/generate_barcodes'

# Example Response
Content-Disposition: attachment
Content-Type: application/pdf
Format: binary
```

> Request: POST /api/v4/materials/generate\_barcodes

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| warehouse\_ids | Array\[String\] | List of warehouse ids |

> Response: pdf

# Orders

## Order Resources

### Order Object

Params for creating and updating Orders

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| `order_number` | String | `required` for creation, `optional` for update. |
| `source_system` | String | Source system (such as "NetSuite", "Shopify", "Magento", and so on). |
| `source_system_id` | String | \* |
| `source_system_domain` | String | \* |
| `source_system_meta` | Hash | A free form hash that can store information for customization. |
| `source` | String | `deprecated` |
| `source_system_processed_at` | DateTime |  |
| `unbundle_kits` | Boolean | Whether or not Order should split kit into separate order line items. |
| `origin_address` | [Address](https://docs.shiphawk.com/#address-object) | Order Address Request object |
| `destination_address` | [Address](https://docs.shiphawk.com/#address-object) | Order Address Request object |
| `billing_address` | [Address](https://docs.shiphawk.com/#address-object) | Order Address Request object |
| `order_line_items` | Array\[ [OrderLineItem](https://docs.shiphawk.com/#order-orderlineitem-object)\] | List of Order Line item request objects. |
| `currency` | String | Order currency code.<br>Item price will be converted to this currency, proposed shipments and shipments will be created in this currency.<br>All the documents will be generated in this currency.<br>If not specified, warehouse currency will be used.<br>Can only be set on order create.<br>Default: `USD` |
| `tax_price` | Float |  |
| `shipping_price` | Float |  |
| `total_price` | Float | Price presented to customer of an Order. |
| `items_price` | Float |  |
| `status` | String | Options: <br>- new _(default)_<br>- partially\_shipped<br>- shipped<br>- delivered<br>- cancelled<br>- on\_hold<br>- picking |
| `requested_shipping_details` | String | Can be used in rules for building criteria. Usually looks like "Carrier - Service" pair. |
| `requested_rate_id` | String or Array\[String\] | Rate ID that is returned from /rates endpoint. If provided on Order creation, Order will use data from Rate (like Carrier/Service) |
| `tags` | Array\[String\] |  |
| `warehouse_id` | String |  |
| `warehouse_code` | String |  |
| `self_packed` | Boolean | Default: `true`. <br> Don't add packing cost to the rate. |
| `include_return_label` | Boolean | Default: `false`. <br> Specify whether return label is printed with regular labels. |
| `reference_numbers` | Array\[ReferenceNumber\] | List of Reference Number Request objects. |
| `proposed_shipments` | Array\[ProposedShipment\] | List of Proposed Shipment Request objects. |
| `notes` | Array\[Note\] | List of Note Request objects. |
| `instant_proposed_shipment_generation` | Boolean | Default: `false`<br> Specifies whether the rating of an Order happens on its creation, which would slow down Order creation. |
| `billing_details` | BillingDetails | Shipment Billing Details Request object |
| `duties_taxes_billing_details` | BillingDetails | Shipment Billing Details Request object |
| `regenerate_proposed_shipments` | Boolean | Available only on `update`.<br> Regenerate (rerate Order) ProposedShipments after update. |
| `regenerate_proposed_shipments_if_changed` | Boolean | Same as `regenerate_proposed_shipments` but would trigger rerate if any field which effects rate is changed (for example: destination, items). |

### Order ReferenceNumber Object

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | String |  |
| `name` | String | If our codes do not support your needs, use `other_id` and then you can name your own reference number. |
| `value` | String | An invoice number, purchase number, and so on. |
| `code` | String | Options: <br>- `invoice_id`<br>- `customer_id`<br>- `reference_id`<br>- `purchase_id`<br>- `bol_id`<br>- `other_id` |

### Order OrderLineItem Object

Parameters are optional unless noted.

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| `id` | String | `required` for update as uniq key identifier if `source_system_id` blank. |
| `source_system_id` | String | ID of entity in external system, `required` for update as a unique key identifier if `id` blank. |
| `name` | String |  |
| `sku` | String |  |
| `upc` | String |  |
| `quantity` | Integer | Default: 1 |
| `value` | Float |  |
| `price` | Float |  |
| `currency` | String | Default: `USD` |
| `length` | Float | Length dimension. |
| `width` | Float | Width dimension. |
| `height` | Float | Height dimension. |
| `dimension_uom` | String | Options: <br>- in<br>- cm<br> Default: `in` |
| `weight` | Float |  |
| `weight_uom` | String | Options: <br>- lb<br>- kg<br> Default: `lb` |
| `item_type` | String | Options: <br>- parcel<br>- handling\_unit<br>- unpacked |
| `type_of_item` | String | Options: <br>- loose<br>- box<br>- pallet |
| `do_not_pack_with_other_items` | Boolean |  |
| `do_not_palletize` | Boolean |  |
| `do_not_pack_before_palletize` | Boolean |  |
| `handling_unit_type` | String | Only used if `item_type=handling_unit`.<br>Options: `pallet``carton``box``crate``bag``drum` |
| `hs_code` | String | Harmonized Code |
| `country_of_origin` | String |  |
| `freight_class` | String |  |
| `nmfc` | String |  |
| `package_type` | String |  |
| `package_quantity` | Integer |  |
| `volume_cubic_ft` | Float |  |
| `warehouse_id` | String |  |
| `warehouse_code` | String |  |
| `line_number` | Integer |  |
| `description` | String |  |
| `lot_number` | String |  |
| `ship_individually` | Boolean | Default: false.<br>Specifies whether each item should be shipped in a separate Shipments. |
| `orm_d` | Boolean | Deprecated! Use [hazmat\_data](https://docs.shiphawk.com/#order-hazmatdata-object) where `dangerous_goods_type` is `limited_quantity` instead of this |
| `commodity_description` | String |  |
| `meta` | Hash |  |
| `origin_address` | Address | Order Address Request object |
| `reference_numbers` | Array\[ [ReferenceNumber](https://docs.shiphawk.com/#order-referencenumber-object)\] | List of Order Line Reference Number Request objects. |
| `hazmat_data` | [HazmatData](https://docs.shiphawk.com/#order-hazmatdata-object) |  |

### Order Address Request Object

| Attribute | Type | Description |
| --- | --- | --- |
| `name` | String |  |
| `company` | String |  |
| `street1` | String |  |
| `street2` | String |  |
| `phone_number` | String |  |
| `city` | String |  |
| `state` | String |  |
| `country` | String | Default: `US` |
| `zip` | String |  |
| `email` | String |  |
| `code` | String |  |
| `is_residential` | Boolean | Default: `false` |

### Order Line Reference Numbers Request Object

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | String |  |
| `name` | String | If our codes do not support your needs, use `other_id` and then you can name your own reference number. |
| `value` | String | An invoice number, purchase number, and so on. |
| `code` | String | Options: <br>- `invoice_id`<br>- `customer_id`<br>- `reference_id`<br>- `purchase_id`<br>- `bol_id`<br>- `other_id` |
| `external_code` | String |  |

### Inventory Identifier Request Object

```
// Inventory Identfiers array example
[\
    { "code": "ML31", "source_system_id": "544", "type": "SerialNumber" },\
    { "code": "ML32", "source_system_id": "545", "type": "SerialNumber" }\
]
```

```
{
    // Context example
    // # ...,
    "order_line_items": [\
        {\
            "name": "1.5 inch display and 4x zoom",\
            "sku": "CAM00002",\
            "source_system_id": "1",\
            "line_number": "1",\
            "quantity": 2,\
            "weight": "0.5",\
            "warehouse_code": "CA",\
            "meta": {},\
            "inventory_identifiers": [\
                { "code": "ML31", "source_system_id": "544", "type": "SerialNumber" },\
                { "code": "ML32", "source_system_id": "545", "type": "SerialNumber" }\
            ]\
\
        }\
    ]
    // ...,
}
```

```
{
    // Context example LOT NUMBERS
    // # ...,
    "order_line_items": [\
        {\
            "name": "1.5 inch display and 4x zoom",\
            "sku": "LOT00001",\
            "source_system_id": "1",\
            "line_number": "1",\
            "quantity": 3,\
            "weight": "0.5",\
            "warehouse_code": "CA",\
            "meta": {},\
            "inventory_identifiers": [\
                { "code": "LOT1", "source_system_id": "544", "type": "LotNumber" },\
                { "code": "LOT1", "source_system_id": "544", "type": "LotNumber" },\
                { "code": "LOT1", "source_system_id": "544", "type": "LotNumber" }\
            ]\
\
        }\
    ]
    // ...,
}
```

| Attribute | Type | Description |
| --- | --- | --- |
| `type` | String | Options: <br>- `SerialNumber`<br>- `LotNumber` |
| `code` | String | SerialNumber/LotNumber value, for example: `SR0015` |
| `source_system_id` | String | ID of inventory identifier in the source system (NetSuite/Shopify/etc) |

### Source System Meta Request Object

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| `status` | String |  |
| `channel` | String |  |

### Order Response Object

```
{
    "id": "ord_K3JZv43A",
    "order_number": "ORD10100111",
    "combined_order_numbers": [],
    "source_system": "ShipHawk eComm",
    "source_system_id": "SH123",
    "source": "Proprietary",
    "source_system_meta": {},
    "source_system_meta_status": "Awaiting Shipment",
    "source_system_meta_channel": "Facebook",
    "source_system_meta_domain": "myshop.myshopify.com",
    "integration_name": null,
    "source_system_processed_at": "2016-03-01T00:00:00+00:00",
    "origin_address": {
        "name": "Mike Richardson",
        "company": "ShipHawk",
        "street1": "1234 Main St.",
        "street2": null,
        "city": "Virginia Beach",
        "state": "VA",
        "zip": "23454",
        "country": "US",
        "phone_number": "805-335-2432",
        "email": "mikel@shiphawk.com",
        "is_residential": false
    },
    "destination_address": {
        "name": "George Chapman",
        "company": "Hawk Apps",
        "street1": "1234 Main St.",
        "street2": null,
        "city": "Ventura",
        "state": "CA",
        "zip": "93001",
        "country": "US",
        "phone_number": "805-770-1642",
        "email": "george@shiphawk.com",
        "is_residential": false,
        "is_po_box": false
    },
    "billing_address": {
        "name": "John Doe",
        "company": "Hawk Apps",
        "street1": "1234 Main St.",
        "street2": null,
        "city": "New York",
        "state": "NY",
        "zip": "10029",
        "country": "US",
        "phone_number": "805-888-1234",
        "email": "john@shiphawk.com",
        "is_residential": false,
    },
    "alternate_return_address": {
        "name": "John Doe",
        "company": "Hawk Apps",
        "street1": "1234 Main St.",
        "street2": null,
        "city": "New York",
        "state": "NY",
        "zip": "10029",
        "country": "US",
        "phone_number": "805-888-1234",
        "email": "john@shiphawk.com",
        "is_residential": false,
    },
    "destination_address_original": {
            "name": "George Chapman",
            "company": "Hawk Apps",
            "street1": "1234 Main St.",
            "street2": null,
            "city": "Ventura",
            "state": "CA",
            "zip": "93001",
            "country": "US",
            "phone_number": "805-770-1642",
            "email": "john@shiphawk.com",
            "is_residential": false,
    },
    "destination_address_suggested": null,
    "reference_numbers": [\
        {\
            "id": "shpr_q1BB1hVy",\
            "code": "purchase_id",\
            "value": "191919",\
            "name": "Purchase Order #"\
        },\
        {\
            "id": "shpr_G7JQn8Q5",\
            "code": "reference_id",\
            "value": "787878",\
            "name": "Shipper's Order #"\
        }\
    ],
    "currency": "USD",
    "total_price": 1000,
    "shipping_price": 800,
    "tax_price": 50,
    "items_price": 150,
    "order_line_items": [],
    "requested_shipping_details": "FedEx Ground",
    "requested_rate_id": "01004c4c-da3c-48ff-b2e7-2f44389077e8",
    "status": "new",
    "include_return_label": false,
    "cancelled_at": null,
    "created_at": "2019-01-24T23:16:34+00:00",
    "updated_at": "2019-01-24T23:16:34+00:00",
    "error_message": [],
    "batch_id": null,
    "batch_name": null,
    "requested_billing_details": null,
    "tags": [],
    "warehouse": null,
    "packing_slip_template": null,
    "single_sku": "1234",
    "single_sku_name": "(None)",
    "skus_count": null,
    "hold_until": null,
    "integration_id": null,
    "shipments": [],
    "proposed_shipments": [],
    "notes": [],
    "documents": [\
        {\
            "id": "doc_haEz8ker",\
            "customer_uploaded": false,\
            "type": "Pick Ticket",\
            "extension": "PDF",\
            "code": "pick_ticket",\
            "url": "https://shiphawk-assets-qa.s3.amazonaws.com/uploads/pick_ticket_646acda37ccd1341b8579a59bdd62730.pdf?AWSAccessKeyId=AKIAIGBEYNQ6VGNFN2GQ&Signature=sPF6%2B5MVtbvxzOAPdoStKg%2Bu8Kk%3D&Expires=1864013115",\
            "meta_data": {},\
            "created_at": "2019-01-24T23:16:37.349+00:00",\
            "filename": "pick_ticket_646acda37ccd1341b8579a59bdd62730.pdf"\
        }\
    ],
    "shipped_order_line_items": [],
    "not_shipped_order_line_items": [\
        {\
            "id": "ordi_QdFvV0J7",\
            "source_system_id": "SH123",\
            "origin_order_source_system_id": null,\
            "origin_order_number": null,\
            "name": null,\
            "description": null,\
            "sku": "1234",\
            "upc": null,\
            "quantity": 1,\
            "value": 251,\
            "length": 11,\
            "width": 11,\
            "height": 11,\
            "dimension_uom": "in",\
            "weight": 0.938,\
            "weight_uom": "lb",\
            "freight_class": null,\
            "package_quantity": null,\
            "package_type": null,\
            "item_type": "parcel",\
            "unpacked_item_type_id": null,\
            "handling_unit_type": null,\
            "hs_code": null,\
            "country_of_origin": null,\
            "lot_number": null,\
            "serial_number": null,\
            "line_number": null,\
            "warehouse_id": null,\
            "warehouse_code": null,\
            "origin_address": null,\
            "error_message": null,\
            "reference_numbers": [],\
            "nmfc": null,\
            "hazmat_data": null\
        }\
    ],
    "integration_code" : null,
    "single_bin_number": "(None)",
    "is_prime": false,
    "channel_name": "amazon",
    "channel_domain": "amazon.com",
    "channel_order_id": "112-1234567-1234567",
    "shipped_line_item_skus": [],
    "not_shipped_line_item_skus": [\
        {\
            "id": "lis_9VCx4GeY",\
            "quantity": 1,\
            "sku": "1234"\
        }\
    ]
}
```

Returned from Order creation, updating, retrieval, etc.

| Attributes | Type | Description |
| --- | --- | --- |
| `id` | String | ShipHawk Order identifier. |
| `order_number` | String |  |
| `combined_order_numbers` | Array\[String\] | List of Order Line Item origin order numbers. |
| `source_system` | String | Source system (such as "NetSuite", "Shopify", "Magento", and so on). |
| `source_system_id` | String |  |
| `source` | String | Source represents where the order came from. It can be as simple as "API" or "Manual" or "John Smith" as a way to tag how this order was triggered. |
| `source_system_meta` | hash |  |
| `source_system_meta_channel` | String | Example: 'Facebook' |
| `source_system_meta_status` | String | Example: 'Awaiting Shipment' |
| `source_system_meta_domain` | String | Example: 'myshop.myshopify.com' |
| `integration_name` | String |  |
| `source_system_processed_at` | DateTime |  |
| `origin_address` | hash | Address object. |
| `destination_address` | hash | Address object. |
| `alternate_return_address` | [Address](https://docs.shiphawk.com/#address-object) | Order Address Request object for alternate return address |
| `destination_address_original` | [Address](https://docs.shiphawk.com/#address-object) | Original destination address |
| `destination_address_suggested` | [Address](https://docs.shiphawk.com/#suggested-address-response) | Suggested destination address |
| `nested_order_line_items` | Array\[ [NestedOrderLineItem](https://docs.shiphawk.com/#order-nested-order-line-item-response-object)\] | List of Order Line item request objects in nested format. |
| `billing_address` | hash | Address object. |
| `reference_numbers` | array | List of Order Reference Number Response objects. |
| `currency` | String | Order currency code |
| `total_price` | float |  |
| `shipping_price` | float |  |
| `tax_price` | float |  |
| `items_price` | float |  |
| `order_line_items` | array | List of Order Line Item Response objects. |
| `requested_shipping_details` | String |  |
| `requested_rate_id` | String |  |
| `status` | String |  |
| `include_return_label` | boolean |  |
| `cancelled_at` | DateTime |  |
| `created_at` | DateTime |  |
| `updated_at` | DateTime |  |
| `error_message` | Array\[String\] |  |
| `batch_id` | String | Order batch identifier |
| `batch_name` | String | Order batch name |
| `requested_billing_details` | hash | Shipment Billing Details Response object |
| `tags` | Array\[String\] |  |
| `warehouse` | hash | Warehouse object |
| `packing_slip_template` | hash | Packing Slip Template object |
| `single_sku` | String | One of: `(None)``(Multiple Items)` a single SKU (if the order has a single Order Line Item with a SKU). |
| `single_sku_name` | String | One of: `(None)``(Multiple Items)` a single SKU (if the order has a single Order Line Item with a SKU). |
| `hold_until` | DateTime |  |
| `integration_id` | integer |  |
| `shipments` | array | List of Shipment objects |
| `proposed_shipments` | array | List of Proposed Shipment objects. |
| `notes` | array | List of Note objects |
| `documents` | Array\[ [Document](https://docs.shiphawk.com/#document-object)\] | List of Document objects |
| `shipped_order_line_items` | array | List of Order Line Item objects. |
| `not_shipped_order_line_items` | array | List of Order Line Item objects. |
| `integration_code` | String | Ingegartion system code (like as 'net\_suite') |
| `single_bin_number` | String | Options: <br>- (None)<br>- Bin number<br>- (Multiple Bins) |
| `is_prime` | Boolean |  |
| `channel_name` | String |  |
| `channel_domain` | String |  |
| `channel_order_id` | String |  |
| `shipped_line_item_skus` | Array\[ [LineItemSku](https://docs.shiphawk.com/#line-item-sku-response-object)\] | List of SKUs of shipped line items. |
| `not_shipped_line_item_skus` | Array\[ [LineItemSku](https://docs.shiphawk.com/#line-item-sku-response-object)\] | List of SKUs of not shipped line items. |

### Order Line Item Response Object

```
{
    "id": "ordi_QdFvV0J7",
    "source_system_id": "SH123",
    "origin_order_source_system_id": null,
    "origin_order_number": null,
    "name": null,
    "description": null,
    "sku": "1234",
    "upc": null,
    "quantity": 1,
    "value": 251,
    "currency": "USD",
    "length": 11,
    "width": 11,
    "height": 11,
    "dimension_uom": "in",
    "weight": 0.938,
    "weight_uom": "lb",
    "freight_class": null,
    "package_quantity": null,
    "package_type": null,
    "item_type": "parcel",
    "unpacked_item_type_id": null,
    "handling_unit_type": null,
    "hs_code": null,
    "country_of_origin": null,
    "lot_number": null,
    "serial_number": null,
    "line_number": null,
    "warehouse_id": null,
    "warehouse_code": null,
    "origin_address": null,
    "error_message": null,
    "reference_numbers": [],
    "nmfc": null,
    "hazmat_data": null,
    "channel_item_id": null,
    "bin_number": null,
    "line_item_skus": []
}
```

| Attributes | Type | Description |
| --- | --- | --- |
| `id` | String |  |
| `source_system_id` | String |  |
| `origin_order_source_system_id` | String | In the case of combined shipments, this line item's original order source system. |
| `origin_order_number` | String | In the case of combined shipments, this line item's original order number. |
| `name` | String |  |
| `description` | String |  |
| `sku` | String |  |
| `upc` | String |  |
| `quantity` | float |  |
| `value` | float |  |
| `currency` | String |  |
| `length` | float |  |
| `width` | float |  |
| `height` | float |  |
| `dimension_uom` | String |  |
| `weight` | float |  |
| `weight_uom` | String |  |
| `freight_class` | String |  |
| `package_quantity` | integer |  |
| `package_type` | String |  |
| `item_type` | String |  |
| `unpacked_item_type_id` | String |  |
| `handling_unit_type` | String |  |
| `hs_code` | String |  |
| `country_of_origin` | String |  |
| `lot_number` | String |  |
| `serial_number` | String |  |
| `line_number` | integer |  |
| `warehouse_id` | String |  |
| `warehouse_code` | String |  |
| `origin_address` | hash | Address Object |
| `error_message` | String |  |
| `reference_numbers` | array | List of Order Reference Numbers Response Objects. |
| `nmfc` | String |  |
| `hazmat_data` | [HazmatData](https://docs.shiphawk.com/#order-hazmatdata-object) |  |
| `channel_item_id` | String | Identifier of the item in the sales channel (e.g., Shopify, Amazon) |
| `bin_number` | String | Bin or storage location identifier in warehouse |
| `line_item_skus` | Array | Array of SKUs linked to this line item (used for kits or bundles) |

### Order Nested Order Line Item Response Object

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| `public_id` | String | Unique internal identifier for the line item. |
| `source_system_id` | String | ID of the entity in an external system. |
| `channel_item_id` | String | Identifier of the item in the sales channel (e.g., Shopify, Amazon). |
| `origin_order_source_system_id` | String | Source system ID of the original order. |
| `origin_order_number` | String | Original order number from the external system. |
| `name` | String | Item name. |
| `description` | String | Detailed item description. |
| `item_type` | String | Type of item. Options: `parcel`, `handling_unit`, `unpacked`. |
| `sku` | String |  |
| `upc` | String |  |
| `quantity` | Integer | Quantity of the item. |
| `value` | Float | Declared or commercial value of the item. |
| `length` | Float | Length dimension. |
| `width` | Float | Width dimension. |
| `height` | Float | Height dimension. |
| `weight` | Float | Weight of the item. |
| `freight_class` | String | Freight class code. |
| `package_quantity` | Integer | Quantity of packages that contain this item. |
| `package_type` | String | Packaging type (e.g., box, pallet, crate). |
| `unpacked_item_type_id` | String | Identifier of unpacked item type. |
| `handling_unit_type` | String | Handling unit type (e.g., pallet). |
| `hs_code` | String | Harmonized System Code. |
| `country_of_origin` | String | Country of origin. |
| `lot_number` | String | Lot or batch number. |
| `serial_number` | String | Serial number for serialized items. |
| `line_number` | Integer | Line number in the order. |
| `origin_address` | Address | Origin address for the item. |
| `reference_numbers` | Array\[ [ReferenceNumber](https://docs.shiphawk.com/#order-referencenumber-object)\] | List of reference numbers associated with this line item. |
| `warehouse_id` | String | Public ID of the warehouse from which the item ships. |
| `warehouse_code` | String | Warehouse code. |
| `nmfc` | String | NMFC code (National Motor Freight Classification). |
| `orm_d` | Boolean | Indicates limited quantity hazmat (deprecated, prefer `hazmat_data.dangerous_goods_type = limited_quantity`). |
| `hazmat_data` | [HazmatData](https://docs.shiphawk.com/#order-hazmatdata-object) | Hazardous material information. |
| `bin_number` | String |  |
| `line_item_skus` | Array | Array of SKUs linked to this line item (used for kits or bundles). |
| `kit_components` | Array\[ [OrderLineItem](https://docs.shiphawk.com/#order-orderlineitem-object)\] | Nested component items if this line is a kit. |
| `is_kit` | Boolean | Indicates whether the line item is a kit. |

### Order Reference Numbers Response Object

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | String |  |
| `code` | String | One of: `invoice_id``customer_id``reference_id``purchase_id``bol_id` or `other_id` |
| `value` | String | An invoice number, purchase number, and so on. |
| `name` | String |  |

### Split Order async Response Object

```
{
    "id": "skjob_mh7vQtVQ",
    "error_message": null,
    "meta": {
        "original_order_id": "ord_2E1pWGRh",
        "new_order_number": "ord_kogf4GhR",
        "move_to_order_id": null
    },
    "meta_search": {},
    "status": "unprocessed",
    "type": null,
    "created_at": "2020-10-05T08:21:06.378+00:00",
    "started_at": null,
    "finished_at": null
}
```

[Job Tracker Object](https://docs.shiphawk.com/#job-tracker-response-object)

"skjob\_mh7vQtVQ" is a Job Tracker Object id

Once splitting is finished, Job Tracker status will be `finished`

Please use [Job Tracker Endpoint](https://docs.shiphawk.com/#job-tracker-api-endpoints) to get updates about the Split process.

### Split Order async Order Line Item Object

```
{
    "id": "ordi_mh7vQtVQ",
    "quantity": 1,
}
```

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String | `required` |
| quantity | Integer | `required` |

### Combine Order async Response Object

```
{
    "id": "skjob_mh7vQtVQ",
    "error_message": null,
    "meta": {
        "master_order_id": "ord_EwpPBxf8",
        "all_order_ids": ["ord_8CS2CvEy", "ord_XZWspyTk"],
    },
    "meta_search": {},
    "status": "unprocessed",
    "type": null,
    "created_at": "2020-10-05T08:21:06.378+00:00",
    "started_at": null,
    "finished_at": null
}
```

[Job Tracker Object](https://docs.shiphawk.com/#job-tracker-response-object)

"skjob\_mh7vQtVQ" is a Job Tracker Object id.

Once splitting is finished, Job Tracker status will be `finished`.

Please use [Job Tracker Endpoint](https://docs.shiphawk.com/#job-tracker-api-endpoints) to get updates about the Combine process.

### Line Item Sku response object

```
{
    "id": "lis_9VCx4GeY",
    "quantity": 1,
    "sku": "CAM00007",
}
```

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String |  |
| quantity | Integer |  |
| sku | String |  |

### Order HazmatData Object

```
Example: Hazmat
{
    "container": "Fiberboard Box",
                "additional_description": "some additional description",
                "emergency_contact_phone_number": "800-424-9300",
                "battery_types": [],
                "packing_group": "II",
                "emergency_response_phone_number": null,
                "amount_unit": "l",
                "technical_name": "Propanone",
                "regulation_set": "CFR",
                "proper_shipping_name": "Acetone",
                "hazard_class_or_division": "3",
                "transportation_mode": "ground",
                "amount": "1",
                "emergency_contact_name": "CHEMTREC",
                "dangerous_goods_type": "hazmat",
                "packing_instructions": null,
                "un_or_na_number": "UN1090"
    // ...,
    "hazmat_data": {
        "dangerous_goods_type":            "hazmat",
        "un_or_na_number":                 "UN1090",
        "proper_shipping_name":            "Acetone",
        "technical_name":                  "Propanone",
        "hazard_class_or_division":        "3",
        "packing_group":                   "II",
        "container":                       "Fiberboard Box",
        "amount":                          "10",
        "amount_unit":                     "L",
        "regulation_set":                  "CFR",
        "transportation_mode":             "ground",
        "emergency_contact_name":          "CHEMTREC (USA) CCN 1883",
        "emergency_contact_phone_number":  "800-424-9300",
        "additional_description":          "some additional description",
        "battery_types": [],
    },
    // ...,
}
```

```
Example: Limited Quantity
{
    // ...,
    "hazmat_data": {
        "dangerous_goods_type": "limited_quantity"
    },
    // ...,
}
```

```
Example: Excepted Quantity
{
    // ...,
    "hazmat_data": {
        "dangerous_goods_type": "excepted_quantity"
    },
    // ...,
}
```

```
Example: Lithium Batteries
{
    // ...,
    "hazmat_data": {
        "dangerous_goods_type": "lithium_batteries",
        "battery_types": ["lithium_ion_packed_with_equipment"]
    },
    // ...,
}
```

| Parameter | Type | Description |
| --- | --- | --- |
| `dangerous_goods_type` | String | One of: `hazmat``limited_quantity``excepted_quantity``lithium_batteries` |
| `battery_types` | Array | Required if `dangerous_goods_type` is `lithium_batteries`. List of Battery Types: `lithium_ion_packed_with_equipment``lithium_ion_contained_in_equipment``lithium_metal_packed_with_equipment``lithium_metal_contained_in_equipment``lithium_metal_stand_alone``lithium_ion_stand_alone` |
| `un_or_na_number` | String | Required if `dangerous_goods_type` is `hazmat`. |
| `proper_shipping_name` | String | Required if `dangerous_goods_type` is `hazmat`. |
| `technical_name` | String | Required if `dangerous_goods_type` is `hazmat`. |
| `hazard_class_or_division` | String | Required if `dangerous_goods_type` is `hazmat`. |
| `packing_group` | String | Required if `dangerous_goods_type` is `hazmat`. |
| `emergency_contact_name` | String | Required if `dangerous_goods_type` is `hazmat`. |
| `emergency_contact_phone_number` | String | Required if `dangerous_goods_type` is `hazmat`. |
| `regulation_set` | String | Required if `dangerous_goods_type` is `hazmat`. |
| `container` | String | Required if `dangerous_goods_type` is `hazmat`. |
| `amount` | Float | Required if `dangerous_goods_type` is `hazmat`. |
| `amount_unit` | String | Required if `dangerous_goods_type` is `hazmat`. One of: `kg``lbs``oz``l` |
| `transportation_mode` | String | Required if `dangerous_goods_type` is `hazmat`. One of: `ground``passenger_aircraft``cargo_aircraft_only` |
| `packing_instructions` | String | Required if `dangerous_goods_type` is `hazmat`. |
| `additional_description` | String | Required if `dangerous_goods_type` is `hazmat`. |

## Order API Endpoints

### Create an Order

```
curl -H "Content-Type: application/json" -X POST -d '
{
    "order_number": "ORD10100111",
    "source_system": "ShipHawk eComm",
    "source_system_id": "SH123",
    "source": "Proprietary",
    "source_system_processed_at": "2016-03-01",
    "origin_address": {
        "name": "Mike Richardson",
        "company": "ShipHawk",
        "street1": "1234 Main St.",
        "city": "Virginia Beach",
        "state": "VA",
        "zip": "234545",
        "phone_number":"805-335-2432",
        "email":"mikel@shiphawk.com"
    },
    "destination_address": {
        "name": "George Chapman",
        "company": "Hawk Apps",
        "street1": "1234 Main St.",
        "city": "Ventura",
        "state": "California",
        "zip": "93001",
        "phone_number":"805-770-1642",
        "email":"george@shiphawk.com"

},
    "billing_address": {
        "name": "John Doe",
        "company": "Hawk Apps",
        "street1": "1234 Main St.",
        "city": "New York",
        "state": "NY",
        "zip": "10029",
        "country": "US",
        "phone_number": "805-888-1234",
        "email": "john@shiphawk.com"
    },
    "order_line_items": [\
        {\
            "source_system_id": "SH123",\
            "name": "",\
            "sku": "1234",\
            "quantity": 1,\
            "value": 251.00,\
            "currency": "USD",\
            "length": 11.0,\
            "width": 11.0,\
            "height": 11.0,\
            "weight": 15.0,\
            "item_type": "parcel"\
        }\
    ],
    "reference_numbers": [\
        {\
            "code": "reference_id",\
            "name":  "Reference ID",\
            "value": "787878"\
        },\
        {\
            "code": "purchase_id",\
            "name":  "Purchase Order #",\
            "value": "191919"\
        }\
    ],
    "currency": "USD",
    "total_price": 1000,
    "shipping_price": 800,
    "tax_price": 50,
    "items_price": 150,
    "status": "new",
    "requested_shipping_details": "FedEx Ground",
    "requested_rate_id": "01004c4c-da3c-48ff-b2e7-2f44389077e8"
}' 'https://sandbox.shiphawk.com/api/v4/orders?api_key=YOUR_API_KEY'
```

```
require 'net/http'
require 'uri'
require 'json'

uri = URI.parse('https://sandbox.shiphawk.com/api/v4/orders/?api_key=YOUR_API_KEY')

order =
'{
    "order_number": "ORD10100111",
    "source_system": "ShipHawk eComm",
    "source_system_id": "SH123",
    "source": "Proprietary",
    "source_system_processed_at": "2016-03-01",
    "origin_address": {
        "name": "Mike Richardson",
        "company": "ShipHawk",
        "street1": "1234 Main St.",
        "city": "Virginia Beach",
        "state": "VA",
        "zip": "234545",
        "phone_number":"805-335-2432",
        "email":"mikel@shiphawk.com"
    },
    "destination_address": {
        "name": "George Chapman",
        "company": "Hawk Apps",
        "street1": "1234 Main St.",
        "city": "Ventura",
        "state": "California",
        "zip": "93001",
        "phone_number":"805-770-1642",
        "email":"george@shiphawk.com"
    },
    "billing_address": {
        "name": "John Doe",
        "company": "Hawk Apps",
        "street1": "1234 Main St.",
        "city": "New York",
        "state": "NY",
        "zip": "10029",
        "country": "US",
        "phone_number": "805-888-1234",
        "email": "john@shiphawk.com"
    },
    "order_line_items": [\
        {\
            "source_system_id": "SH123",\
            "name": "",\
            "sku": "1234",\
            "quantity": 1,\
            "value": 251.00,\
            "currency": "USD",\
            "length": 11.0,\
            "width": 11.0,\
            "height": 11.0,\
            "weight": 15.0,\
            "item_type": "parcel"\
        }\
    ],
    "reference_numbers": [\
        {\
            "code":  "reference_id",\
            "name":  "Reference ID",\
            "value": "787878"\
        },\
        {\
            "code": "purchase_id",\
            "name":  "Purchase Order #",\
            "value": "191919"\
        }\
    ],
    "currency": "USD",
    "total_price": 1000,
    "shipping_price": 800,
    "tax_price": 50,
    "items_price": 150,
    "status": "new",
    "requested_shipping_details": "FedEx Ground",
    "requested_rate_id": "01004c4c-da3c-48ff-b2e7-2f44389077e8"
}'

# Create the HTTP objects
request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
request.body = order

# Send the request
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
    http.request(request)
end

puts response.body
```

```
import requests
import json

url = 'https://sandbox.shiphawk.com/api/v4/orders'
headers = {'X-Api-Key': 'YOUR_API_KEY'}
payload = {
    "order_number": "ORD10100111",
    "source_system": "ShipHawk eComm",
    "source_system_id": "SH123",
    "source": "Proprietary",
    "source_system_processed_at": "2016-03-01",
    "origin_address": {
        "name": "Mike Richardson",
        "company": "ShipHawk",
        "street1": "1234 Main St.",
        "city": "Virginia Beach",
        "state": "VA",
        "zip": "234545",
        "phone_number":"805-335-2432",
        "email":"mikel@shiphawk.com"
    },
    "destination_address": {
        "name": "George Chapman",
        "company": "Hawk Apps",
        "street1": "1234 Main St.",
        "city": "Ventura",
        "state": "California",
        "zip": "93001",
        "phone_number":"805-770-1642",
        "email":"george@shiphawk.com"
    },
    "billing_address": {
        "name": "John Doe",
        "company": "Hawk Apps",
        "street1": "1234 Main St.",
        "city": "New York",
        "state": "NY",
        "zip": "10029",
        "country": "US",
        "phone_number": "805-888-1234",
        "email": "john@shiphawk.com"
    },
    "order_line_items": [\
        {\
            "source_system_id": "SH123",\
            "name": "",\
            "sku": "1234",\
            "quantity": 1,\
            "value": 251.00,\
            "currency": "USD",\
            "length": 11.0,\
            "width": 11.0,\
            "height": 11.0,\
            "weight": 15.0,\
            "item_type": "parcel"\
        }\
    ],
    "reference_numbers": [\
        {\
            "code": "reference_id",\
            "name": "Reference ID",\
            "value": "787878"\
        },\
        {\
            "code": "purchase_id",\
            "name": "Purchase Order #",\
            "value": "191919"\
        }\
    ],
    "currency": "USD",
    "total_price": 1000,
    "shipping_price": 800,
    "tax_price": 50,
    "items_price": 150,
    "status": "new",
    "requested_shipping_details": "FedEx Ground",
    "requested_rate_id": "01004c4c-da3c-48ff-b2e7-2f44389077e8"
}

r = requests.post(url, headers=headers, json=payload)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;
import javax.json.*;
import javax.script.*;

public class PostRequests {
    public static void main(String [] args)
    {
        try{
            sendPost();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendPost() throws IOException {
        JsonObject personObject = Json.createObjectBuilder()
                .add("order_number", "ORD10100111")
                .add("source_system", "ShipHawk eComm")
                .add("source_system_id", "SH123")
                .add("source", "Proprietary")
                .add("source_system_processed_at", "2016-03-01")
                .add("origin_address", Json.createObjectBuilder()
                    .add("name", "Mike Richardson")
                    .add("company", "ShipHawk")
                    .add("street1", "1234 Main St.")
                    .add("city", "Virginia Beach")
                    .add("state", "VA")
                    .add("zip", "234545")
                    .add("phone_number", "805-335-2432")
                    .add("email", "mikel@shiphawk.com")
                    )
                .add("destination_address", Json.createObjectBuilder()
                    .add("name", "George Chapman")
                    .add("company", "Hawk Apps")
                    .add("street1", "1234 Main St.")
                    .add("city", "Ventura")
                    .add("state", "California")
                    .add("zip", "93001")
                    .add("phone_number", "805-770-1642")
                    .add("email", "george@shiphawk.com")
                    )
                .add("order_line_items", Json.createArrayBuilder()
                    .add(Json.createObjectBuilder()
                        .add("source_system_id", "SH123")
                        .add("name", "")
                        .add("sku", "1234")
                        .add("quantity", 1)
                        .add("value", 251.00)
                        .add("currency", "USD")
                        .add("length", 11.0)
                        .add("width", 11.0)
                        .add("height", 11.0)
                        .add("weight", 15.0)
                        .add("item_type", "parcel")
                        )
                    )
                .add("reference_numbers", Json.createArrayBuilder()
                    .add(Json.createObjectBuilder()
                        .add("code", "reference_id")
                        .add("name", "Reference ID")
                        .add("value", "787878")
                        )
                    .add(Json.createObjectBuilder()
                        .add("code", "purchase_id")
                        .add("name", "Purchase Order #")
                        .add("value", "191919")
                        )
                    )
                .add("currency", "USD")
                .add("total_price", "1000")
                .add("shipping_price", "800")
                .add("tax_price", "50")
                .add("items_price", "150")
                .add("status", "new")
                .add("requested_shipping_details", "FedEx Ground")
                .add("requested_rate_id", "01004c4c-da3c-48ff-b2e7-2f44389077e8")
                .build();
        try{
            // For formatting json object to be readable
            ScriptEngineManager manager = new ScriptEngineManager();
            ScriptEngine scriptEngine = manager.getEngineByName("JavaScript");
            scriptEngine.put("jsonString", personObject.toString());
            scriptEngine.eval("result = JSON.Stringify(JSON.parse(jsonString), null, 2)");
            String prettyPrintedJson = (String) scriptEngine.get("result");

URL url = new URL("https://sandbox.shiphawk.com/api/v4/orders?api_key=YOUR_API_KEY");
            HttpURLConnection con = (HttpURLConnection) url.openConnection();
            con.setRequestMethod("POST");
            con.setRequestProperty("Content-Type", "application/json");
            con.setDoOutput(true);
            OutputStream os = con.getOutputStream();
            os.write(personObject.toString().getBytes());
            os.flush();
            os.close();

int responseCode = con.getResponseCode();

> Request: `POST /api/v4/orders`

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| order\_number | String | `required` |
| source\_system | String | Source system (such as "NetSuite", "Shopify", "Magento", and so on). |
| source\_system\_id | String | \* |
| source\_system\_processed\_at | DateTime | \* |
| origin\_address | [Address](https://docs.shiphawk.com/#address-object) | Order Address Request object |
| destination\_address | [Address](https://docs.shiphawk.com/#address-object) | Order Address Request object |
| billing\_address | [Address](https://docs.shiphawk.com/#address-object) | Order Address Request object |
| order\_line\_items | Array\[ [Order Line item](https://docs.shiphawk.com/#order-orderlineitem-object)\] | List of Order Line item request objects. |
| reference\_numbers | Array\[ReferenceNumber\] | List of Reference Number Request objects. |
| currency | String | Order currency code. |
| total\_price | Float | Price presented to customer of an Order. |
| shipping\_price | Float |  |
| tax\_price | Float |  |
| items\_price | Float |  |
| status | String | Options: <br>- new _(default)_<br>- partially\_shipped<br>- shipped<br>- delivered<br>- cancelled<br>- on\_hold<br>- picking |
| requested\_shipping\_details | String | Can be used in rules for building criteria. Usually looks like "Carrier - Service" pair. |
| requested\_rate\_id | String or Array\[String\] | The RateId that is returned from /rates endpoint. If provided on Order creation, Order will use data from Rate (like Carrier/Service). |
| `inventory_identifiers` | Array\[ [InventoryIdentifier](https://docs.shiphawk.com/#inventory-identifier-request-object)\] | List of Inventory Identifiers (Serial/Lot) Number Request objects. This option is also available during an `order update`. |

> Response: [order-response-object](https://docs.shiphawk.com/#order-response-object)

### Update an Order

```
#'ord_DqKvSb9M' is an example order id.
curl -H "Content-Type: application/json" -X POST -d '
{
    "order_number": "ORD10100111",
    "source_system": "ShipHawk eComm",
    "source_system_id": "SH123",
    "source": "Proprietary",
    "source_system_processed_at": "2016-03-01",
    "origin_address": {
        "name": "Mike Richardson",
        "company": "ShipHawk",
        "street1": "1234 Main St.",
        "city": "Virginia Beach",
        "state": "VA",
        "zip": "234545",
        "phone_number":"805-335-2432",
        "email":"mikel@shiphawk.com"
    },
    "destination_address": {
        "name": "George Chapman",
        "company": "Hawk Apps",
        "street1": "1234 Main St.",
        "city": "Ventura",
        "state": "California",
        "zip": "93001",
        "phone_number":"805-770-1642",
        "email":"george@shiphawk.com"
    },
    "billing_address": {
        "name": "John Doe",
        "company": "Hawk Apps",
        "street1": "1234 Main St.",
        "city": "New York",
        "state": "NY",
        "zip": "10029",
        "country": "US",
        "phone_number": "805-888-1234",
        "email": "john@shiphawk.com"
    },
    "order_line_items": [\
        {\
            "source_system_id": "SH123",\
            "name": "",\
            "sku": "1234",\
            "quantity": 1,\
            "value": 251.00,\
            "length": 11.0,\
            "width": 11.0,\
            "height": 11.0,\
            "weight": 15.0,\
            "item_type": "parcel"\
        }\
    ],
    "reference_numbers": [\
        {\
            "code": "reference_id",\
            "name":  "Reference ID",\
            "value": "787878"\
        },\
        {\
            "code": "purchase_id",\
            "name": "Purchase Order #",\
            "value": "191919"\
        }\
    ],
    "total_price": 1000,
    "shipping_price": 800,
    "tax_price": 50,
    "items_price": 150,
    "status": "new",
    "requested_shipping_details": "FedEx Ground",
    "requested_rate_id": "01004c4c-da3c-48ff-b2e7-2f44389077e8"
}' 'https://sandbox.shiphawk.com/api/v4/orders/ord_DqKvSb9M?api_key=YOUR_API_KEY'
```

```
require 'net/http'
require 'uri'
require 'json'

#'ord_c5Py82JD' is an example order id.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/orders/ord_c5Py82JD?api_key=YOUR_API_KEY')

order =
'{
    "order_number": "ORD101001111",
    "source_system": "ShipHawk eComm",
    "source_system_id": "SH123",
    "source": "Proprietary",
    "source_system_processed_at": "2016-03-01",
    "origin_address": {
        "name": "Mike Richardson",
        "company": "ShipHawk",
        "street1": "1234 Main St.",
        "city": "Virginia Beach",
        "state": "VA",
        "zip": "234545",
        "phone_number":"805-335-2432",
        "email":"mikel@shiphawk.com"
    },
    "destination_address": {
        "name": "George Chapman",
        "company": "Hawk Apps",
        "street1": "1234 Main St.",
        "city": "Ventura",
        "state": "California",
        "zip": "93001",
        "phone_number":"805-770-1642",
        "email":"george@shiphawk.com"
    },
    "billing_address": {
        "name": "John Doe",
        "company": "Hawk Apps",
        "street1": "1234 Main St.",
        "city": "New York",
        "state": "NY",
        "zip": "10029",
        "country": "US",
        "phone_number": "805-888-1234",
        "email": "john@shiphawk.com"
    },
    "order_line_items": [\
        {\
            "source_system_id": "SH123",\
            "name": "",\
            "sku": "1234",\
            "quantity": 1,\
            "value": 251.00,\
            "length": 11.0,\
            "width": 11.0,\
            "height": 11.0,\
            "weight": 15.0,\
            "item_type": "parcel"\
        }\
    ],
    "reference_numbers": [\
        {\
            "code": "reference_id",\
            "name": "Reference ID",\
            "value": "787878"\
        },\
        {\
            "code": "purchase_id",\
            "name": "Purchase Order #",\
            "value": "191919"\
        }\
    ],
    "total_price": 1000,
    "shipping_price": 800,
    "tax_price": 50,
    "items_price": 150,
    "status": "new",
    "requested_shipping_details": "FedEx Ground",
    "requested_rate_id": "01004c4c-da3c-48ff-b2e7-2f44389077e8"
}'

# Create the HTTP objects
request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
request.body = order

# Send the request
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
    http.request(request)
end

puts response.body
```

```
import requests
import json

#'ord_mSCP9was' is an example order id.
url = 'https://sandbox.shiphawk.com/api/v4/orders/ord_mSCP9was'
headers = {'X-Api-Key': 'YOUR_API_KEY'}
payload = {
    "order_number": "ORD101001111",
    "source_system": "ShipHawk eComm",
    "source_system_id": "SH123",
    "source": "Proprietary",
    "source_system_processed_at": "2016-03-01",
    "origin_address": {
        "name": "Mike Richardson",
        "company": "ShipHawk",
        "street1": "1234 Main St.",
        "city": "Virginia Beach",
        "state": "VA",
        "zip": "234545",
        "phone_number":"805-335-2432",
        "email":"mikel@shiphawk.com"
    },
    "destination_address": {
        "name": "George Chapman",
        "company": "Hawk Apps",
        "street1": "1234 Main St.",
        "city": "Ventura",
        "state": "California",
        "zip": "93001",
        "phone_number":"805-770-1642",
        "email":"george@shiphawk.com"
    },
    "billing_address": {
        "name": "John Doe",
        "company": "Hawk Apps",
        "street1": "1234 Main St.",
        "city": "New York",
        "state": "NY",
        "zip": "10029",
        "country": "US",
        "phone_number": "805-888-1234",
        "email": "john@shiphawk.com"
    },
    "order_line_items": [\
        {\
            "source_system_id": "SH123",\
            "name": "",\
            "sku": "1234",\
            "quantity": 1,\
            "value": 251.00,\
            "length": 11.0,\
            "width": 11.0,\
            "height": 11.0,\
            "weight": 15.0,\
            "item_type": "parcel"\
        }\
    ],
    "reference_numbers": [\
        {\
            "code": "reference_id",\
            "name": "Reference ID",\
            "value": "787878"\
        },\
        {\
            "code": "purchase_id",\
            "name": "Purchase Order #",\
            "value": "191919"\
        }\
    ],
    "total_price": 1000,
    "shipping_price": 800,
    "tax_price": 50,
    "items_price": 150,
    "status": "new",
    "requested_shipping_details": "FedEx Ground",
    "requested_rate_id": "01004c4c-da3c-48ff-b2e7-2f44389077e8"
}

r = requests.post(url, headers=headers, json=payload)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;
import javax.json.*;
import javax.script.*;

public class PostRequests {
    public static void main(String [] args)
    {
        try{
            sendPost();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendPost() throws IOException {
        JsonObject personObject = Json.createObjectBuilder()
                .add("order_number", "ORD101001111")
                .add("source_system", "ShipHawk eComm")
                .add("source_system_id", "SH123")
                .add("source", "Proprietary")
                .add("source_system_processed_at", "2016-03-01")
                .add("origin_address", Json.createObjectBuilder()
                    .add("name", "Mike Richardson")
                    .add("company", "ShipHawk")
                    .add("street1", "1234 Main St.")
                    .add("city", "Virginia Beach")
                    .add("state", "VA")
                    .add("zip", "234545")
                    .add("phone_number", "805-335-2432")
                    .add("email", "mikel@shiphawk.com")
                    )
                .add("destination_address", Json.createObjectBuilder()
                    .add("name", "George Chapman")
                    .add("company", "Hawk Apps")
                    .add("street1", "1234 Main St.")
                    .add("city", "Ventura")
                    .add("state", "California")
                    .add("zip", "93001")
                    .add("phone_number", "805-770-1642")
                    .add("email", "george@shiphawk.com")
                    )
                .add("order_line_items", Json.createArrayBuilder()
                    .add(Json.createObjectBuilder()
                        .add("source_system_id", "SH123")
                        .add("name", "")
                        .add("sku", "1234")
                        .add("quantity", 1)
                        .add("value", 251.00)
                        .add("length", 11.0)
                        .add("width", 11.0)
                        .add("height", 11.0)
                        .add("weight", 15.0)
                        .add("item_type", "parcel")
                        )
                    )
                .add("reference_numbers", Json.createArrayBuilder()
                    .add(Json.createObjectBuilder()
                        .add("code", "reference_id")
                        .add("name", "Reference ID")
                        .add("value", "787878")
                        )
                    .add(Json.createObjectBuilder()
                        .add("code", "purchase_id")
                        .add("name", "Purchase Order #")
                        .add("value", "191919")
                        )
                    )
                .add("total_price", "1000")
                .add("shipping_price", "800")
                .add("tax_price", "50")
                .add("items_price", "150")
                .add("status", "new")
                .add("requested_shipping_details", "FedEx Ground")
                .add("requested_rate_id", "01004c4c-da3c-48ff-b2e7-2f44389077e8")
                .build();
        try{
            // For formatting json object to be readable
            ScriptEngineManager manager = new ScriptEngineManager();
            ScriptEngine scriptEngine = manager.getEngineByName("JavaScript");
            scriptEngine.put("jsonString", personObject.toString());
            scriptEngine.eval("result = JSON.Stringify(JSON.parse(jsonString), null, 2)");
            String prettyPrintedJson = (String) scriptEngine.get("result");

// 'ord_JKAyGya4' is an example order id.
            URL url = new URL("https://sandbox.shiphawk.com/api/v4/orders/ord_JKAyGya4?api_key=YOUR_API_KEY");
            HttpURLConnection con = (HttpURLConnection) url.openConnection();
            con.setRequestMethod("POST");
            con.setRequestProperty("Content-Type", "application/json");
            con.setDoOutput(true);
            OutputStream os = con.getOutputStream();
            os.write(personObject.toString().getBytes());
            os.flush();
            os.close();

int responseCode = con.getResponseCode();

> Request: `POST /api/v4/orders/:id`

> Response: [order-response-object](https://docs.shiphawk.com/#order-response-object)

### Retrieve an Order

```
#'ord_DqKvSb9M' is an example order id.
curl -X GET 'https://sandbox.shiphawk.com/api/v4/orders/ord_DqKvSb9M?api_key=YOUR_API_KEY'
```

```
require 'net/http'

#'ord_c5Py82JD' is an example order id.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/orders/ord_c5Py82JD?api_key=YOUR_API_KEY')
response = Net::HTTP.get(uri)

puts response
```

```
import requests

url = 'https://sandbox.shiphawk.com/api/v4/orders/ord_mSCP9was'
headers = {'X-Api-Key': 'YOUR_API_KEY'}

r = requests.get(url, headers=headers)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;

public class GetRequests {
    public static void main(String [] args)
    {
        try{
            sendGet();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendGet() throws IOException {
        //'ord_mbX920Mg' is an example order id.
        URL url = new URL("https://sandbox.shiphawk.com/api/v4/orders/ord_mbX920Mg?api_key=YOUR_API_KEY");
        HttpURLConnection con = (HttpURLConnection) url.openConnection();
        con.setRequestMethod("GET");
        int responseCode = con.getResponseCode();

> Request: `GET /api/v4/orders/:id`

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String | Order id, `required` |

> Response: [order-response-object](https://docs.shiphawk.com/#order-response-object)

### Retrieve Pick Ticket for an Order

```
//'ord_DqKvSb9M' is an example order id.
curl -X GET 'https://sandbox.shiphawk.com/api/v4/orders/ord_DqKvSb9M/pick_ticket?api_key=YOUR_API_KEY'
```

```
require 'net/http'

#'ord_c5Py82JD' is an example order id.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/orders/ord_c5Py82JD/pick_ticket?api_key=YOUR_API_KEY')
response = Net::HTTP.get(uri)

puts response
```

```
import requests

url = 'https://sandbox.shiphawk.com/api/v4/orders/ord_mSCP9was/pick_ticket'
headers = {'X-Api-Key': 'YOUR_API_KEY'}

r = requests.get(url, headers=headers)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;

public class GetRequests {
    public static void main(String [] args)
    {
        try{
            sendGet();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendGet() throws IOException {
        // 'ord_mbX920Mg' is an example order id.
        URL url = new URL("https://sandbox.shiphawk.com/api/v4/orders/ord_mbX920Mg/pick_ticket?api_key=YOUR_API_KEY");
        HttpURLConnection con = (HttpURLConnection) url.openConnection();
        con.setRequestMethod("GET");
        int responseCode = con.getResponseCode();

> Request: `GET /api/v4/orders/:id/pick_ticket`

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String | Order id, `required` |

> Example Response: {
> "id": "doc\_jzMM11eB",
> "url": "http://localhost:3000/uploads/pick\_ticket\_92067a160eac5537fec413d487baaa5a.pdf"
> }

### Retrieve Pick Ticket async for an Order

```
//'ord_eHaXPJEmeyeJ' is an example order id.
curl -X POST 'https://sandbox.shiphawk.com/api/v4/orders/ord_eHaXPJEmeyeJ/pick_ticket_async?api_key=YOUR_API_KEY'
```

```
require 'net/http'

#'ord_eHaXPJEmeyeJ' is an example order id.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/orders/ord_eHaXPJEmeyeJ/pick_ticket_async?api_key=YOUR_API_KEY')
response = Net::HTTP.post(uri)

puts response
```

```
import requests

url = 'https://sandbox.shiphawk.com/api/v4/orders/ord_eHaXPJEmeyeJ/pick_ticket_async'
headers = {'X-Api-Key': 'YOUR_API_KEY'}

r = requests.post(url, headers=headers)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;

public class PostRequests {
    public static void main(String [] args)
    {
        try{
            sendPost();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendPost() throws IOException {
        // 'ord_mbX920Mg' is an example order id.
        URL url = new URL("https://sandbox.shiphawk.com/api/v4/orders/ord_eHaXPJEmeyeJ/pick_ticket_async?api_key=YOUR_API_KEY");
        HttpURLConnection con = (HttpURLConnection) url.openConnection();
        con.setRequestMethod("POST");
        int responseCode = con.getResponseCode();

if(responseCode == HttpURLConnection.HTTP_OK){
            BufferedReader in = new BufferedReader(
              new InputStreamReader(con.getInputStream()));
            String inputLine;
            StringBuffer content = new StringBuffer();
            while ((inputLine = in.readLine()) != null) {
                content.append(inputLine);
            }
            in.close();
            System.out.println(content.toString());
        }
        else{
            System.out.println("POST request failed.");
        }
    }
}
```

> Request: `POST /api/v4/orders/:id/pick_ticket_async`

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String | Order id, `required` |

> Example Response: {
> "created\_at": "2021-07-26T13:45:11.488+00:00",
> "error\_message": null,
> "finished\_at": null,
> "id": "skjob\_RSC0YmDbM5CD",
> "meta": { "order\_public\_id": "ord\_eHaXPJEmeyeJ" },
> "meta\_search": {},
> "started\_at": null,
> "status": "unprocessed",
> "type": "PickTicketJob"
> }
>
> "id" from response can be used to check when [job](https://docs.shiphawk.com/#job-tracker-api-endpoints) is finished
>
> Then pick ticket document will be returned with [order](https://docs.shiphawk.com/#retrieve-an-order)

### List all Orders

```
curl -X GET 'https://sandbox.shiphawk.com/api/v4/orders?api_key=YOUR_API_KEY'
```

```
require 'net/http'

uri = URI.parse('https://sandbox.shiphawk.com/api/v4/orders?api_key=YOUR_API_KEY')
response = Net::HTTP.get(uri)

puts response
```

```
import requests

url = 'https://sandbox.shiphawk.com/api/v4/orders/'
headers = {'X-Api-Key': 'YOUR_API_KEY'}

r = requests.get(url, headers=headers)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;

public class GetRequests {
    public static void main(String [] args)
    {
        try{
            sendGet();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendGet() throws IOException {
        URL url = new URL("https://sandbox.shiphawk.com/api/v4/orders?api_key=YOUR_API_KEY");
        HttpURLConnection con = (HttpURLConnection) url.openConnection();
        con.setRequestMethod("GET");
        int responseCode = con.getResponseCode();

> Request: `GET /api/v4/orders`
>
> Response: Array [\[order-response-object\]](https://docs.shiphawk.com/#order-response-object)

### List all Order's Shipments

```
#`ord_2E1pWGRh` is an example order id
curl -X GET 'https://sandbox.shiphawk.com/api/v4/orders/ord_2E1pWGRh/shipments?api_key=YOUR_API_KEY'
```

```
#`ord_2E1pWGRh` is an example order id
require 'net/http'

uri = URI.parse('https://sandbox.shiphawk.com/api/v4/orders/ord_2E1pWGRh/shipments?api_key=YOUR_API_KEY')
response = Net::HTTP.get(uri)

puts response
```

```
# `ord_2E1pWGRh` is an example order id
import requests

url = 'https://sandbox.shiphawk.com/api/v4/orders/ord_2E1pWGRh/shipments'
headers = {'X-Api-Key': 'YOUR_API_KEY'}

r = requests.get(url, headers=headers)
```

```
// `ord_2E1pWGRh` is an example order id
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;

public class GetRequests {
    public static void main(String [] args)
    {
        try{
            sendGet();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendGet() throws IOException {
        URL url = new URL("https://sandbox.shiphawk.com/api/v4/orders/ord_2E1pWGRh/shipments?api_key=YOUR_API_KEY");
        HttpURLConnection con = (HttpURLConnection) url.openConnection();
        con.setRequestMethod("GET");
        int responseCode = con.getResponseCode();

> Request: `GET /api/v4/orders/:id/shipments`

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String | Order id, `required` |

> Response: \[ [Shipment Object](https://docs.shiphawk.com/#shipment-response-object)\]

### List all Order's Proposed Shipments

```
#`ord_2E1pWGRh` is an example order id
curl -X GET 'https://sandbox.shiphawk.com/api/v4/orders/ord_2E1pWGRh/proposed_shipments?api_key=YOUR_API_KEY'
```

```
#`ord_2E1pWGRh` is an example order id
require 'net/http'

uri = URI.parse('https://sandbox.shiphawk.com/api/v4/orders/ord_2E1pWGRh/proposed_shipments?api_key=YOUR_API_KEY')
response = Net::HTTP.get(uri)

puts response
```

```
# `ord_2E1pWGRh` is an example order id
import requests

url = 'https://sandbox.shiphawk.com/api/v4/orders/ord_2E1pWGRh/proposed_shipments'
headers = {'X-Api-Key': 'YOUR_API_KEY'}

r = requests.get(url, headers=headers)
```

```
// `ord_2E1pWGRh` is an example order id
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;

public class GetRequests {
    public static void main(String [] args)
    {
        try{
            sendGet();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendGet() throws IOException {
        URL url = new URL("https://sandbox.shiphawk.com/api/v4/orders/ord_2E1pWGRh/proposed_shipments?api_key=YOUR_API_KEY");
        HttpURLConnection con = (HttpURLConnection) url.openConnection();
        con.setRequestMethod("GET");
        int responseCode = con.getResponseCode();

> Request: `GET /api/v4/orders/:id/proposed_shipments`

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String | Order id, `required` |

> Response: \[ [Proposed Shipment Object](https://docs.shiphawk.com/#proposed-shipment-response-object)\]

### List all Order's Order Line Items

```
#`ord_2E1pWGRh` is an example order id
curl -X GET 'https://sandbox.shiphawk.com/api/v4/orders/ord_2E1pWGRh/order_line_items?api_key=YOUR_API_KEY'
```

```
#`ord_2E1pWGRh` is an example order id
require 'net/http'

uri = URI.parse('https://sandbox.shiphawk.com/api/v4/orders/ord_2E1pWGRh/order_line_items?api_key=YOUR_API_KEY')
response = Net::HTTP.get(uri)

puts response
```

```
# `ord_2E1pWGRh` is an example order id
import requests

url = 'https://sandbox.shiphawk.com/api/v4/orders/ord_2E1pWGRh/order_line_items'
headers = {'X-Api-Key': 'YOUR_API_KEY'}

r = requests.get(url, headers=headers)
```

```
// `ord_2E1pWGRh` is an example order id
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;

public class GetRequests {
    public static void main(String [] args)
    {
        try{
            sendGet();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendGet() throws IOException {
        URL url = new URL("https://sandbox.shiphawk.com/api/v4/orders/ord_2E1pWGRh/order_line_items?api_key=YOUR_API_KEY");
        HttpURLConnection con = (HttpURLConnection) url.openConnection();
        con.setRequestMethod("GET");
        int responseCode = con.getResponseCode();

> Request: `GET /api/v4/orders/:id/order_line_items`

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String | Order id, `required` |
| type | String | If empty - returns all Order Line Items |
|  | String | `shipped` \- returns all shipped Order Line Items |
|  | String | `not_shipped` \- returns all not shipped Order Line Items |
| page | Integer | Current page |
| per\_page | Integer | Items per page |
| query | String | Search word, search is performed only by SKU field |

> Response: \[ [Order Line Item Object](https://docs.shiphawk.com/#order-orderlineitem-object)\]

### List all Order's Shipped Line Item Skus

```
#`ord_2E1pWGRh` is an example order id
curl -X GET 'https://sandbox.shiphawk.com/api/v4/orders/ord_2E1pWGRh/shipped_line_item_skus?api_key=YOUR_API_KEY'
```

```
#`ord_2E1pWGRh` is an example order id
require 'net/http'

uri = URI.parse('https://sandbox.shiphawk.com/api/v4/orders/ord_2E1pWGRh/shipped_line_item_skus?api_key=YOUR_API_KEY')
response = Net::HTTP.get(uri)

puts response
```

```
# `ord_2E1pWGRh` is an example order id
import requests

url = 'https://sandbox.shiphawk.com/api/v4/orders/ord_2E1pWGRh/shipped_line_item_skus'
headers = {'X-Api-Key': 'YOUR_API_KEY'}

r = requests.get(url, headers=headers)
```

```
// `ord_2E1pWGRh` is an example order id
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;

public class GetRequests {
    public static void main(String [] args)
    {
        try{
            sendGet();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendGet() throws IOException {
        URL url = new URL("https://sandbox.shiphawk.com/api/v4/orders/ord_2E1pWGRh/shipped_line_item_skus?api_key=YOUR_API_KEY");
        HttpURLConnection con = (HttpURLConnection) url.openConnection();
        con.setRequestMethod("GET");
        int responseCode = con.getResponseCode();

> Request: `GET /api/v4/orders/:id/shipped_line_item_skus`

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String | Order id, `required` |
| page | Integer | Current page |
| per\_page | Integer | Items per page |

> Response: \[ [Line Item Sku response object](https://docs.shiphawk.com/#line-item-sku-response-object)\]

### List all Order's Not Shipped Line Item Skus

```
#`ord_2E1pWGRh` is an example order id
curl -X GET 'https://sandbox.shiphawk.com/api/v4/orders/ord_2E1pWGRh/not_shipped_line_item_skus?api_key=YOUR_API_KEY'
```

```
#`ord_2E1pWGRh` is an example order id
require 'net/http'

uri = URI.parse('https://sandbox.shiphawk.com/api/v4/orders/ord_2E1pWGRh/not_shipped_line_item_skus?api_key=YOUR_API_KEY')
response = Net::HTTP.get(uri)

puts response
```

```
# `ord_2E1pWGRh` is an example order id
import requests

url = 'https://sandbox.shiphawk.com/api/v4/orders/ord_2E1pWGRh/not_shipped_line_item_skus'
headers = {'X-Api-Key': 'YOUR_API_KEY'}

r = requests.get(url, headers=headers)
```

```
// `ord_2E1pWGRh` is an example order id
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;

public class GetRequests {
    public static void main(String [] args)
    {
        try{
            sendGet();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendGet() throws IOException {
        URL url = new URL("https://sandbox.shiphawk.com/api/v4/orders/ord_2E1pWGRh/not_shipped_line_item_skus?api_key=YOUR_API_KEY");
        HttpURLConnection con = (HttpURLConnection) url.openConnection();
        con.setRequestMethod("GET");
        int responseCode = con.getResponseCode();

> Request: `GET /api/v4/orders/:id/not_shipped_line_item_skus`

> Response: \[ [Line Item Sku response object](https://docs.shiphawk.com/#line-item-sku-response-object)\]

### Cancel an Order - Endpoint is deprecated, please use Cancel (Deprecated on May 1st 2024)

```
### `ORD10100111` is an example order number.
curl -X POST 'https://sandbox.shiphawk.com/api/v4/orders/ORD10100111/cancelled?api_key=YOUR_API_KEY'
```

```
require 'net/http'
#'1253' is an example order number.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/orders/1253/cancelled?api_key=YOUR_API_KEY')

# Create the HTTP objects
request = Net::HTTP::Post.new(uri.request_uri)

# Send the request
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
    http.request(request)
end

puts response.body
```

```
import requests
import json

url = 'https://sandbox.shiphawk.com/api/v4/orders/1253/cancelled'
headers = {'X-Api-Key': 'YOUR_API_KEY'}

r = requests.post(url, headers=headers)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;

public class PostRequests {
    public static void main(String [] args)
    {
        try{
            sendPost();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendPost() throws IOException {
        // 'ord_mbX920Mg' is an example order id.
        URL url = new URL("https://sandbox.shiphawk.com/api/v4/orders/ORD101001111/cancelled?api_key=YOUR_API_KEY");
        HttpURLConnection con = (HttpURLConnection) url.openConnection();
        con.setRequestMethod("POST");
        con.setRequestProperty("Content-Type", "application/json");

int responseCode = con.getResponseCode();

> Request: `POST /api/v4/orders/:order_number/cancelled`

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| order\_number | String | Order id, `required` |

> Response: [order-response-object](https://docs.shiphawk.com/#order-response-object)

### Cancel an Order

```
### `ORD10100111` is an example order number.
curl -X POST 'https://sandbox.shiphawk.com/api/v4/orders/ORD10100111/cancel?api_key=YOUR_API_KEY'
```

```
require 'net/http'
#'1253' is an example order number.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/orders/1253/cancel?api_key=YOUR_API_KEY')

# Create the HTTP objects
request = Net::HTTP::Post.new(uri.request_uri)

# Send the request
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
    http.request(request)
end

puts response.body
```

```
import requests
import json

url = 'https://sandbox.shiphawk.com/api/v4/orders/1253/cancel'
headers = {'X-Api-Key': 'YOUR_API_KEY'}

r = requests.post(url, headers=headers)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;

public class PostRequests {
    public static void main(String [] args)
    {
        try{
            sendPost();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendPost() throws IOException {
        // 'ord_mbX920Mg' is an example order id.
        URL url = new URL("https://sandbox.shiphawk.com/api/v4/orders/ORD101001111/cancel?api_key=YOUR_API_KEY");
        HttpURLConnection con = (HttpURLConnection) url.openConnection();
        con.setRequestMethod("POST");
        con.setRequestProperty("Content-Type", "application/json");

int responseCode = con.getResponseCode();

> Request: `POST /api/v4/orders/:order_number_or_id/cancel`

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| order\_number\_or\_id | String | Order Id / Order Number, `required` |
| remove\_unshiped | Boolean | Default: false. Specify whether we remove Proposed Shipment in unprocessed state |

> Response: [order-response-object](https://docs.shiphawk.com/#order-response-object)

### Combine One or More Orders - Endpoint is deprecated, please use Combine Order Async (Deprecated on January 1st 2024)

[Combine One or More Orders Async](https://docs.shiphawk.com/#combine-one-or-more-orders-async)

```
# Example includes list of order ids.
curl -H "Content-Type: application/json" -X POST -d '
{
    "master_order_id": "1231241",
    "ids": ["ord_DqKvSb9M", "ord_2E1pWGRh"],
    "all_items": "true"
}' 'https://sandbox.shiphawk.com/api/v4/orders/combine?api_key=YOUR_API_KEY'
```

```
require 'net/http'
require 'uri'
require 'json'

# Example includes list of order ids.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/orders/combine?api_key=YOUR_API_KEY')

order =
'{
    "master_order_id": "1231241",
    "ids": ["ord_DqKvSb9M", "ord_2E1pWGRh"],
    "all_items": "true"
}'

# Create the HTTP objects
request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
request.body = order

# Send the request
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
    http.request(request)
end

puts response.body
```

```
import requests
import json

url = 'https://sandbox.shiphawk.com/api/v4/orders/combine'
headers = {'X-Api-Key': 'YOUR_API_KEY'}
payload = {
    "master_order_id": "1231241",
    "ids": ["ord_DqKvSb9M", "ord_2E1pWGRh"],
    "all_items": "true"
}

r = requests.post(url, headers=headers, json=payload)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;
import javax.json.*;
import javax.script.*;

public class PostRequests {
    public static void main(String [] args)
    {
        try{
            sendPost();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendPost() throws IOException {
        JsonObject personObject = Json.createObjectBuilder()
                .add("master_order_id", "1231241")
                .add("ids", Json.createArrayBuilder()
                        .add("ord_DqKvSb9M")
                        .add("ord_2E1pWGRh")
                    )
                .add("all_items", "true")
                .build();
        try{
            // For formatting json object to be readable
            ScriptEngineManager manager = new ScriptEngineManager();
            ScriptEngine scriptEngine = manager.getEngineByName("JavaScript");
            scriptEngine.put("jsonString", personObject.toString());
            scriptEngine.eval("result = JSON.Stringify(JSON.parse(jsonString), null, 2)");
            String prettyPrintedJson = (String) scriptEngine.get("result");

URL url = new URL("https://sandbox.shiphawk.com/api/v4/orders/combine?api_key=YOUR_API_KEY");
            HttpURLConnection con = (HttpURLConnection) url.openConnection();
            con.setRequestMethod("POST");
            con.setRequestProperty("Content-Type", "application/json");
            con.setDoOutput(true);
            OutputStream os = con.getOutputStream();
            os.write(personObject.toString().getBytes());
            os.flush();
            os.close();

int responseCode = con.getResponseCode();

> Request: `POST /api/v4/orders/combine`

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| master\_order\_id | String | Order id, order will keep combined items, `required` |
| ids | Array\[String\] | Order ids to combine, `required` if param `all_items` blank |
| all\_items | Boolean | All order ids to combine, `required` if param `ids` blank |

> Response: [Combine Order async Response Object](https://docs.shiphawk.com/#combine-order-async-response-object)

### Combine One or More Orders Async

```
# Example includes list of order ids.
curl POST 'https://sandbox.shiphawk.com/api/v4/orders/combine_async?api_key=YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "master_order_id": "ord_EwpPBxf8",
    "ids": ["ord_8CS2CvEy", "ord_XZWspyTk"]
}'

# Example combine all orders.
curl POST 'https://sandbox.shiphawk.com/api/v4/orders/combine_async?api_key=YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "master_order_id": "ord_EwpPBxf8",
    "all_items": true
}'
```

```
require 'net/http'
require 'uri'
require 'json'

# Example includes list of order ids.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/orders/combine_async?api_key=YOUR_API_KEY')

# Example includes list of order ids.
combine_async_body = {
    "master_order_id": "ord_EwpPBxf8",
    "ids": ["ord_7eNTAmVT", "ord_4WBTxPxS"],
}.to_json

# Example combine all orders.
combine_async_body = {
    "master_order_id": "ord_EwpPBxf8",
    "all_items": true,
}.to_json

# Create the HTTP objects
request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
request.body = combine_async_body

# Send the request
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
    http.request(request)
end
```

```
import requests
import json

url = 'https://sandbox.shiphawk.com/api/v4/orders/combine_async'
headers = {'X-Api-Key': 'YOUR_API_KEY'}

# Example includes list of order ids.
payload = {
    "master_order_id": "ord_EwpPBxf8",
    "ids": ["ord_DqKvSb9M", "ord_2E1pWGRh"],
}

# Example combine all orders.
payload = {
    "master_order_id": "ord_EwpPBxf8",
    "all_items": true,
}

r = requests.post(url, headers=headers, json=payload)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;
import javax.json.*;
import javax.script.*;

public class PostRequests {
    public static void main(String [] args)
    {
        try{
            sendPost();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendPost() throws IOException {
        JsonObject personObject = Json.createObjectBuilder()
                .add("master_order_id", "ord_EwpPBxf8")
                .add("ids", Json.createArrayBuilder()
                        .add("ord_DqKvSb9M")
                        .add("ord_2E1pWGRh")
                    )
                .build();
        try{
            // For formatting json object to be readable
            ScriptEngineManager manager = new ScriptEngineManager();
            ScriptEngine scriptEngine = manager.getEngineByName("JavaScript");
            scriptEngine.put("jsonString", personObject.toString());
            scriptEngine.eval("result = JSON.Stringify(JSON.parse(jsonString), null, 2)");
            String prettyPrintedJson = (String) scriptEngine.get("result");

URL url = new URL("https://sandbox.shiphawk.com/api/v4/orders/combine_async?api_key=YOUR_API_KEY");
            HttpURLConnection con = (HttpURLConnection) url.openConnection();
            con.setRequestMethod("POST");
            con.setRequestProperty("Content-Type", "application/json");
            con.setDoOutput(true);
            OutputStream os = con.getOutputStream();
            os.write(personObject.toString().getBytes());
            os.flush();
            os.close();

int responseCode = con.getResponseCode();

> Request: `/api/v4/orders/combine_async`

> Response: [Combine Order async Response Object](https://docs.shiphawk.com/#combine-order-async-response-object)

### Split Order Async

```
Request:
#`ord_2E1pWGRh` is an example order id
# Split order to New order
curl POST 'https://sandbox.shiphawk.com/api/v4/orders/ord_2E1pWGRh/split_async?api_key=YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "new_order_number": "ORD10100112",
    "order_line_items": [\
        {\
            "id": "ordi_NmDJkZWj",\
            "quantity": 1\
        }\
    ]
}'

# Split order to Existing order
curl POST 'https://sandbox.shiphawk.com/api/v4/orders/ord_2E1pWGRh/split_async?api_key=YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "move_to_order_id": "ord_F2gvqhR2",
    "order_line_items": [\
        {\
            "id": "ordi_NmDJkZWj",\
            "quantity": 1\
        }\
    ]
}'
```

```
require 'net/http'
require 'uri'
require 'json'

#'ord_c5Py82JD' is an example order id.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/orders/ord_c5Py82JD/split_async?api_key=YOUR_API_KEY')

# Split order to New order
split_body = {
    "order_number": "ORD10100112",
    "order_line_items": [\
        {\
            "id": "ordi_NmDJkZWj",\
            "quantity": 1\
        }\
    ]
}.to_json

# Split order to Existing order
split_body = {
    "move_to_order_id": "ord_F2gvqhR2",
    "order_line_items": [\
        {\
            "id": "ordi_NmDJkZWj",\
            "quantity": 1\
        }\
    ]
}.to_json

# Create the HTTP objects
request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
request.body = split_body

# Send the request
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
    http.request(request)
end

puts response.body
```

```
import requests
import json

url = 'https://sanbox.shiphawk.com/api/v4/orders/ord_c5Py82JD/split_async'
headers = {'X-Api-Key': 'YOUR_API_KEY'}
# Split order to New order
payload = {
    "order_number": "ORD10100112",
    "order_line_items": [\
        {\
            "id": "ordi_NmDJkZWj",\
            "quantity": 1\
        }\
    ]
}

# Split order to Existing order
payload = {
    "move_to_order_id": "ord_F2gvqhR2",
    "order_line_items": [\
        {\
            "id": "ordi_NmDJkZWj",\
            "quantity": 1\
        }\
    ]
}

r = requests.post(url, headers=headers, json=payload)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;
import javax.json.*;
import javax.script.*;

public class PostRequests {
    public static void main(String [] args)
    {
        try{
            sendPost();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendPost() throws IOException {
        JsonObject personObject = Json.createObjectBuilder()
                .add("order_number", "ORD101001111")
                .add("order_line_items", Json.createArrayBuilder())
                .build();
        try{
            // For formatting json object to be readable
            ScriptEngineManager manager = new ScriptEngineManager();
            ScriptEngine scriptEngine = manager.getEngineByName("JavaScript");
            scriptEngine.put("jsonString", personObject.toString());
            scriptEngine.eval("result = JSON.Stringify(JSON.parse(jsonString), null, 2)");
            String prettyPrintedJson = (String) scriptEngine.get("result");

// 'ord_JKAyGya4' is an example order id.
            URL url = new URL("https://sandbox.shiphawk.com/api/v4/orders/ord_JKAyGya4/split_async?api_key=YOUR_API_KEY");
            HttpURLConnection con = (HttpURLConnection) url.openConnection();
            con.setRequestMethod("POST");
            con.setRequestProperty("Content-Type", "application/json");
            con.setDoOutput(true);
            OutputStream os = con.getOutputStream();
            os.write(personObject.toString().getBytes());
            os.flush();
            os.close();

int responseCode = con.getResponseCode();

> Request: `POST /api/v4/orders/:id/split_async`

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String | `required` |
| new\_order\_number | String | New order will be created with entered number, `required` if move\_to\_order\_id param blank. |
| move\_to\_order\_id | String | Order id, Order line items will moved to existing order, `required` if new\_order\_number blank. |
| order\_line\_items | Array\[ [Order Line Item](https://docs.shiphawk.com/#split-order-async-order-line-item-object)\] | `required` |

> Response: [Split Order async Response Object](https://docs.shiphawk.com/#split-order-async-response-object)

### Hold One or More Orders

```
# Example includes list of order ids and a specific date to hold the orders until that time.
curl -H "Content-Type: application/json" -X POST -d '
{
    "ids": ["ord_2E1pWGRh","ord_DqKvSb9M"],
    "hold_until": "2019-01-30T23:16:34+00:00"
}' 'https://sandbox.shiphawk.com/api/v4/orders/hold?api_key=YOUR_API_KEY'
```

```
require 'net/http'
require 'uri'
require 'json'

# Example includes list of order ids and a specific date to hold the orders until that time.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/orders/hold?api_key=YOUR_API_KEY')

order =
'{
    "ids": ["ord_2E1pWGRh","ord_DqKvSb9M"],
    "hold_until": "2019-01-30T23:16:34+00:00"
}'

# Create the HTTP objects
request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
request.body = order

# Send the request
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
    http.request(request)
end

puts response.body
```

```
import requests
import json

url = 'https://sandbox.shiphawk.com/api/v4/orders/hold'
headers = {'X-Api-Key': 'YOUR_API_KEY'}
payload = {
    "ids": ["ord_2E1pWGRh","ord_DqKvSb9M"],
    "hold_until": "2019-01-30T23:16:34+00:00"
}

r = requests.post(url, headers=headers, json=payload)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;
import javax.json.*;
import javax.script.*;

public class PostRequests {
    public static void main(String [] args)
    {
        try{
            sendPost();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendPost() throws IOException {
        JsonObject personObject = Json.createObjectBuilder()
                .add("ids", Json.createArrayBuilder()
                        .add("ord_2E1pWGRh")
                        .add("ord_DqKvSb9M")
                    )
                .add("hold_until", "2019-01-30T23:16:34+00:00")
                .build();
        try{
            // For formatting json object to be readable
            ScriptEngineManager manager = new ScriptEngineManager();
            ScriptEngine scriptEngine = manager.getEngineByName("JavaScript");
            scriptEngine.put("jsonString", personObject.toString());
            scriptEngine.eval("result = JSON.Stringify(JSON.parse(jsonString), null, 2)");
            String prettyPrintedJson = (String) scriptEngine.get("result");

URL url = new URL("https://sandbox.shiphawk.com/api/v4/orders/hold?api_key=YOUR_API_KEY");
            HttpURLConnection con = (HttpURLConnection) url.openConnection();
            con.setRequestMethod("POST");
            con.setRequestProperty("Content-Type", "application/json");
            con.setDoOutput(true);
            OutputStream os = con.getOutputStream();
            os.write(personObject.toString().getBytes());
            os.flush();
            os.close();

int responseCode = con.getResponseCode();

> Request: `POST /api/v4/orders/hold`

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String | `required` |
| hold\_until | DateTime | `required` |

> Example Response: {
> "public\_id": "buop\_dHpM9bKz",
> "finished": false,
> "records\_total\_count": 1,
> "records\_processed\_count": 0,
> "records\_failed\_count": 0
> }

### Remove Hold on Orders

```
# Example includes list of order ids.
curl -H "Content-Type: application/json" -X POST -d '
{
    "ids": ["ord_2E1pWGRh","ord_DqKvSb9M"]
}' 'https://sandbox.shiphawk.com/api/v4/orders/restore?api_key=YOUR_API_KEY'
```

```
require 'net/http'
require 'uri'
require 'json'

# Example includes list of order ids.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/orders/restore?api_key=YOUR_API_KEY')

order =
'{
    "ids": ["ord_2E1pWGRh","ord_DqKvSb9M"]
}'

# Create the HTTP objects
request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
request.body = order

# Send the request
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
    http.request(request)
end

puts response.body
```

```
import requests
import json

url = 'https://sandbox.shiphawk.com/api/v4/orders/restore'
headers = {'X-Api-Key': 'YOUR_API_KEY'}
payload = {
    "ids": ["ord_2E1pWGRh","ord_DqKvSb9M"]
}

r = requests.post(url, headers=headers, json=payload)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;
import javax.json.*;
import javax.script.*;

public class PostRequests {
    public static void main(String [] args)
    {
        try{
            sendPost();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendPost() throws IOException {
        JsonObject personObject = Json.createObjectBuilder()
                .add("ids", Json.createArrayBuilder()
                        .add("ord_2E1pWGRh")
                        .add("ord_DqKvSb9M")
                    )
                .build();
        try{
            // For formatting json object to be readable
            ScriptEngineManager manager = new ScriptEngineManager();
            ScriptEngine scriptEngine = manager.getEngineByName("JavaScript");
            scriptEngine.put("jsonString", personObject.toString());
            scriptEngine.eval("result = JSON.Stringify(JSON.parse(jsonString), null, 2)");
            String prettyPrintedJson = (String) scriptEngine.get("result");

URL url = new URL("https://sandbox.shiphawk.com/api/v4/orders/restore?api_key=YOUR_API_KEY");
            HttpURLConnection con = (HttpURLConnection) url.openConnection();
            con.setRequestMethod("POST");
            con.setRequestProperty("Content-Type", "application/json");
            con.setDoOutput(true);
            OutputStream os = con.getOutputStream();
            os.write(personObject.toString().getBytes());
            os.flush();
            os.close();

int responseCode = con.getResponseCode();

> Request: `POST /api/v4/orders/restore`

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String | `required` |

> Example Response: {
> "public\_id": "buop\_sNVkw4rt",
> "finished": false,
> "records\_total\_count": 1,
> "records\_processed\_count": 0,
> "records\_failed\_count": 0
> }

### Search Orders

```
# Example is searching for NetSuite as the source system.
curl -X GET 'https://sandbox.shiphawk.com/api/v4/orders/simple?api_key=YOUR_API_KEY&source_system=NetSuite'
```

```
require 'net/http'

uri = URI.parse('https://sandbox.shiphawk.com/api/v4/orders/simple?api_key=YOUR_API_KEY&source_system=NetSuite')
response = Net::HTTP.get(uri)

puts response
```

```
import requests

url = 'https://sandbox.shiphawk.com/api/v4/orders/simple?source_system=NetSuite'
headers = {'X-Api-Key': 'YOUR_API_KEY'}

r = requests.get(url, headers=headers)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;

public class GetRequests {
    public static void main(String [] args)
    {
        try{
            sendGet();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendGet() throws IOException {
        URL url = new URL("https://sandbox.shiphawk.com/api/v4/orders/simple?api_key=YOUR_API_KEY&source_system=NetSuite");
        HttpURLConnection con = (HttpURLConnection) url.openConnection();
        con.setRequestMethod("GET");
        int responseCode = con.getResponseCode();

> Request: `GET /api/v4/orders/simple?source_system=NetSuite`

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| source\_system | String | `required` |

> Response: Array\[ [orders](https://docs.shiphawk.com/#order-response-object)\]

### Delete an Order

```
#'ord_DqKvSb9M' is an example order id.
curl -X DELETE 'https://sandbox.shiphawk.com/api/v4/orders/ord_DqKvSb9M?api_key=YOUR_API_KEY'
```

```
require 'net/http'

#'ord_Sq9Q39fx' is an example order id.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/orders/ord_Sq9Q39fx?api_key=YOUR_API_KEY')

# Create the HTTP objects
request = Net::HTTP::Delete.new(uri.request_uri)

# Send the request
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
    http.request(request)
end

puts response.body
```

```
import requests

url = 'https://sandbox.shiphawk.com/api/v4/orders/ord_Sq9Q39fx'
headers = {'X-Api-Key': 'YOUR_API_KEY'}

r = requests.delete(url, headers=headers)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;

public class DeleteRequests {
    public static void main(String [] args)
    {
        try{
            sendDelete();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendDelete() throws IOException {
        // 'ord_YeZgVnBQ' is an example order id.
        URL url = new URL("https://sandbox.shiphawk.com/api/v4/orders/ord_YeZgVnBQ?api_key=YOUR_API_KEY");
        HttpURLConnection con = (HttpURLConnection) url.openConnection();
        con.setRequestMethod("DELETE");
        int responseCode = con.getResponseCode();

if(responseCode == HttpURLConnection.HTTP_NO_CONTENT){
            BufferedReader in = new BufferedReader(
              new InputStreamReader(con.getInputStream()));
            String inputLine;
            StringBuffer content = new StringBuffer();
            while ((inputLine = in.readLine()) != null) {
                content.append(inputLine);
            }
            in.close();
            System.out.println(content.toString());
        }
        else{
            System.out.println("DELETE request failed. Code was " + responseCode);
        }
    }
}
```

> Request: `DELETE /api/v4/orders/:id`

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String | Order id, `required` |

> Response: no content

### Create Order Line Items for an Order

```
#'ord_DqKvSb9M' is an example order id.

curl POST 'https://sandbox.shiphawk.com/api/v4/orders/ord_DqKvSb9M/order_line_items?api_key=YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "order_line_items": [\
        {\
            "source_system_id": "SH123",\
            "name": "",\
            "sku": "1234",\
            "quantity": 5,\
            "value": 251.00,\
            "length": 11.0,\
            "width": 11.0,\
            "height": 11.0,\
            "dimension_uom": "in",\
            "weight": 15.0,\
            "weight_uom": "lb",\
            "item_type": "parcel",\
            "reference_numbers": [\
                {\
                    "code": "reference_id",\
                    "name": "Shippers Order #",\
                    "value": "787878"\
                },\
                {\
                    "code": "purchase_id",\
                    "name": "Purchase Order #",\
                    "value": "191919"\
                }\
            ]\
        }\
    ]
}'
```

```
require 'net/http'
require 'uri'
require 'json'

#'ord_DqKvSb9M' is an example order id.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/orders/ord_DqKvSb9M/order_line_items?api_key=YOUR_API_KEY')

order_line_items_body = {
  "order_line_items": [{\
    "source_system_id": "SH123",\
    "name": "",\
    "sku": "1234",\
    "quantity": 1,\
    "value": 251.00,\
    "length": 11.0,\
    "width": 11.0,\
    "height": 11.0,\
    "dimension_uom": "in",\
    "weight": 15.0,\
    "weight_uom": "lb",\
    "item_type": "parcel",\
    "reference_numbers": [\
      {\
        "code":  "reference_id",\
        "name":  "Shippers Order #",\
        "value": "787878"\
      },\
      {\
        "code": "purchase_id",\
        "name":  "Purchase Order #",\
        "value": "191919"\
      }\
    ]\
  }]
}.to_json

# Create the HTTP objects
request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
request.body = order_line_items_body

# Send the request
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
  http.request(request)
end

puts response.body
```

```
import requests
import json

#'ord_mSCP9was' is an example order id.
url = 'https://sandbox.shiphawk.com/api/v4/orders/ord_mSCP9was/order_line_items'
headers = {'X-Api-Key': 'YOUR_API_KEY'}
payload = {
  "order_line_items": [{\
    "source_system_id": "SH123",\
    "name": "",\
    "sku": "1234",\
    "quantity": 1,\
    "value": 251.00,\
    "length": 11.0,\
    "width": 11.0,\
    "height": 11.0,\
    "dimension_uom": "in",\
    "weight": 15.0,\
    "weight_uom": "lb",\
    "item_type": "parcel",\
    "reference_numbers": [{\
        "code":  "reference_id",\
        "name":  "Shipper's Order #",\
        "value": "787878"\
      },\
      {\
        "code": "purchase_id",\
        "name":  "Purchase Order #",\
        "value": "191919"\
      }\
    ],\
  }],
}

r = requests.post(url, headers=headers, json=payload)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;
import javax.json.*;
import javax.script.*;

public class PostRequests {
    public static void main(String [] args)
    {
        try{
            sendPost();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendPost() throws IOException {
        JsonObject personObject = Json.createObjectBuilder()
                .add("order_line_items", Json.createArrayBuilder()
                    .add(Json.createObjectBuilder()
                        .add("source_system_id", "SH123")
                        .add("name", "")
                        .add("sku", "1234")
                        .add("quantity", 1)
                        .add("value", 251.00)
                        .add("length", 11.0)
                        .add("width", 11.0)
                        .add("height", 11.0)
                        .add("dimension_uom", "in")
                        .add("weight", 15.0)
                        .add("weight_uom", "lb")
                        .add("item_type", "parcel")
                        .add("reference_numbers", Json.createArrayBuilder()
                            .add(Json.createObjectBuilder()
                                .add("code", "reference_id")
                                .add("name", "Shippers Order #")
                                .add("value", "787878")
                                )
                            .add(Json.createObjectBuilder()
                                .add("code", "purchase_id")
                                .add("name", "Purchase Order #")
                                .add("value", "191919")
                                )
                            )
                        )
                    )
                .build();
        try{
            // For formatting json object to be readable
            ScriptEngineManager manager = new ScriptEngineManager();
            ScriptEngine scriptEngine = manager.getEngineByName("JavaScript");
            scriptEngine.put("jsonString", personObject.toString());
            scriptEngine.eval("result = JSON.Stringify(JSON.parse(jsonString), null, 2)");
            String prettyPrintedJson = (String) scriptEngine.get("result");

// 'ord_JKAyGya4' is an example order id.
            URL url = new URL("https://sandbox.shiphawk.com/api/v4/orders/ord_JKAyGya4/order_line_items?api_key=YOUR_API_KEY");
            HttpURLConnection con = (HttpURLConnection) url.openConnection();
            con.setRequestMethod("POST");
            con.setRequestProperty("Content-Type", "application/json");
            con.setDoOutput(true);
            OutputStream os = con.getOutputStream();
            os.write(personObject.toString().getBytes());
            os.flush();
            os.close();

int responseCode = con.getResponseCode();

> Request: `POST /api/v4/orders/:id/order_line_items`

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String | Order id, `required` |
| order\_line\_items | Array\[ [Order Line Item](https://docs.shiphawk.com/#order-orderlineitem-object)\] | Array of Order Line Items, `required` |

> Response: [Array\[Order Line Item\]](https://docs.shiphawk.com/#order-orderlineitem-object)

### Update Order Line Items for an Order

```
#'ord_DqKvSb9M' is an example order id.
#source_system_id or id can be used as unique key to update Order Line Item.
curl POST 'https://sandbox.shiphawk.com/api/v4/orders/ord_DqKvSb9M/order_line_items?api_key=YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "order_line_items": [\
        {\
            "source_system_id": "SH123",\
            "name": "",\
            "sku": "1234",\
            "quantity": 5,\
            "value": 251.00,\
            "length": 11.0,\
            "width": 11.0,\
            "height": 11.0,\
            "dimension_uom": "in",\
            "weight": 15.0,\
            "weight_uom": "lb",\
            "item_type": "parcel",\
            "reference_numbers": [\
                {\
                    "code": "reference_id",\
                    "name": "Shippers Order #",\
                    "value": "787878"\
                },\
                {\
                    "code": "purchase_id",\
                    "name": "Purchase Order #",\
                    "value": "191919"\
                }\
            ]\
        }\
    ]
}'
```

```
require 'net/http'
require 'uri'
require 'json'

#'ord_DqKvSb9M' is an example order id.
#source_system_id or id can be used as unique key to update Order Line Item.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/orders/ord_DqKvSb9M/order_line_items?api_key=YOUR_API_KEY')

# Create the HTTP objects
request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
request.body = order_line_items_body

# Send the request
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
  http.request(request)
end

puts response.body
```

```
import requests
import json

#'ord_mSCP9was' is an example order id.
#source_system_id or id can be used as unique key to update Order Line Item.
url = 'https://sandbox.shiphawk.com/api/v4/orders/ord_mSCP9was/order_line_items'
headers = {'X-Api-Key': 'YOUR_API_KEY'}
payload = {
  "order_line_items": [{\
    "source_system_id": "SH123",\
    "name": "",\
    "sku": "1234",\
    "quantity": 1,\
    "value": 251.00,\
    "length": 11.0,\
    "width": 11.0,\
    "height": 11.0,\
    "dimension_uom": "in",\
    "weight": 15.0,\
    "weight_uom": "lb",\
    "item_type": "parcel",\
    "reference_numbers": [{\
        "code":  "reference_id",\
        "name":  "Shipper's Order #",\
        "value": "787878"\
      },\
      {\
        "code": "purchase_id",\
        "name":  "Purchase Order #",\
        "value": "191919"\
      }\
    ],\
  }],
}

r = requests.post(url, headers=headers, json=payload)
```

```
// Running with javax.json-1.0.jar
// source_system_id or id can be used as unique key to update Order Line Item.
import java.io.*;
import java.net.*;
import javax.json.*;
import javax.script.*;

int responseCode = con.getResponseCode();

> Request: `POST /api/v4/orders/:id/order_line_items`

> Response: [Array\[Order Line Item\]](https://docs.shiphawk.com/#order-orderlineitem-object)

### Delete Order Line Items

```
#'ord_DqKvSb9M' is an example order id.
curl --request DELETE 'https://sandbox.shiphawk.com/api/v4/orders/ord_DqKvSb9M/order_line_items?api_key=YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "order_line_item_ids": ["ordi_aKTSsMHG", "ordi_c3r1tMe0", "ordi_rf45FpNZ"]
}'
```

```
require 'net/http'
require 'uri'
require 'json'

#'ord_DqKvSb9M' is an example order id.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/orders/ord_DqKvSb9M/order_line_items?api_key=YOUR_API_KEY')

order_line_items_body = {
  "order_line_item_ids": ["ordi_aKTSsMHG", "ordi_c3r1tMe0", "ordi_rf45FpNZ"]
}.to_json

# Create the HTTP objects
request = Net::HTTP::Delete.new(uri, 'Content-Type' => 'application/json')
request.body = order_line_items_body

# Send the request
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
  http.request(request)
end

puts response.body
```

```
import requests
import json

#'ord_mSCP9was' is an example order id.
url = 'https://sandbox.shiphawk.com/api/v4/orders/ord_mSCP9was/order_line_items'
headers = {'X-Api-Key': 'YOUR_API_KEY'}
payload = {
  "order_line_items_ids": ["ordi_aKTSsMHG", "ordi_c3r1tMe0", "ordi_rf45FpNZ"],
}

r = requests.delete(url, headers=headers, json=payload)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;
import javax.json.*;
import javax.script.*;

public class DeleteRequestBody {
    public static void main(String [] args)
    {
        try{
            sendDelete();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }

private static void sendDelete() throws IOException {
    JsonObject body = Json.createObjectBuilder()
            .add("order_line_items_ids", Json.createArrayBuilder()
                .add("ordi_aKTSsMHG")
                .add("ordi_c3r1tMe0")
                .add("ordi_rf45FpNZ"))
            .build();
    try{
        // For formatting json object to be readable.
        ScriptEngineManager manager = new ScriptEngineManager();
        ScriptEngine scriptEngine = manager.getEngineByName("JavaScript");
        scriptEngine.put("jsonString", body.toString());
        scriptEngine.eval("result = JSON.stringify(JSON.parse(jsonString), null, 2)");
        String prettyPrintedJson = (String) scriptEngine.get("result");

URL url = new URL("https://sandbox.shiphawk.com/api/v4/orders/ord_mSCP9was/order_line_items?api_key=YOUR_API_KEY");
        HttpURLConnection con = (HttpURLConnection) url.openConnection();
        con.setRequestMethod("DELETE");
        con.setRequestProperty("Content-Type", "application/json");
        con.setDoOutput(true);
        OutputStream os = con.getOutputStream();
        os.write(body.toString().getBytes());
        os.flush();
        os.close();

int responseCode = con.getResponseCode();

if(responseCode == HttpURLConnection.HTTP_NO_CONTENT || responseCode == HttpURLConnection.HTTP_OK || responseCode == HttpURLConnection.HTTP_NO_CONTENT){
            BufferedReader in = new BufferedReader(
              new InputStreamReader(con.getInputStream()));
            String inputLine;
            StringBuffer content = new StringBuffer();
            while ((inputLine = in.readLine()) != null) {
                content.append(inputLine);
            }
            in.close();
            System.out.println(content.toString());
        }
        else{
            System.out.println("POST request failed. Code was " + responseCode);
            System.out.println("Body form:\n" +  prettyPrintedJson);
        }
    } catch(NullPointerException ex){
        ex.printStackTrace(System.out);
    } catch(ScriptException ex){
        ex.printStackTrace(System.out);
    }
    }
}
```

> Request: `DELETE /api/v4/orders/:id/order_line_items`

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String | Order id, `required` |
| order\_line\_item\_ids | Array\[order\_line\_item\_id\] | Array of Order Line Items Ids, `required`, maximum 500 ids |

> Response: no content

# Proposed Shipments

## Proposed Shipment Resources

### Proposed Shipment Request Object

Parameters are optional unless specified.

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| `rate_id` | String |  |
| `ship_date` | Date |  |
| `tracking_number` | String |  |
| `service_name` | String |  |
| `service_code` | String |  |
| `carrier_code` | String |  |
| `reset_carrier` | Boolean | Default: `false`. Nullifies carrier/service attributes during ProposedShipment update |
| `insurance_option` | String | One of: `add_insurance``no_insurance` |
| `license_plate_number` |  |  |
| `packages` | Array | List of Proposed Shipment Package Request objects |
| `pro_number` | String |  |
| `origin_instructions` | String |  |
| `destination_instructions` | String |  |
| `origin_address` | Hash | Object<br>{<br>`first_name`: String<br>`last_name`: String<br>`name`: String<br>`street1`: String<br>`street2`: String<br>`country`: String<br>`city`: String<br>`state`: String<br>`zip`: String<br>`phone_number`: String<br>`email`: String<br>`company`: String<br>`location_type`: String<br>`code`: String<br>`is_residential`: Boolean<br>} |
| `destination_address` | Hash | Object<br>{<br>`first_name`: String<br>`last_name`: String<br>`name`: String<br>`street1`: String<br>`street2`: String<br>`country`: String<br>`city`: String<br>`state`: String<br>`zip`: String<br>`phone_number`: String<br>`email`: String<br>`company`: String<br>`location_type`: String<br>`code`: String<br>`is_residential`: Boolean<br>`is_po_box`: Boolean (Optional)<br>} |
| `alternate_return_address` | Hash | Object<br>{<br>`first_name`: String<br>`last_name`: String<br>`name`: String<br>`street1`: String<br>`street2`: String<br>`country`: String<br>`city`: String<br>`state`: String<br>`zip`: String<br>`phone_number`: String<br>`email`: String<br>`company`: String<br>`location_type`: String<br>`code`: String<br>`is_residential`: Boolean<br>`is_po_box`: Boolean (Optional)<br>} |
| `reference_numbers` | Array | List of Reference Number Request objects |
| `fees` | Hash | Object:<br>{<br>`insurance`: Hash<br>{<br>`active`: Boolean (Default: `false`) `required`<br>}<br>} |
| `origin_accessorials` | Array\[Object\] | List of:<br>{<br>`type`: String `required`<br>`value`: String<br>`option_value`: String<br>} |
| `destination_accessorials` | Array\[Object\] | List of:<br>{<br>`type`: String `required`<br>`value`: String<br>`option_value`: String<br>} |
| `include_return_label` | Boolean | Default: `false` |
| `shipment_billing` | Hash | Shipment Billing Details Request object |
| `duties_taxes_billing` | Hash | Shipment Billing Details Request object |
| `pickup` | Hash | Object:<br>{<br>`start_time`: DateTime<br>`end_time`: DateTime<br>} |
| `shipment_line_items` | Array\[Hash\] | Array of hashes representing the shipment line items for this proposed shipment:<br>{<br>`quantity`: Integer<br>`sku`: String<br>`name`: String<br>`value`: Float<br>`currency`: String<br>`weight`: Float<br>`weight_uom`: String (One of: `lb`, `kg`)<br>`description`: String<br>`hs_code`: String<br>`country_of_origin`: String<br>`upc`: String<br>`child_sku`: String<br>`child_sku_quantity`: Integer<br>`line_number`: Integer<br>`order_line_item_id`: String<br>} |
| `warehouse_code` | String |  |
| `is_external` | Boolean |  |
| `shipping_price` | Float | Default: `0.0` |
| `carrier_name` | String |  |
| `eei` | Hash | Object:<br>{<br>`compliance`: String, One of: `itn`, `exemption_code`<br>`compliance_code`: String (`X20160406131357`, `NO EEI 30.37(a)`)<br>}<br>Allowed Exemption Codes:<br>`NO EEI 30.02(d)`, `NO EEI 30.36`, `NO EEI 30.37(a)`, `NO EEI 30.37(b)`, `NO EEI 30.37(f)`, `NO EEI 30.37(g)`, `NO EEI 30.37(h)`, `NO EEI 30.37(i)`, `NO EEI 30.37(j)`, `NO EEI 30.37(k)`, `NO EEI 30.37(l)`, `NO EEI 30.37(p)`, `NO EEI 30.39`, `NO EEI 30.40(a)`, `NO EEI 30.40(b)`, `NO EEI 30.40(c)`, `NO EEI 30.40(d)` |

### Proposed Shipment Response Object

```
{
    "id": "pshp_pHVCw8qS",
    "carrier": "USPS",
    "carrier_code": "usps",
    "service_name": "Priority Mail",
    "estimated_delivery_date": null,
    "service_days": null,
    "standardized_service_name": "Ground",
    "carrier_type": "Small Parcel",
    "tariff_insurance_rule": null,
    "is_customer_tariff": null,
    "insurance_type": "no_insurance",
    "order_id": "ord_K3JZv43A",
    "total_price": 0,
    "price_details": {
        "shipping": 0,
        "packing": 0,
        "insurance": 0,
        "accessorials": 0
    },
    "currency": "USD",
    "designated_dimension_uom": "in",
    "designated_weight_uom": "lb",
    "origin_address": {
        "name": "Name",
        "company": "Test Company",
        "street1": "1 FIRST ST",
        "street2": null,
        "city": "SANTA BARBARA",
        "state": "CA",
        "zip": "93000",
        "country": "US",
        "phone_number": "5551234567",
        "email": "email@example.com",
        "is_residential": false,
        "is_po_box": false,
        "address_type": "commercial"
    },
    "destination_address": {
        "name": "Name",
        "company": "Test Company",
        "street1": "2 FIRST ST",
        "street2": null,
        "city": "Santa Barbara",
        "state": "CA",
        "zip": "93002",
        "country": "US",
        "phone_number": "5561234567",
        "email": "email@example.com",
        "is_residential": true,
        "is_po_box": false,
        "address_type": "residential"
    },
    "alternate_return_address": null,
    "origin_accessorials": [],
    "destination_accessorials": [],
    "origin_instructions": null,
    "destination_instructions": null,
    "packages": [\
        {\
            "id": "pkg_SEh6CF4d",\
            "length": null,\
            "width": null,\
            "height": null,\
            "dimension_uom": "in",\
            "weight": 2,\
            "weight_uom": "lb",\
            "dry_ice_weight": null,\
            "volume": null,\
            "value": 425,\
            "freight_class": null,\
            "nmfc": null,\
            "packing_type": "parcel",\
            "package_type": null,\
            "package_quantity": 0,\
            "quantity": 1,\
            "commodity_description": "",\
            "carrier_container": null,\
            "unpacked_item_type_id": null,\
            "unpacked_item_type_name": null,\
            "number_of_units": 1,\
            "hazmat_data_list": [{\
                "dangerous_goods_type": null,\
                "battery_types": [],\
                "un_or_na_number": null,\
                "proper_shipping_name": null,\
                "technical_name": null,\
                "hazard_class_or_division": null,\
                "packing_group": null,\
                "emergency_response_phone_number": null,\
                "emergency_contact_name": null,\
                "emergency_contact_phone_number": null,\
                "regulation_level": null,\
                "container": null,\
                "amount": null,\
                "amount_unit": null,\
                "transportation_mode": null,\
                "additional_description": null\
            }],\
            "materials": [],\
            "labors": [],\
            "package_items": [\
                {\
                    "id": null,\
                    "product_sku": null,\
                    "product_upc": null,\
                    "product_sku_packing_code": null,\
                    "product_child_sku": null,\
                    "product_child_sku_quantity": null,\
                    "item_name": "Small Parcel",\
                    "description": null,\
                    "length": 1,\
                    "width": 1,\
                    "height": 1,\
                    "dimension_uom": "in",\
                    "weight": 1,\
                    "weight_uom": "lb",\
                    "volume": 0,\
                    "value": 1,\
                    "unpacked_item_type_id": 0,\
                    "freight_class": null,\
                    "nmfc": null,\
                    "hs_code": null,\
                    "country_of_origin": null,\
                    "quantity": 1,\
                    "order_line_item_id": null,\
                    "order_line_item_source_system_id": null,\
                    "order_line_item_source_system_line_number": null\
                },\
                {\
                    "id": null,\
                    "product_sku": null,\
                    "product_upc": null,\
                    "product_sku_packing_code": null,\
                    "product_child_sku": null,\
                    "product_child_sku_quantity": null,\
                    "item_name": "Small Parcel",\
                    "description": null,\
                    "length": 1,\
                    "width": 1,\
                    "height": 1,\
                    "dimension_uom": "in",\
                    "weight": 1,\
                    "weight_uom": "lb",\
                    "volume": 0,\
                    "value": 1,\
                    "unpacked_item_type_id": 0,\
                    "freight_class": null,\
                    "nmfc": null,\
                    "hs_code": null,\
                    "country_of_origin": null,\
                    "quantity": 1,\
                    "order_line_item_id": null,\
                    "order_line_item_source_system_id": null,\
                    "order_line_item_source_system_line_number": null\
                }\
            ],\
            "handling_unit_packages": [],\
            "accessorials": [],\
            "license_plate_number": null,\
            "customs_data_list": [\
                {\
                    "sku": null,\
                    "product_name": null,\
                    "quantity": null,\
                    "description": null,\
                    "country_of_origin": null,\
                    "hs_code": null,\
                    "unit_weight": null,\
                    "total_weight": null,\
                    "weight_uom": "lb",\
                    "unit_value": null,\
                    "total_value": null\
                },\
                {\
                    "sku": null,\
                    "product_name": null,\
                    "quantity": null,\
                    "description": null,\
                    "country_of_origin": null,\
                    "hs_code": null,\
                    "unit_weight": null,\
                    "total_weight": null,\
                    "weight_uom": "lb",\
                    "unit_value": null,\
                    "total_value": null\
                }\
            ],\
            "sscc_serial_references": [],\
            "system_package_id": null,\
            "preset_container": null,\
            "material_container_kind": null,\
            "materials_weight": null\
        }\
    ],
    "shipment_line_items": [\
        {\
            "order_line_item_id": null,\
            "quantity": 1,\
            "name": "Sample",\
            "description": "Description",\
            "sku": "AAA",\
            "upc": null,\
            "value": 225,\
            "currency": "USD",\
            "weight": 1,\
            "weight_uom": "lb",\
            "hs_code": null,\
            "country_of_origin": null,\
            "child_sku": null,\
            "child_sku_quantity": null,\
            "line_number": null,\
            "origin_order_number": null,\
            "is_kit": false,\
            "kit_id": null\
        },\
        {\
            "order_line_item_id": null,\
            "quantity": 1,\
            "name": "Sample2",\
            "description": "Description",\
            "sku": "BBB",\
            "upc": null,\
            "value": 200,\
            "currency": "USD",\
            "weight": 1,\
            "weight_uom": "lb",\
            "hs_code": null,\
            "country_of_origin": null,\
            "child_sku": null,\
            "child_sku_quantity": null,\
            "line_number": null,\
            "origin_order_number": null,\
            "is_kit": false,\
            "kit_id": null\
        }\
    ],
    "ship_date": "2019-01-25T09:00:00-06:00",
    "created_at": "2019-01-24T23:27:31+00:00",
    "policies_applied": [],
    "fees": {
        "insurance": {
            "active": false
        }
    },
    "include_return_label": false,
    "shipment_billing": null,
    "duties_taxes_billing": null,
    "reference_numbers": [],
    "warehouse_code": null,
    "warehouse_id": null,
    "error_message": "No Rates Available",
    "rate_id": null,
    "status": "unprocessed",
    "license_plate_number": null,
    "all_license_plate_numbers": [],
    "is_external": false,
    "carrier_name": null,
    "shipping_price": 0,
    "tracking_number": null,
    "is_dropship": null,
    "is_backordered": null,
    "eei": {
        "compliance": null,
        "compliance_code": null
    }
}
```

A proposed shipment is information describing a shipment that hasn't been created yet. You can use either a Rate or a Proposed Shipment in order to create a new shipment.

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | string |  |
| `carrier` | string |  |
| `carrier_code` | string |  |
| `service_name` | string |  |
| `estimated_delivery_date` | date | ISO 8601 formatted estimated date of delivery, i.e., YYYY-MM-DD |
| `service_days` | integer | Estimated number of days required to complete the delivery service. |
| `standardized_service_name` | string | Specifies which standardized service is being used for the proposed shipment:<br>`Ground``Guaranteed``Freight``International Economy``International Priority``Local Delivery``Next Day``Restricted Ground``Room of Choice``Same-Day Freight``Standard Courier``Standard Freight``Standard Vehicle``Three-Day Threshold``Two-Day``White Glove` |
| `carrier_type` | string | One of:<br>`truckload``blanket_wrap``courier``small_parcel``ltl``intermodal``auto``auto local_delivery``home_delivery``final_mile custom_carrier` |
| `tariff_insurance_rule` | string | One of:<br>`carrier``third_party``no_insurance` |
| `is_customer_tariff` | boolean | Indicates whether this shipment will be booked using your tariff or ShipHawk's tariff |
| `insurance_type` | string | One of:<br>`no_insurance``carrier``third_party``shiphawk` or `declined` |
| `order_id` | string | Public ID of related Order. |
| `total_price` | float | Sum of all of the prices in the price\_details attribute |
| `price_details` | object | Object:<br>{<br>`shipping`: Float<br>`packing`: Float<br>`insurance`: Float<br>`accessorials`: Float<br>} |
| `currency` | String | Proposed Shipment currency |
| `designated_dimension_uom` | string |  |
| `designated_weight_uom` | string |  |
| `origin_address` | object | `Optional`:<br>{<br>`name`: String<br>`company`: String<br>`street1`: String<br>`street2`: String<br>`city`: String<br>`state`: String<br>`zip`: String<br>`country`: String<br>`phone_number`: String<br>`email`: String<br>`is_residential`: Boolean<br>`is_po_box`: Boolean<br>`address_type`: String<br>} |
| `destination_address` | object | `Optional`:<br>{<br>`name`: String<br>`company`: String<br>`street1`: String<br>`street2`: String<br>`city`: String<br>`state`: String<br>`zip`: String<br>`country`: String<br>`phone_number`: String<br>`email`: String<br>`is_residential`: Boolean<br>`is_po_box`: Boolean<br>`address_type`: String<br>} |
| `alternate_return_address` | object | `Optional`:<br>{<br>`name`: String<br>`company`: String<br>`street1`: String<br>`street2`: String<br>`city`: String<br>`state`: String<br>`zip`: String<br>`country`: String<br>`phone_number`: String<br>`email`: String<br>`is_residential`: Boolean<br>`is_po_box`: Boolean<br>`address_type`: String<br>} |
| `destination_address_original` | [Address](https://docs.shiphawk.com/#address-object) | Original destination address |
| `destination_address_suggested` | [Address](https://docs.shiphawk.com/#suggested-address-response) | Suggested destination address |
| `origin_accessorials` | array\[object\] | Array of Object:<br>{<br>`id`: integer<br>`price`: float<br>`side`: string<br>`name`: string<br>`default`: boolean<br>`type`: string<br>`accessorial_type`: string<br>`value`: any type<br>`option_value`: string<br>`accessorial_options`: {<br>`title`: string<br>`value`: string<br> }<br>} |
| `destination_accessorials` | array\[object\] | Array of Object:<br>{<br>`id`: integer<br>`price`: float<br>`side`: string<br>`name`: string<br>`default`: boolean<br>`type`: string<br>`accessorial_type`: string<br>`value`: any type<br>`option_value`: string<br>`accessorial_options`: {<br>`title`: string<br>`value`: string<br> }<br>} |
| `origin_instructions` | string |  |
| `destination_instructions` | string |  |
| `packages` | array\[object\] | Proposed Shipment Package Response Object |
| `system_packages` | array\[ [Package](https://docs.shiphawk.com/#proposed-shipment-package-response-object)\] | System Packages |
| `shipment_line_items` | array\[hash\] | Array of hashes representing the shipment line items for this proposed shipment:<br>{<br>`order_line_item_id`: integer<br>`quantity`: integer<br>`name`: string<br>`description`: string<br>`sku`: string<br>`upc`: string<br>`value`: float<br>`currency`: string<br>`weight`: float<br>`weight_uom`: string<br>`hs_code`: string<br>`country_of_origin`: string<br>`child_sku`: string<br>`child_sku_quantity`: integer<br>`line_number`: integer<br>`origin_order_number`: string<br>} |
| `ship_date` | string | ISO 8601 formatted date, i.e. YYYY-MM-DD |
| `created_at` | string | ISO 8601 formatted date, i.e. YYYY-MM-DD |
| `policies_applied` | object | Object representing the rating rules applied for rating:<br>{<br>`id`: string<br>`name`: string<br>} |
| `fees` | object | Object determining whether there are active fees (currently supporting insurance fees):<br>{<br>`insurance`: json (returns active: proposed\_shipment.is\_insurance\_requested) <br>} |
| `include_return_label` | boolean |  |
| `shipment_billing` | object | Shipment Billing Details Response object |
| `duties_taxes_billing` | object | Shipment Billing Details Response object |
| `reference_numbers` | object | Object:<br>{<br>`id`: integer <br>`code`: string <br>`value`: string <br>`name`: string <br>} |
| `warehouse_code` | string |  |
| `warehouse_id` | string |  |
| `error_message` | string |  |
| `rate_id` | string |  |
| `status` | string |  |
| `license_plate_number` | string |  |
| `all_license_plate_numbers` | array | Array of string |
| `is_external` | boolean |  |
| `carrier_name` | string |  |
| `shipping_price` | float |  |
| `tracking_number` | string |  |
| `is_dropship` | boolean |  |
| `is_backordered` | boolean |  |
| `eei` | Hash | Object:<br>{<br>`compliance`: String<br>`compliance_code`: String<br>} |
| `single_reference_number` | String |  |
| `source_system_id` | String |  |
| `customs_data_list` | Array\[Object\] | \[{<br>`sku`: String<br>`product_name`: String<br>`quantity`: Integer<br>`description`: String<br>`country_of_origin`: String<br>`hs_code`: String<br>`unit_weight`: Float<br>`total_weight`: Float<br>`weight_uom`: String<br>`unit_value`: Float<br>`total_value`: Float<br>}\] |
| `carrier_account` | [CredentialAccount](https://docs.shiphawk.com/#credential-account-object) |  |
| `system_inventory_identifiers` | [SystemInventoryIdentifiers](https://docs.shiphawk.com/#system-inventory-identifiers-object) |  |

### Proposed Shipment Package Response Object

```
{
    "id": "pkg_SEh6CF4d",
    "length": null,
    "width": null,
    "height": null,
    "dimension_uom": "in",
    "weight": 2,
    "weight_uom": "lb",
    "dry_ice_weight": null,
    "volume": null,
    "value": 425,
    "freight_class": null,
    "nmfc": null,
    "packing_type": "parcel",
    "package_type": null,
    "package_quantity": 0,
    "quantity": 1,
    "commodity_description": "",
    "carrier_container": null,
    "unpacked_item_type_id": null,
    "unpacked_item_type_name": null,
    "number_of_units": 1,
    "hazmat_data_list": [{\
        "dangerous_goods_type": null,\
        "battery_types": [],\
        "un_or_na_number": null,\
        "proper_shipping_name": null,\
        "technical_name": null,\
        "hazard_class_or_division": null,\
        "packing_group": null,\
        "emergency_response_phone_number": null,\
        "emergency_contact_name": null,\
        "emergency_contact_phone_number": null,\
        "regulation_level": null,\
        "container": null,\
        "amount": null,\
        "amount_unit": null,\
        "transportation_mode": null,\
        "additional_description": null\
    }],
    "materials": [],
    "labors": [],
    "package_items": [\
        {\
            "id": null,\
            "product_sku": null,\
            "product_upc": null,\
            "product_sku_packing_code": null,\
            "product_child_sku": null,\
            "product_child_sku_quantity": null,\
            "item_name": "Small Parcel",\
            "description": null,\
            "length": 1,\
            "width": 1,\
            "height": 1,\
            "dimension_uom": "in",\
            "weight": 1,\
            "weight_uom": "lb",\
            "volume": 0,\
            "value": 1,\
            "unpacked_item_type_id": 0,\
            "freight_class": null,\
            "nmfc": null,\
            "hs_code": null,\
            "country_of_origin": null,\
            "quantity": 1,\
            "order_line_item_id": null,\
            "order_line_item_source_system_id": null,\
            "order_line_item_source_system_line_number": null\
        },\
        {\
            "id": null,\
            "product_sku": null,\
            "product_upc": null,\
            "product_sku_packing_code": null,\
            "product_child_sku": null,\
            "product_child_sku_quantity": null,\
            "item_name": "Small Parcel",\
            "description": null,\
            "length": 1,\
            "width": 1,\
            "height": 1,\
            "dimension_uom": "in",\
            "weight": 1,\
            "weight_uom": "lb",\
            "volume": 0,\
            "value": 1,\
            "unpacked_item_type_id": 0,\
            "freight_class": null,\
            "nmfc": null,\
            "hs_code": null,\
            "country_of_origin": null,\
            "quantity": 1,\
            "order_line_item_id": null,\
            "order_line_item_source_system_id": null,\
            "order_line_item_source_system_line_number": null\
        }\
    ],
    "handling_unit_packages": [],
    "accessorials": [],
    "license_plate_number": null,
    "sscc_serial_references": [],
    "customs_data_list": [\
        {\
            "sku": null,\
            "product_name": null,\
            "quantity": null,\
            "description": null,\
            "country_of_origin": null,\
            "hs_code": null,\
            "unit_weight": null,\
            "total_weight": null,\
            "weight_uom": "lb",\
            "unit_value": null,\
            "total_value": null\
        },\
        {\
            "sku": null,\
            "product_name": null,\
            "quantity": null,\
            "description": null,\
            "country_of_origin": null,\
            "hs_code": null,\
            "unit_weight": null,\
            "total_weight": null,\
            "weight_uom": "lb",\
            "unit_value": null,\
            "total_value": null\
        }\
    ]
}
```

| Attribute | Type | Description, Defaults |
| --- | --- | --- |
| `id` | string |  |
| `length` | float |  |
| `width` | float |  |
| `height` | float |  |
| `dimension_uom` | string |  |
| `weight` | float |  |
| `weight_uom` | string |  |
| `dry_ice_weight` | float |  |
| `volume` | float |  |
| `value` | float |  |
| `freight_class` | string |  |
| `nmfc` | string |  |
| `packing_type` | string |  |
| `package_type` | string |  |
| `package_quantity` | integer |  |
| `quantity` | integer |  |
| `commodity_description` | string |  |
| `carrier_container` | string |  |
| `unpacked_item_type_id` | string |  |
| `unpacked_item_type_name` | string |  |
| `number_of_units` | integer |  |
| `hazmat_data_list` | Array\[ [HazmatData](https://docs.shiphawk.com/#proposed-shipment-hazmatdata-object)\] |  |
| `materials` | array\[hash\] | List of packing material:<br>{<br>`name`: string<br>`unit_cost`: float<br>`ext_cost`: float<br>`weight`: float<br>`quantity`: integer <br>`uom` : string <br>} |
| `labors` | object | List of:<br>{<br>`name`: string<br>`unit_cost`: float<br>`ext_cost`: float<br>`quantity`: float<br>`uom`: string<br>} |
| `package_items` | array\[hash\] | List of:<br>{<br>`id`: string<br>`product_sku`: string<br>`product_upc`: string<br>`product_sku_packing_code`: string<br>`product_child_sku`: integer<br>`product_child_sku_quantity`: integer<br>`item_name`: string<br>`description`: string<br>`length`: float<br>`width`: float<br>`height`: float<br>`dimension_uom`: string<br>`weight`: float<br>`weight_uom`: string <br>`volume`: float<br>`value`: float<br>`unpacked_item_type_id`: string<br>`freight_class`: string<br>`nmfc`: string<br>`hs_code`: string<br>`country_of_origin`: string<br>`quantity`: integer <br>`order_line_item_id`: string<br>`order_line_item_source_system_id`: string<br>`order_line_item_source_system_line_number`: string <br>} |
| `handling_unit_packages` | array\[hash\] | List of:<br>{<br>`weight`: float<br>`weight_uom`: string<br>`dry_ice_weight`: float <br>`value`: float<br>`package_type`: string<br>`hazmat`: Deprecated<br>`freight_class`: string<br>`tracking_number`: string<br>`nmfc`: string<br>`number_of_units`: integer<br>`commodity_description`: string<br>`hazmat_data_list`: Array\[ [HandlingUnitPackage](https://docs.shiphawk.com/#proposed-shipment-handling-unit-package-object)\]<br>`package_items`: See `package_items` definition above<br>} |
| `accessorials` | array\[hash\] | List of:<br>{<br>`id`: integer<br>`price`: number<br>`side`: string<br>`name`: string<br>`default`: boolean<br>`type`: string<br>`accessorial_type`: string<br>`value`: any type<br>`option_value`: string<br>`accessorial_options`: {<br>`title`: string<br>`value`: string<br> }<br>} |
| `license_plate_number` | string |  |
| `sscc_serial_references` | Array | list of assigned Serial Shipping Container Codes (SSCC) |
| `customs_data_list` | Array\[Object\] | \[{<br>`sku`: String<br>`product_name`: String<br>`quantity`: Integer<br>`description`: String<br>`country_of_origin`: String<br>`hs_code`: String<br>`unit_weight`: Float<br>`total_weight`: Float<br>`weight_uom`: String<br>`unit_value`: Float<br>`total_value`: Float<br>}\] |
| `system_package_id` | String |  |
| `preset_container` | String |  |
| `material_container_kind` | String |  |
| `materials_weight` | Float |  |

### Credential Account Object

```
{
    "id": "ca_123456789",
    "name": "UPS Account",
    "provider_code": "ups",
    "provider_name": "UPS",
    "default": true,
    "integration_id": "987654321",
    "warehouse_id": "1122334455",
    "packing_types": [\
        "box",\
        "crate",\
        "pallet"\
    ],
    "insurance_categories": [\
        {\
            "id": "inscat_001",\
            "name": "Standard Insurance",\
        }\
    ]
}
```

| Attribute | Type | Description, Defaults |
| --- | --- | --- |
| `id` | String | Unique identifier of the packaging option. |
| `name` | String | Display name of the packaging or carrier option. |
| `provider_code` | String | Provider’s unique code for this packaging or carrier type. |
| `provider_name` | String | Name of the service provider (e.g., UPS, FedEx). |
| `default` | Boolean | Indicates whether this option is the default selection. |
| `integration_id` | String | ID referencing the integration or system connector. |
| `warehouse_id` | String | Public ID of the associated warehouse. |
| `packing_types` | Array\[String\] | Supported packing types. Possible values: `box`, `crate`, `pallet`. |
| `insurance_categories` | Array\[InsuranceCategory\] | List of insurance categories applicable to this provider or packaging type. |

### System Inventory Identifiers Object

| Attribute | Type | Description, Defaults |
| --- | --- | --- |
| `id` | String | Unique identifier of the package item or component. |
| `type` | String |  |
| `code` | String |  |
| `line_item_sku_id` | String |  |
| `package_items_count` | Integer | Number of individual items included in the package. |
| `proposed_shipment_id` | String | Identifier of the proposed shipment this item belongs to. |

### Proposed Shipment HazmatData Object

```
Example: Limited Quantity
{
    // ...,
    "hazmat_data": {
        "dangerous_goods_type": "limited_quantity"
    },
    // ...,
}
```

```
Example: Excepted Quantity
{
    // ...,
    "hazmat_data": {
        "dangerous_goods_type": "excepted_quantity"
    },
    // ...,
}
```

## Proposed Shipment API Endpoints

### Retrieve Proposed Shipments from a Order

```
# 'ord_Sq9Q39fx' is an example order id.
curl -X GET 'https://sandbox.shiphawk.com/api/v4/orders/ord_Sq9Q39fx/proposed_shipments/generate?api_key=YOUR_API_KEY'
```

```
require 'net/http'

uri = URI.parse('https://sandbox.shiphawk.com/api/v4/orders/ord_Sq9Q39fx/proposed_shipments?api_key=YOUR_API_KEY')
response = Net::HTTP.get(uri)
puts response
```

```
import requests

url = 'https://sandbox.shiphawk.com/api/v4/orders/ord_Sq9Q39fx/proposed_shipments'
headers = {'X-Api-Key': 'YOUR_API_KEY'}

r = requests.get(url, headers=headers)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;

public class GetRequests {
    public static void main(String [] args)
    {
        try{
            sendGet();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendGet() throws IOException {
        // 'ord_RfE8CtKE' is an example order id.
        URL url = new URL("https://sandbox.shiphawk.com/api/v4/orders/ord_RfE8CtKE/proposed_shipments?api_key=YOUR_API_KEY");
        HttpURLConnection con = (HttpURLConnection) url.openConnection();
        con.setRequestMethod("GET");
        int responseCode = con.getResponseCode();

> Request: GET /api/v4/orders/:id/proposed\_shipments

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String | Order id |

> Response: [proposed-shipment-response](https://docs.shiphawk.com/#proposed-shipment-response-object)

### Book a Proposed Shipment

```
#'ord_Sq9Q39fx' is an example order id.
curl -H "Content-Type: application/json" -X POST -d '
{
    "rate_id":"06e8521a-0b47-4497-cv2c-ff0abb6d58c9",
    "origin_address":{
      "name":"Name",
      "company":"Test Company",
      "street1":"1 FIRST ST",
      "phone_number":"5551234567",
      "city":"SANTA BARBARA",
      "state":"CA",
      "country":"US",
      "zip":"93000",
      "email":"email@example.com",
      "is_residential":false,
      "is_po_box":false
    },
    "destination_address":{
      "name":"Name",
      "company":"Test Company",
      "street1":"2 FIRST ST",
      "phone_number":"5561234567",
      "city":"Santa Barbara",
      "state":"CA",
      "country":"US",
      "zip":"93001",
      "email":"email@example.com",
      "is_residential":true,
      "is_po_box":false
    },
    "carrier_code":"usps",
    "service_name":"Priority Mail",
    "service_code":"Priority Mail",
    "proposed_shipment_id":"pshp_zW5SZ1SZ",
    "include_return_label":false,
    "insurance_option":"no_insurance",
    "order_source":"BigCommerce",
    "is_external":false,
    "shipping_price":7.1,
    "ship_date":"2018-12-20T08:28:13.000Z",
    "packages":[\
      {\
        "id":"pkg_JCVW80ZE",\
        "packing_type":"parcel",\
        "number_of_units":1,\
        "packed":true,\
        "value":"425",\
        "currency":"USD",\
        "dimension_uom":"in",\
        "weight":2.0,\
        "weight_uom":"lb",\
        "package_items":[],\
        "accessorials":[],\
        "quantity":1,\
        "item_type":"parcel",\
        "customs_data_list": [\
          {\
              "sku": "test_sku",\
              "product_name": "test_product_name",\
              "quantity": 1,\
              "description": "test_product_description",\
              "country_of_origin": "US",\
              "hs_code": 123321,\
              "unit_weight": null,\
              "total_weight": 100,\
              "weight_uom": "lb",\
              "unit_value": null,\
              "total_value": 100\
          },\
          {\
              "sku": "test_sku_2",\
              "product_name": "test_product_name_2",\
              "quantity": 3,\
              "description": "test_product_description_2",\
              "country_of_origin": "US",\
              "hs_code": 123321,\
              "unit_weight": null,\
              "total_weight": 100,\
              "weight_uom": "lb",\
              "unit_value": null,\
              "total_value": 100\
          }\
        ]\
      }\
    ],
    "shipment_line_items":[\
      {\
        "description":"Description",\
        "name":"Sample",\
        "sku":"AAA",\
        "quantity":1,\
        "price":225,\
        "value":225.0,\
        "currency":"USD",\
        "weight":1.0,\
        "order_line_item_id":"ordi_PGPRvEBB",\
        "source_system_id":"3"\
      },\
      {\
        "description":"Description",\
        "name":"Sample2",\
        "sku":"BBB",\
        "quantity":1,\
        "price":200,\
        "value":200.0,\
        "currency":"USD",\
        "weight":1.0,\
        "order_line_item_id":"ordi_h8ckEkff",\
        "source_system_id":"4"\
      }\
    ],
    "destination_accessorials":[],
    "origin_accessorials":[],
    "accessorials":[],
    "label_format":"PDF",
    "include_label_source":false
}' 'https://sandbox.shiphawk.com/api/v4/orders/ord_Sq9Q39fx/proposed_shipments/book?api_key=YOUR_API_KEY'
```

```
require 'net/http'
require 'uri'
require 'json'

#'ord_Sq9Q39fx' is an example order id.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/orders/ord_Sq9Q39fx/proposed_shipments/book?api_key=YOUR_API_KEY')

proposed_shipment =
'{
    "rate_id":"06e8521a-0b47-4497-cv2c-ff0abb6d58c9",
    "origin_address":{
      "name":"Name",
      "company":"Test Company",
      "street1":"1 FIRST ST",
      "phone_number":"5551234567",
      "city":"SANTA BARBARA",
      "state":"CA",
      "country":"US",
      "zip":"93000",
      "email":"email@example.com",
      "is_residential":false,
      "is_po_box":false
    },
    "destination_address":{
      "name":"Name",
      "company":"Test Company",
      "street1":"2 FIRST ST",
      "phone_number":"5561234567",
      "city":"Santa Barbara",
      "state":"CA",
      "country":"US",
      "zip":"93001",
      "email":"email@example.com",
      "is_residential":true,
      "is_po_box":false
    },
    "carrier_code":"usps",
    "service_name":"Priority Mail",
    "service_code":"Priority Mail",
    "proposed_shipment_id":"pshp_dZ7xjhhQ",
    "include_return_label":false,
    "insurance_option":"no_insurance",
    "order_source":"BigCommerce",
    "is_external":false,
    "shipping_price":7.1,
    "ship_date":"2018-12-20T08:28:13.000Z",
    "packages":[\
      {\
        "id":"pkg_JCVW80ZE",\
        "packing_type":"parcel",\
        "number_of_units":1,\
        "packed":true,\
        "value":"425",\
        "currency":"USD",\
        "dimension_uom":"in",\
        "weight":2.0,\
        "weight_uom":"lb",\
        "package_items":[],\
        "accessorials":[],\
        "quantity":1,\
        "item_type":"parcel",\
        "customs_data_list": [\
          {\
              "sku": "test_sku",\
              "product_name": "test_product_name",\
              "quantity": 1,\
              "description": "test_product_description",\
              "country_of_origin": "US",\
              "hs_code": 123321,\
              "unit_weight": null,\
              "total_weight": 100,\
              "weight_uom": "lb",\
              "unit_value": null,\
              "total_value": 100\
          },\
          {\
              "sku": "test_sku_2",\
              "product_name": "test_product_name_2",\
              "quantity": 3,\
              "description": "test_product_description_2",\
              "country_of_origin": "US",\
              "hs_code": 123321,\
              "unit_weight": null,\
              "total_weight": 100,\
              "weight_uom": "lb",\
              "unit_value": null,\
              "total_value": 100\
          }\
        ]\
      }\
    ],
    "shipment_line_items":[\
      {\
        "description":"Description",\
        "name":"Sample",\
        "sku":"AAA",\
        "quantity":1,\
        "price":225,\
        "value":225.0,\
        "currency":"USD",\
        "weight":1.0,\
        "order_line_item_id":"ordi_PGPRvEBB",\
        "source_system_id":"3"\
      },\
      {\
        "description":"Description",\
        "name":"Sample2",\
        "sku":"BBB",\
        "quantity":1,\
        "price":200,\
        "value":200.0,\
        "currency":"USD",\
        "weight":1.0,\
        "order_line_item_id":"ordi_h8ckEkff",\
        "source_system_id":"4"\
      }\
    ],
    "destination_accessorials":[],
    "origin_accessorials":[],
    "accessorials":[],
    "label_format":"PDF",
    "include_label_source":false
}'

# Create the HTTP objects
request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
request.body = proposed_shipment

# Send the request
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
    http.request(request)
end

puts response.body
```

```
import requests
import json

url = 'https://sandbox.shiphawk.com/api/v4/orders/ord_Sq9Q39fx/proposed_shipments/book'
headers = {'X-Api-Key': 'YOUR_API_KEY'}
payload = {
    "rate_id":"06e8521a-0b47-4497-cv2c-ff0abb6d58c9",
    "origin_address":{
      "name":"Name",
      "company":"Test Company",
      "street1":"1 FIRST ST",
      "phone_number":"5551234567",
      "city":"SANTA BARBARA",
      "state":"CA",
      "country":"US",
      "zip":"93000",
      "email":"email@example.com",
      "is_residential":false,
      "is_po_box":false
    },
    "destination_address":{
      "name":"Name",
      "company":"Test Company",
      "street1":"2 FIRST ST",
      "phone_number":"5561234567",
      "city":"Santa Barbara",
      "state":"CA",
      "country":"US",
      "zip":"93001",
      "email":"email@example.com",
      "is_residential":true,
      "is_po_box":false
    },
    "carrier_code":"usps",
    "service_name":"Priority Mail",
    "service_code":"Priority Mail",
    "proposed_shipment_id":"pshp_dZ7xjhhQ",
    "include_return_label":false,
    "insurance_option":"no_insurance",
    "order_source":"BigCommerce",
    "is_external":false,
    "shipping_price":7.1,
    "ship_date":"2018-12-20T08:28:13.000Z",
    "packages":[\
      {\
        "id":"pkg_JCVW80ZE",\
        "packing_type":"parcel",\
        "number_of_units":1,\
        "packed":true,\
        "value":"425",\
        "currency":"USD",\
        "dimension_uom":"in",\
        "weight":2.0,\
        "weight_uom":"lb",\
        "package_items":[],\
        "accessorials":[],\
        "quantity":1,\
        "item_type":"parcel",\
        "customs_data_list": [\
          {\
              "sku": "test_sku",\
              "product_name": "test_product_name",\
              "quantity": 1,\
              "description": "test_product_description",\
              "country_of_origin": "US",\
              "hs_code": 123321,\
              "unit_weight": null,\
              "total_weight": 100,\
              "weight_uom": "lb",\
              "unit_value": null,\
              "total_value": 100\
          },\
          {\
              "sku": "test_sku_2",\
              "product_name": "test_product_name_2",\
              "quantity": 3,\
              "description": "test_product_description_2",\
              "country_of_origin": "US",\
              "hs_code": 123321,\
              "unit_weight": null,\
              "total_weight": 100,\
              "weight_uom": "lb",\
              "unit_value": null,\
              "total_value": 100\
          }\
        ]\
      }\
    ],
    "shipment_line_items":[\
      {\
        "description":"Description",\
        "name":"Sample",\
        "sku":"AAA",\
        "quantity":1,\
        "price":225,\
        "value":225.0,\
        "currency":"USD",\
        "weight":1.0,\
        "order_line_item_id":"ordi_PGPRvEBB",\
        "source_system_id":"3"\
      },\
      {\
        "description":"Description",\
        "name":"Sample2",\
        "sku":"BBB",\
        "quantity":1,\
        "price":200,\
        "value":200.0,\
        "currency":"USD",\
        "weight":1.0,\
        "order_line_item_id":"ordi_h8ckEkff",\
        "source_system_id":"4"\
      }\
    ],
    "destination_accessorials":[],
    "origin_accessorials":[],
    "accessorials":[],
    "label_format":"PDF",
    "include_label_source":false
}

r = requests.post(url, headers=headers, json=payload)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;
import javax.json.*;
import javax.script.*;

public class PostRequests {
    public static void main(String [] args)
    {
        try{
            sendPost();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendPost() throws IOException {
        JsonObject personObject = Json.createObjectBuilder()
                .add("rate_id", "rate_3FqhSS7eakakwn9TeFccRV89")
                .add("order_number", "ORD10100111")
                .add("source_system", "ShipHawk eComm")
                .add("source_system_id", "SH123")
                .add("source", "Proprietary")
                .add("source_system_processed_at", "2016-03-01")
                .add("origin_address", Json.createObjectBuilder()
                    .add("name", "Name")
                    .add("company", "Test Company")
                    .add("street1", "1 FIRST ST")
                    .add("city", "Santa Barbara")
                    .add("state", "CA")
                    .add("country", "US")
                    .add("zip", "93000")
                    .add("email", "email@example.com")
                    .add("is_residential", false)
                    .add("is_po_box", false)
                    )
                .add("destination_address", Json.createObjectBuilder()
                    .add("name", "Name")
                    .add("company", "Test Company")
                    .add("street1", "2 FIRST ST")
                    .add("city", "Santa Barbara")
                    .add("state", "CA")
                    .add("country", "US")
                    .add("zip", "93001")
                    .add("email", "email@example.com")
                    .add("is_residential", true)
                    .add("is_po_box", false)
                    )
                .add("carrier_code", "usps")
                .add("service_name", "Priority Mail")
                .add("service_code", "Priority Mail")
                .add("proposed_shipment_id", "pshp_dZ7xjhhQ")
                .add("include_return_label", false)
                .add("insurance_option", "no_insurance")
                .add("order_source", "BigCommerce")
                .add("is_external", false)
                .add("shipping_price", 7.1)
                .add("ship_date", "2018-12-20T08:28:13.000Z")
                .add("order_line_items", Json.createArrayBuilder()
                    .add(Json.createObjectBuilder()
                        .add("id", "pkg_JCVW80ZE")
                        .add("packing_type", "parcel")
                        .add("number_of_units", 1)
                        .add("packed", true)
                        .add("value", "425")
                        .add("currency", "USD")
                        .add("dimension_uom", "in")
                        .add("weight", 2.0)
                        .add("weight_uom", "lb")
                        .add("package_items", Json.createArrayBuilder())
                        .add("accessorials", Json.createArrayBuilder())
                        .add("quantity", 1)
                        .add("item_type", "parcel")
                        )
                    )
                .add("shipment_line_items", Json.createArrayBuilder()
                    .add(Json.createObjectBuilder()
                        .add("description", "Description")
                        .add("name", "Sample")
                        .add("sku", "AAA")
                        .add("quantity", 1)
                        .add("price", 225)
                        .add("value", 225.0)
                        .add("currency", "USD")
                        .add("weight", 1.0)
                        .add("order_line_item_id", "ordi_PGPRvEBB")
                        .add("source_system_id", "3")
                        )
                    .add(Json.createObjectBuilder()
                        .add("description", "Description")
                        .add("name", "Sample2")
                        .add("sku", "BBB")
                        .add("quantity", 1)
                        .add("price", 200)
                        .add("value", 200.0)
                        .add("currency", "USD")
                        .add("weight", 1.0)
                        .add("order_line_item_id", "ordi_h8ckEkff")
                        .add("source_system_id", "4")
                        )
                    )
                .add("destination_accessorials", Json.createArrayBuilder())
                .add("origin_accessorials", Json.createArrayBuilder())
                .add("accessorials", Json.createArrayBuilder())
                .add("label_format", "PDF")
                .add("include_label_source", false)
                .build();
        try{
            // For formatting json object to be readable
            ScriptEngineManager manager = new ScriptEngineManager();
            ScriptEngine scriptEngine = manager.getEngineByName("JavaScript");
            scriptEngine.put("jsonString", personObject.toString());
            scriptEngine.eval("result = JSON.stringify(JSON.parse(jsonString), null, 2)");
            String prettyPrintedJson = (String) scriptEngine.get("result");

// 'ord_Sq9Q39fx' is an example order id.
            URL url = new URL("https://sandbox.shiphawk.com/api/v4/orders/ord_Sq9Q39fx/proposed_shipments/book?api_key=YOUR_API_KEY");
            HttpURLConnection con = (HttpURLConnection) url.openConnection();
            con.setRequestMethod("POST");
            con.setRequestProperty("Content-Type", "application/json");
            con.setDoOutput(true);
            OutputStream os = con.getOutputStream();
            os.write(personObject.toString().getBytes());
            os.flush();
            os.close();

int responseCode = con.getResponseCode();

> Request: POST /api/v4/orders/:id/proposed\_shipments/book

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| `rate_id` | String |  |
| `origin_address` | Hash | Object<br>{<br>`first_name`: String<br>`last_name`: String<br>`name`: String<br>`street1`: String<br>`street2`: String<br>`country`: String<br>`city`: String<br>`state`: String<br>`zip`: String<br>`phone_number`: String<br>`email`: String<br>`company`: String<br>`location_type`: String<br>`code`: String<br>`is_residential`: Boolean<br>} |
| `destination_address` | Hash | Object<br>{<br>`first_name`: String<br>`last_name`: String<br>`name`: String<br>`street1`: String<br>`street2`: String<br>`country`: String<br>`city`: String<br>`state`: String<br>`zip`: String<br>`phone_number`: String<br>`email`: String<br>`company`: String<br>`location_type`: String<br>`code`: String<br>`is_residential`: Boolean<br>`is_po_box`: Boolean (Optional)<br>} |
| `tracking_number` | String |  |
| `service_name` | String |  |
| `service_code` | String |  |
| `proposed_shipment_id` | String |  |
| `carrier_code` | String |  |
| `insurance_option` | String | One of: `add_insurance``no_insurance` |
| `order_source` | String |  |
| `is_external` | Boolean |  |
| `shipping_price` | Float | Default: `0.0` |
| `ship_date` | Date |  |
| `packages` | Array | List of Proposed Shipment Package Request objects |
| `shipment_line_items` | Array\[Hash\] | Array of hashes representing the shipment line items for this proposed shipment:<br>{<br>`quantity`: Integer<br>`sku`: String<br>`name`: String<br>`value`: Float<br>`currency`: String<br>`weight`: Float<br>`weight_uom`: String (One of: `lb`, `kg`)<br>`description`: String<br>`hs_code`: String<br>`country_of_origin`: String<br>`upc`: String<br>`child_sku`: String<br>`child_sku_quantity`: Integer<br>`line_number`: Integer<br>`order_line_item_id`: String<br>} |
| `origin_accessorials` | Array\[Object\] | List of:<br>{<br>`type`: String `required`<br>`value`: String<br>`option_value`: String<br>} |
| `destination_accessorials` | Array\[Object\] | List of:<br>{<br>`type`: String `required`<br>`value`: String<br>`option_value`: String<br>} |
| `accessorials` | Array\[Object\] | List of:<br>{<br>`type`: String `required`<br>`value`: String<br>`option_value`: String<br>} |
| `label_format` | String |  |
| `include_label_source` | Boolean | Default: `false` |
| `include_return_label` | Boolean | Default: `false` |

> Response: [proposed-shipment-response](https://docs.shiphawk.com/#proposed-shipment-response-object)

### Book async a Proposed Shipment

```
require 'net/http'
require 'uri'
require 'json'

#'ord_Sq9Q39fx' is an example order id.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/orders/ord_Sq9Q39fx/proposed_shipments/book_async?api_key=YOUR_API_KEY')

# Create the HTTP objects
request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
request.body = proposed_shipment

# Send the request
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
    http.request(request)
end

puts response.body
```

```
import requests
import json

url = 'https://sandbox.shiphawk.com/api/v4/orders/ord_Sq9Q39fx/proposed_shipments/book_async'
headers = {'X-Api-Key': 'YOUR_API_KEY'}
payload = {
    "rate_id":"06e8521a-0b47-4497-cv2c-ff0abb6d58c9",
    "origin_address":{
      "name":"Name",
      "company":"Test Company",
      "street1":"1 FIRST ST",
      "phone_number":"5551234567",
      "city":"SANTA BARBARA",
      "state":"CA",
      "country":"US",
      "zip":"93000",
      "email":"email@example.com",
      "is_residential":false,
      "is_po_box":false
    },
    "destination_address":{
      "name":"Name",
      "company":"Test Company",
      "street1":"2 FIRST ST",
      "phone_number":"5561234567",
      "city":"Santa Barbara",
      "state":"CA",
      "country":"US",
      "zip":"93001",
      "email":"email@example.com",
      "is_residential":true,
      "is_po_box":false
    },
    "carrier_code":"usps",
    "service_name":"Priority Mail",
    "service_code":"Priority Mail",
    "proposed_shipment_id":"pshp_dZ7xjhhQ",
    "include_return_label":false,
    "insurance_option":"no_insurance",
    "order_source":"BigCommerce",
    "is_external":false,
    "shipping_price":7.1,
    "ship_date":"2018-12-20T08:28:13.000Z",
    "packages":[\
      {\
        "id":"pkg_JCVW80ZE",\
        "packing_type":"parcel",\
        "number_of_units":1,\
        "packed":true,\
        "value":"425",\
        "dimension_uom":"in",\
        "weight":2.0,\
        "weight_uom":"lb",\
        "package_items":[],\
        "accessorials":[],\
        "quantity":1,\
        "item_type":"parcel"\
      }\
    ],
    "shipment_line_items":[\
      {\
        "description":"Description",\
        "name":"Sample",\
        "sku":"AAA",\
        "quantity":1,\
        "price":225,\
        "value":225.0,\
        "weight":1.0,\
        "order_line_item_id":"ordi_PGPRvEBB",\
        "source_system_id":"3"\
      },\
      {\
        "description":"Description",\
        "name":"Sample2",\
        "sku":"BBB",\
        "quantity":1,\
        "price":200,\
        "value":200.0,\
        "weight":1.0,\
        "order_line_item_id":"ordi_h8ckEkff",\
        "source_system_id":"4"\
      }\
    ],
    "destination_accessorials":[],
    "origin_accessorials":[],
    "accessorials":[],
    "label_format":"PDF",
    "include_label_source":false
}

r = requests.post(url, headers=headers, json=payload)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;
import javax.json.*;
import javax.script.*;

// 'ord_Sq9Q39fx' is an example order id.
            URL url = new URL("https://sandbox.shiphawk.com/api/v4/orders/ord_Sq9Q39fx/proposed_shipments/book_async?api_key=YOUR_API_KEY");
            HttpURLConnection con = (HttpURLConnection) url.openConnection();
            con.setRequestMethod("POST");
            con.setRequestProperty("Content-Type", "application/json");
            con.setDoOutput(true);
            OutputStream os = con.getOutputStream();
            os.write(personObject.toString().getBytes());
            os.flush();
            os.close();

int responseCode = con.getResponseCode();

> Request: POST /api/v4/orders/:id/proposed\_shipments/book\_async

[Params](https://docs.shiphawk.com/#proposed-shipment-request-object)

> Response: \[ [Job Tracker object](https://docs.shiphawk.com/#job-tracker-response-object)\]

### Generate a Proposed Shipment

```
#'ord_Sq9Q39fx' is an example order id.
curl -X POST 'https://sandbox.shiphawk.com/api/v4/orders/ord_Sq9Q39fx/proposed_shipments/generate?api_key=YOUR_API_KEY'
```

```
require 'net/http'

#'ord_Sq9Q39fx' is an example order id.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/orders/ord_Sq9Q39fx/proposed_shipments/generate?api_key=YOUR_API_KEY')

# Create the HTTP objects
request = Net::HTTP::Post.new(uri.request_uri)

# Send the request
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
    http.request(request)
end

puts response.body
```

```
import requests

url = 'https://sandbox.shiphawk.com/api/v4/orders/ord_Sq9Q39fx/proposed_shipments/generate'
headers = {'X-Api-Key': 'YOUR_API_KEY'}

r = requests.post(url, headers=headers)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;

public class PostRequestsSimple {
    public static void main(String [] args)
    {
        try{
            sendPost();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendPost() throws IOException {
        // 'ord_RfE8CtKE' is an example order id.
        URL url = new URL("https://sandbox.shiphawk.com/api/v4/orders/ord_RfE8CtKE/proposed_shipments/generate?api_key=YOUR_API_KEY");
        HttpURLConnection con = (HttpURLConnection) url.openConnection();
        con.setRequestMethod("POST");
        con.setRequestProperty("Content-Type", "application/json");

int responseCode = con.getResponseCode();

> Request: POST /api/v4/orders/:id/proposed\_shipments/generate

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String | Order id |

> Response: [proposed-shipment-response](https://docs.shiphawk.com/#proposed-shipment-response-object)

### Create a Proposed Shipment

```
#'ord_Sq9Q39fx' is an example order id.
curl -H "Content-Type: application/json" -X POST -d '
{
    "origin_address":{
      "name":"Name",
      "company":"Test Company",
      "street1":"1 FIRST ST",
      "phone_number":"5551234567",
      "city":"SANTA BARBARA",
      "state":"CA",
      "country":"US",
      "zip":"93000",
      "email":"email@example.com",
      "is_residential":false,
      "is_po_box":false
    },
    "destination_address":{
      "name":"Name",
      "company":"Test Company",
      "street1":"2 FIRST ST",
      "phone_number":"5561234567",
      "city":"Santa Barbara",
      "state":"CA",
      "country":"US",
      "zip":"93001",
      "email":"email@example.com",
      "is_residential":true,
      "is_po_box":false
    },
    "carrier_code":"usps",
    "service_name":"Priority Mail",
    "service_code":"Priority Mail",
    "proposed_shipment_id":"pshp_zW5SZ1SZ",
    "include_return_label":false,
    "return_label_service_name":"",
    "insurance_option":"no_insurance",
    "order_source":"BigCommerce",
    "is_external":false,
    "shipping_price":7.1,
    "ship_date":"2018-12-20T08:49:30.000Z",
    "reference_numbers":[],
    "packages":[\
      {\
        "id":"pkg_JCVW80ZE",\
        "packing_type":"parcel",\
        "number_of_units":1,\
        "packed":true,\
        "value":"425",\
        "dimension_uom":"in",\
        "weight":2.0,\
        "weight_uom":"lb",\
        "package_items":[\
          {\
            "order_line_item_id":"ofdi_h8xkEfdk",\
            "quantity":1\
          },\
          {\
            "order_line_item_id":"ordt_PDGsvEAA",\
            "quantity":1\
          }\
        ],\
        "accessorials":[],\
        "quantity":1,\
        "item_type":"parcel"\
      }\
    ],
    "shipment_line_items":[\
      {\
        "description":"Description",\
        "name":"Sample",\
        "sku":"AAA",\
        "quantity":1,\
        "price":225,\
        "value":225.0,\
        "weight":1.0,\
        "order_line_item_id":"ordi_PGPRvEBB",\
        "source_system_id":"3"\
      },\
      {\
        "description":"Description",\
        "name":"Sample2",\
        "sku":"BBB",\
        "quantity":1,\
        "price":200,\
        "value":200.0,\
        "weight":1.0,\
        "order_line_item_id":"ordi_h8ckEkff",\
        "source_system_id":"4"\
      }\
    ],
    "destination_accessorials":[],
    "origin_accessorials":[],
    "accessorials":[]
}' 'https://sandbox.shiphawk.com/api/v4/orders/ord_Sq9Q39fx/proposed_shipments?api_key=YOUR_API_KEY'
```

```
require 'net/http'
require 'uri'
require 'json'

#'ord_Sq9Q39fx' is an example order id.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/orders/ord_Sq9Q39fx/proposed_shipments?api_key=YOUR_API_KEY')

proposed_shipment =
'{
    "origin_address":{
      "name":"Name",
      "company":"Test Company",
      "street1":"1 FIRST ST",
      "phone_number":"5551234567",
      "city":"SANTA BARBARA",
      "state":"CA",
      "country":"US",
      "zip":"93000",
      "email":"email@example.com",
      "is_residential":false,
      "is_po_box":false
    },
    "destination_address":{
      "name":"Name",
      "company":"Test Company",
      "street1":"2 FIRST ST",
      "phone_number":"5561234567",
      "city":"Santa Barbara",
      "state":"CA",
      "country":"US",
      "zip":"93001",
      "email":"email@example.com",
      "is_residential":true,
      "is_po_box":false
    },
    "carrier_code":"usps",
    "service_name":"Priority Mail",
    "service_code":"Priority Mail",
    "proposed_shipment_id":"pshp_zW5SZ1SZ",
    "include_return_label":false,
    "return_label_service_name":"",
    "insurance_option":"no_insurance",
    "order_source":"BigCommerce",
    "is_external":false,
    "shipping_price":7.1,
    "ship_date":"2018-12-20T08:49:30.000Z",
    "reference_numbers":[],
    "packages":[\
      {\
        "id":"pkg_JCVW80ZE",\
        "packing_type":"parcel",\
        "number_of_units":1,\
        "packed":true,\
        "value":"425",\
        "dimension_uom":"in",\
        "weight":2.0,\
        "weight_uom":"lb",\
        "package_items":[\
          {\
            "order_line_item_id":"ofdi_h8xkEfdk",\
            "quantity":1\
          },\
          {\
            "order_line_item_id":"ordt_PDGsvEAA",\
            "quantity":1\
          }\
        ],\
        "accessorials":[],\
        "quantity":1,\
        "item_type":"parcel"\
      }\
    ],
    "shipment_line_items":[\
      {\
        "description":"Description",\
        "name":"Sample",\
        "sku":"AAA",\
        "quantity":1,\
        "price":225,\
        "value":225.0,\
        "weight":1.0,\
        "order_line_item_id":"ordi_PGPRvEBB",\
        "source_system_id":"3"\
      },\
      {\
        "description":"Description",\
        "name":"Sample2",\
        "sku":"BBB",\
        "quantity":1,\
        "price":200,\
        "value":200.0,\
        "weight":1.0,\
        "order_line_item_id":"ordi_h8ckEkff",\
        "source_system_id":"4"\
      }\
    ],
    "destination_accessorials":[],
    "origin_accessorials":[],
    "accessorials":[]
}'

# Create the HTTP objects
request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
request.body = proposed_shipment

# Send the request
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
    http.request(request)
end

puts response.body
```

```
import requests
import json

url = 'https://sandbox.shiphawk.com/api/v4/orders/ord_Sq9Q39fx/proposed_shipments'
headers = {'X-Api-Key': 'YOUR_API_KEY'}
payload = {
    "origin_address":{
      "name":"Name",
      "company":"Test Company",
      "street1":"1 FIRST ST",
      "phone_number":"5551234567",
      "city":"SANTA BARBARA",
      "state":"CA",
      "country":"US",
      "zip":"93000",
      "email":"email@example.com",
      "is_residential":false,
      "is_po_box":false
    },
    "destination_address":{
      "name":"Name",
      "company":"Test Company",
      "street1":"2 FIRST ST",
      "phone_number":"5561234567",
      "city":"Santa Barbara",
      "state":"CA",
      "country":"US",
      "zip":"93001",
      "email":"email@example.com",
      "is_residential":true,
      "is_po_box":false
    },
    "carrier_code":"usps",
    "service_name":"Priority Mail",
    "service_code":"Priority Mail",
    "proposed_shipment_id":"pshp_zW5SZ1SZ",
    "include_return_label":false,
    "return_label_service_name":"",
    "insurance_option":"no_insurance",
    "order_source":"BigCommerce",
    "is_external":false,
    "shipping_price":7.1,
    "ship_date":"2018-12-20T08:49:30.000Z",
    "reference_numbers":[],
    "packages":[\
      {\
        "id":"pkg_JCVW80ZE",\
        "packing_type":"parcel",\
        "number_of_units":1,\
        "packed":true,\
        "value":"425",\
        "dimension_uom":"in",\
        "weight":2.0,\
        "weight_uom":"lb",\
        "package_items":[\
          {\
            "order_line_item_id":"ofdi_h8xkEfdk",\
            "quantity":1\
          },\
          {\
            "order_line_item_id":"ordt_PDGsvEAA",\
            "quantity":1\
          }\
        ],\
        "accessorials":[],\
        "quantity":1,\
        "item_type":"parcel"\
      }\
    ],
    "shipment_line_items":[\
      {\
        "description":"Description",\
        "name":"Sample",\
        "sku":"AAA",\
        "quantity":1,\
        "price":225,\
        "value":225.0,\
        "weight":1.0,\
        "order_line_item_id":"ordi_PGPRvEBB",\
        "source_system_id":"3"\
      },\
      {\
        "description":"Description",\
        "name":"Sample2",\
        "sku":"BBB",\
        "quantity":1,\
        "price":200,\
        "value":200.0,\
        "weight":1.0,\
        "order_line_item_id":"ordi_h8ckEkff",\
        "source_system_id":"4"\
      }\
    ],
    "destination_accessorials":[],
    "origin_accessorials":[],
    "accessorials":[]
}

r = requests.post(url, headers=headers, json=payload)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;
import javax.json.*;
import javax.script.*;

public class PostRequests {
    public static void main(String [] args)
    {
        try{
            sendPost();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendPost() throws IOException {
        JsonObject personObject = Json.createObjectBuilder()
                .add("origin_address", Json.createObjectBuilder()
                    .add("name", "Name")
                    .add("company", "Test Company")
                    .add("street1", "1 FIRST ST")
                    .add("city", "Santa Barbara")
                    .add("state", "CA")
                    .add("country", "US")
                    .add("zip", "93000")
                    .add("email", "email@example.com")
                    .add("is_residential", false)
                    .add("is_po_box", false)
                    )
                .add("destination_address", Json.createObjectBuilder()
                    .add("name", "Name")
                    .add("company", "Test Company")
                    .add("street1", "2 FIRST ST")
                    .add("city", "Santa Barbara")
                    .add("state", "CA")
                    .add("country", "US")
                    .add("zip", "93001")
                    .add("email", "email@example.com")
                    .add("is_residential", true)
                    .add("is_po_box", false)
                    )
                .add("carrier_code", "usps")
                .add("service_name", "Priority Mail")
                .add("service_code", "Priority Mail")
                .add("proposed_shipment_id", "pshp_dZ7xjhhQ")
                .add("include_return_label", false)
                .add("insurance_option", "no_insurance")
                .add("order_source", "BigCommerce")
                .add("is_external", false)
                .add("shipping_price", 7.1)
                .add("ship_date", "2018-12-20T08:28:13.000Z")
                .add("order_line_items", Json.createArrayBuilder()
                    .add(Json.createObjectBuilder()
                        .add("id", "pkg_JCVW80ZE")
                        .add("packing_type", "parcel")
                        .add("number_of_units", 1)
                        .add("packed", true)
                        .add("value", "425")
                        .add("dimension_uom", "in")
                        .add("weight", 2.0)
                        .add("weight_uom", "lb")
                        .add("package_items", Json.createArrayBuilder())
                        .add("accessorials", Json.createArrayBuilder())
                        .add("quantity", 1)
                        .add("item_type", "parcel")
                        )
                    )
                .add("shipment_line_items", Json.createArrayBuilder()
                    .add(Json.createObjectBuilder()
                        .add("description", "Description")
                        .add("name", "Sample")
                        .add("sku", "AAA")
                        .add("quantity", 1)
                        .add("price", 225)
                        .add("value", 225.0)
                        .add("weight", 1.0)
                        .add("order_line_item_id", "ordi_PGPRvEBB")
                        .add("source_system_id", "3")
                        )
                    .add(Json.createObjectBuilder()
                        .add("description", "Description")
                        .add("name", "Sample2")
                        .add("sku", "BBB")
                        .add("quantity", 1)
                        .add("price", 200)
                        .add("value", 200.0)
                        .add("weight", 1.0)
                        .add("order_line_item_id", "ordi_h8ckEkff")
                        .add("source_system_id", "4")
                        )
                    )
                .add("destination_accessorials", Json.createArrayBuilder())
                .add("origin_accessorials", Json.createArrayBuilder())
                .add("accessorials", Json.createArrayBuilder())
                .build();
        try{
            // For formatting json object to be readable
            ScriptEngineManager manager = new ScriptEngineManager();
            ScriptEngine scriptEngine = manager.getEngineByName("JavaScript");
            scriptEngine.put("jsonString", personObject.toString());
            scriptEngine.eval("result = JSON.stringify(JSON.parse(jsonString), null, 2)");
            String prettyPrintedJson = (String) scriptEngine.get("result");

// 'ord_gYcgBh5K' is an example order id.
            URL url = new URL("https://sandbox.shiphawk.com/api/v4/orders/ord_gYcgBh5K/proposed_shipments?api_key=YOUR_API_KEY");
            HttpURLConnection con = (HttpURLConnection) url.openConnection();
            con.setRequestMethod("POST");
            con.setRequestProperty("Content-Type", "application/json");
            con.setDoOutput(true);
            OutputStream os = con.getOutputStream();
            os.write(personObject.toString().getBytes());
            os.flush();
            os.close();

int responseCode = con.getResponseCode();

> Request: POST /api/v4/orders/:id/proposed\_shipments

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| `origin_address` | Hash | Object<br>{<br>`first_name`: String<br>`last_name`: String<br>`name`: String<br>`street1`: String<br>`street2`: String<br>`country`: String<br>`city`: String<br>`state`: String<br>`zip`: String<br>`phone_number`: String<br>`email`: String<br>`company`: String<br>`location_type`: String<br>`code`: String<br>`is_residential`: Boolean<br>} |
| `destination_address` | Hash | Object<br>{<br>`first_name`: String<br>`last_name`: String<br>`name`: String<br>`street1`: String<br>`street2`: String<br>`country`: String<br>`city`: String<br>`state`: String<br>`zip`: String<br>`phone_number`: String<br>`email`: String<br>`company`: String<br>`location_type`: String<br>`code`: String<br>`is_residential`: Boolean<br>`is_po_box`: Boolean (Optional)<br>} |
| `tracking_number` | String |  |
| `service_name` | String |  |
| `service_code` | String |  |
| `proposed_shipment_id` | String |  |
| `carrier_code` | String |  |
| `return_label_service_name` | String |  |
| `insurance_option` | String | One of: `add_insurance``no_insurance` |
| `order_source` | String |  |
| `is_external` | Boolean |  |
| `shipping_price` | Float | Default: `0.0` |
| `ship_date` | Date |  |
| `reference_numbers` | Array | Array of reference number objects |
| `packages` | Array | List of Proposed Shipment Package Request objects |
| `shipment_line_items` | Array\[Hash\] | Array of hashes representing the shipment line items for this proposed shipment:<br>{<br>`quantity`: Integer<br>`sku`: String<br>`name`: String<br>`value`: Float<br>`weight`: Float<br>`weight_uom`: String (One of: `lb`, `kg`)<br>`description`: String<br>`hs_code`: String<br>`country_of_origin`: String<br>`upc`: String<br>`child_sku`: String<br>`child_sku_quantity`: Integer<br>`line_number`: Integer<br>`order_line_item_id`: String<br>} |
| `origin_accessorials` | Array\[Object\] | List of:<br>{<br>`type`: String `required`<br>`value`: String<br>`option_value`: String<br>} |
| `destination_accessorials` | Array\[Object\] | List of:<br>{<br>`type`: String `required`<br>`value`: String<br>`option_value`: String<br>} |
| `accessorials` | Array\[Object\] | List of:<br>{<br>`type`: String `required`<br>`value`: String<br>`option_value`: String<br>} |
| `label_format` | String |  |
| `include_label_source` | Boolean | Default: `false` |

> Response: [proposed-shipment-response](https://docs.shiphawk.com/#proposed-shipment-response-object)

### Edit a Proposed Shipment

```
#'pshp_sfbMrjqZ' is an example proposed shipment id, and 'ord_Sq9Q39fx' is an example order id.
curl -H "Content-Type: application/json" -X POST -d '
{
    "origin_address":{
      "name":"Name",
      "company":"Test Company",
      "street1":"1 FIRST ST",
      "phone_number":"5551234567",
      "city":"SANTA BARBARA",
      "state":"CA",
      "country":"US",
      "zip":"93000",
      "email":"email@example.com",
      "is_residential":false,
      "is_po_box":false
    },
    "destination_address":{
      "name":"Name",
      "company":"Test Company",
      "street1":"2 FIRST ST",
      "phone_number":"5561234567",
      "city":"Santa Barbara",
      "state":"CA",
      "country":"US",
      "zip":"93001",
      "email":"email@example.com",
      "is_residential":true,
      "is_po_box":false
    },
    "carrier_code":"usps",
    "service_name":"Priority Mail",
    "service_code":"Priority Mail",
    "proposed_shipment_id":"pshp_zW5SZ1SZ",
    "include_return_label":false,
    "return_label_service_name":"",
    "insurance_option":"no_insurance",
    "order_source":"BigCommerce",
    "is_external":false,
    "shipping_price":7.1,
    "ship_date":"2018-12-20T08:49:30.000Z",
    "reference_numbers":[],
    "packages":[\
      {\
        "id":"pkg_JCVW80ZE",\
        "packing_type":"parcel",\
        "number_of_units":1,\
        "packed":true,\
        "value":"425",\
        "dimension_uom":"in",\
        "weight":2.0,\
        "weight_uom":"lb",\
        "package_items":[\
          {\
            "order_line_item_id":"ofdi_h8xkEfdk",\
            "quantity":1\
          },\
          {\
            "order_line_item_id":"ordt_PDGsvEAA",\
            "quantity":1\
          }\
        ],\
        "accessorials":[],\
        "quantity":1,\
        "item_type":"parcel"\
      }\
    ],
    "shipment_line_items":[\
      {\
        "description":"Description",\
        "name":"Sample",\
        "sku":"AAA",\
        "quantity":1,\
        "price":225,\
        "value":225.0,\
        "weight":1.0,\
        "order_line_item_id":"ordi_PGPRvEBB",\
        "source_system_id":"3"\
      },\
      {\
        "description":"Description",\
        "name":"Sample2",\
        "sku":"BBB",\
        "quantity":1,\
        "price":200,\
        "value":200.0,\
        "weight":1.0,\
        "order_line_item_id":"ordi_h8ckEkff",\
        "source_system_id":"4"\
      }\
    ],
    "destination_accessorials":[],
    "origin_accessorials":[],
    "accessorials":[]
}' 'https://sandbox.shiphawk.com/api/v4/orders/ord_Sq9Q39fx/proposed_shipments/pshp_sfbMrjqZ?api_key=YOUR_API_KEY'
```

```
require 'net/http'
require 'uri'
require 'json'

#'ord_Sq9Q39fx' is an example order id and 'pshp_ckyz6CSn' is an example proposed shipment id.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/orders/ord_Sq9Q39fx/proposed_shipments/pshp_ckyz6CSn?api_key=YOUR_API_KEY')

# Create the HTTP objects
request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
request.body = proposed_shipment

# Send the request
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
    http.request(request)
end

puts response.body
```

```
import requests
import json

url = 'https://sandbox.shiphawk.com/api/v4/orders/ord_Sq9Q39fx/proposed_shipments/pshp_ckyz6CSn'
headers = {'X-Api-Key': 'YOUR_API_KEY'}
payload = {
    "origin_address":{
      "name":"Name",
      "company":"Test Company",
      "street1":"1 FIRST ST",
      "phone_number":"5551234567",
      "city":"SANTA BARBARA",
      "state":"CA",
      "country":"US",
      "zip":"93000",
      "email":"email@example.com",
      "is_residential":false,
      "is_po_box":false
    },
    "destination_address":{
      "name":"Name",
      "company":"Test Company",
      "street1":"2 FIRST ST",
      "phone_number":"5561234567",
      "city":"Santa Barbara",
      "state":"CA",
      "country":"US",
      "zip":"93001",
      "email":"email@example.com",
      "is_residential":true,
      "is_po_box":false
    },
    "carrier_code":"usps",
    "service_name":"Priority Mail",
    "service_code":"Priority Mail",
    "proposed_shipment_id":"pshp_zW5SZ1SZ",
    "include_return_label":false,
    "return_label_service_name":"",
    "insurance_option":"no_insurance",
    "order_source":"BigCommerce",
    "is_external":false,
    "shipping_price":7.1,
    "ship_date":"2018-12-20T08:49:30.000Z",
    "reference_numbers":[],
    "packages":[\
      {\
        "id":"pkg_JCVW80ZE",\
        "packing_type":"parcel",\
        "number_of_units":1,\
        "packed":true,\
        "value":"425",\
        "dimension_uom":"in",\
        "weight":2.0,\
        "weight_uom":"lb",\
        "package_items":[\
          {\
            "order_line_item_id":"ofdi_h8xkEfdk",\
            "quantity":1\
          },\
          {\
            "order_line_item_id":"ordt_PDGsvEAA",\
            "quantity":1\
          }\
        ],\
        "accessorials":[],\
        "quantity":1,\
        "item_type":"parcel"\
      }\
    ],
    "shipment_line_items":[\
      {\
        "description":"Description",\
        "name":"Sample",\
        "sku":"AAA",\
        "quantity":1,\
        "price":225,\
        "value":225.0,\
        "weight":1.0,\
        "order_line_item_id":"ordi_PGPRvEBB",\
        "source_system_id":"3"\
      },\
      {\
        "description":"Description",\
        "name":"Sample2",\
        "sku":"BBB",\
        "quantity":1,\
        "price":200,\
        "value":200.0,\
        "weight":1.0,\
        "order_line_item_id":"ordi_h8ckEkff",\
        "source_system_id":"4"\
      }\
    ],
    "destination_accessorials":[],
    "origin_accessorials":[],
    "accessorials":[]
}

r = requests.post(url, headers=headers, json=payload)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;
import javax.json.*;
import javax.script.*;

public class PostRequests {
    public static void main(String [] args)
    {
        try{
            sendPost();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendPost() throws IOException {
        JsonObject personObject = Json.createObjectBuilder()
                .add("origin_address", Json.createObjectBuilder()
                    .add("name", "Name")
                    .add("company", "Test Company")
                    .add("street1", "3 FIRST ST")
                    .add("city", "Santa Barbara")
                    .add("state", "CA")
                    .add("country", "US")
                    .add("zip", "93000")
                    .add("email", "email@example.com")
                    .add("is_residential", false)
                    .add("is_po_box", false)
                    )
                .add("destination_address", Json.createObjectBuilder()
                    .add("name", "Name")
                    .add("company", "Test Company")
                    .add("street1", "2 FIRST ST")
                    .add("city", "Santa Barbara")
                    .add("state", "CA")
                    .add("country", "US")
                    .add("zip", "93001")
                    .add("email", "email@example.com")
                    .add("is_residential", true)
                    .add("is_po_box", false)
                    )
                .add("carrier_code", "usps")
                .add("service_name", "Priority Mail")
                .add("service_code", "Priority Mail")
                .add("proposed_shipment_id", "pshp_dZ7xjhhQ")
                .add("include_return_label", false)
                .add("insurance_option", "no_insurance")
                .add("order_source", "BigCommerce")
                .add("is_external", false)
                .add("shipping_price", 7.1)
                .add("ship_date", "2018-12-20T08:28:13.000Z")
                .add("packages", Json.createArrayBuilder()
                    .add(Json.createObjectBuilder()
                        .add("id", "pkg_JCVW80ZE")
                        .add("packing_type", "parcel")
                        .add("number_of_units", 1)
                        .add("packed", true)
                        .add("value", "425")
                        .add("dimension_uom", "in")
                        .add("weight", 2.0)
                        .add("weight_uom", "lb")
                        .add("package_items", Json.createArrayBuilder()
                            .add(Json.createObjectBuilder()
                                .add("order_line_item_id", "ofdi_h8xkEfdk")
                                .add("quantity", 1)
                                )
                            .add(Json.createObjectBuilder()
                                .add("order_line_item_id", "ordt_PDGsvEAA")
                                .add("quantity", 1)
                                )
                            )
                        .add("accessorials", Json.createArrayBuilder())
                        .add("quantity", 1)
                        .add("item_type", "parcel")
                        )
                    )
                .add("shipment_line_items", Json.createArrayBuilder()
                    .add(Json.createObjectBuilder()
                        .add("description", "Description")
                        .add("name", "Sample")
                        .add("sku", "AAA")
                        .add("quantity", 1)
                        .add("price", 225)
                        .add("value", 225.0)
                        .add("weight", 1.0)
                        .add("order_line_item_id", "ordi_PGPRvEBB")
                        .add("source_system_id", "3")
                        )
                    .add(Json.createObjectBuilder()
                        .add("description", "Description")
                        .add("name", "Sample2")
                        .add("sku", "BBB")
                        .add("quantity", 1)
                        .add("price", 200)
                        .add("value", 200.0)
                        .add("weight", 1.0)
                        .add("order_line_item_id", "ordi_h8ckEkff")
                        .add("source_system_id", "4")
                        )
                    )
                .add("destination_accessorials", Json.createArrayBuilder())
                .add("origin_accessorials", Json.createArrayBuilder())
                .add("accessorials", Json.createArrayBuilder())
                .build();
        try{
            // For formatting json object to be readable
            ScriptEngineManager manager = new ScriptEngineManager();
            ScriptEngine scriptEngine = manager.getEngineByName("JavaScript");
            scriptEngine.put("jsonString", personObject.toString());
            scriptEngine.eval("result = JSON.stringify(JSON.parse(jsonString), null, 2)");
            String prettyPrintedJson = (String) scriptEngine.get("result");

// 'pshp_kcNhnmW5' is an example proposed shipment id, and 'ord_gYcgBh5K' is an example order id.
            URL url = new URL("https://sandbox.shiphawk.com/api/v4/orders/ord_gYcgBh5K/proposed_shipments/pshp_kcNhnmW5?api_key=YOUR_API_KEY");
            HttpURLConnection con = (HttpURLConnection) url.openConnection();
            con.setRequestMethod("POST");
            con.setRequestProperty("Content-Type", "application/json");
            con.setDoOutput(true);
            OutputStream os = con.getOutputStream();
            os.write(personObject.toString().getBytes());
            os.flush();
            os.close();

int responseCode = con.getResponseCode();

> Request: POST /api/v4/orders/:id/proposed\_shipments/:proposed\_shipment\_id

> Response: [proposed-shipment-response](https://docs.shiphawk.com/#proposed-shipment-response-object)

### Delete a Proposed Shipment

```
#'pshp_sfbMrjqZ' is an example proposed shipment id, and 'ord_Sq9Q39fx' is an example order id.
curl -X DELETE 'https://sandbox.shiphawk.com/api/v4/orders/ord_Sq9Q39fx/proposed_shipments/pshp_sfbMrjqZ?api_key=YOUR_API_KEY'
```

```
require 'net/http'

#'pshp_sfbMrjqZ' is an example proposed shipment id, and 'ord_Sq9Q39fx' is an example order id.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/orders/ord_Sq9Q39fx/proposed_shipments/pshp_ckyz6CSn?api_key=YOUR_API_KEY')

# Create the HTTP objects
request = Net::HTTP::Delete.new(uri.request_uri)

# Send the request
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
    http.request(request)
end

puts response.body
```

```
import requests

url = 'https://sandbox.shiphawk.com/api/v4/orders/ord_Sq9Q39fx/proposed_shipments/pshp_ckyz6CSn'
headers = {'X-Api-Key': 'YOUR_API_KEY'}

r = requests.delete(url, headers=headers)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;

public class DeleteRequests {
    public static void main(String [] args)
    {
        try{
            sendDelete();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendDelete() throws IOException {
        // 'ord_RfE8CtKE' is an example order id, 'pshp_6wr47Zhs' is an example proposed shipment id.
        URL url = new URL("https://sandbox.shiphawk.com/api/v4/orders/ord_RfE8CtKE/proposed_shipments/pshp_6wr47Zhs?api_key=YOUR_API_KEY");
        HttpURLConnection con = (HttpURLConnection) url.openConnection();
        con.setRequestMethod("DELETE");
        int responseCode = con.getResponseCode();

> Request: DELETE /api/v4/orders/:id/proposed\_shipments/:proposed\_shipment\_id

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String | order id |
| proposed\_shipment\_id | String | proposed shipment id |

> Response: no content

# Rates

## Rate Resources

### Rate Request Object

Parameters are optional unless specified.

| Attribute | Type | Description |
| --- | --- | --- |
| `origin_address` | [Address](https://docs.shiphawk.com/#rate-address-object) | `required` |
| `destination_address` | [Address](https://docs.shiphawk.com/#rate-address-object) | `required` |
| `source_system` | String |  |
| `source_system_domain` | String |  |
| `source_system_order_id` | String |  |
| `display_rate_detail` | Boolean | Default: `false` |
| `free_shipping_for_cheapest_rate` | Boolean | Default: `false` |
| `apply_rules` | Boolean | Default: `false` |
| `third_party_fulfillment` | Boolean | Default: `false` |
| `ship_complete` | Boolean | Default: `false` |
| `display_rate_uuid` | Boolean | Default: `false` |
| `usps_parcel_select` | Boolean |  |
| `usps_library_mail` | Boolean |  |
| `usps_media_mail` | Boolean |  |
| `carrier_filter` | Array | Default: \[\] |
| `carrier_type_filter` | Array | An Array of strings. |
| `carrier_service_code` | String |  |
| `standardized_service_filter` | String | One of: <br>`White Glove``Threshold``Standard Courier``Room of Choice``Flatbed``Local Delivery``Standard Freight``Same-Day Freight``Guaranteed Freight``Next Day``Two-Day``Three-Day``International Economy``International Priority``Ground``Restricted Ground``Standard Vehicle``Same Day``Flat Rate``Same Day Freight``Blanket Wrap` |
| `rate_filter` | String | One of: `best``consumer``top_10` |
| `service_days_filter` | Integer |  |
| `ship_date` | String |  |
| `origin_accessorials` | Hash |  |
| `destination_accessorials` | Hash |  |
| `network_location` | String |  |
| `insurance_option` | String | One of:<br>`add_insurance``no_insurance` |
| `order_source` | String |  |
| `rate_source` | String |  |
| `currency_codes` | String | One of:<br>`AED``AFN``ALL``AMD``ANG``AOA``ARS``AUD``AWG``AZN``BAM``BBD``BDT``BGN``BHD``BIF``BMD``BND``BOB``BOV``BRL``BSD``BTN``BWP``BYN``BZD``CAD``CDF``CHE``CHF``CHW``CLF``CLP``CNY``COP``COU``CRC``CUC``CUP``CVE``CZK``DJF``DKK``DOP``DZD``EGP``ERN``ETB``EUR``FJD``FKP``GBP``GEL``GHS``GIP``GMD``GNF``GTQ``GYD``HKD``HNL``HRK``HTG``HUF``IDR``ILS``INR``IQD``IRR``ISK``JMD``JOD``JPY``KES``KGS``KHR``KMF``KPW``KRW``KWD``KYD``KZT``LAK``LBP``LKR``LRD``LSL``LYD``MAD``MDL``MGA``MKD``MMK``MNT``MOP``MRO``MUR``MVR``MWK``MXN``MXV``MYR``MZN``NAD``NGN``NIO``NOK``NPR``NZD``OMR``PAB``PEN``PGK``PHP``PKR``PLN``PYG``QAR``RON``RSD``RUB``RWF``SAR``SBD``SCR``SDG``SEK``SGD``SHP``SLL``SOS``SRD``SSP``STD``SVC``SYP``SZL``THB``TJS``TMT``TND``TOP``TRY``TTD``TWD``TZS``UAH``UGX``USD``USN``UYI``UYU``UZS``VEF``VND``VUV``WST``XAF``XAG``XAU``XBA``XBB``XBC``XBD``XCD``XDR``XOF``XPD``XPF``XPT``XSU``XTS``XUA``XXX``YER``ZAR``ZMW``ZWL` |
| `warehouse_id` | String |  |
| `warehouse_code` | String |  |
| `shipment_line_items` | Array\[ [ShipmentLineItem](https://docs.shiphawk.com/#rate-shipment-line-item-object)\] |  |
| `items` | Array\[ [Item](https://docs.shiphawk.com/#rate-item-object)\] | `required`: List of Rate Item Request objects |
| `shipment_billing` | Hash | {<br>`bill_to`: String, one of `sender``third_party``recipient`<br>`carrier_code`: String<br>`service_code`: String<br>`account_number`: String<br>`name`: String<br>`company`: String<br>`phone_number`: String<br>`street1`: String<br>`street2`: String<br>`city`: String<br>`state`: String<br>`zip`: String<br>`country`: String<br>} |
| `duties_billing_taxes` | Hash | {<br>`bill_to`: String, one of `sender``third_party``recipient`<br>`carrier_code`: String<br>`service_code`: String<br>`account_number`: String<br>`name`: String<br>`company`: String<br>`phone_number`: String<br>`street1`: String<br>`street2`: String<br>`city`: String<br>`state`: String<br>`zip`: String<br>`country`: String<br>} |
| `designated_currency` | String | Currency code that will be used for rating.<br>Item price will be converted to this currency and rates will be returned in this currency.<br>If not specified, warehouse currency will be used.<br>Default: `USD` |

### Rate Address Object

| Attribute | Type | Description |
| --- | --- | --- |
| name | String |  |
| company | String |  |
| street1 | String |  |
| street2 | String |  |
| city | String |  |
| state | String |  |
| zip | String |  |
| phone\_number | String |  |
| email | String |  |
| code | String |  |
| is\_residential | Boolean |  |
| country | String | 2 letter country code |

### Rate Shipment Line Item Object

| Attribute | Type | Description |
| --- | --- | --- |
| quantity | Integer |  |
| source\_system\_id | String |  |
| sku | String |  |

### Rate Item Object

Parameters are optional unless specified.

| Attribute | Type | Description |
| --- | --- | --- |
| `item_type` | Enum | Default: `parcel`<br> Options:<br>- parcel<br>- handling\_unit<br>- unpacked |
| `accessorials` | Array |  |
| `name` | String |  |
| `length` | Float |  |
| `width` | Float |  |
| `height` | Float |  |
| `dimension_uom` | String | Options: <br>- in<br>- cm<br> Default: `in` |
| `weight` | Float |  |
| `dry_ice_weight` | Float |  |
| `weight_uom` | String | Options: <br>- lb<br>- oz<br>- kg<br> Default: `lb` |
| `volume_cubic_ft` | Float |  |
| `value` | Float |  |
| `currency` | String | Default: `USD` |
| `handling_unit_type` | String |  |
| `quantity` | Integer | Default: `1` |
| `freight_class` | String |  |
| `nmfc` | String |  |
| `description` | String |  |
| `can_ship_parcel` | Boolean | Default: `false` |
| `optimize_packing` | Boolean | Default: `false` |
| `ship_individually` | Boolean |  |
| `is_dropship` | Boolean | Default: `false` |
| `action_if_not_available` | Enum | Default: `backorder`. Options:<br>- backorder<br>- dropship |
| `package_type` | String |  |
| `package_quantity` | Integer |  |
| `hs_code` | String |  |
| `country_of_origin` | String |  |
| `product_sku` | String |  |
| `unpacked_item_type_id` | String |  |
| `hazmat` | Boolean | Deprecated! Use [hazmat\_data\_list](https://docs.shiphawk.com/#rate-hazmatdata-object) where `dangerous_goods_type` is `hazmat` instead of this |
| `orm_d` | Boolean | Deprecated! Use [hazmat\_data\_list](https://docs.shiphawk.com/#rate-hazmatdata-object) where `dangerous_goods_type` is `limited_quantity` instead of this |
| `carrier_container` | String |  |
| `number_of_units` | Integer | Default: `1` |
| `available_in` | Hash |  |
| `warehouse_code` | String |  |
| `order_line_item_source_system_id` | String |  |
| `origin_address` | Hash | {<br>`id`: String<br>`name`: String<br>`company`: String<br>`street1`: String<br>`street2`: String<br>`city`: String<br>`state`: String<br>`zip`: String<br>`phone_number`: String<br>`email`: String<br>`code`: String<br>`is_residential`: Boolean (Default: `false`)<br>`country`: String (Default: `US`)<br>} |
| `hazmat_data_list` | Array\[ [HazmatData](https://docs.shiphawk.com/#rate-hazmatdata-object)\] | List of: [HazmatData](https://docs.shiphawk.com/#rate-hazmatdata-object) |
| `handling_unit_packages` | Array | List of:<br>{<br>`package_type`: String<br>`package_quantity`: Integer<br>`weight, type`: Float<br>`dry_ice_weight`: Float<br>`weight_uom`: String<br>`nmfc`: String<br>`freight_class`: String<br>`number_of_units`: Integer<br>`commodity_description`: String<br>`hazmat_data_list`: List of [HazmatData](https://docs.shiphawk.com/#rate-hazmatdata-object)<br>} |

### Rate Without Details Response Object

Parameters are optional unless specified.

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | String |  |
| `carrier` | String |  |
| `carrier_code` | String |  |
| `tariff_insurance_role` | String |  |
| `service_name` | String |  |
| `service_level` | String |  |
| `standardized_serivce_name` | String |  |
| `rate_display_name` | String |  |
| `price` | Float |  |
| `currency_code` | String |  |
| `est_delivery_date` | DateTime |  |
| `estimated_delivery_time` | String |  |
| `service_days` | Integer |  |
| `origin_network_location_id` | Integer |  |
| `destination_network_location_id` | Integer |  |
| `carrier_quote_number` | String |  |

### Rate Response Object

```
{
    "rates": [\
        {\
            "id": "rate_6ZPt6R1fSsSg8FXvq0zSGPwD",\
            "carrier": "USPS",\
            "carrier_code": "usps",\
            "tariff_insurance_rule": "carrier",\
            "service_name": "First-Class Mail",\
            "service_level": "First-Class Mail",\
            "standardized_service_name": "Ground",\
            "rate_display_name": "USPS First-Class Mail",\
            "price": "4.19",\
            "currency_code": "USD",\
            "est_delivery_date": "2019-01-23T00:00:00.000-06:00",\
            "est_delivery_time": null,\
            "service_days": 3,\
            "origin_network_location_id": null,\
            "destination_network_location_id": null\
            "carrier_quote_number": null\
        },\
        {\
            "id": "rate_fG2f45GaBQH0c4XS1vgNybsD",\
            "carrier": "USPS",\
            "carrier_code": "usps",\
            "tariff_insurance_rule": "carrier",\
            "service_name": "Priority Mail",\
            "service_level": "Priority Mail",\
            "standardized_service_name": "Ground",\
            "rate_display_name": "USPS Priority Mail",\
            "price": "7.99",\
            "currency_code": "USD",\
            "est_delivery_date": "2019-01-22T00:00:00.000-06:00",\
            "est_delivery_time": null,\
            "service_days": 2,\
            "origin_network_location_id": null,\
            "destination_network_location_id": null\
            "carrier_quote_number": "123456789"\
        }\
    ]
}
```

Parameters are optional unless specified.

| Attribute | Type | Description |
| --- | --- | --- |
| `RateWithoutDetails` | Object | Rate Without Details Response Object |
| `rate_detail` | Object | Rate Detail Response Object |
| `carrier_details` | Object | Carrier Details Response Object |
| `applied_rules` | Object | Rule For Rating Response Object |

### Rate Detail Response Object

Parameters are optional unless specified.

| Attribute | Type | Description |
| --- | --- | --- |
| `pickup_price` | Float |  |
| `delivery_price` | Float |  |
| `est_delivery_time` | String |  |
| `proposed_shipment` | Object | Proposed Shipment Response Object |

### Carrier Details Response Object

| Attribute | Type | Description |
| --- | --- | --- |
| `logo` | String |  |
| `friendly_name` | String |  |
| `carrier_type` | String |  |

### Rate HazmatData Object

```
Example: Limited Quantity
{
    // ...,
    "hazmat_data": {
        "dangerous_goods_type": "limited_quantity"
    },
    // ...,
}
```

```
Example: Excepted Quantity
{
    // ...,
    "hazmat_data": {
        "dangerous_goods_type": "excepted_quantity"
    },
    // ...,
}
```

## Rate API Endpoints

### Create a New Rate Request

```
curl -H "Content-Type: application/json" -X POST -d'{
 "items":[\
   {\
     "type": "parcel",\
     "length": "10",\
     "width" : "10",\
     "height": "11",\
     "dimension_uom": "in",\
     "weight": "10",\
     "weight_uom": "lb",\
     "value": 100.00\
   }\
 ],
 "origin_address":{ "zip": "93101"},
 "destination_address":{ "zip": "60060"}
}' 'https://sandbox.shiphawk.com/api/v4/rates?api_key=YOUR_API_KEY'
```

```
require 'net/http'
require 'uri'
require 'json'

uri = URI.parse('https://sandbox.shiphawk.com/api/v4/rates?api_key=YOUR_API_KEY')

rate =
'{
    "items":[\
       {\
         "type": "parcel",\
         "length": "10",\
         "width" : "10",\
         "height": "11",\
         "dimension_uom": "in",\
         "weight": "10",\
         "weight_uom": "lb",\
         "value": 100.00\
       }\
     ],
     "origin_address":{ "zip": "93101"},
     "destination_address":{ "zip": "60060"}
 }'

# Create the HTTP objects
request = Net::HTTP::Post.new(uri.request_uri, 'Content-Type' => 'application/json')
request.body = rate

# Send the request
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
    http.request(request)
end

print(response.body)
```

```
import requests
import json

url = 'https://sandbox.shiphawk.com/api/v4/rates'
headers = {'X-Api-Key': 'YOUR_API_KEY'}
payload = {
    "items":[\
       {\
         "type": "parcel",\
         "length": "10",\
         "width" : "10",\
         "height": "11",\
         "dimension_uom": "in",\
         "weight": "10",\
         "weight_uom": "lb",\
         "value": 100.00\
       }\
     ],
     "origin_address":{ "zip": "93101"},
     "destination_address":{ "zip": "60060"}
}
r = requests.post(url, headers=headers, json=payload)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;
import javax.json.*;
import javax.script.*;

public class PostRequests {
    public static void main(String [] args)
    {
        try{
            sendPost();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendPost() throws IOException {
        JsonObject personObject = Json.createObjectBuilder()
                .add("items", Json.createArrayBuilder().add(Json.createObjectBuilder()
                                                        .add("type", "parcel")
                                                        .add("length", "10")
                                                        .add("width", "10")
                                                        .add("height", "11")
                                                        .add("dimension_uom", "in")
                                                        .add("weight", "10")
                                                        .add("weight_uom", "lb")
                                                        .add("value", 100.00))
                    )
                .add("origin_address", Json.createObjectBuilder().add("zip", "93101"))
                .add("destination_address", Json.createObjectBuilder().add("zip", "60060"))
                .build();
        try{
            // For formatting json object to be readable
            ScriptEngineManager manager = new ScriptEngineManager();
            ScriptEngine scriptEngine = manager.getEngineByName("JavaScript");
            scriptEngine.put("jsonString", personObject.toString());
            scriptEngine.eval("result = JSON.stringify(JSON.parse(jsonString), null, 2)");
            String prettyPrintedJson = (String) scriptEngine.get("result");

URL url = new URL("https://sandbox.shiphawk.com/api/v4/rates?api_key=YOUR_API_KEY");
            HttpURLConnection con = (HttpURLConnection) url.openConnection();
            con.setRequestMethod("POST");
            con.setRequestProperty("Content-Type", "application/json");
            con.setDoOutput(true);
            OutputStream os = con.getOutputStream();
            os.write(personObject.toString().getBytes());
            os.flush();
            os.close();

int responseCode = con.getResponseCode();

> Request: POST /api/v4/rates?api\_key=YOUR\_API\_KEY

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| `items` | Array [\[items\]](https://docs.shiphawk.com/#rate-item-object) | required: List of Rate Item Request objects |
| `origin_address` | Hash | Object<br>{<br>`first_name`: String<br>`last_name`: String<br>`name`: String<br>`street1`: String<br>`street2`: String<br>`country`: String<br>`city`: String<br>`state`: String<br>`zip`: String<br>`phone_number`: String<br>`email`: String<br>`company`: String<br>`location_type`: String<br>`code`: String<br>`is_residential`: Boolean<br>} |
| `destination_address` | Hash | Object<br>{<br>`first_name`: String<br>`last_name`: String<br>`name`: String<br>`street1`: String<br>`street2`: String<br>`country`: String<br>`city`: String<br>`state`: String<br>`zip`: String<br>`phone_number`: String<br>`email`: String<br>`company`: String<br>`location_type`: String<br>`code`: String<br>`is_residential`: Boolean<br>`is_po_box`: Boolean (Optional)<br>} |

> Response: [rate-response-object](https://docs.shiphawk.com/#rate-response-object)

# Shipment Notes

## Shipment Note Object

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String | `readonly` |
| body | String |  |
| tag | String |  |
| created\_at | DateTime | `readonly` |
| updated\_at | DateTime | `readonly` |

## Shipment Notes Api Endpoints

### Create Shipment Note

```
#shp_yYtFWAhc is an example shipment external id
curl -H "Content-Type: application/json" -X POST -d '
{
  “id”: “shp_yYtFWAhc”
}’ ‘https://sandbox.shiphawk.com/api/v4/shipments/shp_yYtFWAhc/notes?api_key=YOUR_API_KEY'
```

> Request: POST /api/v4/shipments/:id/notes

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String | Shipment id |

> Response: [ShipmentNoteObject](https://docs.shiphawk.com/#shipment-note-object)

### Retrieve Shipment Note

```
#'shp_becFaAAj' is an example shipment external id, note_74YxKaMq is an example note id.
curl -X GET 'https://sandbox.shiphawk.com/api/v4/shipments/shp_becFaAAj/notes/note_74YxKaMq/?api_key=YOUR_API_KEY'
```

> Request: GET /api/v4/shipments/:id/notes/:note\_id

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String | Shipment external id, |
| note\_id | String | Note id |

> Response: [ShipmentNoteObject](https://docs.shiphawk.com/#shipment-note-object)

### Retrieve All Shipment Notes

```
#'shp_yYtFWAhc' is an example shipment external id
curl -X GET 'https://sandbox.shiphawk.com/api/v4/shipments/shp_yYtFWAhc/notes?api_key=YOUR_API_KEY'
```

> Request: GET /api/v4/shipments/:id/notes

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String | Shipment id, `required` |

> Response: Array [ShipmentNoteObject](https://docs.shiphawk.com/#shipment-note-object)

### Update Shipment Note

```
#shp_yYtFWAhc is an example shipment external id, note_74YxKaMq is an example note id
curl -H "Content-Type: application/json" -X POST -d '
{
  “body”: “This is the body”,
  "tag": "This is a tag"
}’ ‘https://sandbox.shiphawk.com/api/v4/shipments/shp_yYtFWAhc/notes/note_74YxKaMq/?api_key=YOUR_API_KEY'
```

> Request: POST /api/v4/shipments/:id/notes/:note\_id

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| body | String |  |
| tag | String |  |

> Response: [ShipmentNoteObject](https://docs.shiphawk.com/#shipment-note-object)

### Delete Shipment Note

```
#shp_yYtFWAhc is an example shipment external id, note_74YxKaMq is an example note id
curl -X DELETE 'https://sandbox.shiphawk.com/api/v4/shipments/shp_yYtFWAhc/notes/note_74YxKaMq/?api_key=YOUR_API_KEY'
```

> Request: DELETE /api/v4/shipments/:id/notes/:note\_id

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String | Shipment external id, |
| note\_id | String | Note id |

> Response: no content

# Shipments

## Shipment Resources

### Shipment Request Object

Parameters are optional unless noted.

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| `id` | String |  |
| `shid` | String |  |
| `proposed_shipment_id` | String |  |
| `rate_id` | String | `required` |
| `origin_address` | [BookingAddress](https://docs.shiphawk.com/#booking-address-Object) | `required`<br> Shipment Address Request object |
| `destination_address` | [BookingAddress](https://docs.shiphawk.com/#booking-address-Object) | `required`<br> Shipment Address Request object |
| `pickup` | Array\[ [Pickup](https://docs.shiphawk.com/#shipment-pickup-object)\] |  |
| `accessorials` | Array\[ [ShipmentAccessorial](https://docs.shiphawk.com/#shipment-accessorial-object)\] |  |
| `reference_numbers` | Array\[ [ReferenceNumber](https://docs.shiphawk.com/#shipment-reference-number-object)\] |  |
| `origin_instructions` | String |  |
| `destination_instructions` | String |  |
| `order_id` | String |  |
| `order_number` | String |  |
| `carrier` | String |  |
| `service_name` | String |  |
| `carrier_service_code` | String |  |
| `label_format` | Enum | Default: `PDF`.<br> Options:<br>- ZPL<br>- PDF |
| `include_return_label` | Boolean | Default: `false` |
| `is_external` | Boolean |  |
| `shipping_price` | Float | Default: `0.0` |
| `currency` | String | Shipment currency code.<br>Can only be set on shipment create when there is no order or proposed shipment.<br>Item price will be converted to this currency, and the documents will be generated in this currency.<br>If not specified, warehouse currency will be used.<br>Default: `USD` |
| `tracking_number` | String |  |
| `packages` | Array\[ [PackageNoRate](https://docs.shiphawk.com/#shipment-packages-without-rate-request-object)\] | List of Shipment Packages Without Rate Request objects. |
| `eei` | Hash | Object:<br>{<br>`compliance`: String, One of: `itn`, `exemption_code`<br>`compliance_code`: String (`X20160406131357`, `NO EEI 30.37(a)`)<br>}<br>Allowed Exemption Codes:<br>`NO EEI 30.02(d)`, `NO EEI 30.36`, `NO EEI 30.37(a)`, `NO EEI 30.37(b)`, `NO EEI 30.37(f)`, `NO EEI 30.37(g)`, `NO EEI 30.37(h)`, `NO EEI 30.37(i)`, `NO EEI 30.37(j)`, `NO EEI 30.37(k)`, `NO EEI 30.37(l)`, `NO EEI 30.37(p)`, `NO EEI 30.39`, `NO EEI 30.40(a)`, `NO EEI 30.40(b)`, `NO EEI 30.40(c)`, `NO EEI 30.40(d)` |

### Shipment Pickup Object

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| `start_time` | DateTime |  |
| `end_time` | DateTime |  |

### Shipment Accessorial Object

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| `type` | String |  |
| `value` | String |  |
| `option_value` | String |  |

### Shipment Reference Number Object

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| `id` | String |  |
| `name` | String | If our codes do not support your needs, use `other_id` and then you can name your own reference number. |
| `value` | String | An invoice number, purchase number, etc |
| `code` | String | Options: <br>- `invoice_id`<br>- `customer_id`<br>- `reference_id`<br>- `purchase_id`<br>- `bol_id`<br>- `other_id` |

### Shipment Address Request object

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| `first_name` | String |  |
| `last_name` | String |  |
| `name` | String |  |
| `street1` | String |  |
| `street2` | String |  |
| `country` | String |  |
| `city` | String |  |
| `state` | String |  |
| `zip` | String |  |
| `phone_number` | String |  |
| `email` | String |  |
| `company` | String |  |
| `location_type` | String |  |
| `code` | String |  |
| `is_residential` | Boolean |  |

### Shipment Billing Details Request Object

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| `bill_to` | string | Required: One of: `sender``third_party``recipient` |
| `carrier_code` | string |  |
| `service_code` | string |  |
| `account_number` | string |  |
| `name` | string |  |
| `company` | string |  |
| `phone_number` | string |  |
| `street1` | string |  |
| `street2` | string |  |
| `city` | string |  |
| `state` | string |  |
| `zip` | string |  |
| `country` | string |  |

### Shipment Packages Without Rate Request Object

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| `id` | String |  |
| `length` | Float |  |
| `width` | Float |  |
| `height` | Float |  |
| `dimension_uom` | String | Options: <br>- in<br>- cm<br> Default: `in` |
| `weight` | Float |  |
| `weight_uom` | String | Options: <br>- lb<br>- kg<br> Default: `lb` |
| `dry_ice_weight` | Float |  |
| `value` | Float |  |
| `currency` | String | Default: `USD` |
| `freight_class` | String |  |
| `tracking_number` | String |  |
| `packing_type` | String |  |
| `package_quantity` | Integer |  |
| `package_type` | String |  |
| `quantity` | Integer | Default: `1` |
| `commidity_description` | String |  |
| `carrier_container` | String |  |
| `hazmat` | Boolean | Deprecated! Use [hazmat\_data\_list](https://docs.shiphawk.com/#shipment-hazmatdata-object) where `dangerous_goods_type` is `hazmat` instead of this |
| `orm_d` | Boolean | Deprecated! Use [hazmat\_data\_list](https://docs.shiphawk.com/#shipment-hazmatdata-object) where `dangerous_goods_type` is `limited_quantity` instead of this |
| `nmfc` | String |  |
| `number_of_units` | Integer | Default: `1` |
| `hazmat_data_list` | Array\[ [HazmatData](https://docs.shiphawk.com/#shipment-hazmatdata-object)\] | List of: [HazmatData](https://docs.shiphawk.com/#shipment-hazmatdata-object) |
| `package_items` | Array\[ [PackageItem](https://docs.shiphawk.com/#proposed-shipment-package-item-request-object)\] | List Of: <br>{<br>`product_sku`: String<br>`id`: String<br>`value`: String<br>`hs_code`: String<br>`country_of_origin`: String<br>`description`: String<br>`weight`: Float<br>`weight_uom`: String<br>`quantity`: Integer<br>} |
| `handling_unit_packages` | Array\[ [HandlingUnitPackage](https://docs.shiphawk.com/#shipment-handling-unit-package-request-object)\] | Shipment Handling Unit Packages Request object |
| `sscc_serial_references` | Array | List of assigned Serial Shipping Container Codes (SSCC). |

### Shipment Handling Unit Package Request Object

| Parameter | Type | Description |
| --- | --- | --- |
| `package_type` | String |  |
| `package_quantity` | Integer |  |
| `weight` | Float |  |
| `weight_uom` | String | Options: <br>- lb<br>- kg<br> Default: `lb` |
| `dry_ice_weight` | Float |  |
| `nmfc` | String |  |
| `freight_class` | String |  |
| `hazmat` | Boolean | Deprecated! Use [hazmat\_data\_list](https://docs.shiphawk.com/#shipment-hazmatdata-object) where `dangerous_goods_type` is `hazmat` instead of this |
| `orm_d` | Boolean | Deprecated! Use [hazmat\_data\_list](https://docs.shiphawk.com/#shipment-hazmatdata-object) where `dangerous_goods_type` is `limited_quantity` instead of this |
| `number_of_units` | Integer |  |
| `commodity_description` | String |  |
| `hazmat_data_list` | Array\[ [HazmatData](https://docs.shiphawk.com/#shipment-hazmatdata-object)\] | List of: [HazmatData](https://docs.shiphawk.com/#shipment-hazmatdata-object) |
| `package_items` | Array\[ [PackageItem](https://docs.shiphawk.com/#proposed-shipment-package-item-request-object)\] | Proposed Shipment Package Item Request object |
| `sscc_serial_references` | Array | List of assigned Serial Shipping Container Codes (SSCC). |

### Proposed Shipment Package Item Request Object

| Attribute | Type | Description |
| --- | --- | --- |
| `freight_class` | String |  |
| `nmfc` | String |  |
| `product_sku` | String |  |
| `hs_code` | String |  |
| `country_of_origin` | String |  |
| `weight` | Float |  |
| `weight_uom` | String | Options: <br>- lb<br>- kg<br> Default: `lb` |
| `value` | String |  |
| `description` | String |  |
| `order_line_item_id` | String |  |
| `quantity` | Integer | Default: `1` |

### Shipment Response Object

```
{
    "id": "shp_8Wskd61X",
    "shid": 6395133,
    "proposed_shipment_id": "pshp_dZ7xjhhQ",
    "status": "ordered",
    "origin_address": {
        "id": "badr_816JMXka",
        "name": "Parcel Origin",
        "company": "Example, Inc",
        "street1": "465 Hillview Ave",
        "street2": "Apt 5",
        "city": "GOLETA",
        "state": "CA",
        "zip": "93116",
        "country": "US",
        "phone_number": "",
        "email": null,
        "is_residential": false,
        "is_warehouse": false,
        "address_type": "commercial",
        "code": null
    },
    "destination_address": {
        "id": "badr_xVMhBK9j",
        "name": "Parcel Destination",
        "company": "Example, Inc",
        "street1": "925 De La Vina St",
        "street2": "Suite 8",
        "city": "SANTA BARBARA",
        "state": "CA",
        "zip": "93101",
        "country": "US",
        "phone_number": "",
        "email": null,
        "is_residential": false,
        "is_warehouse": false,
        "address_type": "commercial",
        "code": null
    },
    "carrier": "USPS",
    "carrier_code": "usps",
    "carrier_scac": "USPS",
    "carrier_type_code": "small_parcel",
    "is_external": false,
    "is_customer_tariff": true,
    "is_international": false,
    "service_name": "First-Class Mail",
    "service_level": null,
    "insurance_type": "no_insurance",
    "currency": "USD",
    "total_price": 4.94,
    "designated_weight_uom": "lb",
    "designated_dimension_uom": "in",
    "tracking_number": "9400110200864380488444",
    "license_plate_number": null,
    "all_license_plate_numbers": []
    "documents": [\
        {\
            "id": "doc_BGT54Etg",\
            "customer_uploaded": false,\
            "type": "Package Labels Combined",\
            "extension": "PDF",\
            "code": "package_labels_combined",\
            "url": "https://sandbox.shiphawk.com/api/v4/public/documents/files/edf8ce54b1f161d0f7ba21acb059aee7.pdf",\
            "meta_data": {},\
            "created_at": "2019-01-29T23:35:32.559+00:00"\
        },\
        {\
            "id": "doc_kwDvXGHZ",\
            "customer_uploaded": false,\
            "type": "Package Labels Combined",\
            "extension": "ZPL",\
            "code": "package_labels_combined",\
            "url": "https://sandbox.shiphawk.com/api/v4/public/documents/files/70c8f6d157a95aa10c0c60eef9ebf424.zpl",\
            "meta_data": {},\
            "created_at": "2019-01-29T23:35:32.379+00:00"\
        },\
        {\
            "id": "doc_7M7nnvbt",\
            "customer_uploaded": false,\
            "type": "label for a package",\
            "extension": "ZPL",\
            "code": "package_label",\
            "url": "https://sandbox.shiphawk.com/api/v4/public/documents/files/8bb792044ba47aa5119bb6c6870f2379.zpl",\
            "meta_data": {},\
            "created_at": "2019-01-29T23:35:31.941+00:00"\
        }\
    ],
    "price_details": {
        "shipping": 4.94,
        "packing": 0,
        "insurance": 0,
        "pickup": 0,
        "delivery": 0,
        "accessorials": 0,
        "duty": null,
        "taxes": null
    },
    "dispatch": null,
    "packages": [\
        {\
            "id": "pkg_MKWXs4X8",\
            "tracking_number": "9400110200864380488444",\
            "tracking_url": "https://tools.usps.com/go/TrackConfirmAction.action?tRef=fullpage&tLc=1&text28777=&tLabels=9400110200864380488444",\
            "freight_class": null,\
            "nmfc": null,\
            "packing_type": "boxed",\
            "package_type": null,\
            "handling_unit_type": null,\
            "quantity": 1,\
            "package_quantity": 1,\
            "length": 10,\
            "width": 10,\
            "height": 11,\
            "dimension_uom": "in",\
            "weight": 0.9375,\
            "weight_uom": "lb",\
            "dry_ice_weight": null,\
            "value": 100,\
            "volume": 0.64,\
            "commodity_description": "",\
            "label_document_id": "doc_7M7nnvbt",\
            "carrier_container": null,\
            "number_of_units": 1,\
            "accessorials": [],\
            "hazmat_data_list": [{\
                "dangerous_goods_type": null,\
                "battery_types": [],\
                "un_or_na_number": null,\
                "proper_shipping_name": null,\
                "technical_name": null,\
                "hazard_class_or_division": null,\
                "packing_group": null,\
                "emergency_response_phone_number": null,\
                "emergency_contact_name": null,\
                "emergency_contact_phone_number": null,\
                "regulation_level": null,\
                "container": null,\
                "amount": null,\
                "amount_unit": null,\
                "transportation_mode": null,\
                "additional_description": null\
            }],\
            "package_items": [\
                {\
                    "id": "pkgi_YjcRjjjd",\
                    "product_sku": null,\
                    "product_upc": null,\
                    "product_sku_packing_code": null,\
                    "item_name": "Small Parcel",\
                    "length": 10,\
                    "width": 10,\
                    "height": 11,\
                    "dimension_uom": "in",\
                    "weight": 0.9375,\
                    "weight_uom": "lb",\
                    "volume": 0.64,\
                    "freight_class": null,\
                    "nmfc": null,\
                    "hs_code": null,\
                    "country_of_origin": null,\
                    "value": 100,\
                    "description": "",\
                    "order_line_item_id": null,\
                    "quantity": 1,\
                    "order_line_item_source_system_id": null,\
                    "order_line_item_source_system_line_number": null\
                }\
            ],\
            "handling_unit_packages": [],\
            "materials": [],\
            "labors": [],\
            "license_plate_number": null,\
            "sscc_serial_references": []\
        }\
    ],
    "shipment_line_items": [\
        {\
            "order_line_item_id": null,\
            "quantity": 1,\
            "name": null,\
            "description": null,\
            "sku": null,\
            "upc": null,\
            "value": 100,\
            "currency": "USD",\
            "weight": 0.9375,\
            "weight_uom": "lb",\
            "hs_code": null,\
            "country_of_origin": null,\
            "child_sku": null,\
            "child_sku_quantity": null,\
            "line_number": null,\
            "origin_order_number": null,\
            "is_kit": false,\
            "kit_id": null\
        }\
    ],
    "origin_network_location_id": null,
    "destination_network_location_id": null,
    "reference_numbers": [],
    "origin_instructions": null,
    "destination_instructions": null,
    "shiphawk_managed": false,
    "print_package_labels_enabled": true,
    "exceptions": [],
    "est_delivery_date": "2019-01-30T00:00:00.000+00:00",
    "service_days": null,
    "order_id": null,
    "order_number": null,
    "combined_order_numbers": [],
    "label_url": "https://sandbox.shiphawk.com/api/v4/public/documents/files/edf8ce54b1f161d0f7ba21acb059aee7.pdf",
    "label_format": "PDF",
    "label_document_id": "doc_BGT54Etg",
    "label_pdf_url": "https://sandbox.shiphawk.com/api/v4/public/documents/files/edf8ce54b1f161d0f7ba21acb059aee7.pdf",
    "label_pdf_document_id": "doc_BGT54Etg",
    "label_zpl_url": "https://sandbox.shiphawk.com/api/v4/public/documents/files/70c8f6d157a95aa10c0c60eef9ebf424.zpl",
    "label_zpl_document_id": "doc_kwDvXGHZ",
    "carrier_report_date": null,
    "created_at": "2019-01-29T23:35:31.073+00:00",
    "created_by": {
        "type": "api",
        "name": "API"
    },
    "updated_at": "2019-01-29T23:35:32.272+00:00",
    "actual_pickup_time": null,
    "shipment_billing": null,
    "duties_taxes_billing": null,
    "packing_slip_template": null,
    "can_attach_bol": false,
    "cannot_attach_bol_reason": "Carrier does not support printing of BOL",
    "accessorials": [],
    "is_generate_commercial_invoice": false,
    "can_dispatch": false,
    "ship_date": "2019-01-29T23:35:31.012+00:00",
    "eei": {
        "compliance": null,
        "compliance_code": null
    },
    "warehouse": {
        "id": "whs_vVPCqvsyemQQ",
        "code": "WH-1"
        "default_for_international": false
        "enabled_for_external_domestic_rating": true
        "enabled_for_external_international_rating": true
        "domestic_priority": "9"
        "international_priority": "10"
        "created_at": "2023-05-29T09:20:14+00:00"
    },
    "workstation": {
        "id": "wst_abc123",
        "name": "Packing Station 1"
    }
}
```

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | string |  |
| `shid` | integer |  |
| `proposed_shipment_id` | string |  |
| `origin_address` | hash | Booking Address object |
| `destination_address` | hash | Booking Address object |
| `carrier` | string |  |
| `carrier_code` | string |  |
| `carrier_scac` | string |  |
| `carrier_type_code` | string |  |
| `is_external` | boolean |  |
| `is_customer_tariff` | boolean |  |
| `is_international` | boolean |  |
| `service_name` | string |  |
| `service_level` | string |  |
| `insurance_type` | string |  |
| `total_price` | string |  |
| `currency` | string |  |
| `designated_weight_uom` | string |  |
| `designated_dimension_uom` | string |  |
| `tracking_number` | string |  |
| `license_plate_number` | string |  |
| `all_license_plate_numbers` | array\[string\] |  |
| `documents` | array\[hash\] | {<br>`id`: string<br>`customer_uploaded` :boolean<br>`type`: string<br>`extension`: string<br>`code`: string<br>`url`: string<br>`meta_data`: hash<br>`created_at`: float<br>} |
| `price_details` | hash | Price Details Response object |
| `dispatch_details` | hash | {<br>`id`: string<br>`pickup_date`: date<br>`pickup_start_time`: date<br>`pickup_end_time`: date<br>`dispatch_instructions`: string<br>`sent_at`: date<br>`sent_type`: string<br>`confirmed_at`: date<br>`confirmation_number`: string<br>`bol_number`: string<br>`status`: string<br>`shipment_id`: string<br>`error_message`: string<br>} |
| `packages` | array\[hash\] | List of Package Response Objects |
| `shipment_line_items` | array\[hash\] | List of:<br>{<br>`order_line_item_id`: integer<br>`quantity`: integer<br>`name`: string<br>`description`: string<br>`sku`: string<br>`upc`: string<br>`value`: float<br>`currency`: string<br>`weight`: float<br>`weight_uom`: string<br>`hs_code`: string<br>`country_of_origin`: string<br>`child_sku`: string<br>`child_sku_quantity`: integer<br>`line_number`: integer<br>`origin_order_number`: string<br>} |
| `origin_network_location_id` | string |  |
| `destination_network_location_id` | string |  |
| `reference_numbers` | array\[object\] | List Of: <br>{<br>`id`: string<br>`code`: string<br>`value`: string<br>`name`: string<br>} |
| `origin_instruction` | string |  |
| `destination_instructions` | string |  |
| `shiphawk_managed` | boolean |  |
| `is_external` | boolean |  |
| `print_package_labels_enabled` | boolean |  |
| `exceptions` | array\[hash\] | List of:<br>{<br>`id`: string<br>`is_resolved`: boolean<br>`resolved_at`: date<br>`created_at`: date<br>} |
| `est_delivery_date` | datetime |  |
| `service_days` | integer |  |
| `order_id` | string |  |
| `order_number` | string |  |
| `combined_order_numbers` | array\[string\] |  |
| `label_url` | string |  |
| `label_format` | string |  |
| `label_document_id` | string |  |
| `label_pdf_url` | string |  |
| `label_pdf_document_id` | string |  |
| `label_zpl_url` | string |  |
| `label_zpl_document_id` | string |  |
| `carrier_report_date` | string |  |
| `label_source` | string |  |
| `created_at` | datetime |  |
| `created_by` | hash | {<br>`type`: string<br>`name`: string<br>} |
| `updated_at` | datetime |  |
| `actual_pickup_time` | datetime |  |
| `shipment_billing` | hash | Shipment Billing Details Response object |
| `duties_taxes_billing` | hash | Shipment Billing Details Response object |
| `packing_slip_template` | hash | {<br>`size`: string<br>`advanced_size`: string<br>} |
| `can_attach_bol` | boolean |  |
| `cannot_attach_bol_reason` | string |  |
| `accessorials` | array\[object\] | List of Shipment Accessorial Response objects. |
| `is_generate_commercial_invoice` | boolean |  |
| `can_dispatch` | boolean |  |
| `ship_date` | boolean |  |
| `eei` | Hash | Object:<br>{<br>`compliance`: String<br>`compliance_code`: String<br>} |
| `warehouse` | Hash | Object:<br>{<br>`id`: String<br>`code`: String<br>`default_for_international`: Boolean<br>`enabled_for_external_domestic_rating`: Boolean<br>`enabled_for_external_international_rating`: Boolean<br>`domestic_priority`: Integer<br>`international_priority`: Integer<br>`created_at`: DateTime<br>} |
| `workstation` | Hash | Object:<br>{<br>`id`: String<br>`name`: String<br>} |

### Shipment Billing Details Response Object

| Attribute | Type | Description |
| --- | --- | --- |
| `shortcut_account_number` | string |  |
| `account_number` | string |  |
| `name` | string |  |
| `company` | string |  |
| `phone_number` | string |  |
| `street1` | string |  |
| `street2` | string |  |
| `city` | string |  |
| `state` | string |  |
| `country` | string |  |
| `zip` | string |  |
| `country` | string |  |
| `bill_to` | string | Required: One of: `sender``third_party``recipient` |
| `carrier_code` | string |  |
| `service_code` | string |  |
| `service_name` | string |  |

### Shipment Accessorial Response Object

| Attribute | Type | Description |
| --- | --- | --- |
| `accessorial_type` | string |  |
| `cod_amount` | string | Present if accessorial is collect on delivery. |
| `payment_types` | array\[string\] |  |
| `remittance_address` | hash | Booking Address object |
| `add_freight_charges` | boolean |  |
| `price` | float |  |

### Shipment HazmatData Object

```
Example: Limited Quantity
{
    // ...,
    "hazmat_data": {
        "dangerous_goods_type": "limited_quantity"
    },
    // ...,
}
```

```
Example: Excepted Quantity
{
    // ...,
    "hazmat_data": {
        "dangerous_goods_type": "excepted_quantity"
    },
    // ...,
}
```

## Shipment API Endpoints

### Cancel a Shipment

```
#'shp_Hcy0ZwR1' is an example shipment id.
curl -X DELETE 'https://sandbox.shiphawk.com/api/v4/shipments/shp_Hcy0ZwR1?api_key=YOUR_API_KEY'
```

```
require 'net/http'

#'shp_yYtFWAhc' is an example shipment id.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/shipments/shp_yYtFWAhc?api_key=YOUR_API_KEY')

# Create the HTTP objects
request = Net::HTTP::Delete.new(uri.request_uri)

# Send the request
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
    http.request(request)
end

puts response.body
```

```
import requests

url = 'https://sandbox.shiphawk.com/api/v4/shipments/shp_yYtFWAhc'
headers = {'X-Api-Key': 'YOUR_API_KEY'}

r = requests.delete(url, headers=headers)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;

public class DeleteRequests {
    public static void main(String [] args)
    {
        try{
            sendDelete();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendDelete() throws IOException {
        // 'shp_Tsa5fTbk' is an example shipment id.
        URL url = new URL("https://sandbox.shiphawk.com/api/v4/shipments/shp_Tsa5fTbk?api_key=YOUR_API_KEY");
        HttpURLConnection con = (HttpURLConnection) url.openConnection();
        con.setRequestMethod("DELETE");
        int responseCode = con.getResponseCode();

> Request: DELETE /api/v4/shipments/:id

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String | Shipment id, `required` |

> Response: no content

### Create a New Shipment

```
curl -H "Content-Type: application/json" -X POST -d '
{
    "rate_id":"rate_5SNcd9293WRhPdNBgqPRN4KG",
    "origin_address": {
        "name": "Parcel Origin",
        "company": "Example, Inc",
        "street1": "465 Hillview Ave",
        "street2": "Apt 5",
        "zip": "93116"
    },
    "destination_address": {
        "name": "Parcel Destination",
        "company": "Example, Inc",
        "street1": "925 De La Vina St",
        "street2": "Suite 8",
        "zip": "93101"
    }
}' 'https://sandbox.shiphawk.com/api/v4/shipments/?api_key=YOUR_API_KEY'
```

```
require 'net/http'
require 'uri'
require 'json'

uri = URI.parse('https://sandbox.shiphawk.com/api/v4/shipments?api_key=YOUR_API_KEY')

shipment =
'{
    "rate_id":"rate_5SNcd9293WRhPdNBgqPRN4KG",
    "origin_address": {
        "name": "Parcel Origin",
        "company": "Example, Inc",
        "street1": "465 Hillview Ave",
        "street2": "Apt 5",
        "zip": "93116"
    },
    "destination_address": {
        "name": "Parcel Destination",
        "company": "Example, Inc",
        "street1": "925 De La Vina St",
        "street2": "Suite 8",
        "zip": "93101"
    }
}'

# Create the HTTP objects
request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
request.body = shipment

# Send the request
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
    http.request(request)
end

puts response.body
```

```
import requests
import json

url = 'https://sandbox.shiphawk.com/api/v4/shipments'
headers = {'X-Api-Key': 'YOUR_API_KEY'}
payload = {
    "rate_id":"rate_5SNcd9293WRhPdNBgqPRN4KG",
    "origin_address": {
        "name": "Parcel Origin",
        "company": "Example, Inc",
        "street1": "465 Hillview Ave",
        "street2": "Apt 5",
        "zip": "93116"
    },
    "destination_address": {
        "name": "Parcel Destination",
        "company": "Example, Inc",
        "street1": "925 De La Vina St",
        "street2": "Suite 8",
        "zip": "93101"
    }
}

r = requests.post(url, headers=headers, json=payload)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;
import javax.json.*;
import javax.script.*;

public class PostRequests {
    public static void main(String [] args)
    {
        try{
            sendPost();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendPost() throws IOException {
        JsonObject personObject = Json.createObjectBuilder()
                .add("rate_id", "rate_3FqhSS7eakakwn9TeFccRV89")
                .add("origin_address", Json.createObjectBuilder()
                    .add("name", "Parcel Origin")
                    .add("company", "Example, Inc")
                    .add("street1", "465 Hillview Ave")
                    .add("street2", "Apt 5")
                    .add("zip", "93116")
                    )
                .add("destination_address", Json.createObjectBuilder()
                    .add("name", "Parcel Destination")
                    .add("company", "Example, Inc")
                    .add("street1", "925 De La Vina St")
                    .add("street2", "Suite 8")
                    .add("zip", "93101")
                    )
                .build();
        try{
            // For formatting json object to be readable
            ScriptEngineManager manager = new ScriptEngineManager();
            ScriptEngine scriptEngine = manager.getEngineByName("JavaScript");
            scriptEngine.put("jsonString", personObject.toString());
            scriptEngine.eval("result = JSON.stringify(JSON.parse(jsonString), null, 2)");
            String prettyPrintedJson = (String) scriptEngine.get("result");

URL url = new URL("https://sandbox.shiphawk.com/api/v4/shipments?api_key=YOUR_API_KEY");
            HttpURLConnection con = (HttpURLConnection) url.openConnection();
            con.setRequestMethod("POST");
            con.setRequestProperty("Content-Type", "application/json");
            con.setDoOutput(true);
            OutputStream os = con.getOutputStream();
            os.write(personObject.toString().getBytes());
            os.flush();
            os.close();

int responseCode = con.getResponseCode();

> Request: POST /api/v4/shipments/?api\_key=YOUR\_API\_KEY

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| rate\_id | String or Array\[String\] | The RateId that is returned from /rates endpoint. If provided on Order creation, Order will use data from Rate (like Carrier/Service). |
| origin\_address | [Address](https://docs.shiphawk.com/#address-object) | Order Address Request object |
| destination\_address | [Address](https://docs.shiphawk.com/#address-object) | Order Address Request object |

> Response: [shipment-response-object](https://docs.shiphawk.com/#shipment-response-object)

### List all Shipments

```
curl -X GET 'https://sandbox.shiphawk.com/api/v4/shipments?api_key=YOUR_API_KEY'
```

```
require 'net/http'

uri = URI.parse('https://sandbox.shiphawk.com/api/v4/shipments?api_key=YOUR_API_KEY')
response = Net::HTTP.get(uri)

puts response
```

```
import requests

url = 'https://sandbox.shiphawk.com/api/v4/shipments'
headers = {'X-Api-Key': 'YOUR_API_KEY'}

r = requests.get(url, headers=headers)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;

public class GetRequests {
    public static void main(String [] args)
    {
        try{
            sendGet();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendGet() throws IOException {
        URL url = new URL("https://sandbox.shiphawk.com/api/v4/shipments?api_key=YOUR_API_KEY&source_system=NetSuite");
        HttpURLConnection con = (HttpURLConnection) url.openConnection();
        con.setRequestMethod("GET");
        int responseCode = con.getResponseCode();

> Request: GET /api/v4/shipments
>
> Response: Array [\[shipment-response-object\]](https://docs.shiphawk.com/#shipment-response-object)

### Retrieve a Shipment

```
#'shp_becFaAAj' is an example shipment external id.
curl -X GET 'https://sandbox.shiphawk.com/api/v4/shipments/shp_becFaAAj/?api_key=YOUR_API_KEY'
```

```
require 'net/http'

#'shp_8Wskd61X' is an example shipment id.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/shipments/shp_8Wskd61X?api_key=YOUR_API_KEY')
response = Net::HTTP.get(uri)

puts response
```

```
import requests

url = 'https://sandbox.shiphawk.com/api/v4/shipments/shp_8Wskd61X'
headers = {'X-Api-Key': 'YOUR_API_KEY'}

r = requests.get(url, headers=headers)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;

public class GetRequests {
    public static void main(String [] args)
    {
        try{
            sendGet();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendGet() throws IOException {
        // 'shp_xxP5vPQm' is an example shipment id.
        URL url = new URL("https://sandbox.shiphawk.com/api/v4/shipments/shp_xxP5vPQm?api_key=YOUR_API_KEY&source_system=NetSuite");
        HttpURLConnection con = (HttpURLConnection) url.openConnection();
        con.setRequestMethod("GET");
        int responseCode = con.getResponseCode();

> Request: GET /api/v4/shipments/:id

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String | shipment id |

> Response: [shipment-response-object](https://docs.shiphawk.com/#shipment-response-object)

### Retrieve the URL of a BOL PDF File

```
#`shp_CkSqDRPW` is an example shipment id.
curl -X GET 'https://sandbox.shiphawk.com/api/v4/shipments/shp_CkSqDRPW/bol?api_key=YOUR_API_KEY'
```

```
require 'net/http'

#'shp_8Wskd61X' is an example shipment id.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/shipments/shp_8Wskd61X/bol?api_key=YOUR_API_KEY')
response = Net::HTTP.get(uri)

puts response
```

```
import requests

url = 'https://sandbox.shiphawk.com/api/v4/shipments/shp_8Wskd61X/bol'
headers = {'X-Api-Key': 'YOUR_API_KEY'}

r = requests.get(url, headers=headers)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;

public class GetRequests {
    public static void main(String [] args)
    {
        try{
            sendGet();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendGet() throws IOException {
        // 'shp_xxP5vPQm' is an example shipment id.
        URL url = new URL("https://sandbox.shiphawk.com/api/v4/shipments/shp_xxP5vPQm/bol?api_key=YOUR_API_KEY&source_system=NetSuite");
        HttpURLConnection con = (HttpURLConnection) url.openConnection();
        con.setRequestMethod("GET");
        int responseCode = con.getResponseCode();

> Request: GET /api/v4/shipments/:id/bol

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String | shipment id |

> Example Response: {
> "url": "https://sandbox.shiphawk.com/uploads/labels\_7b2bc795e6e9b6a88eac2e7d067640c0.pdf",
> "id": "doc\_0zRNYArq",
> "extension": "pdf"
> }

### Retrieve the URL of a Commercial Invoice PDF file

```
#'shp_CkSqDRPW' is an example shipment id.
curl -X GET 'https://sandbox.shiphawk.com/api/v4/shipments/shp_CkSqDRPW/commercial_invoice?api_key=YOUR_API_KEY'
```

```
require 'net/http'

#'shp_8Wskd61X' is an example shipment id.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/shipments/shp_8Wskd61X/commercial_invoice?api_key=YOUR_API_KEY')
response = Net::HTTP.get(uri)

puts response
```

```
import requests

url = 'https://sandbox.shiphawk.com/api/v4/shipments/shp_8Wskd61X/commercial_invoice'
headers = {'X-Api-Key': 'YOUR_API_KEY'}

r = requests.get(url, headers=headers)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;

public class GetRequests {
    public static void main(String [] args)
    {
        try{
            sendGet();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendGet() throws IOException {
        // 'shp_xxP5vPQm' is an example shipment id, assuming commercial invoice is necessary for shipment.
        URL url = new URL("https://sandbox.shiphawk.com/api/v4/shipments/shp_xxP5vPQm/commercial_invoice?api_key=YOUR_API_KEY&source_system=NetSuite");
        HttpURLConnection con = (HttpURLConnection) url.openConnection();
        con.setRequestMethod("GET");
        int responseCode = con.getResponseCode();

> Request: GET /api/v4/shipments/:id/commercial\_invoice

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String | shipment id |

> Example Response: {
> "url": "https://sandbox.shiphawk.com/uploads/ci\_2E37C2FB50.pdf",
> "id": "doc\_HejPj0CT",
> "extension": "pdf"
> }

### Retrieve the URL of an Address Label PDF File

```
#`shp_CkSqDRPW` is an example shipment id.
curl -X GET 'https://sandbox.shiphawk.com/api/v4/shipments/shp_CkSqDRPW/address_labels?api_key=YOUR_API_KEY'
```

```
require 'net/http'

#'shp_8Wskd61X' is an example shipment id.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/shipments/shp_8Wskd61X/address_labels?api_key=YOUR_API_KEY')
response = Net::HTTP.get(uri)

puts response
```

```
import requests

url = 'https://sandbox.shiphawk.com/api/v4/shipments/shp_8Wskd61X/address_labels'
headers = {'X-Api-Key': 'YOUR_API_KEY'}

r = requests.get(url, headers=headers)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;

public class GetRequests {
    public static void main(String [] args)
    {
        try{
            sendGet();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendGet() throws IOException {
        // 'shp_xxP5vPQm' is an example shipment id.
        URL url = new URL("https://sandbox.shiphawk.com/api/v4/shipments/shp_xxP5vPQm/address_labels?api_key=YOUR_API_KEY&source_system=NetSuite");
        HttpURLConnection con = (HttpURLConnection) url.openConnection();
        con.setRequestMethod("GET");
        int responseCode = con.getResponseCode();

> Request: GET /api/v4/shipments/:id/address\_labels

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String | shipment id |

> Example Response: {
> "url": "https://sandbox.shiphawk.com/uploads/address\_labels\_7b2bc795e6e9b6a88eac2e7d067640c0.pdf",
> "id": "doc\_0zRNYArq",
> "extension": "pdf"
> }

### Retrieve the URL of the label(s) for a Parcel Shipment

```
#`shp_CkSqDRPW` is an example shipment id.
curl -X GET 'https://sandbox.shiphawk.com/api/v4/shipments/shp_CkSqDRPW/labels?api_key=YOUR_API_KEY'
```

```
require 'net/http'

#'shp_8Wskd61X' is an example shipment id.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/shipments/shp_8Wskd61X/labels?api_key=YOUR_API_KEY')
response = Net::HTTP.get(uri)

puts response
```

```
import requests

url = 'https://sandbox.shiphawk.com/api/v4/shipments/shp_8Wskd61X/labels'
headers = {'X-Api-Key': 'YOUR_API_KEY'}

r = requests.get(url, headers=headers)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;

public class GetRequests {
    public static void main(String [] args)
    {
        try{
            sendGet();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendGet() throws IOException {
        // 'shp_xxP5vPQm' is an example shipment id, assuming commercial invoice is necessary for shipment.
        URL url = new URL("https://sandbox.shiphawk.com/api/v4/shipments/shp_xxP5vPQm/labels?api_key=YOUR_API_KEY&source_system=NetSuite");
        HttpURLConnection con = (HttpURLConnection) url.openConnection();
        con.setRequestMethod("GET");
        int responseCode = con.getResponseCode();

> Request: GET /api/v4/shipments/:id/labels

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String | shipment id |

> Example Response: {
> "url": "https://sandbox.shiphawk.com/uploads/package\_labels\_combined\_20201001-51659-18y8z4j.pdf",
> "id": "doc\_4TSr8V99",
> "extension": "pdf"
> }

### Retrieve the Packing Slip of a shipment

```
#'shp_CkSqDRPW' is an example shipment id.
curl -X GET 'https://sandbox.shiphawk.com/api/v4/shipments/shp_CkSqDRPW/packing_slip?api_key=YOUR_API_KEY'
```

```
require 'net/http'

#'shp_8Wskd61X' is an example shipment id.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/shipments/shp_8Wskd61X/packing_slip?api_key=YOUR_API_KEY')
response = Net::HTTP.get(uri)

puts response
```

```
import requests

url = 'https://sandbox.shiphawk.com/api/v4/shipments/shp_8Wskd61X/packing_slip'
headers = {'X-Api-Key': 'YOUR_API_KEY'}

r = requests.get(url, headers=headers)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;

public class GetRequests {
    public static void main(String [] args)
    {
        try{
            sendGet();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendGet() throws IOException {
        // 'shp_xxP5vPQm' is an example shipment id.
        URL url = new URL("https://sandbox.shiphawk.com/api/v4/shipments/shp_xxP5vPQm/packing_slip?api_key=YOUR_API_KEY&source_system=NetSuite");
        HttpURLConnection con = (HttpURLConnection) url.openConnection();
        con.setRequestMethod("GET");
        int responseCode = con.getResponseCode();

> Request: GET /api/v4/shipments/:id/packing\_slip

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String | shipment id |

> Example Response: {
> "url": "https://sandbox.shiphawk.com/uploads/packing\_slip\_7b2bc795e6e9b6a88eac2e7d067640c0.pdf",
> "id": "doc\_0zRNYArq",
> "extension": "pdf"
> }

### Retrieve Count of Shipments Grouped By Status

```
curl -X GET 'https://sandbox.shiphawk.com/api/v4/shipments/search_count?api_key=YOUR_API_KEY'
```

```
require 'net/http'

uri = URI.parse('https://sandbox.shiphawk.com/api/v4/shipments/search_count?api_key=YOUR_API_KEY')
response = Net::HTTP.get(uri)

puts response
```

```
import requests

url = 'https://sandbox.shiphawk.com/api/v4/shipments/search_count'
headers = {'X-Api-Key': 'YOUR_API_KEY'}

r = requests.get(url, headers=headers)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;

public class GetRequests {
    public static void main(String [] args)
    {
        try{
            sendGet();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendGet() throws IOException {
        URL url = new URL("https://sandbox.shiphawk.com/api/v4/shipments/search_count?api_key=YOUR_API_KEY&source_system=NetSuite");
        HttpURLConnection con = (HttpURLConnection) url.openConnection();
        con.setRequestMethod("GET");
        int responseCode = con.getResponseCode();

> Request: GET /api/v4/shipments/search\_count
>
> Example Response: {
> "ordered": 0,
> "confirmed": 0,
> "scheduled\_for\_pickup": 0,
> "nl\_prep": 0,
> "ready\_for\_carrier\_pickup": 0,
> "in\_transit": 0,
> "delivered": 0,
> "exception": 0,
> "cancelled": 2
> }

### Search Shipments

```
#`shp_CkSqDRPW` is an example shipment id.
curl -X GET 'https://sandbox.shiphawk.com/api/v4/shipments/?api_key=YOUR_API_KEY&id=shp_CkSqDRPW'
```

```
require 'net/http'

#'shp_8Wskd61X' is an example shipment id.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/shipments/api_key=YOUR_API_KEY&id=shp_8Wskd61X')
response = Net::HTTP.get(uri)

puts response
```

```
import requests

url = 'https://sandbox.shiphawk.com/api/v4/shipments/id=shp_8Wskd61X'
headers = {'X-Api-Key': 'YOUR_API_KEY'}

r = requests.get(url, headers=headers)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;

public class GetRequests {
    public static void main(String [] args)
    {
        try{
            sendGet();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendGet() throws IOException {
        // 'shp_xxP5vPQm' is an example shipment id.
        URL url = new URL("https://sandbox.shiphawk.com/api/v4/shipments?api_key=YOUR_API_KEY&id=shp_xxP5vPQm");
        HttpURLConnection con = (HttpURLConnection) url.openConnection();
        con.setRequestMethod("GET");
        int responseCode = con.getResponseCode();

> Request: GET /api/v4/shipments/:id

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String | shipment id |

> Response: [shipment-response-object](https://docs.shiphawk.com/#shipment-response-object)

### Track Shipment

```
#'shp_CkSqDRPW' is an example shipment id.
curl -X GET 'https://sandbox.shiphawk.com/api/v4/shipments/shp_CkSqDRPW/tracking?api_key=YOUR_API_KEY'
```

```
require 'net/http'

uri = URI.parse('https://sandbox.shiphawk.com/api/v4/shipments/shp_8Wskd61X/tracking?api_key=YOUR_API_KEY')
response = Net::HTTP.get(uri)

puts response
```

```
import requests

url = 'https://sandbox.shiphawk.com/api/v4/shipments/shp_8Wskd61X/tracking'
headers = {'X-Api-Key': 'YOUR_API_KEY'}

r = requests.get(url, headers=headers)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;

public class GetRequests {
    public static void main(String [] args)
    {
        try{
            sendGet();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendGet() throws IOException {
        // 'shp_xxP5vPQm' is an example shipment id.
        URL url = new URL("https://sandbox.shiphawk.com/api/v4/shipments/shp_xxP5vPQm/tracking?api_key=YOUR_API_KEY");
        HttpURLConnection con = (HttpURLConnection) url.openConnection();
        con.setRequestMethod("GET");
        int responseCode = con.getResponseCode();

> Request: GET /api/v4/shipments/:id/tracking

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String | shipment id |

> Example Response: {
> "id": "shp\_bMv9F00T",
> "status": "cancelled",
> "status\_updates": \[\],
> "tracking\_number": "0041218925",
> "tracking\_url": "",
> "actual\_delivery\_date": null,
> "actual\_pickup\_time": null,
> "requested\_at": null,
> "requested\_end\_at": null
> }

### Track Shipment Subscription

```
#`shp_CkSqDRPW` is an example shipment id.
curl -H "Content-Type: application/json" -X POST -d '
{
    "callback_url": "valid_url"
}' 'https://sandbox.shiphawk.com/api/v4/shipments/shp_CkSqDRPW/tracking?api_key=YOUR_API_KEY'
```

```
require 'net/http'
require 'uri'
require 'json'

#'shp_XMMB707d' is an example shipment id.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/shipments/shp_XMMB707d?api_key=YOUR_API_KEY')

shipment =
'{
    "callback_url": "valid_url"
}'

# Create the HTTP objects
request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
request.body = shipment

# Send the request
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
    http.request(request)
end

puts response.body
```

```
import requests

url = 'https://sandbox.shiphawk.com/api/v4/shipments/shp_XMMB707d/tracking'
headers = {'X-Api-Key': 'YOUR_API_KEY'}

r = requests.post(url, headers=headers)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;
import javax.json.*;
import javax.script.*;

public class PostRequests {
    public static void main(String [] args)
    {
        try{
            sendPost();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendPost() throws IOException {
        JsonObject personObject = Json.createObjectBuilder()
                .add("callback_url", "valid_url")
                .build();
        try{
            // For formatting json object to be readable
            ScriptEngineManager manager = new ScriptEngineManager();
            ScriptEngine scriptEngine = manager.getEngineByName("JavaScript");
            scriptEngine.put("jsonString", personObject.toString());
            scriptEngine.eval("result = JSON.stringify(JSON.parse(jsonString), null, 2)");
            String prettyPrintedJson = (String) scriptEngine.get("result");

// 'shp_xxP5vPQm' is an example shipment id.
            URL url = new URL("https://sandbox.shiphawk.com/api/v4/shipments/shp_xxP5vPQm/tracking?api_key=YOUR_API_KEY");
            HttpURLConnection con = (HttpURLConnection) url.openConnection();
            con.setRequestMethod("POST");
            con.setRequestProperty("Content-Type", "application/json");
            con.setDoOutput(true);
            OutputStream os = con.getOutputStream();
            os.write(personObject.toString().getBytes());
            os.flush();
            os.close();

int responseCode = con.getResponseCode();

> Request: POST /api/v4/shipments/:id/tracking

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| callback\_url | String |  |

### Update an Existing Shipment

```
#`shp_becFaAAj` is an example external shipment id.
curl -H "Content-Type: application/json" -X POST -d '
{
    "status": "delivered",
    "tracking_number": "Track my ship",
    "origin_instructions": "Instructions for the man with the pickup truck",
    "destination_instructions": "Instructions for the man with the bigger pickup truck",
  "itn_confirmation_number": 1343,
  "origin_address": {
        "company": "Example, Inc",
        "street1": "465 Hillview Ave",
        "street2": null,
        "phone_number": "1234567890",
        "email": "order@example.org"
  },
  "destination_address": {
        "company": "Example, Inc",
        "street1": "465 Hillview Ave",
        "street2": null,
        "phone_number": "1234567890",
        "email": "order@example.org"
  }
}' 'https://sandbox.shiphawk.com/api/v4/shipments/shp_becFaAAj/?api_key=YOUR_API_KEY'
```

```
require 'net/http'
require 'uri'
require 'json'

#include 'shp_XMMB707d' is an example shipment id.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/shipments/shp_XMMB707d?api_key=YOUR_API_KEY')

shipment =
'{
    "status": "delivered",
    "tracking_number": "Track my ship",
    "origin_instructions": "Instructions for the man with the pickup truck",
    "destination_instructions": "Instructions for the man with the bigger pickup truck",
  "itn_confirmation_number": 1343,
  "origin_address": {
        "company": "Example, Inc",
        "street1": "465 Hillview Ave",
        "street2": null,
        "phone_number": "1234567890",
        "email": "order@example.org"
  },
  "destination_address": {
        "company": "Example, Inc",
        "street1": "465 Hillview Ave",
        "street2": null,
        "phone_number": "1234567890",
        "email": "order@example.org"
  }
}'

# Create the HTTP objects
request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
request.body = shipment

# Send the request
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
    http.request(request)
end

puts response.body
```

```
import requests
import json

url = 'https://sandbox.shiphawk.com/api/v4/shipments/shp_XMMB707d'
headers = {'X-Api-Key': 'YOUR_API_KEY'}
payload = {
    "status": "delivered",
    "tracking_number": "Track my ship",
    "origin_instructions": "Instructions for the man with the pickup truck",
    "destination_instructions": "Instructions for the man with the bigger pickup truck",
  "itn_confirmation_number": 1343,
  "origin_address": {
        "company": "Example, Inc",
        "street1": "465 Hillview Ave",
        "street2": null,
        "phone_number": "1234567890",
        "email": "order@example.org"
  },
  "destination_address": {
        "company": "Example, Inc",
        "street1": "465 Hillview Ave",
        "street2": null,
        "phone_number": "1234567890",
        "email": "order@example.org"
  }
}

r = requests.post(url, headers=headers, json=payload)
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;
import javax.json.*;
import javax.script.*;

public class PostRequests {
    public static void main(String [] args)
    {
        try{
            sendPost();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendPost() throws IOException {
        JsonObject personObject = Json.createObjectBuilder()
                .add("status", "delivered")
                .add("tracking_number", "Track my ship")
                .add("origin_instructions", "Instructions for the man with the pickup truck")
                .add("destination_instructions", "Instructions for the man with the bigger pickup truck")
                .add("itn_confirmation_number", "1343")
                .add("origin_address", Json.createObjectBuilder()
                        .add("company", "Example, Inc")
                        .add("street1", "465 Hillview Ave")
                        .add("street2", "null")
                        .add("phone_number", "1234567890")
                        .add("email", "order@example.org")
                    )
                .add("destination_address", Json.createObjectBuilder()
                        .add("company", "Example, Inc")
                        .add("street1", "465 Hillview Ave")
                        .add("street2", "null")
                        .add("phone_number", "1234567890")
                        .add("email", "order@example.org")
                    )
                .add("destination_address", "valid_url")
                .build();
        try{
            // For formatting json object to be readable
            ScriptEngineManager manager = new ScriptEngineManager();
            ScriptEngine scriptEngine = manager.getEngineByName("JavaScript");
            scriptEngine.put("jsonString", personObject.toString());
            scriptEngine.eval("result = JSON.stringify(JSON.parse(jsonString), null, 2)");
            String prettyPrintedJson = (String) scriptEngine.get("result");

// 'shp_xxP5vPQm' is an example shipment id.
            URL url = new URL("https://sandbox.shiphawk.com/api/v4/shipments/shp_xxP5vPQm?api_key=YOUR_API_KEY");
            HttpURLConnection con = (HttpURLConnection) url.openConnection();
            con.setRequestMethod("POST");
            con.setRequestProperty("Content-Type", "application/json");
            con.setDoOutput(true);
            OutputStream os = con.getOutputStream();
            os.write(personObject.toString().getBytes());
            os.flush();
            os.close();

int responseCode = con.getResponseCode();

> Request: POST /api/v4/shipments/:id

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| status | String |  |
| tracking\_number | String |  |
| origin\_instructions | String |  |
| destination\_instructions | String |  |
| itn\_confirmation\_number | Integer |  |
| origin\_address | [Address](https://docs.shiphawk.com/#address-object) | Order Address Request object |
| destination\_address | [Address](https://docs.shiphawk.com/#address-object) | Order Address Request object |

> Response: [shipment-response-object](https://docs.shiphawk.com/#shipment-response-object)

# SKU

## SKU Resourses

### SKU Object

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| `sku` | String | `required` Unique identifier of a product |
| `external_id` | String | Can store id of item in external system (eg Shopify, Magento) |
| `name` | String |  |
| `description` | String |  |
| `child_sku` | String | Sku that is part of current sku |
| `child_sku_qty` | Integer | How many child sku are in current sku |
| `child_sku_qty_min` | Integer | Minimum quantity of child sku in Order to use current sku dims for packing algorithm and rating. If left blank `child_sku_qty` will be used |
| `image_url` | String | Accessible URL with product image |
| `packing_code` | String |  |
| `price` | Float |  |
| `units_per_sku` | Integer |  |
| `aggregate_weight` | Boolean |  |
| `ship_individually` | Boolean |  |
| `kit_skus` | KitSkus |  |
| `kit_sku_value_percentages` | KitSkusValuePercentages |  |
| `kit_skus_as_one_line_item_for_customs` | Boolean | Default: false |
| `upc` | String |  |
| `inventory_identification` | Enum | Default: none. If item requires special identification should be specified. Options: <br>- serialized<br>- lotted |
| `items` | Array\[ [SkuItem](https://docs.shiphawk.com/#sku-item-object)\] |  |

### SKU Item Object

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| quantity | Integer |  |
| length | Float |  |
| width | Float |  |
| height | Float |  |
| weight | Float |  |
| description | String |  |
| value | Float |  |
| item\_type | Enum | Options:<br>- parcel<br>- handling\_unit<br>- unpacked |
| handling\_unit\_type | Enum |  |
| package\_type | Enum | Options:<br>- carton<br>- box<br>- crate<br>- bag<br>- drum |
| package\_quantity | Integer |  |
| requires\_crating | Boolean |  |
| freight\_class | Enum | Options:<br>- 50<br>- 55<br>- 60<br>- 65<br>- 70<br>- 77.5<br>- 85<br>- 92.5<br>- 100<br>- 110<br>- 125<br>- 150<br>- 175<br>- 200<br>- 250<br>- 300<br>- 400<br>- 500 |
| nmfc | String |  |
| can\_ship\_parcel | Boolean |  |
| optimize\_packing | Boolean |  |
| commodity\_description | String |  |
| country\_of\_manufacture | String | 2 letter country code |
| orm\_d | Boolean | Deprecated! Use [hazmat\_data](https://docs.shiphawk.com/#sku-hazmatdata) where `dangerous_goods_type` is `limited_quantity` instead of this |
| harmonized\_codes | Array\[ [HarmonizedCodeMapping](https://docs.shiphawk.com/#sku-harmonizedcodemapping)\] | Is used to calculate proper harmanized code based on destionation |
| hazmat\_data | [HazmatData](https://docs.shiphawk.com/#sku-hazmatdata) | Data required for hazmat documentation |

### SKU HarmonizedCodeMapping

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| harmonized\_code | String | Actual harmonized code to be used for filling customs |
| country\_code | String | The destination country code which use this harmonized code. Leave this field blank if harmonized code can be used for any destination |

### SKU HazmatData

```
Example: Limited Quantity
{
    // ...,
    "hazmat_data": {
        "dangerous_goods_type": "limited_quantity"
    },
    // ...,
}
```

```
Example: Excepted Quantity
{
    // ...,
    "hazmat_data": {
        "dangerous_goods_type": "excepted_quantity"
    },
    // ...,
}
```

### Bulk Sku Import Status

| Parameter | Type | Description |
| --- | --- | --- |
| id | Integer |  |
| status | unprocessed, in\_progress, completed |  |
| num\_skus | Integer | Number of imported SKUs |
| num\_items | Integer | Number of imported SKU items |
| num\_rows | Integer | Total number of source records |
| rows\_processed | Integer | Number of processed records |
| errors | Array of errors |  |
| created\_at | Timestamp |  |

## SKU API Endpoints

### Endpoint

> /api/v4/skus

### Create SKU

```
curl -H "Content-Type: application/json" -X POST -d '
{
  "sku": "T001",
  "name": "T-Shirt 1",
  "description": "Regular fit t-shirt",
  "image_url": "https://example.com/t-shirt.jpg",
  "price": "20.0",
  "items": [\
    {\
      "quantity": 1,\
      "length": 2,\
      "width": 1,\
      "height": 1,\
      "weight": 1,\
      "description": "Some description",\
      "value": 150,\
      "item_type": "parcel",\
      "commodity_description": "Some commodity description",\
      "country_of_manufacture: "CN",\
      "harmonized_codes": [\
        {\
          "country_code": "UA",\
          "harmonized_code: "123.123.123",\
        },\
        {\
          "country_code": "DE",\
          "harmonized_code: "333.333.333",\
        },\
        {\
          "country_code": "",\
          "harmonized_code: "111.111.111",\
        }\
      ]\
    }\
  ],
}' 'https://sandbox.shiphawk.com/api/v4/skus?api_key=YOUR_API_KEY'
```

> Request: POST /api/v4/skus

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| sku | String | required Uniq identifier of a product |
| name | String |  |
| description | String |  |
| image\_url | String | Accessible URL with product image |
| price | Float |  |
| items | Array\[ [SkuItem](https://docs.shiphawk.com/#sku-item-object)\] |  |

> Response: [sku-object](https://docs.shiphawk.com/#sku-object)

### Get SKU

```
curl -H "Content-Type: application/json" -X GET 'https://sandbox.shiphawk.com/api/v4/skus/detect?api_key=YOUR_API_KEY&sku=ABC&integration_id='
```

> Request: GET /api/v4/skus/detect

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| `sku` | String | `required` |
| `integration_id` | Integer | Optional. To distinguish products if you have several integrations (e.g., two Shopify stores) that have products with same SKU. |

> Response: [sku-object](https://docs.shiphawk.com/#sku-object)

### Count SKU

Return number of products

```
curl -H "Content-Type: application/json" -X GET 'https://sandbox.shiphawk.com/api/v4/skus/counts?api_key=YOUR_API_KEY'
```

> Request: GET /api/v4/skus/counts

### Search SKU

```
curl -H "Content-Type: application/json" -X GET 'https://sandbox.shiphawk.com/api/v4/skus/search?q=some+product&sort=name&page=1&per_page=20&api_key=YOUR_API_KEY'
```

> Request: GET /api/v4/skus/search

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| q | String | Search query string |
| status | Enum | Options:<br>- valid<br>- invalid |
| sort | String | Sortable Fields: id, created\_at, name, sku, valid\_for\_rating, hazmat. <br>Can accept several fields, like "-created\_at,price,-name".<br>Minus before field name means reverse order |
| page | Integer | Default: 1 |
| per\_page | Integer | Default: 100 |

### Delete SKU

```
curl -H "Content-Type: application/json" -X DELETE 'https://sandbox.shiphawk.com/api/v4/skus/all?api_key=YOUR_API_KEY'
```

> Request: DELETE /api/v4/skus
>
> Response: no content

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| `sku` | String, Array\[String\] | One or many skus |
| `integration_id` | Integer |  |

### Delete all SKUs

```
curl -H "Content-Type: application/json" -X DELETE 'https://sandbox.shiphawk.com/api/v4/skus/all?api_key=YOUR_API_KEY'
```

> Request: DELETE /api/v4/skus/all
>
> Response: no content

## Bulk SKU Import API Endpoints

### Endpoint

> /api/v4/bulk\_sku\_imports

### Start Bulk SKU import

```
curl -H "Content-Type: application/json" -X POST -d '
{
  "skus": [\
    {\
      "sku": "T001",\
      "name": "T-Shirt 1",\
      "description": "Regular fit t-shirt",\
      "price": "20.0",\
      "items": [\
        {\
          "quantity": 1,\
          "length": 2,\
          "width": 1,\
          "height": 1,\
          "weight": 0.5,\
          "item_type": "parcel"\
        }\
      ]\
    },\
    {\
      "sku": "T002",\
      "name": "T-Shirt 2",\
      "description": "Regular fit t-shirt",\
      "price": "20.0",\
      "items": [\
        {\
          "quantity": 1,\
          "length": 2,\
          "width": 1,\
          "height": 1,\
          "weight": 0.5,\
          "item_type": "parcel"\
        }\
      ]\
    }\
  ]
}' 'https://sandbox.shiphawk.com/api/v4/bulk_sku_imports?api_key=YOUR_API_KEY'
```

> Request: POST /api/v4/bulk\_sku\_imports

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| skus | Array\[ [Sku](https://docs.shiphawk.com/#sku-object)\] | A list of SKU Object to import (up to 1000 objects) |

> Response: [Import Status](https://docs.shiphawk.com/#bulk-sku-import-status)

### Endpoint

> /api/v4/bulk\_sku\_imports/:id

### Get Bulk SKU import status

```
curl 'https://sandbox.shiphawk.com/api/v4/bulk_sku_imports/3333?api_key=YOUR_API_KEY'
```

> Request: GET /api/v4/bulk\_sku\_imports/:id

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | Integer | ID of the created import |

> Response: [Import Status](https://docs.shiphawk.com/#bulk-sku-import-status)

# Unpacked Items

## Unpacked Item Resources

### Unpacked Item Object

Small unpacked items must be packed prior to shipping. ShipHawk estimates the packing materials required and provides rates based on the estimated weight and dimensions of the resulting package(s).

```
# Example Response
{
        "id": "itm_ceQKE0MS",
        "category": "Food and Beverage",
        "subcategory_name": "Food and Beverage",
        "name": "Coffee-33 Panama box",
        "length": 20,
        "width": 19,
        "height": 8,
                "dimension_uom": "in",
        "weight": 34.5,
                "weight_uom": "lb",
        "value": 0,
        "can_be_rolled": false,
        "can_be_folded": false,
        "can_be_stacked": false
}
```

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | long |  |
| `category` | string |  |
| `subcategory_name` | string |  |
| `name` | string |  |
| `length` | float |  |
| `width` | float |  |
| `height` | float |  |
| `dimension_uom` | String | Options: <br>- in<br>- cm<br> Default: `in` |
| `weight` | float |  |
| `weight_uom` | String | Options: <br>- lb<br>- kg<br> Default: `lb` |
| `value` | float |  |
| `can_be_rolled` | boolean |  |
| `can_be_folded` | boolean |  |
| `can_be_stacked` | boolean |  |

### Unpacked Item Type Object

Unpacked Item Types represent types of items (i.e. Macbook Pro, Antique Chair, etc.) for which ShipHawk provides detailed information for (i.e. average length, minimum padding, whether it can be rolled or stacked, etc.)

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | string |  |
| `name` | long |  |
| `category_name` | string |  |
| `subcategory_name` | string |  |
| `dimensions` | object | Dimensions Object |

### Dimensions Object

| Attribute | Type | Description |
| --- | --- | --- |
| `length` | float |  |
| `width` | float |  |
| `height` | float |  |
| `weight` | float |  |

## Unpacked Item API Endpoints

### Retrieve Unpacked Items Types by IDs

```
# 'itm_ceQKE0MS' and 'itm_QrKZQ4Jf' are example unpacked item type ids.
curl -X GET 'https://sandbox.shiphawk.com/api/v4/unpacked_item_types/find?ids\[\]=itm_ceQKE0MS&ids\[\]=itm_QrKZQ4Jf&api_key=YOUR_API_KEY'
```

```
require 'net/http'

# 'itm_ceQKE0MS' and 'itm_QrKZQ4Jf' are example unpacked item type ids.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/unpacked_item_types/find?ids[]=itm_ceQKE0MS&ids[]=itm_QrKZQ4Jf&api_key=YOUR_API_KEY')
response = Net::HTTP.get(uri)

puts response
```

```
import requests

# 'itm_ceQKE0MS' and 'itm_QrKZQ4Jf' are example unpacked item type ids.
url = 'https://sandbox.shiphawk.com/api/v4/unpacked_item_types/find?ids[]=itm_ceQKE0MS&ids[]=itm_QrKZQ4Jf'
headers = {'X-Api-Key': 'YOUR_API_KEY'}

r = requests.get(url, headers=headers)
print r.content
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;

public class GetRequests {
    public static void main(String [] args)
    {
        try{
            sendGet();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendGet() throws IOException {
        // 'itm_ceQKE0MS' and 'itm_QrKZQ4Jf' are example unpacked item type ids.
        URL url = new URL("https://sandbox.shiphawk.com/api/v4/unpacked_item_types/find?ids[]=itm_ceQKE0MS&ids[]=itm_QrKZQ4Jf&api_key=YOUR_API_KEY");
        HttpURLConnection con = (HttpURLConnection) url.openConnection();
        con.setRequestMethod("GET");
        int responseCode = con.getResponseCode();

> Request: GET /api/v4/unpacked\_item\_types/find?ids\[\]=:id&ids\[\]=:id&...&api\_key=YOUR\_API\_KEY

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String | Unpacked item id |

> Response: [unpacked-item-type-object](https://docs.shiphawk.com/#unpacked-item-type-object)

### Search for an Unpacked Item Type

```
# 'P8A' is an example unpacked item type name.
curl -X GET 'https://sandbox.shiphawk.com/api/v4/unpacked_item_types/search?name=P8A&api_key=YOUR_API_KEY'
```

```
require 'net/http'

#'P8A' is an example unpacked item type name.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/unpacked_item_types/search?name=P8A&api_key=YOUR_API_KEY')
response = Net::HTTP.get(uri)

puts response
```

```
import requests

# 'P8A' is an example unpacked item type name.
url = 'https://sandbox.shiphawk.com/api/v4/unpacked_item_types/search?name=P8A'
headers = {'X-Api-Key': 'YOUR_API_KEY'}

r = requests.get(url, headers=headers)
print r.content
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;

public class GetRequests {
    public static void main(String [] args)
    {
        try{
            sendGet();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendGet() throws IOException {
        // 'P8A' is an example unpacked item type name.
        URL url = new URL("https://sandbox.shiphawk.com/api/v4/unpacked_item_types/search?name=P8A&api_key=YOUR_API_KEY");
        HttpURLConnection con = (HttpURLConnection) url.openConnection();
        con.setRequestMethod("GET");
        int responseCode = con.getResponseCode();

> Request: GET /api/v4/unpacked\_item\_types/search?name=P8A&api\_key=YOUR\_API\_KEY

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| name | String | Unpacked item name |

> Response: [unpacked-item-type-object](https://docs.shiphawk.com/#unpacked-item-type-object)

### Validates Unpacked Item Types by ID

```
# 'itm_ceQKE0MS' and 'itm_QrKZQ4Jf' are example unpacked item type ids.
curl -X GET 'https://sandbox.shiphawk.com/api/v4/unpacked_item_types/check_existence?ids\[\]=itm_ceQKE0MS&ids\[\]=itm_QrKZQ4Jf&api_key=YOUR_API_KEY'
```

```
require 'net/http'

# 'itm_ceQKE0MS' and 'itm_QrKZQ4Jf' are example unpacked item type ids.
uri = URI.parse('https://sandbox.shiphawk.com/api/v4/unpacked_item_types/check_existence?ids[]=itm_ceQKE0MS&ids[]=itm_QrKZQ4Jf&api_key=YOUR_API_KEY')
response = Net::HTTP.get(uri)

puts response
```

```
import requests

# 'itm_ceQKE0MS' and 'itm_QrKZQ4Jf' are example unpacked item type ids.
url = 'https://sandbox.shiphawk.com/api/v4/unpacked_item_types/check_existence?ids[]=itm_ceQKE0MS&ids[]=itm_QrKZQ4Jf'
headers = {'X-Api-Key': 'YOUR_API_KEY'}

r = requests.get(url, headers=headers)
print r.content
```

```
// Running with javax.json-1.0.jar
import java.io.*;
import java.net.*;

public class GetRequests {
    public static void main(String [] args)
    {
        try{
            sendGet();
        }
        catch(IOException ex){
            ex.printStackTrace(System.out);
        }
    }
    private static void sendGet() throws IOException {
        // 'itm_ceQKE0MS' and 'itm_QrKZQ4Jf' are example unpacked item type ids.
        URL url = new URL("https://sandbox.shiphawk.com/api/v4/unpacked_item_types/check_existence?ids[]=itm_ceQKE0MS&ids[]=itm_QrKZQ4Jf&api_key=YOUR_API_KEY");
        HttpURLConnection con = (HttpURLConnection) url.openConnection();
        con.setRequestMethod("GET");
        int responseCode = con.getResponseCode();

> Request: GET /api/v4/unpacked\_item\_types/check\_existence?ids\[\]=:id&ids\[\]=:id&...&api\_key=YOUR\_API\_KEY

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String | Unpacked item id |

> Response: [unpacked-item-type-object](https://docs.shiphawk.com/#unpacked-item-type-object)

# Users

## User Resources

### User Object

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String |  |
| first\_name | String |  |
| last\_name | String |  |
| email | String |  |
| account\_id | String |  |
| qz\_printer | String |  |
| qz\_dimensioner | String |  |
| homepage | String |  |
| print\_driver | String |  |
| dimensioner\_driver | String |  |
| print\_node\_user\_setting | String |  |
| auto\_print\_labels\_for\_booked\_shipments | String |  |
| print\_labels\_upside\_down | Boolean |  |
| warehouse\_ids | Array\[String\] |  |

## User Api Endpoints

### User Current

Returns information about current user

```
curl -X GET 'https://sandbox.shiphawk.com/api/v4/user?api_key=YOUR_API_KEY'
```

> Request: GET /api/v4/user

No params

> Response: [User](https://docs.shiphawk.com/#user-object)

### User Retrieve User

Retrieve specific user

```
#user_HeNeRHFG is an example of a user id
curl -X GET 'https://sandbox.shiphawk.com/api/v4/user/user_HeNeRHFG/?api_key=YOUR_API_KEY'
```

> Request: GET /api/v4/user/:id

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String | `required` |

> Response: [User](https://docs.shiphawk.com/#user-object)

### Create User

```
curl -H "Content-Type: application/json" -X POST -d '
{
  “email”: “mikel@shiphawk.com”,
  “password”: “MwLtNFV”,
  “first_name”: “Mikel”,
  “last_name”: “Richardson”,
  “warehouse_ids”: ["mc_n7nJ5XjQ"]
}’ ‘https://sandbox.shiphawk.com/api/v4/users?api_key=YOUR_API_KEY'
```

> Request: POST /api/v4/users

> Response: [User](https://docs.shiphawk.com/#user-object)

### Destroy User

```
#user_HeNeRHFG is an example of a user id
curl -X DELETE 'https://sandbox.shiphawk.com/api/v4/users/user_HeNeRHFG/?api_key=YOUR_API_KEY'
```

> Request: DELETE /api/v4/users/:id

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| ids | Array\[String\] |  |

> Response: no content

### User Update Settings

```
#user_HeNeRHFG is an example of a user id
curl -H "Content-Type: application/json" -X POST -d '
{
  “qz_printer”: “Horse556”,
  “qz_dimensioner”: null,
  “homepage”: “dashboard”,
  “print_driver”: “printnode”,
  “dimensioner_driver”: "printnode",
  "auto_print_labels_for_booked_shipments": true,
  "print_labels_upside_down": false,
  "show_rts_model": true
}’ ‘https://sandbox.shiphawk.com/api/v4/users/user_HeNeRHFG/settings?api_key=YOUR_API_KEY'
```

> Request: POST /api/v4/users/:id/settings

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| qz\_printer | String |  |
| qz\_dimensioner | String |  |
| homepage | Enum | Options:<br>- dashboard<br>- orders<br>- shipments<br>- rts |
| print\_driver | Enum | Options:<br>- qztray<br>- printnode |
| dimensioner\_driver | Enum | Options:<br>- qztray<br>- printnode |
| auto\_print\_labels\_for\_booked\_shipments | Boolean |  |
| print\_labels\_upside\_down | Boolean |  |
| show\_rts\_modal | Boolean |  |

> Response: [User](https://docs.shiphawk.com/#user-object)

# Warehouses

## Warehouse Object

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String |  |
| code | String |  |
| created\_at | DateTime |  |
| address | [BookingAddress](https://docs.shiphawk.com/#booking-address-Object) |  |
| alternate\_return\_address | [Address](https://docs.shiphawk.com/#address-object) |  |

## Warehouses Endpoints

### Retrieve Warehouses

```
curl -X GET 'https://sandbox.shiphawk.com/api/v4/warehouses?api_key=YOUR_API_KEY'
```

> Request: GET /api/v4/warehouses

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| code | Array\[String\] | If not set all warehouses will be returned |

> Response: Array\[ [Warehouse](https://docs.shiphawk.com/#warehouse-object)\]

### Delete Warehouses

```
#whs_NdKaIREU is an example of a warehouse id
curl -X DELETE 'https://sandbox.shiphawk.com/api/v4/warehouses/whs_NdKaIREU/?api_key=YOUR_API_KEY'
```

> Request: DELETE /api/v4/warehouses/:id

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| code | Array\[String\] | \`required |

> Response: no content

### Update Warehouse

```
#whs_NdKaIREU is an example of a warehouse
curl -H "Content-Type: application/json" -X POST -d '
{
  “id”: “wrh_NdKaIREU”,
  “code”: “12345”,
  “address”: null,
  “alternate_return_address”: null,
}’ ‘https://sandbox.shiphawk.com/api/v4/warehouses/whs_NdKaIREU/?api_key=YOUR_API_KEY'
```

> Request: POST /api/v4/warehouses/:id

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String |  |
| code | String |  |
| address | [BookingAddress](https://docs.shiphawk.com/#booking-address-Object) |  |
| alternate\_return\_address | [Address](https://docs.shiphawk.com/#address-object) |  |

# Webhooks

## Webhook API Endpoints

### Get List of Available Webhooks

```
curl -X GET -H "X-Api-Key: YOUR_API_KEY" "https://sandbox.shiphawk.com/api/v4/webhooks/events"

# Example Response
{[\
  "shipment.status_update",\
  "shipment.address_update",\
  "shipment.notes_update",\
  "shipment.timing_update",\
  "shipment.tracking_update",\
  "shipment.documents_update",\
  "shipment.create_from_order"\
]}
```

> Request: GET /api/v4/webhooks/events

### Create a Webhook

```
curl -X POST -H "X-Api-Key: YOUR_API_KEY" -H "Content-Type: application/json" -d
'{"callback_url": "http://requestb.in/1khurll1",
  "events":["shipment.status_update","shipment.tracking_update"]}'
  "https://sandbox.shiphawk.com/api/v4/webhooks"

# Example Response
{
  "id": "wh_6vh3AegY",
  "events": [\
    "shipment.status_update",\
    "shipment.tracking_update"\
  ],
  "callback_url": "http://requestb.in/1khurll1",
  "created_at": "2016-12-28T11:59:15Z"
}
```

> Request: POST /api/v4/webhooks

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| callback\_url | String | `required` Publicly accesssible URL |
| use\_basic\_auth | Boolean |  |
| basic\_auth\_username | String |  |
| basic\_auth\_password | String |  |
| events | Array\[Enum\] | Options:<br>- shipment.status\_update<br>- shipment.address\_update<br>- shipment.notes\_update<br>- shipment.timing\_update<br>- shipment.tracking\_update<br>- shipment.documents\_update<br>- shipment.create\_from\_order<br>- shipment.create<br>- proposed\_shipment.create<br>- order.document\_create |

### Get List of Created Webhooks

```
curl -X GET -H "X-API-KEY: YOUR_API_KEY" "https://sandbox.shiphawk.com/api/v4/webhooks"

# Example Response
{
    "id": "wh_BZ1mtcGR",
    "events": [\
      "shipment.timing_update",\
      "shipment.tracking_update"\
    ],
    "callback_url": "http://requestb.in/197klsd1",
    "created_at": "2017-01-03T22:39:10Z"
  },
  {
    "id": "wh_T85FsAXe",
    "events": [\
      "shipment.status_update",\
      "shipment.address_update"\
    ],
    "callback_url": "http://requestb.in/197klsd1",
    "created_at": "2017-01-03T21:34:57Z"
}
```

> Request: GET /api/v4/webhooks

### Get a Webhook

```
curl -X GET -H "X-Api-Key: YOUR_API_KEY" "https://sandbox.shiphawk.com/api/v4/webhooks/"

> Request: GET /api/v4/webhooks/:id

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String | webhook id |

### Update a Webhook

> Request: POST /api/v4/webhooks/:id

### Delete a Webhook

```
curl -X DELETE -H "X-API-KEY: YOUR_API_KEY" "https://sandbox.shiphawk.com/api/v4/webhooks/wh_BZ1mtcGR"

# Example Response
{
  "No Content"
}
```

> Request: DELETE /api/v4/webhooks/:id

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String | webhook id |

## Example Webhook Event Payloads

### Status Update Event

See an example payload for a status update webhook on the right.

```
{
  "event": "shipment.status_update",
  "status": "in_transit",
  "updated_at": "2017-04-04T10:50:57.821Z",
  "shipment_id": 1311664,
  "shipment_public_id": "shp_KfVyKJNy",
  "order_number": null
}
```

### Address Update Event

See an example payload for an address update webhook on the right.

```
{
  "event": "shipment.address_update",
  "from_address": {
    "name": "SB Pack and Post",
    "company": null,
    "email": null,
    "phone_number": "8058809339",
    "street1": "1627 Chapala St.",
    "street2": null,
    "city": "SANTA BARBARA",
    "state": "CA",
    "zip": "93101",
    "country": "US",
    "is_residential": false,
    "updated_at": "2017-04-04T23:54:41.305Z"
  },
  "to_address": {
    "name": "Max Horrell",
    "company": null,
    "email": null,
    "phone_number": "8053352432",
    "street1": "117 Lilly Pond Lane",
    "street2": null,
    "city": "EAST HAMPTON",
    "state": "NY",
    "zip": "11937",
    "country": "US",
    "is_residential": true,
    "updated_at": "2015-06-17T21:18:44.731Z"
  },
  "updated_at": "2017-04-04T23:54:41.125Z",
  "shipment_id": 1030067,
  "shipment_public_id": "shp_nAVbypfV",
  "order_number": null
}
```

### Notes Update Event

See an example payload for a notes update webhook on the right.

```
{
  "event": "shipment.notes_update",
  "status_notes": [\
    {\
      "message": "Not available until 3 pm",\
      "created_at": "2017-04-04T23:57:31.873Z",\
      "updated_at": "2017-04-04T23:57:31.873Z"\
    }\
  ],
  "updated_at": "2017-04-04T23:57:03.764Z",
  "shipment_id": 1030067,
  "shipment_public_id": "shp_nAVbypfV",
  "order_number": null
}
```

### Timing Update Event

See an example payload for a timing update webhook on the right.

```
{
  "event": "shipment.timing_update",
  "actual_delivery_date": null,
  "actual_pickup_time": "2017-04-04T07:00:00.000Z",
  "updated_at": "2017-04-05T15:37:40.301Z",
  "shipment_id": 1405294,
  "shipment_public_id": "shp_tzzkd1nW",
  "order_number": null
}
```

### Tracking Update Event

See an example payload for a tracking update webhook on the right.

```
{
  "event": "shipment.tracking_update",
  "tracking_number": "786135883423",
  "tracking_url": "https://www.fedex.com/apps/fedextrack/?action=track&trackingnumber=786135883423",
  "updated_at": "2017-04-06T17:33:20.543Z",
  "shipment_id": 1405294,
  "shipment_public_id": "shp_tzzkd1nW",
  "order_number": null
}
```

### Shipment Create From Order Event

See an example payload for a shipment create from order webhook on the right.

```
{
  "event": "shipment.create_from_order",
  "id": "shp_ZqqSDjaC",
  "shid": "SH1455422",
  "proposed_shipment_id": "pshp_dZ7xjhhQ",
  "status": "ordered",
  "origin_address": {
    "id": "badr_MAz3KFQD",
    "name": "maxstore",
    "company": null,
    "street1": "26 Castilian Drive, Suite C",
    "street2": null,
    "city": "Goleta",
    "state": "CA",
    "zip": "93117",
    "country": "US",
    "phone_number": "",
    "email": null,
    "is_residential": false,
    "is_warehouse": false,
    "address_type": "commercial",
    "code": null
  },
  "destination_address": {
    "id": "badr_0kkt3eHc",
    "name": "max horrell",
    "company": "123",
    "street1": "316 w alamar",
    "street2": null,
    "city": "Santa Barbara",
    "state": "CA",
    "zip": "93105",
    "country": "US",
    "phone_number": "",
    "email": null,
    "is_residential": false,
    "is_warehouse": false,
    "address_type": "commercial",
    "code": null
  },
  "carrier": "USPS",
  "carrier_code": "usps",
  "carrier_type_code": "small_parcel",
  "is_external": false,
  "is_customer_tariff": false,
  "service_name": "Priority Mail",
  "insurance_type": "no_insurance",
  "total_price": 7.17,
  "tracking_number": "9405510200864427693834",
  "documents": [\
    {\
      "id": "doc_KNePFaSw",\
      "customer_uploaded": false,\
      "type": "label for a package",\
      "code": "package_label",\
      "url": "https://shiphawk.com/api/v4/public/documents/files/0936208d0a9aac0fe3743226936131b9.pdf",\
      "created_at": "2017-04-05T00:02:33.408Z"\
    },\
    {\
      "id": "doc_sFE0kBNv",\
      "customer_uploaded": false,\
      "type": "Package Labels Combined",\
      "code": "package_labels_combined",\
      "url": "https://shiphawk.com/api/v4/public/documents/files/46b3b73b5a0ad80d45d84872414c2868.pdf",\
      "created_at": "2017-04-05T00:02:34.646Z"\
    }\
  ],
  "price_details": {
    "shipping": 7.17,
    "packing": 0.0,
    "insurance": 0.0,
    "pickup": 0.0,
    "delivery": 0.0,
    "accessorials": 0,
    "taxes": 0.0,
    "duty": 0.0
  },
  "dispatch": null,
  "packages": [\
    {\
      "id": "pkg_R99T6Q8W",\
      "tracking_number": "9405510200864427693834",\
      "tracking_url": "https://tools.usps.com/go/TrackConfirmAction.action?tRef=fullpage&tLc=1&text28777=&tLabels=9405510200864427693834",\
      "freight_class": "50",\
      "packing_type": "box",\
      "package_type": null,\
      "package_quantity": null,\
      "package_items": [],\
      "materials": [],\
      "labors": [],\
      "length": 5.0,\
      "width": 5.0,\
      "height": 5.0,\
      "weight": 5.0,\
      "volume": 0.07\
    }\
  ],
  "origin_network_location_id": null,
  "destination_network_location_id": null,
  "reference_numbers": [\
    {\
      "id": "shpr_k3thDbD8",\
      "code": "purchase_id",\
      "value": "1234",\
      "name": "Purchase Order #"\
    }\
  ],
  "origin_instructions": null,
  "destination_instructions": null,
  "shiphawk_managed": false,
  "print_package_labels_enabled": true,
  "itn_confirmation_number": null,
  "exceptions": [],
  "est_delivery_date": "2017-04-07T00:00:00.000Z",
  "order_id": "ord_b5Jj7F9W",
  "order_number": "1024",
  "label_url": "https://shiphawk.com/api/v4/public/documents/files/46b3b73b5a0ad80d45d84872414c2868.pdf",
  "carrier_report_date": null,
  "created_at": "2017-04-05T00:02:31.790Z",
  "created_by": {
    "type": "api",
    "name": "API"
  },
  "updated_at": "2017-04-05T00:02:34.438Z",
  "shipment_billing": {
    "shortcut_account_number": null,
    "country": "US",
    "zip": null,
    "bill_to": "sender"
  },
  "duties_taxes_billing": {
    "shortcut_account_number": null,
    "country": "US",
    "zip": null,
    "bill_to": "recipient"
  }
}
```

# Workstations

## Workstation Object

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| id | String |  |
| name | String |  |
| code | String |  |
| warehouse\_codes | Array\[String\] |  |

## Workstations Endpoints

### Retrieve Workstations

```
curl -X GET 'https://sandbox.shiphawk.com/api/v4/workstations?api_key=YOUR_API_KEY'
```

> Request: GET /api/v4/workstations
>
> Response: Array\[ [Workstation](https://docs.shiphawk.com/#workstation-object)\]

# Common Params

## Pagination Params

| Parameter | Type | Description, Defaults |
| --- | --- | --- |
| page | Integer | Default: 1 |
| per\_page | Integer | Default: 100 |
| sort | String |  |
| direction | Enum | Default: `asc`. Options: `asc`, `desc`. |

# Status Codes

In a response, HTTP status codes that can indicate a problem include the following:

| Code | Meaning |
| --- | --- |
| 400 | Bad Request. Parameters might be missing or incorrect. |
| 401 | Unauthorized. Your authentication credentials are out of date or invalid. |
| 402 | Suspended. Your account has been suspended. Please contact ShipHawk support at support@shiphawk.com. |
| 403 | Forbidden. You do not have permission to perform the request. |
| 404 | Not Found. The requested resource does not exist. |
| 422 | Unprocessable Entity. Params are valid, but some logic error happened. |
| 423 | Locked. Resource is locked because it is processing another request. |
| 500 | Internal Server Error. An unexpected condition occurred on the ShipHawk server. |
