The capstone — how integrators drive Foundry. A small, clean REST surface: authenticate, then a few commands grouped by what they do — transactions, configuration, device status. The transaction set now spans sale, pre-authorization, completion, void, and refund. The surface is served by the native C engine; language wrappers expose it without reimplementing the logic. Offline store-and-forward is a named later phase, not this iteration.
The API is the public face of everything docs 01–06 built. It exposes the semi-integrated interface (doc 01) as HTTP, translates requests into canonical transactions (doc 03), and routes online auth through the active adapter (doc 04). Integrators never see TLV, kernels, or processors — only this.
Standard OAuth2 client-credentials. An integrator exchanges credentials for a short-lived bearer token, then carries it on every call. Scopes gate which command groups a client may reach, so a status dashboard can't fire a sale.
client_id + client_secret for a bearer token. Returns access_token + expires_in.Authorization: Bearer <token>. No token, no entry — 401.txn:write, txn:read, config:write, device:read — least-privilege per client.Three groups. Transactions is the core — the v1 feature set. Configuration drives the provisioning feed (doc 05). Device is read-only status. Endpoints marked later are deliberately deferred this iteration.
id; the adapter formats the capture/completion message to the processor.id; the adapter formats the reversal/void message to the processor. Shipped in the C engine as fdy_api_void(), routed through the engine to the active adapter.fdy_api_refund(); the adapter formats the refund/credit message to the processor.device:read scope only.The pre-auth → completion arc as the API sees it, and what a sale request/response looks like on the wire.
// request { "amount": 12500, // minor units "currency": 484, // MXN "reference": "order-8842", "language": "es" } // header: Idempotency-Key: 9f2a-…
// response { "id": "txn_a1b2c3", "state": "completed", "outcome": "approved", "authCode": "OK1234", "responseCode": "00", "panMasked": "512345••••0008", "entryMode": "contactless" }
What keeps the API small, safe, and stable as the feature set grows.
/v1 from day one. New capabilities are additive; breaking changes get a new version.