Quickstart with the API
The Miridia API has two parts. The Global API manages your identity: login, organisations, API keys, and billing. The Core API holds your business data: products, stock, orders, and more. Read the API overview for the full model.
What you need
- A Miridia user with the Administrator role. Read Quickstart in the portal.
curl, or another HTTP client.
Log in
Send your email address and password to the Global API.
curl -X POST https://global.miridia.io/api/auth/login \
-H "Content-Type: application/json" \
-d '{"email":"you@example.com","password":"<your-password>"}'
The response holds a session with an access token. Keep the value of data.session.accessToken.
{
"data": {
"requiresOrganizationSelection": false,
"session": {
"accessToken": "eyJhbGciOiJSUzI1NiIs...",
"expiresAtUtc": "2026-09-29T09:00:00Z",
"organization": { "id": "...", "slug": "your-company", "name": "Your Company" }
}
},
"statusCode": 200,
"messages": []
}
requiresOrganizationSelection: true, a selectionToken, and a list of organizations. Send POST /api/auth/select-organization to choose one. Read Authentication.Find your business id
Read your account from the Core API. The response lists the businesses that you can use.
curl https://api.miridia.io/api/me \
-H "Authorization: Bearer $MIRIDIA_TOKEN"
The data.userBusinesses list holds your businesses. Keep the id of the business that you want to use.
Make an API key
An access token expires after a short time. For a system that calls Miridia, make an API key.
curl -X POST https://global.miridia.io/api/auth/tokens \
-H "Authorization: Bearer $MIRIDIA_TOKEN" \
-H "Content-Type: application/json" \
-d '{"label":"My first integration","businessId":"<your-business-id>"}'
The response holds the key in data.token. Miridia shows the key only one time. Keep it in a secret store.
Read your products
Send the API key in the x-dispatch-api-key header.
curl "https://api.miridia.io/api/v1/Products?Page=1&PageSize=20" \
-H "x-dispatch-api-key: $MIRIDIA_API_KEY"
The response is a PagedResult. The data field holds the products.
Next steps
- Read the conventions for paging, filters, enums, and errors.
- Find an operation in the Core API reference.
- Try the operations in the API explorer.