Getting Started
Create a Gateway Account
Sign up for a Gateway account at www.gatewaylines.com/sign-up. Once registered, you'll have access to the customer portal where you can manage API keys.
Generate an API Key
Navigate to Settings → API Keys in your dashboard. Click "Create New Key" and give it a descriptive name. Choose between two modes:
Production Mode
Prefix: gw_...
Real shipment data. Calls count against your monthly limit.
Sandbox Mode
Prefix: gw_test_...
Mock test data. Unlimited free calls for development.
Important: Save your API key immediately
Your API key is only shown once. Copy it to a secure location. If lost, you'll need to generate a new one.
Make Your First Request
Test your API key by making a simple request to the shipments endpoint:
curl -X GET "https://www.gatewaylines.com/api/v1/shipments" \ -H "Authorization: Bearer gw_test_your_key_here"
With a sandbox key, you'll receive mock test data:
{
"success": true,
"data": [...mock shipments...],
"api_usage": {
"calls_remaining": "unlimited",
"mode": "sandbox"
},
"_sandbox": true,
"_notice": "This is sandbox/test data..."
}Once ready for production, switch to a production key (gw_...) to access real data.
Explore the API Reference
Now that you're connected, explore the full API reference to discover all available endpoints including shipment management, tracking, invoices, and EDI integration.
Rate Limits
To ensure fair usage and system stability, all API requests are subject to rate limiting.
50 requests
Rolling 60-second window
1,000 requests
Resets at midnight UTC
Rate Limit Headers
Every API response includes headers to help you track your usage:
X-RateLimit-Limit: 50
X-RateLimit-Remaining: 47
X-RateLimit-Reset: 1704067200
Need higher limits? Contact [email protected] to discuss enterprise rate limits for high-volume integrations.
Best Practices
API Key Security
- Store API keys in environment variables, never in code
- Use different keys for development and production
- Rotate keys periodically (every 90 days recommended)
- Revoke compromised keys immediately
Error Handling
- Always check HTTP status codes before parsing responses
- Implement exponential backoff for 429 (rate limit) errors
- Log API errors with request IDs for troubleshooting
- Handle network timeouts gracefully (30s recommended)
Performance
- Cache responses where appropriate (tracking data: 5 min)
- Use pagination for list endpoints (default: 50 items)
- Use webhooks instead of polling for real-time updates
- Batch requests when possible to reduce API calls
Data Handling
- Always use HTTPS for all API requests
- Validate webhook signatures before processing
- Store timestamps in UTC format
- Use ISO 8601 date format for all date parameters
Frequently Asked Questions
Support
Enterprise Support
Need dedicated support, custom integrations, or higher rate limits? Our enterprise team can help with custom solutions for high-volume shippers.
Contact Enterprise Sales