Getting started overview
Integrating with the ShipStation API enables developers to automate shipping processes, manage orders, and create labels programmatically. This guide details the essential steps for setting up your ShipStation account, obtaining your API credentials, and executing your first API call. The ShipStation API uses a RESTful architecture with JSON for request and response bodies, and authenticates requests via HTTP Basic authentication.
Before beginning, ensure you have a ShipStation account. While ShipStation does not offer a free tier, new users can typically access a free trial period to evaluate the service and API capabilities ShipStation pricing plans. The API reference documentation provides comprehensive details on available endpoints and data models ShipStation API reference documentation.
The following table provides a quick reference for the steps involved in getting started:
| Step | What to Do | Where |
|---|---|---|
| 1. Create Account | Sign up for a ShipStation account or free trial. | ShipStation homepage |
| 2. Get API Keys | Generate your unique API Key and API Secret from your account settings. | ShipStation Account Settings > API Settings |
| 3. Understand Auth | Familiarize yourself with HTTP Basic authentication for the API. | MDN HTTP authentication guide |
| 4. First Request | Construct and send a basic GET request using your API credentials. | Your preferred HTTP client (e.g., cURL, Postman) |
| 5. Parse Response | Process the JSON response from your first successful API call. | Your application environment |
Create an account and get keys
To begin using the ShipStation API, you need an active ShipStation account. Navigate to the ShipStation website and sign up for a plan or a free trial. Once your account is active, you can generate the necessary API credentials.
- Log in to your ShipStation account: Access your ShipStation dashboard using your registered email and password.
- Navigate to API Settings: From the ShipStation dashboard, go to
Settings(the gear icon) in the top right corner. Then, selectAPI Settingsunder theAccountsection. - Generate API Keys: If you don't already have an API key and secret, click the
Generate New API Keysbutton. ShipStation will display a uniqueAPI KeyandAPI Secret. It is crucial to copy these values immediately, as the API Secret will only be displayed once for security reasons. If you lose your API Secret, you will need to regenerate a new pair, invalidating the old one. - Record your credentials: Securely store your API Key and API Secret. These credentials will be used for all authenticated API requests.
ShipStation's API uses HTTP Basic authentication. This means you will encode your API Key and API Secret into a Base64 string and include it in the Authorization header of your HTTP requests. The format for the header is Authorization: Basic <Base64EncodedString>, where <Base64EncodedString> is derived from APIKey:APISecret. For example, if your API Key is YOUR_API_KEY and your API Secret is YOUR_API_SECRET, you would encode YOUR_API_KEY:YOUR_API_SECRET.
Your first request
With your API Key and API Secret, you can now make your first authenticated request to the ShipStation API. A common initial request is to retrieve a list of stores configured in your account. This confirms your authentication is set up correctly and provides a tangible interaction with the API.
The ShipStation API base URL for most endpoints is https://ssapi.shipstation.com/. For example, to list stores, you would target the /stores endpoint.
Here's an example using curl, a common command-line tool for making HTTP requests:
export SHIPSTATION_API_KEY="YOUR_API_KEY"
export SHIPSTATION_API_SECRET="YOUR_API_SECRET"
# Encode API Key and Secret
AUTH_STRING=$(echo -n "$SHIPSTATION_API_KEY:$SHIPSTATION_API_SECRET" | base64)
curl -X GET \
"https://ssapi.shipstation.com/stores" \
-H "Authorization: Basic $AUTH_STRING" \
-H "Content-Type: application/json"
Replace YOUR_API_KEY and YOUR_API_SECRET with your actual credentials. If successful, the API will return a JSON array of store objects, similar to the following (simplified for brevity):
[
{
"storeId": 12345,
"storeName": "My Online Store",
"marketplaceId": 1,
"marketplaceName": "Custom Store",
"active": true
},
{
"storeId": 67890,
"storeName": "Another Storefront",
"marketplaceId": 2,
"marketplaceName": "Shopify",
"active": true
}
]
This successful JSON response indicates that your API keys are valid, and your authentication header is correctly formatted. You have established basic connectivity with the ShipStation API.
Common next steps
After successfully making your first API call, you can explore more advanced functionalities to integrate ShipStation into your workflow. Common next steps include:
-
Fetching Orders: Integrate with the
/ordersendpoint to retrieve orders from your connected selling channels. You can filter orders by status, date range, and other criteria ShipStation Get Orders API reference. -
Creating Shipments and Labels: Once you have orders, you can use the
/shipments/createLabelendpoint to generate shipping labels. This involves providing order details, carrier information, and service types ShipStation Create Label API documentation. -
Webhooks: Set up webhooks to receive real-time notifications about events in ShipStation, such as order status changes or shipment updates. This eliminates the need for constant polling and ensures your system is always up-to-date ShipStation API Webhooks guide.
-
Inventory Management: If your ShipStation plan includes inventory features, you can use API endpoints to manage product inventory levels, update stock, and track movements ShipStation Inventory Management API documentation.
-
SDKs and Libraries: For specific programming languages, consider using one of the community-developed SDKs for ShipStation. While these are not officially maintained by ShipStation, they can simplify API interactions by handling authentication and request/response serialization. Common languages with SDKs include PHP, Python, Ruby, Java, Node.js, and C#.
-
Error Handling: Implement robust error handling in your application to gracefully manage API rate limits, invalid requests, and other potential issues. Consult the ShipStation API documentation for specific error codes and their meanings ShipStation API Error Codes.
Troubleshooting the first call
Encountering issues during your first API call is common. Here are some troubleshooting steps:
-
401 Unauthorized: This is the most frequent error, indicating an issue with your authentication. Double-check the following:
- API Key and Secret: Ensure they are copied exactly as generated, without extra spaces.
- Base64 Encoding: Verify that the concatenation of
APIKey:APISecretis correctly Base64 encoded. Many online tools can help verify this, or you can use your programming language's built-in functions. The basic authentication scheme requires this specific encoding RFC 7617 Basic HTTP Authentication Scheme. - Authorization Header Format: Confirm the header is exactly
Authorization: Basic <Base64String>. - Active Keys: Ensure your API keys have not been revoked or regenerated, which would invalidate previous keys.
-
400 Bad Request: This typically means your request body or parameters are malformed or missing required fields. Even for a GET request like
/stores, an incorrect content type header could cause this. EnsureContent-Type: application/jsonis present, even if no body is sent. -
Network Issues: Verify your internet connection and ensure no firewalls or proxies are blocking your outbound requests to
ssapi.shipstation.com. -
Endpoint URL: Confirm you are using the correct base URL and endpoint path (e.g.,
https://ssapi.shipstation.com/stores). -
Rate Limits: ShipStation imposes rate limits to prevent abuse. While unlikely on your very first call, repeated failed attempts in a short period might temporarily trigger a 429 Too Many Requests error. If this happens, wait a few minutes before retrying.
-
Check ShipStation Status Page: Occasionally, service outages can occur. Check the ShipStation status page for any ongoing issues that might affect API availability.