Start here

The whole API is sixteen operations on one host, grouped by what they do: shipping rates, payments (a payment session an agent hands to a human), refunds, package tracking, the monthly price index, three reference reads (billable weight, holiday shipping deadlines, shipping restrictions) and a liveness probe. No key for anything but the create-or-update keyed by your own id, the Idempotency-Key header and the list of your own payment sessions. Everything below is published by SMKlog and kept in step with the live contract by the same test run that gates a deploy.

Contract and schemas

One contract, one vocabulary, one data model, published as files a tool can read.

ArtifactWhat it isWhere
OpenAPI 3.1The live contract; the root copy on this site is byte-identical to the API host.quote-api.smklog.com/openapi.json · mirror
JSON Schema (2020-12)One schema per component: QuoteRequest, QuoteResponse, Rate, Package, CheckoutSessionRequest, CheckoutSession, CheckoutStatus, RefundStatus, TrackingResult, PriceIndexIssue, BillableWeight, HolidayDeadlines, ShippingRestrictions, WebhookEvent, Liveness, Problem. Cross-referenced by URL.quote-request · quote-response · rate · package · checkout-session-request · checkout-session · checkout-status · refund-status · tracking-result · price-index-issue · billable-weight · holiday-deadlines · shipping-restrictions · webhook-event · liveness · problem
JSON-LD contextBinds every class and property of the contract to a stable IRI, with schema.org terms where one fits.context.jsonld
VocabularyThe words the contract, the MCP tools and the docs use, each with one meaning, plus the enumerations.vocabulary.yaml
OverlayOpenAPI Overlay 1.0 binding each operation to its MCP tool, A2A skill and rate-limit bucket.overlay.yaml
Inbound webhook contractThe payment-session webhook seen from your server: one OpenAPI 3.1 document (x-direction: inbound) with the operation to mount, the signature header and the WebhookEvent body, for generating a receiver stub.webhooks-inbound.openapi.json · guide
AsyncAPI 3.1The same webhooks as an event contract: one message per stage (six), each with its payload schema and an example signed the way deliveries are signed; the signature header is the server security scheme.asyncapi.yaml
Arazzo 1.0.1Five workflows over the contract: quote to tracked label, one session per order of yours keyed on external_id, refund status, withdrawing an unopened link, the holiday ship-by check. Every operation, parameter, field and response pointer is checked against the live contract when the file is built.arazzo.yaml
APIs.jsonThe self-hosted index of this API and every artifact around it./apis.json · /.well-known/apis.json

Governance

What the contract is held to before it ships.

The Spectral ruleset extends the maintained spectral:oas base with twenty house rules in three severities: every operation explains itself (error), every error answer is the one Problem shape (error), examples ride on every request, the webhook’s included, and on every 2xx answer (warn), the document names its author (error), and naming guidance (info). The same promises are asserted in code on every test run; Spectral runs against the generated document whenever the contract changes, and the expected result is zero findings at any severity.

Versioning. One product version (today 1.5.0) is shared by the MCP server card, the agent card and the /status answer; the OpenAPI document carries its own contract version (1.6.0 since 26 November 2026, when the REST surface gained the list of a client’s own payment sessions, the label email sent again to the buyer and the request to void an unused label, each with an MCP tool beside it, while the product version stayed where it was; before that 1.5.0 since 7 November 2026, when it gained the Idempotency-Key header, the create-or-update keyed in the path, the update by id and self-service client registration, none of which the MCP tools or the A2A skills expose, plus three reads: package tracking and the price index, which the MCP tools already had, and refund status, and three reference reads: billable weight, holiday shipping deadlines and shipping restrictions, which came with MCP twins; the tags were renamed for what the operations do, and the product version moved with it). Paths carry no version prefix. Every change to date has been additive (new operations, new fields, new examples, richer descriptions), with one change of order in 1.5.0: POST /agent/checkout-session with an external_id whose session the human has opened answers 409 session_in_checkout before the shipment is checked or priced, so a body that would not price gets that 409 rather than a 422. The news page records each release with its date.

For agents

The same capability over MCP and A2A, and every discovery document an agent tries first.

SurfaceAddress
MCP (streamable HTTP, thirteen tools)https://quote-api.smklog.com/mcp · server card · registry listing
Client librariesJavaScript (npm install smklog) · Python (pip install smklog-sdk, with the smklog CLI) · Go (go get github.com/smklog/smklog-sdk/go)
Stdio bridge (open source)github.com/smklog/parcel-shipping-rates-mcp
A2A (JSON-RPC, three skills)https://quote-api.smklog.com/a2a · signed agent card · JWKS
Agent Skills (fifteen, one per capability, plus the combined overview on smklog.com)discovery index · API host copy
CatalogsRFC 9727 api-catalog · ai-catalog · apis.json · llms.txt
Authentication (optional)auth.md · authorization-server metadata · protected-resource metadata
Execution contractsagentic-access.yaml: the x-agentic-access class of every operation (nine read, four act; every session write puts a human in the loop), the same values the OpenAPI document carries per operation
WebhooksPayment session webhooks: give a session write a callback_url and every later stage (checkout started, paid, label ready, delivered, refunded, cancelled) is POSTed to it, signed with HMAC-SHA256 and retried for about eighteen hours; the receiving side is published as its own OpenAPI document
RetriesRetries and idempotency: the Idempotency-Key header on every session write, the external_id create-or-update, and which answers to resend
Agentic commerceUCP business profile (Universal Commerce Protocol, also at ucp.json): one custom service, com.smklog.shipping, bound to this REST contract and the A2A endpoint; no payment handler, because the human pays on smklog.com
An agent prices and prepares checkout; a human always completes payment on smklog.com. No operation on this host can charge anything.

Retries and idempotency

What a second identical call does, operation by operation, and the header that makes the writes safe to resend blind.

The reads are safe by nature: POST /quote stores nothing (a repeat is a fresh price, which the carrier may have moved), GET /agent/checkout-session/{session_id}, GET /agent/checkout-session/{session_id}/refund, GET /tracking/{tracking_number}, GET /price-index and GET /status change nothing, and DELETE /agent/checkout-session/{session_id} answers the same cancelled session on a repeat. The three writes that store something, createPaymentSession, upsertPaymentSession and updatePaymentSession, have two keys for two different questions.

Idempotency-Key deduplicates the request. Send a client-generated token (a UUID is the usual choice; any 1 to 255 printable ASCII characters without spaces) in the Idempotency-Key header of a session write. The first call does its work and keeps its final answer for 24 hours; a repeat with the same key and the same method, path and body (whitespace and key order do not count) replays that answer, status and body alike, with Idempotent-Replayed: true: it prices nothing, stores no second session and spends no daily write, though like any request it counts once in the hourly window. The same key with a different request answers 422 idempotency_key_reused; a key whose first call is still being answered answers 409 idempotency_key_in_progress with Retry-After. Keys are scoped to the OAuth client, so the header needs a bearer from /oauth/token (401 token_required without one); any agent registers a client for that itself at POST /oauth/register, with no human step (auth.md). Only final answers are kept (200, 201, 404, 409, 422): a 429 or a 5xx releases the key, so the retry goes through.

external_id deduplicates the session. It is your own id for the shipment, an order or cart number: the call creates the session when none is stored under it and re-prices the stored one in place when one is, same session_id, with created saying which happened. Carry it in the body of POST /agent/checkout-session or in the path of PUT /agent/checkout-session/by-external-id/{external_id}; PATCH /agent/checkout-session/{session_id} addresses a session by its id instead and takes no external_id. Use both: external_id so one order never gets two sessions, Idempotency-Key so a call that timed out can be resent without reading the answer first.

Retry a 429 after Retry-After seconds and a 5xx with exponential backoff from one second; never resend a 400, 401, 404, 409 or 422 unchanged, the Problem body says what to change. The same rules are stated for machines in rate-limits.yaml, the Idempotency-Key parameter and the Idempotent-Replayed header of the OpenAPI document, and the idempotency_key, upsert and update terms of the vocabulary.

Operations

Where to look when something is slow, refused or down.