Public API v1 • SDK Module

SDK Registrations

Build an external registration form safely: read config, validate options, and submit registrations.

What it does

The Registrations module lets approved integrations create registrations from outside Confera. It’s built for: event websites, partner portals, and offline registration desks.

The flow is intentionally structured: fetch config build a formsubmit.

Scopes

  • registrations:read – required for config, list/get, universities, receipts
  • registrations:write – required to create registrations

Best practice: use separate keys. One key with registrations:write for the form, another key with registrations:read for back-office verification.

Get config

GET/api/public/v1/registrations/config

This tells you whether registrations are open and what fields/options are currently valid: fields, required keys, open phase, ticket types, payment methods, and pricing.

SDK
ts
const cfg = await confera.registrations.getConfig();

if (!cfg.data.public_registration_enabled) {
  throw new Error("Registrations are closed");
}

console.log(cfg.data.open_phase);
console.log(cfg.data.ticket_types);
console.log(cfg.data.payment_methods);
console.log(cfg.data.fields);

Search universities

GET/api/public/v1/registrations/universities

Institutions must be selected from the official list. Use this endpoint to power an autocomplete. Query params: q and limit (max 50).

SDK
ts
const res = await confera.registrations.searchUniversities({ q: "karachi", limit: 10 });
console.log(res.data);

Upload proof (optional but recommended)

The create endpoint accepts paymentProofUrl as either anhttps:// URL or a private Confera storage URI (storage://registration-evidence/...).

If you want private storage managed by Confera, use the SDK helper below. It creates a short-lived signed upload URL, uploads bytes, and returns the storageUri you can pass intopaymentProofUrl.

SDK (Node.js): upload → use storageUri
ts
import { readFile } from "node:fs/promises";

const bytes = await readFile("./receipt.png");

const uploaded = await confera.registrations.uploadEvidence({
  filename: "receipt.png",
  contentType: "image/png",
  data: bytes,
});

// Use uploaded.storageUri as paymentProofUrl
await confera.registrations.create({
  firstName: "Aisha",
  lastName: "Khan",
  email: "aisha@example.com",
  ticketTypeId: "<ticket_type_id>",
  paymentMethodId: "<payment_method_id>",
  paymentReference: "TXN-12345",
  paymentProofUrl: uploaded.storageUri,
});

Create registration

POST/api/public/v1/registrations/registrations

This endpoint enforces real rules: required fields, valid ticket type/payment method, and an open pricing phase.

SDK (minimal)
ts
const created = await confera.registrations.create({
  firstName: "Aisha",
  lastName: "Khan",
  email: "aisha@example.com",
  ticketTypeId: "<ticket_type_id>",
  paymentMethodId: "<payment_method_id>",
  paymentReference: "TXN-12345",
  paymentProofUrl: "https://example.com/receipt.png",
});

console.log(created);
SDK (with institution + custom fields)
ts
const created = await confera.registrations.create({
  firstName: "Aisha",
  lastName: "Khan",
  email: "aisha@example.com",
  phone: "+92...",
  institutionId: "<university_id>",
  yearOfStudy: "Final year",
  registrationType: "Student",
  ticketTypeId: "<ticket_type_id>",
  paymentMethodId: "<payment_method_id>",
  paymentReference: "TXN-12345",
  paymentProofUrl: "storage://registration-evidence/<path>",
  customFields: {
    dietary: "Vegetarian",
    consent: true,
  },
});

List registrations

GET/api/public/v1/registrations/registrations

Filters: email, status,verification_status. Uses limit/offset (default 50, max 200).

SDK
ts
const res = await confera.registrations.list({
  limit: 50,
  offset: 0,
  email: "aisha@example.com",
});
console.log(res.data);

Get registration

GET/api/public/v1/registrations/registrations/:registrationId
SDK
ts
const reg = await confera.registrations.get("REG123");
console.log(reg.data);

Receipt URL

GET/api/public/v1/registrations/registrations/:registrationId/receipt

Returns a signed URL when the receipt is stored privately. If the stored URL is public, it may be returned as-is.

SDK
ts
const { url } = await confera.registrations.getReceiptUrl("REG123");
console.log(url);

Rules & gotchas (read this)

Phase gating

Even if registrations are enabled, creation can fail with 409if no pricing phase is currently open.

Institutions must be real

Provide institutionId from the universities search. Passing a random institution name will be rejected.

Avoid duplicates

Creation does a best-effort duplicate check on email and can return 409. Handle that by showing "Already registered" and offering support contact.

Proof URL requirements

paymentProofUrl must be an https://URL or a storage://registration-evidence/... URI.