Developer guide · updated November 2026

API and webhooks for agents, scripts and internal tools

TradeAbacus is the deterministic layer between an inquiry and a document: Incoterm pricing, margin, PI / CI / PL, and a buyer acceptance event. Your agent or ERP can call it, instead of re-implementing the arithmetic.

Workspace tokens Signed webhooks OpenAPI schema

What you can do today

Create a workspace token in Settings → API access. Read quotes, customers and the product catalog, create quotes, export CSV, and subscribe to quote.accepted webhooks in Settings → Webhooks.

Quickstart

Create a token in the app: Settings → API access → Create token. The plaintext token starts with ta_live_ and is shown once. Store it on your server, never in a public page.

export TA_TOKEN="ta_live_..."
export WORKSPACE_ID="00000000-0000-0000-0000-000000000000"

curl -s "https://tradeabacus.com/api/v1/workspaces/$WORKSPACE_ID/quotes?page=1&page_size=20" \
  -H "Authorization: Bearer $TA_TOKEN"

Create a quote with the same engine the web app uses:

curl -s -X POST "https://tradeabacus.com/api/v1/workspaces/$WORKSPACE_ID/quotes" \
  -H "Authorization: Bearer $TA_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "customer_name": "Acme Trading LLC",
    "product_name": "Bluetooth Speaker SP-100",
    "items": [{
      "product_name": "Bluetooth Speaker SP-100",
      "model": "SP-100",
      "hs_code": "851822",
      "unit": "pcs",
      "quantity": 500,
      "unit_cost_cny": 68,
      "packaging_cost_cny_per_unit": 4
    }],
    "input": {
      "quantity": 500,
      "unit_cost_cny": 68,
      "fx_rate": 7.2,
      "currency": "USD",
      "packaging_cost_cny_per_unit": 4,
      "ocean_freight_cny": 2600,
      "insurance_rate": 0.003,
      "target_margin_rate": 0.18,
      "incoterm": "CIF"
    }
  }'

Export the full workspace as CSV for a spreadsheet or warehouse job:

curl -s -OJ "https://tradeabacus.com/api/v1/workspaces/$WORKSPACE_ID/export/quotes.csv" \
  -H "Authorization: Bearer $TA_TOKEN"

Main endpoints

Method & pathPurpose
GET /workspaces/{id}/quotesList quotes with filters and pagination
POST /workspaces/{id}/quotesCreate a quote from cost inputs
GET /workspaces/{id}/quotes/{quote_id}Read one quote with terms and items
POST /workspaces/{id}/quotes/{quote_id}/shareCreate the buyer's read-only link
GET /workspaces/{id}/customersList or search the customer book
GET /workspaces/{id}/catalogList products and HS codes
GET /workspaces/{id}/export/quotes.csvExport every quote as CSV
POST /workspaces/{id}/webhooksSubscribe an endpoint to events

Full schema: /api/openapi.json. All workspace endpoints require Authorization: Bearer ta_live_... or a normal signed-in session.

Webhooks

Add an endpoint in Settings → Webhooks. Only https endpoints on public addresses are accepted; private and loopback addresses are rejected to prevent SSRF. Every delivery is signed and logged.

Event: quote.accepted

Fires once, the first time a buyer accepts a shared quote. Repeated accepts do not send duplicates.

{
  "event": "quote.accepted",
  "created_at": "2026-11-16T09:30:00+00:00",
  "data": {
    "quote_id": "6a0c...",
    "quote_no": "Q-202611-0001",
    "customer_name": "Acme Trading LLC",
    "product_name": "Bluetooth Speaker SP-100",
    "quantity": 500,
    "currency": "USD",
    "incoterm": "CIF",
    "unit_price": 12.34,
    "total_price": 6170.0,
    "valid_until": "2026-12-01",
    "accepted_at": "2026-11-16T09:30:00+00:00",
    "accepted_by": "John Smith",
    "customer_note": "Please ship in December."
  }
}

Headers

  • X-TradeAbacus-Event: quote.accepted
  • X-TradeAbacus-Timestamp: 1763285400
  • X-TradeAbacus-Signature: t=1763285400,v1=<hex>
  • X-TradeAbacus-Delivery: <endpoint id>

Deliveries retry up to three times (immediately, after 2 seconds, after 5 seconds) with a 6-second timeout. Any 2xx response counts as success. The last status and the last 20 deliveries are visible in Settings.

Verify the signature (Python)

import hashlib, hmac, time

def verify(secret: str, header: str, body: bytes, tolerance: int = 300) -> bool:
    parts = dict(part.split("=", 1) for part in header.split(","))
    timestamp = int(parts["t"])
    if abs(time.time() - timestamp) > tolerance:
        return False
    expected = hmac.new(
        secret.encode(),
        f"{timestamp}.".encode() + body,
        hashlib.sha256,
    ).hexdigest()
    return hmac.compare_digest(expected, parts["v1"])

Verify the signature (Node.js)

const crypto = require("crypto");

function verify(secret, header, body) {
  const parts = Object.fromEntries(header.split(",").map((p) => p.split("=")));
  const expected = crypto
    .createHmac("sha256", secret)
    .update(`${parts.t}.`)
    .update(body)
    .digest("hex");
  return crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(parts.v1));
}

Where TradeAbacus fits in an agent workflow

The useful split is: the agent handles language and orchestration; TradeAbacus handles arithmetic, documents and the audit trail.

StageWho does itTradeAbacus role
Inquiry intakeEmail / WhatsApp / agent extracts product, quantity, destinationStores the customer and quote record
Cost and Incoterm pricingAgent collects costs; human confirms FX, freight and rebateCalculates FOB / CFR / CIF / DDP, margin and profit deterministically
ApprovalSales manager reviewsApproval workflow, version history, audit log
DocumentsAnyonePI / CI / packing list from the same dataset
Buyer acceptanceBuyer clicks the linkRecords acceptance and sends quote.accepted
DownstreamCRM, ERP, fulfillmentWebhook or CSV export triggers the next system

Example: inquiry to accepted quote

  1. An email-parsing agent extracts the buyer, product, quantity and destination.
  2. It calls POST /quotes with the cost inputs and a target margin.
  3. A human approves the DDP price in the workspace.
  4. The agent or the salesperson sends the share link.
  5. The buyer accepts; your endpoint receives quote.accepted and creates an order in the ERP.

What TradeAbacus is not

  • It is not a language model and does not guess costs, duty rates or HS codes.
  • It does not track shipments, book freight or process payments.
  • API tokens are workspace-scoped and cannot change passwords or email addresses.
  • An MCP server is not available yet; agents should call the REST API today.

Build against a real workspace

14-day Pro trial, no card. Create a token and run the quickstart in a few minutes.

Start the free trial

API and webhook behavior described here matches the production build of 16 November 2026. Breaking changes will be announced by email before rollout.

Home · Security · Terms · Privacy