Accept EVC Mail payments

Let customers pay your website from their EVC Plus wallet using just their email. Create a checkout session on your server, send the customer to the hosted page, and receive a signed webhook the moment they pay. No card data, no wallet numbers on your side.

Quickstart

  1. Open a free business account and create an API key under Business → Developers.
  2. From your server, create a checkout session for the order.
  3. Redirect the customer to the returned url (or render the pay button).
  4. Fulfil the order when you receive checkout.completed on your webhook — not on the redirect.
1
Your checkout → POST /checkout/sessions
2
Customer → EVC Mail hosted page
3
Pays with SMS code (OTP)
4
Webhook → you ship the order

Authentication

Send your secret key as a Bearer token. Keys start with evk_test_ in the sandbox. Never expose them in browser code or mobile apps.

Authorization: Bearer evk_test_xxxxxxxxxxxxxxxxxxxxxxxx

Base URL: https://evcmail.sookoobe.com/api/v1

Checkout sessions

POST /api/v1/checkout/sessions — amounts are integer US cents.

curl
curl https://evcmail.sookoobe.com/api/v1/checkout/sessions \
  -H "Authorization: Bearer $EVCMAIL_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: order-4471" \
  -d '{
    "amount_cents": 4250,
    "description": "2 × Cotton dirac",
    "client_reference": "order-4471",
    "success_url": "https://yourshop.so/thanks",
    "cancel_url": "https://yourshop.so/cart",
    "metadata": { "cart_id": "c_91" }
  }'
Response · 201
{
  "id": "cs_...",
  "object": "checkout.session",
  "status": "open",
  "amount_cents": 4250,
  "currency": "usd",
  "url": "https://evcmail.sookoobe.com/checkout/cs_...",
  "client_reference": "order-4471",
  "payment_id": null,
  "expires_at": "…"
}

After payment the customer is sent to success_url?session_id=cs_.... Sessions expire after 24 hours. Retrieve one with GET /api/v1/checkout/sessions/:id; list with GET /api/v1/checkout/sessions?limit=20.

Node.js (fetch)
const res = await fetch("https://evcmail.sookoobe.com/api/v1/checkout/sessions", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.EVCMAIL_KEY}`,
    "Content-Type": "application/json",
    "Idempotency-Key": order.id,
  },
  body: JSON.stringify({
    amount_cents: order.totalCents,
    description: order.summary,
    client_reference: order.id,
    success_url: "https://yourshop.so/thanks",
    cancel_url: "https://yourshop.so/cart",
  }),
});
const session = await res.json();
// redirect the customer to session.url

Pay button widget

Drop in the script and point the button at an endpoint on your server that creates a session and returns { "url": "..." }.

HTML
<script src="https://evcmail.sookoobe.com/v1/evcmail.js" defer></script>

<div data-evcmail-checkout data-create-url="/api/create-evcmail-checkout"></div>

<!-- or, if you already have a session URL: -->
<div data-evcmail-checkout data-session-url="https://evcmail.sookoobe.com/checkout/cs_..."></div>

Programmatic: EVCMail.mount(element, { createUrl, label, onError }) or EVCMail.redirectToCheckout(url).

Webhooks

Add an endpoint under Business → Developers. Every event is a JSON POST signed with your endpoint's secret. Respond with any 2xx within 8 seconds; failures retry at 1m, 5m, 30m, 2h and 12h.

payment.completedcheckout.completedinvoice.createdinvoice.sentinvoice.viewedinvoice.paidinvoice.cancelledrefund.completed
Payload
POST https://yourshop.so/api/evcmail-webhook
EVC-Signature: t=1790000000,v1=5f2c…
EVC-Event-Id: evt_…

{
  "id": "…",
  "object": "event",
  "type": "checkout.completed",
  "created": "…",
  "data": {
    "id": "…", "reference": "EM-…", "kind": "CHECKOUT",
    "amount_cents": 4250, "fee_cents": 64, "net_cents": 4186,
    "payer_email": "customer@example.com",
    "checkout_session_id": "…", "client_reference": "order-4471",
    "completed_at": "…"
  }
}
Verify the signature (Node.js)
import crypto from "node:crypto";

export function verifyEvcMail(rawBody, header, secret, toleranceSec = 300) {
  const parts = Object.fromEntries(header.split(",").map((p) => p.split("=")));
  const t = Number(parts.t);
  if (!t || Math.abs(Date.now() / 1000 - t) > toleranceSec) return false;
  const expected = crypto.createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex");
  const a = Buffer.from(expected), b = Buffer.from(parts.v1 ?? "");
  return a.length === b.length && crypto.timingSafeEqual(a, b);
}
// Use the RAW request body — not re-serialized JSON.

Events can arrive more than once; de-duplicate on id.

Invoices

POST /api/v1/invoices creates an invoice; "send": true emails the customer a hosted pay link. GET /api/v1/invoices/:id, GET /api/v1/invoices.

{
  "customer_email": "sagal@example.com",
  "customer_name": "Sagal Jama",
  "due_date": "2026-10-15",
  "send": true,
  "items": [
    { "description": "Logo design", "quantity": 1, "unit_amount_cents": 15000 }
  ]
}

Statuses: draft → sent → viewed → paid, or overdue / cancelled.

Payments

GET /api/v1/payments and GET /api/v1/payments/:id return payments your business received, with fee_cents (1.5%) and net_cents. Refunds are issued from the dashboard and require the owner's SMS code — EVC Mail never moves money without per-transaction consent.

Errors, idempotency & limits

HTTP 400  { "error": { "type": "invalid_request_error", "message": "amount_cents: minimum is 50 cents" } }
HTTP 401  authentication_error      HTTP 404  not_found
HTTP 409  idempotency_error         HTTP 429  rate_limit_error (Retry-After header)
  • Idempotency: send Idempotency-Key on POSTs. Retrying with the same key and body returns the original response; a different body returns 409.
  • Rate limit: 120 requests per minute per key.

Sandbox

This environment runs on simulated EVC Plus and Salaam African Bank rails: every new account gets $500 of test money, SMS codes appear in the on-screen demo phone, and no real money moves. The API, webhooks and ledger behave exactly as they will in production.