Skip to main content

Hauly Partner API

Book same-day UK couriers from your own system. Quote between two postcodes, book with an idempotency key, get signed webhooks as the driver collects and delivers, and pull proof of delivery. Same prices as the website.

Quick start

Every account starts on the free sandbox. Email [email protected] and we open an account and send a test key (hk_test_…). Test jobs never reach a driver or your card.

# 1. Price a job (valid 24 hours)
curl https://www.hauly.co.uk/api/v1/quotes \
  -H "Authorization: Bearer $HAULY_KEY" -H "Content-Type: application/json" \
  -d '{"from_postcode":"M1 1AE","to_postcode":"L1 8JQ","item_type":"small-parcel","urgency":"same-day"}'

# 2. Book it (same Idempotency-Key on every retry of this booking)
curl https://www.hauly.co.uk/api/v1/jobs \
  -H "Authorization: Bearer $HAULY_KEY" -H "Content-Type: application/json" \
  -H "Idempotency-Key: order-10042" \
  -d '{"quote_id":"<id from step 1>","external_ref":"10042",
       "collection":{"address":"1 Piccadilly, Manchester M1 1AE","contact_name":"Sam","contact_phone":"07700900123"},
       "delivery":{"address":"5 Lord St, Liverpool L1 8JQ","contact_name":"Alex","contact_phone":"07700900456"}}'

# 3. Follow it: webhooks (below), or
curl https://www.hauly.co.uk/api/v1/jobs/<job id> -H "Authorization: Bearer $HAULY_KEY"

Keys and scopes

Send Authorization: Bearer <key> on every request, from your server only (never a browser or app). Live keys start hk_live_, test keys hk_test_. Keys are shown once; we store only a hash. Rolling a key gives a new one and keeps the old one working for 24 hours.

Scopes: quotes:readjobs:readjobs:writejobs:cancelwebhooks:manage.

Live bookings are charged to the card saved on your Hauly account at the moment you book (paid before dispatch, like the website). Approved accounts on Growth and up can be invoiced monthly instead.

Errors

Errors are RFC 9457 problem documents with a stable code and the request_id (also in the Hauly-Request-Id header; quote it when you contact us).

codeHTTP
invalid_api_key401
insufficient_scope403
account_suspended403
plan_required402
payment_failed402
payment_method_required409
credit_limit_exceeded402
rate_limited429
quota_exceeded429
validation_failed400
idempotency_key_required400
idempotency_mismatch422
idempotency_in_progress409
quote_expired409
quote_on_request409
not_found404
invalid_transition409
limit_reached409
not_available403
internal500

Rate limits and quotas

Each key has a per-minute limit and each account a monthly call allowance (by plan, below). Every response carries RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset. Over the minute limit you get 429 rate_limited with Retry-After. Past the monthly allowance paid plans carry on at the overage rate up to a hard cap, then 429 quota_exceeded. /ping, 401 and 429 responses are not counted. Use webhooks instead of polling.

Idempotency

POST /jobs and POST /jobs/{id}/cancel need an Idempotency-Key header (any unique string up to 255 characters, such as your order number). Retrying with the same key and body returns the first response with Idempotent-Replayed: true, so a timeout can never book twice. The same key with a different body is 422; a request still running is 409. Keys are kept 24 hours.

Webhooks

Add an endpoint with POST /webhook-endpoints (public https URL; the secret is returned once). We POST an event within about 5 minutes of each change: job.createdjob.acceptedjob.driver_assignedjob.collectingjob.in_transitjob.deliveredjob.failedjob.cancelled. The body carries the event id and data.job (id, status, previous_status, external_ref); GET the job for the rest.

Answer 2xx within 10 seconds. Failures are retried with backoff (5 minutes up to 24 hours) for 24 or 72 hours by plan. Events can repeat or arrive out of order: dedupe on id. Verify Hauly-Signature: t=<unix>,v1=<hex>, an HMAC-SHA256 of <t>.<raw body> with your secret, and reject anything more than 5 minutes old:

import crypto from 'node:crypto'

// rawBody: the request body exactly as received (a string), before JSON.parse
export function verifyHauly(rawBody, header, secret) {
  const parts = Object.fromEntries(header.split(',').map((p) => p.split('=')))
  const t = Number(parts.t)
  if (!t || Math.abs(Date.now() / 1000 - t) > 300) return false
  const expected = crypto.createHmac('sha256', secret).update(`${t}.${rawBody}`).digest('hex')
  return header.split(',').some((p) => {
    const [k, v] = p.split('=')
    return k === 'v1' && v.length === expected.length &&
      crypto.timingSafeEqual(Buffer.from(v), Buffer.from(expected))
  })
}
import hashlib, hmac, time

def verify_hauly(raw_body: bytes, header: str, secret: str) -> bool:
    parts = [p.split("=", 1) for p in header.split(",")]
    t = next((int(v) for k, v in parts if k == "t"), 0)
    if not t or abs(time.time() - t) > 300:
        return False
    expected = hmac.new(secret.encode(), f"{t}.".encode() + raw_body, hashlib.sha256).hexdigest()
    return any(k == "v1" and hmac.compare_digest(v, expected) for k, v in parts)

Sandbox

Test keys use the real pricing engine but book sandbox jobs that never reach a driver, Stripe or our dispatch. Move one through its statuses with POST /sandbox/jobs/{id}/advance; each step fires a real signed webhook to your test endpoints. The sandbox is free and never expires.

Endpoints

Base URL https://www.hauly.co.uk/api/v1. Full schemas in the OpenAPI document (import it into Postman or generate a client).

MethodPathWhat it does
get/pingCheck a key (not counted)
post/quotesGet a fixed priceScope `quotes:read`. Same engine and price as the website. Valid 24 hours.
get/quotes/{id}Get a quote
post/jobsBook a quoted jobScope `jobs:write`. `Idempotency-Key` required. The price is the quote's; card accounts are charged their saved card now (402 `payment_failed` if declined), invoice accounts are billed monthly. Test keys create sandbox jobs that never reach a driver.
get/jobsList your jobs, newest first
get/jobs/{id}Get a job (status, driver, ETA, proof of delivery)
post/jobs/{id}/cancelCancel before a driver is assignedScope `jobs:cancel`. `Idempotency-Key` required. Full refund. Once a driver is assigned this returns 409 `invalid_transition`: contact [email protected].
get/webhook-endpointsList endpoints (this key's mode)
post/webhook-endpointsAdd an endpoint (secret returned once)
delete/webhook-endpoints/{id}Delete an endpoint
post/webhook-endpoints/{id}/testQueue a signed `ping` event
post/webhook-endpoints/{id}/roll-secretNew secret; the old one also signs for 24 hours
post/sandbox/jobs/{id}/advanceTest keys only: move a sandbox job one status on and fire its webhook

Plans

The plan pays for API access. Each job costs the same as booking on the website. No VAT is charged. Launch offer: Starter free for 3 months for the first 10 accounts.

SandboxStarterGrowthScaleEnterprise
Per month£0£39£129£349From £1,000
Per year—£390£1,290£3,490Contract
Live calls a monthTest only10,000100,000500,000Agreed
Overage per 1,000 callsStops at limit£3£2£1Agreed
Requests per minute per key10603001,200Agreed
Live keys021050Unlimited
Webhook endpoints11520Unlimited
Webhook retries for24 hours24 hours72 hours72 hours72 hours
Monthly invoicing for jobs——On approvalOn approvalOn approval
SupportDocsEmail, 2 working daysEmail, 1 working dayNamed contact, 4 working hoursNamed contact and call

Versioning and changelog

The version is in the path (/api/v1). Within v1 we only add things: new fields, endpoints, event types and status values. Ignore fields you do not know. A breaking change becomes /api/v2, and v1 then stays up for at least 12 months with Deprecation and Sunset headers.

  • 1.0.0 (November 2026): quotes, jobs (book, list, get, cancel), webhook endpoints, signed job events, sandbox.