AdvancedIntegrations
Advanced

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();
{
  "data": [
    {
      "id": "shp_abc123",
      "status": "in_transit",
      "tracking_url": "https://dhl.com/track/123456"
    }
  ],
  "meta": {
    "total": 1,
    "page": 1
  }
}

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.

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.

path
shipment_idstring
Required

Unique shipment identifier, e.g., shp_abc123.

query
statusstring

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"
  }
}

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-key header to avoid duplicates.
  • Paginate large responses with ?page=1&limit=50.
  • Rate limit: <100 requests per minute per key.

Monitor webhook delivery retries. Failed deliveries after 5 attempts are queued for manual review.

Was this page helpful?
Built with Documentation.AI

Last updated today