Integrations and API
How to connect Fresa Technologies with third-party services and use the API for custom integrations.
const response = await fetch('https://api.fresa.io/v1/shipments', {
method: 'GET',
headers: {
'Authorization': `Bearer ${process.env.FRESA_API_KEY}`,
'Content-Type': 'application/json'
}
});
const shipments = await response.json();
import requests
headers = {
'Authorization': f'Bearer {os.getenv("FRESA_API_KEY")}',
'Content-Type': 'application/json'
}
response = requests.get('https://api.fresa.io/v1/shipments', headers=headers)
shipments = response.json()
curl -X GET 'https://api.fresa.io/v1/shipments' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json'
{
"data": [
{
"id": "shp_abc123",
"status": "in_transit",
"tracking_url": "https://dhl.com/track/123456"
}
],
"meta": {
"total": 1,
"page": 1
}
}
{
"error": {
"code": "unauthorized",
"message": "Invalid API key"
}
}
Overview
Fresa Technologies supports seamless integrations with popular third-party services in the freight and shipping ecosystem. You can connect your account to accounting tools, carriers, and e-commerce platforms to automate quoting, documentation, and tracking. The RESTful API enables custom workflows, while webhooks keep your systems in sync with real-time events like shipment updates.
Accounting
Sync invoices and payments with QuickBooks or Xero.
Carriers
Direct connections to DHL, FedEx, and UPS for label generation.
E-commerce
Import orders from Shopify and WooCommerce automatically.
API Authentication
Start by generating an API key from your Fresa dashboard. This key authenticates all requests using Bearer token authorization.
Navigate to Settings
Log in to your Fresa account and go to Account > API Keys.
Create Key
Click Generate New Key, add a name like "Production Integration", and copy the key securely.
Store Securely
Save the key as an environment variable: FRESA_API_KEY.
Rotate keys every 90 days and restrict scopes to minimize risks.
Making API Requests
The API base URL is https://api.fresa.io/v1. All endpoints require the Authorization: Bearer YOUR_API_KEY header.
Unique shipment identifier, e.g., shp_abc123.
Filter by status: pending, in_transit, delivered.
Setting Up Webhooks
Webhooks notify your endpoint of events like shipment status changes. Configure them in the Fresa dashboard under Integrations > Webhooks.
Payload includes shipment details for immediate quoting.
{
"event": "shipment.created",
"data": {
"id": "shp_abc123",
"origin": "New York",
"destination": "Los Angeles"
}
}
Triggers on delivery milestones.
{
"event": "shipment.status_updated",
"data": {
"id": "shp_abc123",
"new_status": "delivered"
}
}
Verify webhooks by responding with HTTP 200. Use ngrok for local testing.
Data Synchronization Best Practices
- Use webhooks for real-time updates and polling as fallback.
- Implement idempotency with
idempotency-keyheader to avoid duplicates. - Paginate large responses with
?page=1&limit=50. - Rate limit:
<100requests per minute per key.
Monitor webhook delivery retries. Failed deliveries after 5 attempts are queued for manual review.
Last updated today