Quickstart
Zero to first API call in 10 minutes
Walk through signing up, minting a key, reading your usage, and registering a signed webhook to receive VIA events. Every sample runs as-is.
Create an account
Self-serve signup takes about two minutes — email verification is instant, no manual approval needed.
Create developer account — freeMint a test API key
In the developer dashboard (Developers → API Keys), mint a new key. It defaults to the "tenants:read" scope (read your usage); add "webhooks:manage" if you'll manage webhooks. The full secret is shown once — copy it immediately.
sk_test_ and are isolated from your live traffic and billing.Make your first call
Export your key and read your current-month usage — the simplest API-key-authenticated endpoint.
export VIA_API_KEY="sk_test_…" curl https://sandbox.api.via-basket.com/v1/usage/current-month \ -H "Authorization: Bearer $VIA_API_KEY"
Understand the response
Endpoints wrap their result in a `data` field. The usage response summarises your call count, included quota, and latency.
{
"data": {
"calls": 1284,
"included": 100000,
"p50_latency_ms": 42,
"p99_latency_ms": 180
}
}Browse webhook event types
Before registering a webhook, list the event types you can subscribe to. This endpoint needs no scope.
curl https://sandbox.api.via-basket.com/v1/webhooks/events \ -H "Authorization: Bearer $VIA_API_KEY"
Set up a webhook endpoint
Register your HTTPS endpoint and subscribe to the event types you care about. VIA returns the signing secret once — store it safely.
curl -X POST https://sandbox.api.via-basket.com/v1/webhooks \
-H "Authorization: Bearer $VIA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/hooks/via",
"events": ["order.created", "order.status_changed", "order.delivered"],
"description": "Production dispatch integration"
}'Verify HMAC signatures
Every delivery carries an X-VIA-Signature header of the form t=<ts>,v1=<hex>. Verify before trusting the body.
import express from 'express';
import { verifySignature } from '@via/sdk';
const app = express();
app.post(
'/hooks/via',
express.raw({ type: 'application/json' }), // raw body is load-bearing
(req, res) => {
const sig = req.header('X-VIA-Signature') ?? '';
if (!verifySignature(req.body, sig, process.env.VIA_WEBHOOK_SECRET!)) {
return res.status(400).end();
}
const event = JSON.parse(req.body.toString());
// …fulfil event…
res.status(204).end();
},
);Go live
Back in the developer dashboard, mint a `sk_live_…` key. Swap the environment variable — no code change needed. The SDKs auto-detect the host from the key prefix.
Monitor usage
The Developers → Usage dashboard shows daily request counts, rate-limit hits, and billing period status. We email an alert at 80% of your monthly quota.
Open usage dashboardUpgrade your plan
Approaching your limits? Upgrade in one click from your portal settings (Manage billing button).
What next?
Dive into the full reference or browse every webhook event type.