Miridia
Portal
Logistics

Rates

This controller is responsible for setting price data which is used to resolve quotation suggestions for delivery partners

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

MethodPathOperation
GET/api/ratesGet configured rates
POST/api/ratesCreate price matrix
GET/api/rates/discountsGet pricing discounts
POST/api/rates/{rateId}/discountsCreate 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.

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

FieldTypeRequiredDescription
titlestringNo
ratenumber (double)No
distanceBasedRatenumber (double)No
minWeightnumber (double)No
maxWeightnumber (double)No
deliveryDaysMininteger (int32)No
deliveryDaysMaxinteger (int32)No
serviceLevelenum ServiceLevelNoOne of: Unknown, Standard, Express, SameDay, Overnight, TwoDay, InternationalStandard, InternationalExpress, OnDemand, Freight.
limitOnenum LimitOnNoOne of: Dimension, Volume.
lengthTypeenum LengthTypeNoOne of: Unknown, Centimeter, Meter, Inch, Foot.
weightTypeenum WeightTypeNoOne of: Unknown, Kilogram, Tonne, Pound, Stone, UsTon, ImperialTon, Gram.
businessDimensionPresetIdstring (uuid)NoThe id of the business dimension preset to link to this price matrix.
originZoneIdstring (uuid)NoThe id of the origin zone for zone-based pricing. Null means any origin.
destinationZoneIdstring (uuid)NoThe id of the destination zone for zone-based pricing. Null means any destination.

Response

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

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

Request
curl -X GET "https://api.miridia.io/api/rates/discounts" \
  -H "Authorization: Bearer $MIRIDIA_TOKEN" \
  -H "X-Business-Id: $MIRIDIA_BUSINESS_ID"
Response
[
  {
    "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

NameInTypeRequiredDescription
rateIdpathstring (uuid)Yes

Request body

Send JSON with the shape CreateDiscountMatrixCommand.

FieldTypeRequiredDescription
priceMatrixIdstring (uuid)NoThe price matrix id to associate this discount with
titlestringNo
discountTypeenum DiscountTypeNoOne of: None, Percentage, FixedValue.
discountBynumber (double)No
minPackageCountinteger (int32)No
maxPackageCountinteger (int32)No

Response

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

Request
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
}'
Response
{
  "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

NameInTypeRequiredDescription
rateIdpathstring (uuid)Yes
discountIdpathstring (uuid)YesThe discount matrix id

Request body

Send JSON with the shape UpdateDiscountMatrixCommand.

FieldTypeRequiredDescription
priceMatrixIdstring (uuid)NoThe price matrix id to associate this discount with
titlestringNo
discountTypeenum DiscountTypeNoOne of: None, Percentage, FixedValue.
discountBynumber (double)No
minPackageCountinteger (int32)No
maxPackageCountinteger (int32)No

Response

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

Request
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
}'
Response
{
  "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

NameInTypeRequiredDescription
rateIdpathstring (uuid)Yes
discountIdpathstring (uuid)Yes

Response

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

Request
curl -X DELETE "https://api.miridia.io/api/rates/{rateId}/discounts/{discountId}" \
  -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
}

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

NameInTypeRequiredDescription
rateIdpathstring (uuid)YesThe price matrix id

Request body

Send JSON with the shape UpdatePriceMatrixCommand.

FieldTypeRequiredDescription
titlestringNo
ratenumber (double)No
distanceBasedRatenumber (double)No
minWeightnumber (double)No
maxWeightnumber (double)No
deliveryDaysMininteger (int32)No
deliveryDaysMaxinteger (int32)No
serviceLevelenum ServiceLevelNoOne of: Unknown, Standard, Express, SameDay, Overnight, TwoDay, InternationalStandard, InternationalExpress, OnDemand, Freight.
limitOnenum LimitOnNoOne of: Dimension, Volume.
lengthTypeenum LengthTypeNoOne of: Unknown, Centimeter, Meter, Inch, Foot.
weightTypeenum WeightTypeNoOne of: Unknown, Kilogram, Tonne, Pound, Stone, UsTon, ImperialTon, Gram.
businessDimensionPresetIdstring (uuid)NoThe id of the business dimension preset to link to this price matrix.
originZoneIdstring (uuid)NoThe id of the origin zone for zone-based pricing. Null means any origin.
destinationZoneIdstring (uuid)NoThe id of the destination zone for zone-based pricing. Null means any destination.

Response

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

Request
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

NameInTypeRequiredDescription
rateIdpathstring (uuid)Yes

Response

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

Request
curl -X DELETE "https://api.miridia.io/api/rates/{rateId}" \
  -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.

CurrencyResponse
FieldTypeDescription
iso4217string
utf8Symbolstring
currencyCodeenum CurrencyCodeOne of: Invalid, Eur, Usd, Gbp, Zar, Zmw.
DeliveryZoneResponse
FieldTypeDescription
idstring (uuid)
titlestring
descriptionstring
geoZonesGeoZone[]
DimensionPresetResponse
FieldTypeDescription
idstring (uuid)
vendorstringLimits: maximum 100 characters.
fulfillmentTypeenum FulfillmentTypeOne of: Unknown, Package, Pallet, Container, Miscellaneous.
titlestringLimits: maximum 200 characters.
weightnumber (double)The weight property acts as a limit for this specific box size.
lengthnumber (double)
widthnumber (double)
heightnumber (double)
defaultOptionbooleanevery business can have one package size preset set as the default option
lengthTypeenum LengthTypeOne of: Unknown, Centimeter, Meter, Inch, Foot.
weightTypeenum WeightTypeOne of: Unknown, Kilogram, Tonne, Pound, Stone, UsTon, ImperialTon, Gram.
countryCodeenum CountryCodeOne of: Invalid, Global, FallbackZa, Be, De, Lu, Nl, Za, Zw, Gb, Us, Zm.
dimensionTypeGeometryFieldSymbol
DiscountMatrixResponse
FieldTypeDescription
idstring (uuid)
titlestring
discountTypeenum DiscountTypeOne of: None, Percentage, FixedValue.
discountBynumber (double)
minPackageCountinteger (int32)
maxPackageCountinteger (int32)
priceMatrixPrimitivePriceMatrixResponse
currencyCurrencyResponse
originalRatenumber (double)
discountedRatenumber (double)
GeometryFieldSymbol
FieldTypeDescription
weightTypeenum WeightTypeOne of: Unknown, Kilogram, Tonne, Pound, Stone, UsTon, ImperialTon, Gram.
lengthTypeenum LengthTypeOne of: Unknown, Centimeter, Meter, Inch, Foot.
lengthSymbolstring
weightSymbolstring
GeoZone
FieldTypeDescription
latitudenumber (double)
longitudenumber (double)
radiusInMetersinteger (int32)
PriceMatrixResponse
FieldTypeDescription
businessDimensionPresetDimensionPresetResponse
dimensionTypeGeometryFieldSymbol
currencyCurrencyResponse
idstring (uuid)
titlestring
ratenumber (double)
distanceBasedRatenumber (double)
minWeightnumber (double)
maxWeightnumber (double)
deliveryDaysMininteger (int32)
deliveryDaysMaxinteger (int32)
serviceLevelenum ServiceLevelOne of: Unknown, Standard, Express, SameDay, Overnight, TwoDay, InternationalStandard, InternationalExpress, OnDemand, Freight.
limitOnenum LimitOnOne of: Dimension, Volume.
lengthTypeenum LengthTypeOne of: Unknown, Centimeter, Meter, Inch, Foot.
weightTypeenum WeightTypeOne of: Unknown, Kilogram, Tonne, Pound, Stone, UsTon, ImperialTon, Gram.
originZoneDeliveryZoneResponse
destinationZoneDeliveryZoneResponse
discountsDiscountMatrixResponse[]
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).

FieldTypeDescription
idstring (uuid)
titlestring
ratenumber (double)