For the complete documentation index, see llms.txt. This page is also available as Markdown.

POST /shipments/calculations

General Information

Method Name

Shipment calculation

HTTP Method

POST

Route

/v.1.0/shipments/calculations /mobileapp/v.1.1/shipments/calculations /ui/v.1.0/shipments/calculations ui/v.1.0/shipments/delivery-calculations ui/site/v.1.0/shipments/delivery-calculations

Change Type

Changes to existing endpoint

Authorization

Authorization: Bearer jwt-token…

Product

API Gateway

Data Source

System/module

client-api, Мobile App, UI (/ui/ /mobileapp/ /v.1.0/)

Description

For endpoint shipments/calculations (POST, /shipments/calculations), the logic of volumetric weight (volumetricWeight) calculation is changed for shipments related to Moldova.

Essence of the change

  • BEFORE: For all countries volumetric weight was calculated as: volumetricWeight = length * width * height / 4000

  • AFTER:

    • For shipments related to Moldova, volumetric weight must be calculated as: volumetricWeight = length * width * height / 5000. See rules below.

    • For all other shipments the formula with divisor 4000 remains unchanged.

volumetricWeight is calculated on API Gateway side even if parcels[].volumetricWeight is not sent in the request or is sent as null.

Rules when divisor 5000 must be applied (Moldova)

The formula with divisor 5000 is used if at least one of the following cases is true:

  1. Domestic shipments within Moldova

    • Sender and recipient are in Moldova

    • sender.countryCode = "MD"

    • recipient.countryCode = "MD"

  2. Shipments from Moldova and payer = sender or third person with a Moldovan contract

    • sender.countryCode = "MD"

    • Payer of the shipment:

      • payerType = "Sender" OR

      • payerType = "ThirdPerson" and the payer’s contract is Moldovan

  3. Shipments to Moldova and payer = recipient or third person with a Moldovan contract

    • recipient.countryCode = "MD"

    • Payer of the shipment:

      • payerType = "Recipient" OR

      • payerType = "ThirdPerson" and the payer’s contract is Moldovan

Determining a “Moldovan” contract for ThirdPerson

If payerType = "ThirdPerson", to determine that the payer is a third party under a Moldovan contract:

  1. Take contract number from payerContractNumber in /shipments request.

  2. Call /api/contracts/ with:

    • numbers[] = {payerContractNumber}

    • countryCodes[] = MD

  3. If the response for filter countryCodes[] = MD contains a contract with this number – the contract is considered Moldovan. If not – the contract is not Moldovan and the formula with divisor 5000 must not be applied.

Example:

GET /api/contracts/?numbers[]=GNPMD-00020861&countryCodes[]=MD