verification
use it
# add to stunt.yaml
services:
square:
adapter: embedded:square-style
# then
$ stunt upThe embedded: source extracts this adapter from the binary — no git clone, fully offline.
how to mock the Square API locally
Install stunt, paste the service block above into stunt.yaml, run stunt up — then point your client at localhost instead of Square API. It works offline, keeps state across requests and restarts, and every response is synthetic: the route shapes, status codes, pagination, and webhook delivery follow the real Square API 2024-08-21 surface — the data is fake, the behavior is real.
backing stores
paymentsrefundsordersaccess_tokens
api surface (18)
generated from the adapter manifest — exactly what boots, nothing more · covers 3% of the real API's 329 routes (derived from sdk square-node @ 45.1.0 (floor))
18 routes
POST/oauth2/token
GET/v2/payments
POST/v2/payments
GET/v2/payments/{id}
DELETE/v2/payments/{id}
POST/v2/payments/{id}/complete
POST/v2/payments/{id}/capture
GET/v2/refunds
POST/v2/refunds
GET/v2/locations
POST/v2/catalog/search
POST/v2/orders
POST/v2/orders/calculate
GET/v2/orders/{id}
PUT/v2/orders/{id}
DELETE/v2/orders/{id}
POST/v2/orders/{id}/pay
POST/v2/orders/{id}/complete
SDK-verified behaviors (4)
- ✓oAuth.obtainToken mints the bearer the adapter validates
- ✓payments.create + payments.get round-trip
- ✓orders.create prices line items and mints an order id
- ✓orders.get round-trips the priced order
Not implemented (7)
- No Customers API at all (create/list/retrieve customers)
- Catalog is search-only; no upsert, batch-retrieve, list, or info endpoints
- No Invoices, Terminal, Loyalty, Gift Cards, Bookings, or Team APIs
- No POST /v2/payments/{id}/cancel for authorized payments
- No /oauth2/revoke or token access-check; only the exchange exists
- No webhook subscription endpoints; the delivery sink is stunt config
- No orders list (GET /v2/orders) or POST /v2/orders/search
Differs from the real API (2)
- DELETE /v2/payments/{id} and DELETE /v2/orders/{id} are stunt extensions, not real Square
- Square-Version header is required (400 when absent); real Square defaults it
want more of the Square API surface? adapters are YAML + Starlark — the authoring guide covers adding routes, fixtures, and state machines. Open an issue for anything big first, or just file a PR — merged routes ship in the next release.