Public Sector9 November 202610 min read

Regulating a Digital Gambling Economy — Part 13 of 20

APIs and secure data exchange with licensed operators

A monthly spreadsheet and a signed PDF tell a regulator what happened weeks ago, and prove less than they appear to. Part 13 of Regulating a Digital Gambling Economy designs controlled, repeatable data exchange between a gambling regulator and its licensees: what to exchange, how each submission is verified and receipted, how schemas change safely and how reconciliation raises questions rather than findings.

#Public Sector#Gambling Regulation#Solution Architecture#Zero Trust Security#System Integration
Streams of luminous particles flow across a dark plane past a large lens on a stand in front of a columned civic building; the lens highlights one stream in amber.

Every month, a large online bookmaker licensed by the Tankwa Gambling and Betting Board, the fictional provincial regulator in this series, exported figures from its betting platform into the board's spreadsheet template, had a director sign a PDF copy and emailed both. The board's returns team checked that the totals added up, retyped them into its own system and filed the email. If a figure was wrong, the board usually found out when the tax declaration arrived and did not match.

Both sides had modern systems. The bookmaker's platform recorded every bet in real time. The board had the front door from Part 5, case management from Part 11 and the data platform from Part 12. Between them sat a spreadsheet, an email and a person retyping numbers.

This article designs what should sit there instead: controlled, repeatable data exchange through APIs. It is written for executives and architects, so it explains the ideas in plain language first. What an API gateway actually does covers the gateway's general jobs, and we do not repeat them here. Legal references are general information, not legal advice.

An API is a controlled digital counter

An API (application programming interface) is a controlled digital counter through which one system asks another for information or hands information over. Think of the counter at a licensing office. The official behind it checks who you are, whether you are allowed to submit on behalf of the company, whether the form is the right one and properly completed, and gives you a stamped receipt. An API does the same things, in milliseconds and the same way every time.

  • Identity. Which system is calling, and which licensee does it belong to?
  • Authority. Is that system allowed to submit this kind of data, for this licensee?
  • Format. Does the submission match the published structure, field by field?
  • Limits. Is it within the agreed size and frequency?
  • Receipt. What exactly was received, when, and with what result?

The counter analogy also shows what an API is not. It is not an open pipe into the board's systems. Nothing behind the counter is visible from in front of it.

What to exchange, and what not to

The first design decision is not technical. It is which information should move, in which direction and how often. The Tankwa board agreed six exchanges with its licensees.

ExchangeDirectionFrequencyLevel of detail
Transaction aggregatesLicensee to boardDailyTotals by product, channel and day; no punter-level data
Monthly returnLicensee to boardMonthlyThe statutory return, in the same structure as the web form
Incident notificationLicensee to boardAs it happensStructured: type, time, systems affected, actions taken
Change notificationLicensee to boardAs it happensNew games, devices, payment providers, key systems
Case statusBoard to licenseeOn requestStatus of the licensee's own cases only
Reference dataBoard to licenseeWhen it changesPublished schemas, product codes, the licensee's own licence details

Daily aggregates are the most useful change. They give the board a near-current view of activity without asking for detail it does not need. The Protection of Personal Information Act's minimality condition points the same way: if aggregates serve the supervisory purpose, punter-level data should not flow as a matter of routine. When an investigation needs more, it asks through a restricted case for specific records, with a stated purpose.

Small licensees keep the web form. The form and the API produce the same structured submission and run the same validation, as Part 5 required, so the board has one process with two entrances.

One submission, end to end

Take the simplest useful case. A licensed bookmaker submits its daily aggregated transaction data through a secured API. The platform validates the structure, timestamps the submission, checks completeness and returns a receipt.

From submission to signed receiptONE DAILY SUBMISSIONLicenseesystemGatewayCertificate,token, limitsSchemavalidationVersionrecordedTimestampand hashProof ofwhat arrivedCompletenesschecksDays, venues,totals presentSignedreceiptHash, time,result, IDIf invalidRejected: machine-readable error, resubmitReceipt returned to the licenseeThe receipt is the licensee's proof of submission and the board's proof of receipt
A licensed bookmaker's system submits a daily aggregated file to the Tankwa board. The gateway checks the client certificate, token and rate limit. The platform validates the file against the published schema version, timestamps and hashes what arrived, checks completeness and returns a signed receipt. An invalid file is rejected at once with a machine-readable error, so nothing incomplete is stored as accepted. Illustrative design.
  1. The gateway checks the calling system's certificate and access token, and applies the licensee's rate limit.
  2. Schema validation checks the file against the published schema version the licensee declared, and records that version.
  3. Timestamp and hash. The platform records the time of receipt and a cryptographic hash, a short fingerprint of the exact bytes received. If anyone later changes the stored file, the hash will no longer match.
  4. Completeness checks confirm that the expected days, venues or products are present and that totals are internally consistent.
  5. A signed receipt goes back to the licensee with the submission identifier, the hash, the time, the schema version and the result.

An invalid submission is rejected at once with a machine-readable error that says what was wrong. RFC 9457, Problem Details for HTTP APIs (2023), defines a standard format for such errors, which saves every licensee from learning a board-specific one. Nothing that fails validation is stored as accepted. A rejected file is logged, but the licensee's obligation is met only when a valid submission is receipted.

The receipt is the piece that changes the relationship. The licensee holds proof that it submitted on time. The board holds proof of what it received. Neither depends on an email inbox.

Identity, integrity and proof

A regulator relies on submissions as evidence, so it has to be able to show who sent them and that they have not changed. Four controls do most of the work.

  • Certificates for systems. Each licensee system that connects has its own client certificate, issued through a recorded process and revoked when the system is retired. OAuth 2.0 Mutual-TLS Client Authentication and Certificate-Bound Access Tokens (RFC 8705, 2020) describes how an access token can be bound to a certificate, so a stolen token is useless without the matching private key.
  • A recognised security profile. The OpenID Foundation's FAPI 2.0 Security Profile, final since 22 February 2025, was written for high-value APIs and requires sender-constrained tokens. A regulator does not have to adopt it in full, but it is a sound reference rather than a home-made scheme.
  • Signed messages. HTTP Message Signatures (RFC 9421, 2024) lets the sender sign parts of a request, so the board can check that the content was not altered in transit and came from the holder of the key.
  • Trusted time. A timestamp from a source that both parties accept, such as a time-stamping service following the Time-Stamp Protocol (RFC 3161), supports the receipt's statement about when the file arrived.

Together these support non-repudiation: they make it much harder for the licensee to deny sending a submission, or for the board to deny receiving one. The Electronic Communications and Transactions Act 25 of 2002 is relevant here. Section 15(3) says that in assessing the evidential weight of a data message, regard must be had to the reliability of how it was "generated, stored or communicated", how its integrity was maintained and how its originator was identified. Those are the properties these controls are designed to provide. Whether a particular return also needs a specific form of electronic signature under the provincial law is a question for the board's legal advisers.

Identity is the new regulatory perimeter covers the identity model behind these controls, and Zero trust security: a practical starting point covers the wider approach.

Schemas and versions

A schema is the published structure of a submission: the fields, their types, which are required and which values are allowed. The Tankwa board publishes its schemas in the OpenAPI Specification, whose latest version when we checked on 7 November 2026 was 3.2.1, dated 10 September 2026. Licensees can generate code and tests from the specification instead of reading a PDF.

Schemas will change, because the law, products and the board's needs change. The board's versioning policy is short.

  • Additive changes that do not break existing submissions, such as a new optional field, are a minor version. Old submissions remain valid.
  • Breaking changes, such as a new required field or a changed meaning, are a new major version, announced with a published notice period. The old and new versions run side by side for an agreed overlap.
  • Every receipt records the version used, so the data platform knows how to read each submission.
  • Rule changes are versioned too. If a completeness rule changes, the receipt records which rule version ran, linking to the versioned rules from Part 5.

Retries, corrections and late submissions

Networks fail and systems retry. A licensee that sends the same daily file twice because the first response was lost should not end up with two submissions. Each submission carries a licensee-generated identifier, and the platform treats a repeat of the same identifier and the same content as the same submission. This is idempotency, which Why a successful payment can still end in a failed order explains in plain terms.

Corrections are new versions, never overwrites. If a licensee finds an error in last Tuesday's figures, it submits a correction that references the original. Both are kept and both are receipted. The data platform uses the latest valid version and can still show what was first submitted, which matters if timeliness or accuracy is ever in question.

Late submissions are accepted and receipted with their actual time. Whether lateness has consequences is a supervisory question for officials, informed by the receipt, not a decision the API makes.

Reconciliation raises questions

Structured exchange makes reconciliation cheap. The Tankwa board compares the sum of a licensee's daily aggregates with its monthly return, and the monthly return with its tax declaration, using versioned rules with stated tolerances.

Reconciliation opens a question, not a findingTHREE VIEWS OF ONE MONTHDaily APIaggregatesMonthlyreturnTaxdeclarationRECONCILIATIONVersioned rules,stated tolerancesOUTCOMEMatchedfiled with the receiptsSmall varianceexplained and notedMismatchquery case openedOfficial reviews thelicensee's explanationA mismatch is a question for the licensee, not a finding of non-compliance
The Tankwa board reconciles the sum of a licensee's daily aggregates with its monthly return and its tax declaration, using versioned rules with stated tolerances. A match is filed with the receipts. A small variance is explained and noted. A material mismatch opens a query case in case management, and an official reviews the licensee's explanation before anything further happens. Tolerances and outcomes are illustrative.

A material mismatch opens a query case in case management. That is a question for the licensee, not a finding of non-compliance. There are many innocent explanations, such as a late-settled bet, a timing difference at month-end or a correction not yet applied. An official reviews the licensee's explanation and decides whether anything further is needed. Continuous revenue assurance, the next part, builds on this.

Sandbox and onboarding

No licensee connects to production first. The Tankwa board runs a sandbox with synthetic data and a conformance test suite that each licensee's integration must pass before it receives production credentials.

StageWhat happensExit test
RegisterLicensee names a technical contact and its systemsContacts verified, systems recorded
SandboxLicensee builds against published schemas and synthetic dataConformance suite passes, including rejection cases
CertifyBoard reviews the results and issues production certificatesCertificates bound to named systems
Live, monitoredParallel run with the existing return for an agreed periodFigures match, receipts reconciled
Business as usualThe API becomes the primary routeOld route retired for that licensee

The parallel run matters. It proves, with real figures, that the new route and the old one agree before anyone relies on the new one.

What this does not mean

  • It does not mean the regulator reaches into licensees' systems. Licensees push agreed data through a counter. The board does not have direct access to their platforms.
  • It does not mean punter-level surveillance. Routine exchange is aggregated. More detailed records are requested for a stated purpose, through a restricted case.
  • It does not mean automated penalties. A rejected, late or mismatched submission produces a receipt or a query. Officials decide what follows.
  • It does not mean small licensees must build APIs. The web form remains, with the same schema and validation.
  • It does not settle legal questions. Signature requirements, retention periods and the legal status of receipts need legal advice.

Questions for the executive team

  1. Which of our returns could be submitted as structured data tomorrow, and which still arrive as spreadsheets and PDFs?
  2. Can we prove, for any return, exactly what we received, when and from which system?
  3. Do we publish our submission formats as machine-readable schemas with a versioning policy?
  4. When a licensee's figures do not reconcile, does that open a tracked query, or an email thread?
  5. Would a licensee's new integration be tested in a sandbox before it touched production?

Key points

  • An API is a controlled counter: it checks identity, authority, format and limits, and gives a receipt. It is not an open pipe.
  • Agree what to exchange before building anything. Daily aggregates give a near-current view without punter-level data.
  • Validate, timestamp, hash and check every submission, and return a signed receipt that both sides can rely on.
  • Use certificates, certificate-bound tokens, signed messages and trusted time to support integrity and non-repudiation, and take legal advice on signature requirements.
  • Publish versioned schemas, treat corrections as new versions, let reconciliation open query cases, and onboard every licensee through a sandbox and a parallel run.

This is part 13 of Regulating a Digital Gambling Economy. Previous: The regulatory data platform. Next: Continuous revenue assurance.

Background reading: OpenAPI Specification; FAPI 2.0 Security Profile; RFC 8705; RFC 9421; RFC 9457; Electronic Communications and Transactions Act 25 of 2002. Checked on 7 November 2026. This article is general information, not legal advice.

How CloudNala can help

CloudNala helps regulators replace emailed spreadsheets with data exchange that both sides can prove. We work with your returns, revenue and compliance teams and a small group of licensees to agree what should be exchanged and at what level of detail, publish the first schemas and versioning policy, and design the gateway, certificate, receipt and reconciliation flow. We then set up the sandbox and conformance tests, run the first licensees through a parallel run and measure whether retyping and late detection are actually falling.


Work with CloudNala

CloudNala helps organisations move from technology ambition to practical execution across cloud, AI, data, platform engineering and digital services.

Whether you are exploring AI, modernising your cloud environment, building a public-sector digital service, or turning an idea into a working MVP, we can help you shape the roadmap and deliver the next step.

Book a Regulatory Technology Review or write to us at consult@cloudnala.co.za

Found this useful?

Share