Miridia
Portal
Procurement

Suppliers

The suppliers operations of the Core API.

Base URL: https://api.miridia.io. Read Authentication and Conventions before you call these operations.

MethodPathOperation
GET/api/v1/suppliersGet suppliers
POST/api/v1/suppliersCreate supplier
GET/api/v1/suppliers/{supplierId}Get supplier
PUT/api/v1/suppliers/{supplierId}Update supplier
DELETE/api/v1/suppliers/{supplierId}Delete supplier

Get suppliers

GET/api/v1/suppliers

Access. Send a bearer token or an API key. The caller needs the Suppliers view permission.

Parameters

NameInTypeRequiredDescription
Pagequeryinteger (int32)NoLimits: minimum 1.
PageSizequeryinteger (int32)NoLimits: minimum 1, maximum 100.
$orderbyquerystringNoExample: "created_at desc" or "name asc"
$filterquerystringNoApply a ODATA style filter to the query to add a fixed constraint. For example, if you want to filter by the creation date, you would set the filter to "created_at ge 2022-01-01". Or if you want to filter by a specific status, you would set the filter to "status eq 'active'".
$searchquerystringNoProvide a search value which would inherit the 'CONTAINS' behaviour.

Response

200. Returns a PagedResult envelope. Each item in data is SupplierResponse.

Request
curl -X GET "https://api.miridia.io/api/v1/suppliers" \
  -H "Authorization: Bearer $MIRIDIA_TOKEN" \
  -H "X-Business-Id: $MIRIDIA_BUSINESS_ID"
Response
{
  "count": 0,
  "totalCount": 0,
  "page": 0,
  "finalPage": 0,
  "pageSize": 0,
  "hasMore": true,
  "statusCode": "OK",
  "data": [
    {
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "title": "string",
      "description": "string",
      "contact": {},
      "addressId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "address": {},
      "paymentTerms": "string",
      "defaultLeadTimeDays": 0,
      "code": "string",
      "defaultCurrency": "Eur"
    }
  ],
  "messages": [
    {
      "title": "string",
      "message": "string",
      "level": "Standard",
      "icon": "SyncAlert",
      "code": "string"
    }
  ]
}

Create supplier

POST/api/v1/suppliers

Access. Send a bearer token or an API key. The caller needs the Suppliers modify permission.

Request body

Send JSON with the shape CreateSupplierCommand.

FieldTypeRequiredDescription
titlestringYesLimits: maximum 100 characters.
descriptionstringNoLimits: maximum 500 characters.
contactIdstring (uuid)NoThe contact could optionally already exist and be provided from a dropdown list.
createContactCreateContactCommandYes
addressIdstring (uuid)NoNot created here. Attach an id already persisted via the address CRUD.
paymentTermsstringNoLimits: maximum 50 characters.
defaultLeadTimeDaysinteger (int32)No
codestringNoLimits: maximum 50 characters.
defaultCurrencyenum CurrencyCodeNoOne of: Invalid, Eur, Usd, Gbp, Zar, Zmw.

Response

200. Returns a SingleResult envelope. The data field is SupplierResponse.

Request
curl -X POST "https://api.miridia.io/api/v1/suppliers" \
  -H "Authorization: Bearer $MIRIDIA_TOKEN" \
  -H "X-Business-Id: $MIRIDIA_BUSINESS_ID" \
  -H "Content-Type: application/json" \
  -d '{
  "title": "string",
  "description": "string",
  "contactId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "createContact": {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "customerId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "title": "string",
    "description": "string",
    "firstName": "string",
    "lastName": "string",
    "email": "name@example.com",
    "phoneNumber": "string",
    "mobileNumber": "string"
  },
  "addressId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "paymentTerms": "string",
  "defaultLeadTimeDays": 0,
  "code": "string",
  "defaultCurrency": "Eur"
}'

Get supplier

GET/api/v1/suppliers/{supplierId}

Access. Send a bearer token or an API key. The caller needs the Suppliers view permission.

Parameters

NameInTypeRequiredDescription
supplierIdpathstring (uuid)Yes

Response

200. Returns a SingleResult envelope. The data field is SupplierResponse.

Request
curl -X GET "https://api.miridia.io/api/v1/suppliers/{supplierId}" \
  -H "Authorization: Bearer $MIRIDIA_TOKEN" \
  -H "X-Business-Id: $MIRIDIA_BUSINESS_ID"

Update supplier

PUT/api/v1/suppliers/{supplierId}

Access. Send a bearer token or an API key. The caller needs the Suppliers modify permission.

Parameters

NameInTypeRequiredDescription
supplierIdpathstring (uuid)Yes

Request body

Send JSON with the shape UpdateSupplierCommand.

FieldTypeRequiredDescription
idstring (uuid)No
titlestringYesLimits: maximum 100 characters.
descriptionstringNoLimits: maximum 500 characters.
contactUpdateContactCommandNo
addressIdstring (uuid)NoNot created here. Attach an id already persisted via the address CRUD. Set to null to clear the existing reference.
paymentTermsstringNoLimits: maximum 50 characters.
defaultLeadTimeDaysinteger (int32)No
codestringNoLimits: maximum 50 characters.
defaultCurrencyenum CurrencyCodeNoOne of: Invalid, Eur, Usd, Gbp, Zar, Zmw.

Response

200. Returns a SingleResult envelope. The data field is SupplierResponse.

Request
curl -X PUT "https://api.miridia.io/api/v1/suppliers/{supplierId}" \
  -H "Authorization: Bearer $MIRIDIA_TOKEN" \
  -H "X-Business-Id: $MIRIDIA_BUSINESS_ID" \
  -H "Content-Type: application/json" \
  -d '{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "title": "string",
  "description": "string",
  "contact": {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "customerId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "title": "string",
    "description": "string",
    "firstName": "string",
    "lastName": "string",
    "email": "name@example.com",
    "phoneNumber": "string",
    "mobileNumber": "string"
  },
  "addressId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "paymentTerms": "string",
  "defaultLeadTimeDays": 0,
  "code": "string",
  "defaultCurrency": "Eur"
}'

Delete supplier

DELETE/api/v1/suppliers/{supplierId}

Access. Send a bearer token or an API key. The caller needs the Suppliers delete permission.

Parameters

NameInTypeRequiredDescription
supplierIdpathstring (uuid)Yes

Response

200. Returns a SingleResult envelope. The data field is boolean.

Request
curl -X DELETE "https://api.miridia.io/api/v1/suppliers/{supplierId}" \
  -H "Authorization: Bearer $MIRIDIA_TOKEN" \
  -H "X-Business-Id: $MIRIDIA_BUSINESS_ID"
Response
{
  "message": "string",
  "messages": [
    {
      "title": "string",
      "message": "string",
      "level": "Standard",
      "icon": "SyncAlert",
      "code": "string"
    }
  ],
  "data": true,
  "statusCode": "OK",
  "canRead": true,
  "canEdit": true,
  "canDelete": true
}

Models

The operations on this page use these object types. Select a type to see its fields.

AddressResponse
FieldTypeDescription
idstring (uuid)
placeIdstring
namestring
websitestring
fullAddressstring
streetstring
suburbstring
citystring
countrystring
postcodestring
unitstring
numberstring
provincestring
latitudenumber (double)
longitudenumber (double)
ContactResponse
FieldTypeDescription
idstring (uuid)
titlestring
descriptionstring
firstNamestring
lastNamestring
emailstring
phoneNumberstring
mobileNumberstring
CreateContactCommand
FieldTypeDescription
idstring (uuid)
customerIdstring (uuid)
titlestringLimits: maximum 50 characters.
descriptionstringLimits: maximum 1000 characters.
firstNamestringLimits: maximum 50 characters.
lastNamestringLimits: maximum 50 characters.
emailstring (email)
phoneNumberstring (tel)
mobileNumberstring (tel)
SupplierResponse
FieldTypeDescription
idstring (uuid)
titlestring
descriptionstring
contactContactResponse
addressIdstring (uuid)Reference to the supplier's origin address (business_addresses), if set.
addressAddressResponse
paymentTermsstringFree-text payment terms (e.g. "Net 30"). Display-only.
defaultLeadTimeDaysinteger (int32)Fallback lead time in days for suppliers with no purchase-order history yet.
codestringOptional free-text internal reference code for the supplier (e.g. "SUP-001"). Display-only.
defaultCurrencyenum CurrencyCodeOne of: Invalid, Eur, Usd, Gbp, Zar, Zmw.
UpdateContactCommand
FieldTypeDescription
idstring (uuid)
customerIdstring (uuid)
titlestringLimits: maximum 50 characters.
descriptionstringLimits: maximum 1000 characters.
firstNamestringLimits: maximum 50 characters.
lastNamestringLimits: maximum 50 characters.
emailstring (email)
phoneNumberstring (tel)
mobileNumberstring (tel)