Rates
Base URL: https://api.miridia.io. Read Authentication and Conventions before you call these operations.
| Method | Path | Operation |
|---|---|---|
| GET | /api/rates | Get configured rates |
| POST | /api/rates | Create price matrix |
| GET | /api/rates/discounts | Get pricing discounts |
| POST | /api/rates/{rateId}/discounts | Create discount matrix |
| PUT | /api/rates/{rateId}/discounts/{discountId} | Update discount matrix |
| DELETE | /api/rates/{rateId}/discounts/{discountId} | Delete price discount |
| PUT | /api/rates/{rateId} | Update price matrix |
| DELETE | /api/rates/{rateId} | Delete price matrix |
Get configured rates
GET/api/rates
Retrieve the pricing matrix (configured pricing) for the requested business
Access. Send a bearer token or an API key. The caller needs the Shipments view permission.
Response
200. Returns a JSON array. Each item is PriceMatrixResponse.
curl -X GET "https://api.miridia.io/api/rates" \
-H "Authorization: Bearer $MIRIDIA_TOKEN" \
-H "X-Business-Id: $MIRIDIA_BUSINESS_ID"Create price matrix
POST/api/rates
Create a new price matrix
Access. Send a bearer token or an API key. The caller needs the Shipments modify permission.
Request body
Send JSON with the shape CreatePriceMatrixCommand.
| Field | Type | Required | Description |
|---|---|---|---|
title | string | No | |
rate | number (double) | No | |
distanceBasedRate | number (double) | No | |
minWeight | number (double) | No | |
maxWeight | number (double) | No | |
deliveryDaysMin | integer (int32) | No | |
deliveryDaysMax | integer (int32) | No | |
serviceLevel | enum ServiceLevel | No | One of: Unknown, Standard, Express, SameDay, Overnight, TwoDay, InternationalStandard, InternationalExpress, OnDemand, Freight. |
limitOn | enum LimitOn | No | One of: Dimension, Volume. |
lengthType | enum LengthType | No | One of: Unknown, Centimeter, Meter, Inch, Foot. |
weightType | enum WeightType | No | One of: Unknown, Kilogram, Tonne, Pound, Stone, UsTon, ImperialTon, Gram. |
businessDimensionPresetId | string (uuid) | No | The id of the business dimension preset to link to this price matrix. |
originZoneId | string (uuid) | No | The id of the origin zone for zone-based pricing. Null means any origin. |
destinationZoneId | string (uuid) | No | The id of the destination zone for zone-based pricing. Null means any destination. |
Response
200. Returns a SingleResult envelope. The data field is PriceMatrixResponse.
curl -X POST "https://api.miridia.io/api/rates" \
-H "Authorization: Bearer $MIRIDIA_TOKEN" \
-H "X-Business-Id: $MIRIDIA_BUSINESS_ID" \
-H "Content-Type: application/json" \
-d '{
"title": "string",
"rate": 0,
"distanceBasedRate": 0,
"minWeight": 0,
"maxWeight": 0,
"deliveryDaysMin": 0,
"deliveryDaysMax": 0,
"serviceLevel": "Standard",
"limitOn": "Dimension",
"lengthType": "Centimeter",
"weightType": "Kilogram",
"businessDimensionPresetId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"originZoneId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"destinationZoneId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}'Get pricing discounts
GET/api/rates/discounts
Retrieve the list of all discounts applied to price matrices for a business
Access. Send a bearer token or an API key. The caller needs the Shipments view permission.
Response
200. Returns a JSON array. Each item is DiscountMatrixResponse.
curl -X GET "https://api.miridia.io/api/rates/discounts" \
-H "Authorization: Bearer $MIRIDIA_TOKEN" \
-H "X-Business-Id: $MIRIDIA_BUSINESS_ID"[
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"title": "string",
"discountType": "Percentage",
"discountBy": 0,
"minPackageCount": 0,
"maxPackageCount": 0,
"priceMatrix": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"title": "string",
"rate": 0
},
"currency": {
"iso4217": "string",
"utf8Symbol": "string",
"currencyCode": "Eur"
},
"originalRate": 0,
"discountedRate": 0
}
]Create discount matrix
POST/api/rates/{rateId}/discounts
Create a new discount for a price matrix
Access. Send a bearer token or an API key. The caller needs the Shipments modify permission.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
rateId | path | string (uuid) | Yes |
Request body
Send JSON with the shape CreateDiscountMatrixCommand.
| Field | Type | Required | Description |
|---|---|---|---|
priceMatrixId | string (uuid) | No | The price matrix id to associate this discount with |
title | string | No | |
discountType | enum DiscountType | No | One of: None, Percentage, FixedValue. |
discountBy | number (double) | No | |
minPackageCount | integer (int32) | No | |
maxPackageCount | integer (int32) | No |
Response
200. Returns a SingleResult envelope. The data field is DiscountMatrixResponse.
curl -X POST "https://api.miridia.io/api/rates/{rateId}/discounts" \
-H "Authorization: Bearer $MIRIDIA_TOKEN" \
-H "X-Business-Id: $MIRIDIA_BUSINESS_ID" \
-H "Content-Type: application/json" \
-d '{
"priceMatrixId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"title": "string",
"discountType": "Percentage",
"discountBy": 0,
"minPackageCount": 0,
"maxPackageCount": 0
}'{
"message": "string",
"messages": [
{
"title": "string",
"message": "string",
"level": "Standard",
"icon": "SyncAlert",
"code": "string"
}
],
"data": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"title": "string",
"discountType": "Percentage",
"discountBy": 0,
"minPackageCount": 0,
"maxPackageCount": 0,
"priceMatrix": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"title": "string",
"rate": 0
},
"currency": {
"iso4217": "string",
"utf8Symbol": "string",
"currencyCode": "Eur"
},
"originalRate": 0,
"discountedRate": 0
},
"statusCode": "OK",
"canRead": true,
"canEdit": true,
"canDelete": true
}Update discount matrix
PUT/api/rates/{rateId}/discounts/{discountId}
Update an existing discount for a price matrix
Access. Send a bearer token or an API key. The caller needs the Shipments modify permission.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
rateId | path | string (uuid) | Yes | |
discountId | path | string (uuid) | Yes | The discount matrix id |
Request body
Send JSON with the shape UpdateDiscountMatrixCommand.
| Field | Type | Required | Description |
|---|---|---|---|
priceMatrixId | string (uuid) | No | The price matrix id to associate this discount with |
title | string | No | |
discountType | enum DiscountType | No | One of: None, Percentage, FixedValue. |
discountBy | number (double) | No | |
minPackageCount | integer (int32) | No | |
maxPackageCount | integer (int32) | No |
Response
200. Returns a SingleResult envelope. The data field is DiscountMatrixResponse.
curl -X PUT "https://api.miridia.io/api/rates/{rateId}/discounts/{discountId}" \
-H "Authorization: Bearer $MIRIDIA_TOKEN" \
-H "X-Business-Id: $MIRIDIA_BUSINESS_ID" \
-H "Content-Type: application/json" \
-d '{
"priceMatrixId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"title": "string",
"discountType": "Percentage",
"discountBy": 0,
"minPackageCount": 0,
"maxPackageCount": 0
}'{
"message": "string",
"messages": [
{
"title": "string",
"message": "string",
"level": "Standard",
"icon": "SyncAlert",
"code": "string"
}
],
"data": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"title": "string",
"discountType": "Percentage",
"discountBy": 0,
"minPackageCount": 0,
"maxPackageCount": 0,
"priceMatrix": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"title": "string",
"rate": 0
},
"currency": {
"iso4217": "string",
"utf8Symbol": "string",
"currencyCode": "Eur"
},
"originalRate": 0,
"discountedRate": 0
},
"statusCode": "OK",
"canRead": true,
"canEdit": true,
"canDelete": true
}Delete price discount
DELETE/api/rates/{rateId}/discounts/{discountId}
Delete a price discount
Access. Send a bearer token or an API key. The caller needs the Shipments delete permission.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
rateId | path | string (uuid) | Yes | |
discountId | path | string (uuid) | Yes |
Response
200. Returns a SingleResult envelope. The data field is boolean.
curl -X DELETE "https://api.miridia.io/api/rates/{rateId}/discounts/{discountId}" \
-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
}Update price matrix
PUT/api/rates/{rateId}
Update an existing price matrix
Access. Send a bearer token or an API key. The caller needs the Shipments modify permission.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
rateId | path | string (uuid) | Yes | The price matrix id |
Request body
Send JSON with the shape UpdatePriceMatrixCommand.
| Field | Type | Required | Description |
|---|---|---|---|
title | string | No | |
rate | number (double) | No | |
distanceBasedRate | number (double) | No | |
minWeight | number (double) | No | |
maxWeight | number (double) | No | |
deliveryDaysMin | integer (int32) | No | |
deliveryDaysMax | integer (int32) | No | |
serviceLevel | enum ServiceLevel | No | One of: Unknown, Standard, Express, SameDay, Overnight, TwoDay, InternationalStandard, InternationalExpress, OnDemand, Freight. |
limitOn | enum LimitOn | No | One of: Dimension, Volume. |
lengthType | enum LengthType | No | One of: Unknown, Centimeter, Meter, Inch, Foot. |
weightType | enum WeightType | No | One of: Unknown, Kilogram, Tonne, Pound, Stone, UsTon, ImperialTon, Gram. |
businessDimensionPresetId | string (uuid) | No | The id of the business dimension preset to link to this price matrix. |
originZoneId | string (uuid) | No | The id of the origin zone for zone-based pricing. Null means any origin. |
destinationZoneId | string (uuid) | No | The id of the destination zone for zone-based pricing. Null means any destination. |
Response
200. Returns a SingleResult envelope. The data field is PriceMatrixResponse.
curl -X PUT "https://api.miridia.io/api/rates/{rateId}" \
-H "Authorization: Bearer $MIRIDIA_TOKEN" \
-H "X-Business-Id: $MIRIDIA_BUSINESS_ID" \
-H "Content-Type: application/json" \
-d '{
"title": "string",
"rate": 0,
"distanceBasedRate": 0,
"minWeight": 0,
"maxWeight": 0,
"deliveryDaysMin": 0,
"deliveryDaysMax": 0,
"serviceLevel": "Standard",
"limitOn": "Dimension",
"lengthType": "Centimeter",
"weightType": "Kilogram",
"businessDimensionPresetId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"originZoneId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"destinationZoneId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}'Delete price matrix
DELETE/api/rates/{rateId}
Delete a price matrix
Access. Send a bearer token or an API key. The caller needs the Shipments delete permission.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
rateId | path | string (uuid) | Yes |
Response
200. Returns a SingleResult envelope. The data field is boolean.
curl -X DELETE "https://api.miridia.io/api/rates/{rateId}" \
-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.
CurrencyResponse
| Field | Type | Description |
|---|---|---|
iso4217 | string | |
utf8Symbol | string | |
currencyCode | enum CurrencyCode | One of: Invalid, Eur, Usd, Gbp, Zar, Zmw. |
DeliveryZoneResponse
| Field | Type | Description |
|---|---|---|
id | string (uuid) | |
title | string | |
description | string | |
geoZones | GeoZone[] |
DimensionPresetResponse
| Field | Type | Description |
|---|---|---|
id | string (uuid) | |
vendor | string | Limits: maximum 100 characters. |
fulfillmentType | enum FulfillmentType | One of: Unknown, Package, Pallet, Container, Miscellaneous. |
title | string | Limits: maximum 200 characters. |
weight | number (double) | The weight property acts as a limit for this specific box size. |
length | number (double) | |
width | number (double) | |
height | number (double) | |
defaultOption | boolean | every business can have one package size preset set as the default option |
lengthType | enum LengthType | One of: Unknown, Centimeter, Meter, Inch, Foot. |
weightType | enum WeightType | One of: Unknown, Kilogram, Tonne, Pound, Stone, UsTon, ImperialTon, Gram. |
countryCode | enum CountryCode | One of: Invalid, Global, FallbackZa, Be, De, Lu, Nl, Za, Zw, Gb, Us, Zm. |
dimensionType | GeometryFieldSymbol |
DiscountMatrixResponse
| Field | Type | Description |
|---|---|---|
id | string (uuid) | |
title | string | |
discountType | enum DiscountType | One of: None, Percentage, FixedValue. |
discountBy | number (double) | |
minPackageCount | integer (int32) | |
maxPackageCount | integer (int32) | |
priceMatrix | PrimitivePriceMatrixResponse | |
currency | CurrencyResponse | |
originalRate | number (double) | |
discountedRate | number (double) |
GeometryFieldSymbol
| Field | Type | Description |
|---|---|---|
weightType | enum WeightType | One of: Unknown, Kilogram, Tonne, Pound, Stone, UsTon, ImperialTon, Gram. |
lengthType | enum LengthType | One of: Unknown, Centimeter, Meter, Inch, Foot. |
lengthSymbol | string | |
weightSymbol | string |
GeoZone
| Field | Type | Description |
|---|---|---|
latitude | number (double) | |
longitude | number (double) | |
radiusInMeters | integer (int32) |
PriceMatrixResponse
| Field | Type | Description |
|---|---|---|
businessDimensionPreset | DimensionPresetResponse | |
dimensionType | GeometryFieldSymbol | |
currency | CurrencyResponse | |
id | string (uuid) | |
title | string | |
rate | number (double) | |
distanceBasedRate | number (double) | |
minWeight | number (double) | |
maxWeight | number (double) | |
deliveryDaysMin | integer (int32) | |
deliveryDaysMax | integer (int32) | |
serviceLevel | enum ServiceLevel | One of: Unknown, Standard, Express, SameDay, Overnight, TwoDay, InternationalStandard, InternationalExpress, OnDemand, Freight. |
limitOn | enum LimitOn | One of: Dimension, Volume. |
lengthType | enum LengthType | One of: Unknown, Centimeter, Meter, Inch, Foot. |
weightType | enum WeightType | One of: Unknown, Kilogram, Tonne, Pound, Stone, UsTon, ImperialTon, Gram. |
originZone | DeliveryZoneResponse | |
destinationZone | DeliveryZoneResponse | |
discounts | DiscountMatrixResponse[] |
PrimitivePriceMatrixResponse
Lightweight projection of a price matrix used as a cross-reference on a discount matrix. Carries just enough information to identify the parent price matrix without recursing into the full PriceMatrixResponse (which itself lists its discounts).
| Field | Type | Description |
|---|---|---|
id | string (uuid) | |
title | string | |
rate | number (double) |