Miridia
Portal
Developers

Conventions

The response envelopes, paging, filters, enums, dates, partial updates, and errors that each operation uses.

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.

SingleResult
{
  "data": { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "code": "PO-0042" },
  "statusCode": "OK",
  "messages": []
}
FieldDescription
dataThe item.
statusCodeThe HTTP status as a name, for example OK.
messagesMessages 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.

PagedResult
{
  "data": [ { "id": "..." }, { "id": "..." } ],
  "count": 2,
  "totalCount": 57,
  "page": 1,
  "finalPage": 3,
  "pageSize": 25,
  "hasMore": true,
  "statusCode": "OK",
  "messages": []
}
FieldDescription
dataThe items on this page.
countThe number of items on this page.
totalCountThe number of items on all pages.
pageThe number of this page. The first page is 1.
finalPageThe number of the last page.
pageSizeThe maximum number of items on a page.
hasMoretrue 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.

A list operation accepts these query parameters.

ParameterDescriptionExample
PageThe page to return. The first page is 1.Page=2
PageSizeThe number of items on a page, from 1 to 100.PageSize=50
$orderbyThe sort field and the direction.$orderby=created_at desc
$filterA filter in the OData style.$filter=status eq 'active'
$searchText that a field must contain.$search=vanilla

Many list operations also accept their own filters, for example status or supplierId. The reference shows them.

Terminal
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.

Terminal
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.

StatusMeaning
400The request is not valid. Read reasons for the details.
401The credential is missing or not valid.
403The credential does not have the permission.
404The item does not exist, or the business cannot see it.
409The request conflicts with the current state, for example a status change that is not permitted.
500An error occurred in Miridia. Try again later. If the error continues, contact support.

The two APIs use different error bodies.

Error
{
  "message": "The purchase order cannot be received in its current status.",
  "code": "E409-...",
  "reasons": []
}
FieldDescription
messageA description of the error.
codeA code for the error. It can be empty.
reasonsFor a 400 error, one entry for each field that is not valid.

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.