Shipping API quick start

Before you begin

Before you can use the Shipping API, you must:

  • Be a Metapack customer
  • Have a Metapack shipper account

You cannot use the Shipping API to send any consignments until the setup data for your Metapack shipper account has been configured. This setup data includes carriers, carrier services, currencies, and warehouses (shipping locations).

Getting an API key

You must request an API key from your Metapack Professional Services implementation consultant.

An API key is sent by encrypted email to the email address specified in an API key request. The messsage includes your username, password, key, and secret.

By default, your API key provides access to our sandbox environment.

Making API requests

Authentication

The Shipping API uses TLS authentication and the HTTP basic access authentication method.

To authenticate yourself to the API, you must include an Authorization header in each API request, which comprises the Basic prefix followed by a Base64-encoded <username>:<password> string .

Copy
Copied
curl --request HTTP_VERB \ 
--url "https://API_BASE_ADDRESS_AND_ENDPOINT" \ 
--header "Authorization: Basic Base64-encoded <username>:<password>" \

The Shipping API uses Hypertext Transfer Protocol Secure (HTTPS) to provide secure connections. Therefore, you must use HTTPS for all direct communication between your systems or apps and the API.

Sandbox environment

The Shipping API is available in the following sandbox environment:

https://api.sbx.metapack.com/shipping/v1

You can use the sandbox environment until you are ready to move to our production environment. To get your API key to access our production environment, you must contact your Metapack Professional Services implementation consultant.

Versions

The base URLs of all Shipping API resources are versioned. The API uses URI versioning as follows:

MAJOR.MINOR.PATCH

These versions are as follows.

Version Description
Major The version number used in the URI. It denotes breaking changes to the API. Any previously existing URIs should continue to operate as before, returning resources that conform to their original schemas.
Minor, Patch These are communicated in the API changelog to inform clients about new features, deprecated features, or bug fixes.

Rate limits

The Shipping API supports API key-level rate limiting, so it enforces a limit on the number of requests or the quantity of data that clients can consume.

When a rate limit is reached, the API returns status code 429 (Too Many Requests).

Make your first API request

To make your first Shipping API request, go to the API and use your API key and cURL to retrieve the carriers associated with your Metapack shipper account.

Next steps

Now that you’re successfully making authenticated requests to the Shipping API with your API key, there are different paths that you can take to become more familiar with the API.

If you want to… See…
Understand how the API works Supported workflows, Consignment lifecycle, and Allocation
Review the API definition YAML or JSON format
Review the API endpoints Reference
Try out the API endpoints API Explorer
Experiment with the API Postman collection
Learn how to use the API Guides