Conventions
Each operation of the Miridia API follows the rules on this page. The reference does not repeat them.
Requests
- Send JSON with the header
Content-Type: application/json. - The names of fields use camelCase, for example
supplierId. - An id is a UUID, for example
3fa85f64-5717-4562-b3fc-2c963f66afa6. - A file upload uses
multipart/form-data.
Response envelopes
Most operations wrap the result in an envelope. The reference names the envelope and the type inside it.
Single result
An operation that returns one item uses SingleResult.
{
"data": { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "code": "PO-0042" },
"statusCode": "OK",
"messages": []
}
| Field | Description |
|---|---|
data | The item. |
statusCode | The HTTP status as a name, for example OK. |
messages | Messages for the user, for example a warning. Each message has a title, a message, a level, and a code. |
Paged result
An operation that returns a list uses PagedResult.
{
"data": [ { "id": "..." }, { "id": "..." } ],
"count": 2,
"totalCount": 57,
"page": 1,
"finalPage": 3,
"pageSize": 25,
"hasMore": true,
"statusCode": "OK",
"messages": []
}
| Field | Description |
|---|---|
data | The items on this page. |
count | The number of items on this page. |
totalCount | The number of items on all pages. |
page | The number of this page. The first page is 1. |
finalPage | The number of the last page. |
pageSize | The maximum number of items on a page. |
hasMore | true when there is a page after this page. |
Lists for a lookup
An operation that returns a short, fixed list returns a plain JSON array. The reference tells you when an operation does this.
Paging, sorting, filters, and search
A list operation accepts these query parameters.
| Parameter | Description | Example |
|---|---|---|
Page | The page to return. The first page is 1. | Page=2 |
PageSize | The number of items on a page, from 1 to 100. | PageSize=50 |
$orderby | The sort field and the direction. | $orderby=created_at desc |
$filter | A filter in the OData style. | $filter=status eq 'active' |
$search | Text that a field must contain. | $search=vanilla |
Many list operations also accept their own filters, for example status or supplierId. The reference shows them.
curl "https://api.miridia.io/api/v1/purchase-orders?Page=1&PageSize=50&status=Ordered" \
-H "x-dispatch-api-key: $MIRIDIA_API_KEY"
Enums
An enum value is a string in PascalCase. The string is the name of the value, for example PartiallyReceived or FinishedGood.
- The API writes the name.
- The API reads the name and ignores the letter case. It also accepts the number of the value. Use the name, because the name is easier to read.
The reference lists the values of each enum.
Dates and times
A date and time uses ISO 8601, for example 2026-09-29T08:00:00Z. Send times in UTC.
Some operations accept an effective date, for example a receipt of a purchase order. Use this date to record an event that occurred in the past. The stock ledger then uses the correct date.
Partial updates
A PATCH operation changes only the fields that you send. A field that you do not send, or that you send as null, does not change. Thus you can change one field without a full copy of the item.
curl -X PATCH https://api.miridia.io/api/v1/purchase-orders/$PO_ID \
-H "x-dispatch-api-key: $MIRIDIA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"expectedDeliveryDate":"2026-10-06T00:00:00Z"}'
A PUT operation replaces the item.
Errors
The API uses the standard HTTP status codes.
| Status | Meaning |
|---|---|
400 | The request is not valid. Read reasons for the details. |
401 | The credential is missing or not valid. |
403 | The credential does not have the permission. |
404 | The item does not exist, or the business cannot see it. |
409 | The request conflicts with the current state, for example a status change that is not permitted. |
500 | An error occurred in Miridia. Try again later. If the error continues, contact support. |
The two APIs use different error bodies.
{
"message": "The purchase order cannot be received in its current status.",
"code": "E409-...",
"reasons": []
}
| Field | Description |
|---|---|
message | A description of the error. |
code | A code for the error. It can be empty. |
reasons | For a 400 error, one entry for each field that is not valid. |
The Global API uses the problem details format (RFC 9457), with the content type application/problem+json.
{
"type": "about:blank",
"title": "Authentication is required.",
"status": 401
}
Identifiers in the API
Some paths and fields use the name dispatch, for example /api/v1/plans/{dispatchId} or the header x-dispatch-api-key. These names come from an earlier name of the platform. They are correct, and they stay the same so that each client continues to operate.