Passin

Documentation

Both live services are plain HTTPS + JSON APIs authenticated with a per-app API key (Authorization: Bearer <key>). Keys are server-side only. We ship a single-file, dependency-free TypeScript client for each that runs on Cloudflare Workers, Node 20+, Deno and Bun.

Authentication

An OAuth 2.0 authorization-code flow with PKCE. Your app redirects the user to Passin's hosted sign-in page; Passin returns a one-time code to your callback; your server exchanges it for the user.

EndpointWhat it does
GET /authorizeHosted sign-in / sign-up page (email + password, emailed code, Google, GitHub)
POST /v1/tokenExchange the code for the user, session ID and membership
GET /v1/users/{id}Read a user (by ID or ?email=)
GET /v1/sessions/{id}, POST …/revokeCheck or end a sign-in session
POST /v1/mailSend a transactional email from your app's domain
GET /v1/eventsEvent log; the same events are pushed to your webhook

Webhook events (HMAC-SHA256 signed, retried with back-off): user.updated, user.disabled, user.enabled, user.deleted, session.revoked, mail.bounced, mail.complained.

const passin = createPassinClient({ appId: "my_app", apiKey: env.PASSIN_API_KEY });
// sign-in route
return (await passin.beginLogin({ redirectUri })).response;
// callback route
const r = await passin.completeLogin(request, { redirectUri });
if (r.ok) { /* find or create your user by r.user.id, start your session */ }

Payments

One order API in front of the providers you connect. Amounts are integers in the currency's minor unit.

EndpointWhat it does
GET /v1/channelsPayment methods available to your app right now
POST /v1/ordersCreate an order; returns a hosted checkout URL or a QR code
GET /v1/orders/{id}Order status (optionally re-checked with the provider)
POST /v1/orders/{id}/closeCancel an unpaid order
POST /v1/orders/{id}/refundFull or partial refund

Webhook events: order.paid, order.closed, order.refunded. Signed, retried for up to three days, idempotent by order reference.

const order = await pay.createOrder({ ref: "inv_1042", channel: "stripe_checkout", amount: 1900, currency: "USD",
  title: "Pro plan", customer_ref: user.id, return_url: "https://example.com/billing/done" });
// redirect the buyer to order.pay_url

Access

API keys are issued during onboarding. Email contact@passin.io with what you are building; the full reference and client libraries are shared with your keys.