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

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 / 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