Suppliers
Base URL: https://api.miridia.io. Read Authentication and Conventions before you call these operations.
| Method | Path | Operation |
|---|---|---|
| GET | /api/v1/suppliers | Get suppliers |
| POST | /api/v1/suppliers | Create 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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Page | query | integer (int32) | No | Limits: minimum 1. |
PageSize | query | integer (int32) | No | Limits: minimum 1, maximum 100. |
$orderby | query | string | No | Example: "created_at desc" or "name asc" |
$filter | query | string | No | Apply 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'". |
$search | query | string | No | Provide a search value which would inherit the 'CONTAINS' behaviour. |
Response
200. Returns a PagedResult envelope. Each item in data is SupplierResponse.
curl -X GET "https://api.miridia.io/api/v1/suppliers" \
-H "Authorization: Bearer $MIRIDIA_TOKEN" \
-H "X-Business-Id: $MIRIDIA_BUSINESS_ID"{
"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.
| Field | Type | Required | Description |
|---|---|---|---|
title | string | Yes | Limits: maximum 100 characters. |
description | string | No | Limits: maximum 500 characters. |
contactId | string (uuid) | No | The contact could optionally already exist and be provided from a dropdown list. |
createContact | CreateContactCommand | Yes | |
addressId | string (uuid) | No | Not created here. Attach an id already persisted via the address CRUD. |
paymentTerms | string | No | Limits: maximum 50 characters. |
defaultLeadTimeDays | integer (int32) | No | |
code | string | No | Limits: maximum 50 characters. |
defaultCurrency | enum CurrencyCode | No | One of: Invalid, Eur, Usd, Gbp, Zar, Zmw. |
Response
200. Returns a SingleResult envelope. The data field is SupplierResponse.
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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
supplierId | path | string (uuid) | Yes |
Response
200. Returns a SingleResult envelope. The data field is SupplierResponse.
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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
supplierId | path | string (uuid) | Yes |
Request body
Send JSON with the shape UpdateSupplierCommand.
| Field | Type | Required | Description |
|---|---|---|---|
id | string (uuid) | No | |
title | string | Yes | Limits: maximum 100 characters. |
description | string | No | Limits: maximum 500 characters. |
contact | UpdateContactCommand | No | |
addressId | string (uuid) | No | Not created here. Attach an id already persisted via the address CRUD. Set to null to clear the existing reference. |
paymentTerms | string | No | Limits: maximum 50 characters. |
defaultLeadTimeDays | integer (int32) | No | |
code | string | No | Limits: maximum 50 characters. |
defaultCurrency | enum CurrencyCode | No | One of: Invalid, Eur, Usd, Gbp, Zar, Zmw. |
Response
200. Returns a SingleResult envelope. The data field is SupplierResponse.
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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
supplierId | path | string (uuid) | Yes |
Response
200. Returns a SingleResult envelope. The data field is boolean.
curl -X DELETE "https://api.miridia.io/api/v1/suppliers/{supplierId}" \
-H "Authorization: Bearer $MIRIDIA_TOKEN" \
-H "X-Business-Id: $MIRIDIA_BUSINESS_ID"{
"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
| Field | Type | Description |
|---|---|---|
id | string (uuid) | |
placeId | string | |
name | string | |
website | string | |
fullAddress | string | |
street | string | |
suburb | string | |
city | string | |
country | string | |
postcode | string | |
unit | string | |
number | string | |
province | string | |
latitude | number (double) | |
longitude | number (double) |
ContactResponse
| Field | Type | Description |
|---|---|---|
id | string (uuid) | |
title | string | |
description | string | |
firstName | string | |
lastName | string | |
email | string | |
phoneNumber | string | |
mobileNumber | string |
CreateContactCommand
| Field | Type | Description |
|---|---|---|
id | string (uuid) | |
customerId | string (uuid) | |
title | string | Limits: maximum 50 characters. |
description | string | Limits: maximum 1000 characters. |
firstName | string | Limits: maximum 50 characters. |
lastName | string | Limits: maximum 50 characters. |
email | string (email) | |
phoneNumber | string (tel) | |
mobileNumber | string (tel) |
SupplierResponse
| Field | Type | Description |
|---|---|---|
id | string (uuid) | |
title | string | |
description | string | |
contact | ContactResponse | |
addressId | string (uuid) | Reference to the supplier's origin address (business_addresses), if set. |
address | AddressResponse | |
paymentTerms | string | Free-text payment terms (e.g. "Net 30"). Display-only. |
defaultLeadTimeDays | integer (int32) | Fallback lead time in days for suppliers with no purchase-order history yet. |
code | string | Optional free-text internal reference code for the supplier (e.g. "SUP-001"). Display-only. |
defaultCurrency | enum CurrencyCode | One of: Invalid, Eur, Usd, Gbp, Zar, Zmw. |
UpdateContactCommand
| Field | Type | Description |
|---|---|---|
id | string (uuid) | |
customerId | string (uuid) | |
title | string | Limits: maximum 50 characters. |
description | string | Limits: maximum 1000 characters. |
firstName | string | Limits: maximum 50 characters. |
lastName | string | Limits: maximum 50 characters. |
email | string (email) | |
phoneNumber | string (tel) | |
mobileNumber | string (tel) |