API

Ship InstaDuty into your stack

Authenticate with an API key, upload invoices or fetch duty quotes, receive signed webhooks on completion. Full Swagger + ReDoc available.

Step 01

Get an API key

Go to Settings → API Key and mint one.

Step 02

Make your first call

Hit /v1/me to verify your key works.

Step 03

Set up webhooks

Configure a delivery URL + HMAC secret in Settings.

Quickstart

Your first request

curl -H "X-API-Key: sk_live_..." https://api.187-77-70-98.nip.io/v1/me
Endpoints

Core surface

GET/v1/meAPI Key

Fetch your account profile

curl -H "X-API-Key: sk_live_..." https://api.187-77-70-98.nip.io/v1/me
POST/v1/invoicesAPI Key

Upload a PDF invoice for processing

curl -H "X-API-Key: sk_live_..." \
     -F "file=@invoice.pdf" \
     -F "origin_country=CN" \
     -F "destination_country=US" \
     https://api.187-77-70-98.nip.io/v1/invoices
GET/v1/invoicesAPI Key

List recent invoices (limit 100)

curl -H "X-API-Key: sk_live_..." https://api.187-77-70-98.nip.io/v1/invoices
GET/v1/invoices/{id}API Key

Fetch a single invoice with line items

curl -H "X-API-Key: sk_live_..." https://api.187-77-70-98.nip.io/v1/invoices/abc-123
POST/v1/quoteAPI Key

Fast duty quote without uploading a PDF

curl -H "X-API-Key: sk_live_..." \
     -H "Content-Type: application/json" \
     -d '{
       "origin": "CN",
       "destination": "DE",
       "currency": "USD",
       "lines": [
         {"description":"smartphone","hs_code":"851713","quantity":100,"unit_price":300}
       ]
     }' \
     https://api.187-77-70-98.nip.io/v1/quote
Webhooks

Signed delivery

Every invoice completion fires an HTTP POST to your webhook URL with a signed payload. Verify with X-InstaDuty-Signature:

X-InstaDuty-Signature: t=1712345678,v1=<hex-hmac-sha256>

# Python verification
import hmac, hashlib
sig_header = request.headers["X-InstaDuty-Signature"]
ts = sig_header.split(",")[0].split("=")[1]
v1 = sig_header.split(",")[1].split("=")[1]
expected = hmac.new(
  webhook_secret.encode(),
  f"{ts}.{request.body.decode()}".encode(),
  hashlib.sha256
).hexdigest()
assert hmac.compare_digest(expected, v1)
Limits

Rate limits

Free
10 / min
5 invoices / month
Pro
120 / min
500 invoices / month
Enterprise
Custom
Contact sales

Need help?

Full interactive API reference at Swagger UI or ReDoc, or drop us a line for integration help.