Shippo is a shipping API that connects you with multiple shipping carriers (such as USPS, UPS, DHL, Canada Post, Australia Post, and many others) through one interface.
You must register for a Shippo account to use our API. It's free to sign up. Only pay to print a live label, test labels are free.
To use the API, you must generate an API Token. In the following examples, replace <YOUR_API_KEY_HERE>
with your own token.
For example.
apiKeyHeader:"shippo_test_595d9cb0c0e14497bf07e75ecfec6c6d"
Shippo external API.: Use this API to integrate with the Shippo service
- SDK Installation
- SDK Example Usage
- Available Resources and Operations
- Error Handling
- Server Selection
- Authentication
To add the NuGet package to a .NET project:
dotnet add package Shippo
To add a reference to a local instance of the SDK in a .NET project:
dotnet add reference Shippo/Shippo.csproj
using Shippo;
using Shippo.Models.Requests;
using Shippo.Models.Components;
var sdk = new ShippoSDK(
apiKeyHeader: "<YOUR_API_KEY_HERE>",
shippoApiVersion: "2018-02-08"
);
var res = await sdk.Addresses.ListAsync(
page: 1,
results: 5,
shippoApiVersion: "2018-02-08"
);
// handle response
The following is taken from Speakeasy's C# design:
By default the C# SDK will instantiate its own
SpeakeasyHttpClient
, which uses theSystem.Net.HttpClient
under the hood. The default client can be overridden by passing a custom HTTP client when initializing the SDK:
var sdk = new ShippoSDK(client: new CustomHttpClient());
The provided HTTP Client must implement the
ISpeakeasyHttpClient
interface as defined inUtils.SpeakeasyHttpClient.cs
: ...
This can be useful if you want to use a custom HTTP Client that supports a proxy or other custom configuration.
Below is an example of custom client that inherits from the internal
SpeakeasyHttpClient
class, which itself implements theISpekeasyHttpClient
interface. This client simply adds a header to all requests before sending them:
using Shippo.Utils;
public class CustomHttpClient : SpeakeasyHttpClient
{
public CustomHttpClient() {}
public override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request)
{
request.Headers.Add("X-Custom-Header", "custom value");
return await base.SendAsync(request);
}
}
A further example is included in the ShippoTests
project in this repo.
Review our full guides and references at https://docs.goshippo.com/.
Available methods
- List - List all addresses
- Create - Create a new address
- Get - Retrieve an address
- Validate - Validate an address
- Create - Create a batch
- Get - Retrieve a batch
- AddShipments - Add shipments to a batch
- Purchase - Purchase a batch
- RemoveShipments - Remove shipments from a batch
- List - List all carrier accounts
- Create - Create a new carrier account
- Get - Retrieve a carrier account
- Update - Update a carrier account
- InitiateOauth2Signin - Connect an existing carrier account using OAuth 2.0
- Register - Add a Shippo carrier account
- GetRegistrationStatus - Get Carrier Registration status
- List - List all customs declarations
- Create - Create a new customs declaration
- Get - Retrieve a customs declaration
- Create - Create a pickup
- Get - Retrieve a rate
- ListShipmentRates - Retrieve shipment rates
- ListShipmentRatesByCurrencyCode - Retrieve shipment rates in currency
- Create - Generate a live rates request
- GetDefaultParcelTemplate - Show current default parcel template
- UpdateDefaultParcelTemplate - Update default parcel template
- DeleteDefaultParcelTemplate - Clear current default parcel template
- List - List all service groups
- Create - Create a new service group
- Update - Update an existing service group
- Delete - Delete a service group
- List - List all Shippo Accounts
- Create - Create a Shippo Account
- Get - Retrieve a Shippo Account
- Update - Update a Shippo Account
- List - List all user parcel templates
- Create - Create a new user parcel template
- Delete - Delete a user parcel template
- Get - Retrieves a user parcel template
- Update - Update an existing user parcel template
- CreateWebhook - Create a new webhook
- ListWebhooks - List all webhooks
- GetWebhook - Retrieve a specific webhook
- UpdateWebhook - Update an existing webhook
- DeleteWebhook - Delete a specific webhook
While we value open-source contributions to this SDK, this library is generated programmatically. Feel free to open a PR or a Github issue as a proof of concept and we'll do our best to include it in a future release!
Connect with multiple different carriers, get discounted shipping labels, track parcels, and much more with just one integration. You can use your own carrier accounts or take advantage of our discounted rates with the Shippo carrier accounts. Using Shippo makes it easy to deal with multiple carrier integrations, rate shopping, tracking and other parts of the shipping workflow. We provide the API and web app for all your shipping needs.