Skip to content

REST · OpenAPI 3

API for developers

Issue, modify and query DeCAs from your TMS, ERP or script. The website uses exactly the same API.

Authentication

Each company can create secret keys from the dashboard (owners only). Send them in the Authorization header as a Bearer token. Keys start with deca_live_ and are shown only once.

  1. Sign in to the dashboard and open API keys.
  2. Create a key with a name and, optionally, an expiry date.
  3. Store it in a secrets manager: we cannot show it to you again.

Full reference

Swagger UI (try it in the browser) ↗ReDoc (reading) ↗https://api.deca.routyn.com

Example: issue a DeCA

curl -X POST https://api.deca.routyn.com/api/v1/decas \
  -H "Authorization: Bearer $DECA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "external_ref": "TRIP-2026-1012-A",
  "data": {
    "shipper_name": "Logística Ibérica S.L.",
    "shipper_tax_id": "B12345678",
    "shipper_address": "Calle Mayor 10, 28013 Madrid",
    "carrier_name": "Transportes Ejemplo S.A.",
    "carrier_tax_id": "A87654321",
    "vehicle_plate": "1234 KLM",
    "transport_date": "2026-10-12",
    "lines": [
      {
        "origin": "Polígono Industrial Las Mercedes, 28022 Madrid",
        "destination": "Puerto de Valencia, 46024 Valencia",
        "goods": "Palés de bebidas",
        "weight_kg": 12400
      }
    ]
  }
}'
import os, requests

resp = requests.post(
    "https://api.deca.routyn.com/api/v1/decas",
    headers={"Authorization": f"Bearer {os.environ['DECA_API_KEY']}"},
    json={
        "external_ref": "TRIP-2026-1012-A",
        "data": {
            "shipper_name": "Logística Ibérica S.L.",
            "shipper_tax_id": "B12345678",
            "shipper_address": "Calle Mayor 10, 28013 Madrid",
            "carrier_name": "Transportes Ejemplo S.A.",
            "carrier_tax_id": "A87654321",
            "vehicle_plate": "1234 KLM",
            "transport_date": "2026-10-12",
            "lines": [
                {
                    "origin": "Polígono Industrial Las Mercedes, 28022 Madrid",
                    "destination": "Puerto de Valencia, 46024 Valencia",
                    "goods": "Palés de bebidas",
                    "weight_kg": 12400
                }
            ]
        }
    },
    timeout=30,
)
if not resp.ok:
    problem = resp.json()  # application/problem+json
    raise RuntimeError(f"{problem['code']}: {problem['detail']}")
deca = resp.json()
print(deca["id"], deca["url"])  # url = the QR link
const res = await fetch("https://api.deca.routyn.com/api/v1/decas", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.DECA_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "external_ref": "TRIP-2026-1012-A",
    "data": {
      "shipper_name": "Logística Ibérica S.L.",
      "shipper_tax_id": "B12345678",
      "shipper_address": "Calle Mayor 10, 28013 Madrid",
      "carrier_name": "Transportes Ejemplo S.A.",
      "carrier_tax_id": "A87654321",
      "vehicle_plate": "1234 KLM",
      "transport_date": "2026-10-12",
      "lines": [
        {
          "origin": "Polígono Industrial Las Mercedes, 28022 Madrid",
          "destination": "Puerto de Valencia, 46024 Valencia",
          "goods": "Palés de bebidas",
          "weight_kg": 12400
        }
      ]
    }
  }),
});
if (!res.ok) {
  const problem = await res.json(); // application/problem+json
  throw new Error(`${problem.code}: ${problem.detail}`);
}
const deca = await res.json();
console.log(deca.id, deca.url); // url = the QR link

Main endpoints

POST/api/v1/decasIssue a DeCA (idempotent on external_ref).
GET/api/v1/decasList DeCAs, filtered by status.
PATCH/api/v1/decas/{id}Modify with a reason.
POST/api/v1/decas/{id}/completeMark as completed.
GET/api/v1/decas/{id}/pdfDownload the PDF of any version.
GET/api/v1/carriersMaster data: also shippers, customers, drivers, vehicles and trailers.

Errors

Every error response uses application/problem+json with a stable code field. Branch on code, never on the detail text.

{"type": "about:blank", "title": "Conflict", "status": 409,
 "code": "deca_not_editable", "detail": "DeCA is completed"}

Stop paying for every DeCA

Register today and issue your first document in minutes. Free, with your team and with an API.

Create an account and get a key