AI4MSME API
One GraphQL endpoint over a merchant's whole back office. Ads, sales, payments, people and paperwork are separate services with separate databases; a client sees one schema, and a single query may cross several of them.
POST /graphql Authorization: Bearer <access token>
There is no REST surface, no second endpoint per module, and no versioned URL. The API only ever grows: fields are added, never removed or narrowed, and anything on its way out is marked deprecated with a removal date first.
What ships today
| Module | Status | What you can read and change |
|---|---|---|
| People (HR) | live | Employees, leave requests; raise a leave request |
| Ads | live | Connected ad accounts, campaigns, blended cost per acquisition; pause a campaign |
| Sales | live | The merchant record, orders, products, period totals by channel; adjust a product's price |
| Payments | planned | Payments, payouts, disputes |
| Legal | planned | Contracts and documents |
The schema reference is generated from the running graph, so it is always the truthful answer to "what exists right now" — this table is prose, and the schema is the contract.
Read these four, in this order
- Getting started — get a token, send your first query, know which port is which.
- Authentication and scopes — how a token names both the person and the merchant, and what each of the ten module scopes opens.
- Pagination — every list is a cursor connection, and page size is never optional.
- Errors — which failures arrive as data and which arrive as errors, and how to correlate one with a trace.
Then use the explorer to write queries against the real schema with completion and validation. It loads the schema from a file this site ships, so it works with nothing running.
Two rules that explain most of the design
The merchant comes from the token, never from the request. There is no tenant argument, no tenant header, and no field that takes a merchant id. Every query is already scoped to the organisation in your access token, and the databases underneath enforce it a second time. If you hold a token for the wrong merchant, you do not get an error — you get an empty result, which is the truthful answer to "what of theirs can I see".
Expected failures are data. A campaign that cannot be paused because it has
already ended is not an exception; it is one branch of a union you select on.
The errors[] array is reserved for the things that genuinely went wrong. See
Errors.