POST, PUT /shipments
General Information
Method Name
Shipment creation Shipment update
HTTP Method
POST PUT
Route
POST:
/v.1.0/shipments
/ui/v.1.0/shipments
/mobileapp/v.1.1/shipments
PUT:
/v.1.0/shipments/{id}
/ui/v.1.0/shipments/{id}
/mobileapp/v.1.1/shipments
Change Type
Changes to existing endpoint
Authorization
Authorization: Bearer jwt-token…
System/module
client-api, Мobile App, UI (/ui/ /mobileapp/ /v.1.0/)
Description
For endpoints 1) shipment create and 2) shipment update (POST, PUT /shipments), 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 / 4000AFTER:
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:
Domestic shipments within Moldova
Sender and recipient are in Moldova
sender.countryCode = "MD"recipient.countryCode = "MD"
Shipments from Moldova and payer = sender or third person with a Moldovan contract
sender.countryCode = "MD"Payer of the shipment:
payerType = "Sender"ORpayerType = "ThirdPerson"and the payer’s contract is Moldovan
Shipments to Moldova and payer = recipient or third person with a Moldovan contract
recipient.countryCode = "MD"Payer of the shipment:
payerType = "Recipient"ORpayerType = "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:
Take contract number from
payerContractNumberin/shipmentsrequest.Call
/api/contracts/with:numbers[] = {payerContractNumber}countryCodes[] = MD
If the response for filter
countryCodes[] = MDcontains 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