Back

Shippo API Essential Guide

Sep 14, 20246 minute read

What type of API does Shippo provide?

The Shippo API provides a REST API. The key points are:

  1. The Shippo API documentation refers to it as a REST API.

  2. The documentation mentions typical REST concepts like API keys, client libraries/SDKs, and API status.

  3. There is no mention of SOAP, GraphQL, or other API types in the Shippo documentation.

  4. REST is one of the most common modern API types, especially for web services like Shippo.

  5. The documentation structure with resources like Addresses, Shipments, etc. is typical of a REST API design.

In summary, Shippo provides a REST API for integrating shipping functionality into applications. REST is a popular choice for web service APIs due to its simplicity and flexibility compared to alternatives like SOAP or GraphQL.

Does the Shippo API have webhooks?

Yes, the official Shippo API does have webhooks. Here are the key points about Shippo's webhook functionality:

Webhook Availability

Shippo offers webhooks as part of their API, allowing you to receive real-time notifications about various events related to your shipments and labels.

Event Types

You can subscribe to different types of events through Shippo's webhooks. Some of the events you can subscribe to include:

  • Track updates: Receive notifications when there are updates to the tracking status of a package.
  • Label creation: Get notified when new shipping labels are created.
  • Delivery attempts and completions: Receive alerts for delivery attempts and successful deliveries.
  • Shipment delays: Get notifications about any delays in shipments.

Webhook Registration

To register a webhook, you need to make a POST request to the Shippo API's webhook endpoint. Here's an example of how to register a webhook:

curl --location --request POST 'https://api.goshippo.com/webhooks' \ --header 'Authorization: ShippoToken <API_TOKEN>' \ --header 'Content-Type: application/json' \ --data-raw '{ "url": "<CLIENT_OWNED_URL>", "event": "<YOUR_EVENT>", "is_test": "true" //this value is defaulted to false and is optional }'

Webhook Management

Shippo provides endpoints for managing your webhooks, including:

  • Retrieving a single webhook
  • Retrieving all active webhooks
  • Deleting a webhook subscription

Security Options

Shippo offers several security options for webhooks to ensure the integrity of the data you receive:

  1. Self-generated tokens: You can add a token to the webhook URL as a query parameter.
  2. HMAC Security: A more secure option using hash-based message authentication.
  3. Inbound IP allowlist: You can whitelist Shippo's IP addresses to ensure requests come from a trusted source.

Best Practices

When implementing Shippo webhooks, consider the following best practices:

  1. Use HTTPS for your webhook endpoint to ensure secure communication.
  2. Implement at least one of the security options provided by Shippo.
  3. Set up proper error handling and logging for your webhook endpoint.
  4. Consider implementing a retry mechanism in case of temporary failures.

By utilizing Shippo's webhook functionality, you can create more responsive and automated shipping workflows, improving your overall shipping management process.

Rate Limits and other limitations

Here are the key points about the API Rate Limits for the Shippo API:

Rate Limit Structure

  • Shippo has different rate limits depending on the endpoint and the HTTP verb being used (GET, POST, PUT, etc.) [1]

  • All rate limits are per minute [1]

  • Exceeding the rate limit will result in a 429 error [1]

Specific Rate Limits

The rate limits vary for different endpoints and request types. Here are some examples:

  • For most endpoints (Address, Parcel, Shipment, Rate, Transaction, etc.):

    • POST/PUT: 500 requests/minute (live), 50 requests/minute (test)
    • GET (single): 4000 requests/minute (live), 400 requests/minute (test)
    • GET (multiple): 50 requests/minute (live), 5 requests/minute (test) [1]
  • For the Batch endpoint:

    • POST/PUT: 50 requests/minute (live), 5 requests/minute (test)
    • GET (single): 400 requests/minute (live), 40 requests/minute (test)
    • GET (multiple): 50 requests/minute (live), 5 requests/minute (test) [1]

Key Points to Consider

  • The rate limits are different for live and test environments, with test environments generally having lower limits [1]

  • Some endpoints have different limits for different operations (e.g., Batch endpoint has lower limits for POST/PUT compared to other endpoints) [1]

  • If you need higher rate limits than those provided, you can contact Shippo to request an increase [1]

Best Practices

  1. Monitor your API usage to ensure you stay within the rate limits.

  2. Implement proper error handling for 429 errors in case you exceed the rate limits.

  3. If you consistently approach or exceed the rate limits, consider optimizing your API usage or requesting higher limits from Shippo.

  4. Use the test environment judiciously, as it has lower rate limits compared to the live environment.

  5. Be aware of the different limits for different operations (POST, GET, etc.) and plan your API calls accordingly.

Latest API Version

Based on the search results provided, here are the key points regarding the most recent version of the Shippo API:

Current API Version

The most recent version of the Shippo API is not explicitly stated in the search results. However, the latest update mentioned is from August 5, 2024, which indicates that the API is actively maintained and updated.

Key Points to Consider

  1. Versioning System: Shippo uses a date-based versioning system for its API, with versions formatted as YYYY-MM-DD.

  2. Latest Updates: The most recent updates mentioned include:

    • Support for parcel tracking for a large number of carriers (August 5, 2024)
    • Release of a new C# SDK (June 10, 2024)
    • Update to the policy for automatically refunding unused USPS labels (April 8, 2024)
  3. Upgrading Process: Users are encouraged to stay up-to-date with the latest API version. The current version can be checked and upgraded through the Developer keys menu on the Shippo Developer portal.

  4. Backwards Compatibility: New versions are released when backwards-incompatible changes are made. Users are not forced to upgrade until they're ready.

  5. Testing: It's recommended to test thoroughly before upgrading. Users can set the API version on specific requests for testing purposes.

Best Practices

  1. Stay Updated: Regularly check for updates and consider upgrading to take advantage of the latest improvements and features.

  2. Test Before Upgrading: Always test your integration with a new API version using a test token before applying changes to your live environment.

  3. Version Specification: Specify the API version in your code, as it takes precedence over the version set in your Shippo account.

  4. Gradual Upgrade: When upgrading, it's recommended to upgrade each API call one at a time to ensure smooth transition.

  5. Review Changelog: Before upgrading, review the changelog to understand the changes to the endpoints you use.

In conclusion, while the exact most recent version number is not provided, the Shippo API is actively maintained with regular updates. Users should check their current version through the Developer portal and consider upgrading to the latest version after thorough testing.

How to get a Shippo developer account and API Keys?

To get a developer account for Shippo and create an API integration, follow these steps:

  1. Sign up for a Shippo account:

    • Go to https://goshippo.com/register and create a new account.
  2. Generate an API key:

    • Log in to the Shippo API portal at https://portal.goshippo.com/api-config/api
    • Under "Developer keys" in the "API configuration" section, click "Create new live key" for a live key or "Create new test key" for a test key.
    • Copy the generated API key, as it will not be shown again.
  3. Use the API key for authentication:

    • Include the API key in the "Authorization" header of your HTTP requests.
    • The format should be: Authorization: ShippoToken <your_api_key>

What can you do with the Shippo API?

Based on the Shippo API documentation, here are the key data models you can interact with using the Shippo API:

Addresses

  • Create, retrieve and validate shipping addresses
  • Used for origin, destination and return addresses

Parcels

  • Define package dimensions and weight
  • Create reusable parcel templates

Shipments

  • Combine addresses and parcels to get shipping rates
  • Book shipments and generate labels

Rates

  • Get and compare shipping rates from multiple carriers

Transactions (Shipping Labels)

  • Purchase shipping labels
  • Retrieve label URLs and tracking numbers

Tracking

  • Track packages and get status updates

Customs Items & Declarations

  • Provide customs information for international shipments

Carrier Accounts

  • Connect and manage carrier accounts

Manifests & Pickups

  • Create end-of-day manifests
  • Schedule carrier pickups

Orders (Beta)

  • Create and manage e-commerce orders

Refunds

  • Request refunds for unused labels

Service Groups

  • Define custom groupings of shipping services

Shippo Accounts

  • Manage platform/marketplace sub-accounts

Webhooks

  • Receive real-time notifications for shipment events

Key points:

  • Most objects are immutable once created, except Carrier Accounts, Service Groups and User Parcel Templates
  • Objects are identified by unique object IDs
  • Use POST to create, GET to retrieve, and PUT to update (where allowed)
  • The API provides a standardized interface to interact with multiple carriers

This covers the main data models and capabilities of the Shippo API for managing the full shipping workflow.