To create a new API draft shipment, the already existing ShipmentRequest is used and there is a new boolean field called "IsDraft" to include within the request.
This usecase helps the user create a draft shipment via API, regardless the MOL user waybill printing permissions.
By putting the "IsDraft" parameter within the ShipmentRequest:
IsDraft = true
the user creates a shipment record in a draft state (Status: DRAFT_TO_BE_CLOSED), meaning that the shipment is saved in the system but is not yet finalized, has no carrier tracking number and no label has been generated.
This mechanism must operate independently of, and override, any default MOL user-level waybill printing settings that might otherwise trigger an immediate finalization of the shipment. Crucially, this flag also marks the draft as being manageable via the API, making it eligible for later completion through the new FinalizeShipment call.
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.onlinembe.eu/ws/">
<SOAP-ENV:Body>
<ns2:ShipmentRequest xmlns:ns2="http://www.onlinembe.eu/ws/">
<RequestContainer>
<System>IT</System>
<Credentials>
<Username></Username>
<Passphrase></Passphrase>
</Credentials>
<InternalReferenceID>test</InternalReferenceID>
<MbeTrackingId></MbeTrackingId>
<Sender>
<Name>Sender Draft</Name>
<CompanyName>Draft SRL</CompanyName>
<Address>Via del Sender</Address>
<Phone>1111222333</Phone>
<ZipCode>21042</ZipCode>
<City>Caronno Pertusella</City>
<State>VA</State>
<Country>IT</Country>
<Email>ptambato@fortidia.com</Email>
</Sender>
<Recipient>
<Name>Test Srl</Name>
<CompanyName>Sender company</CompanyName>
<Address>Via Recipient 1</Address>
<Phone>123123123</Phone>
<ZipCode>20125</ZipCode>
<City>Milano</City>
<State>MI</State>
<Country>IT</Country>
<Email>nscaccianoce@fortidia.com</Email>
</Recipient>
<Shipment>
<ShipperType>COURIERLDV</ShipperType>
<Description>Merce</Description>
<Service>SSE</Service>
<PackageType>GENERIC</PackageType>
<Referring>Test</Referring>
<Items>
<Item>
<Weight>2</Weight>
<Dimensions>
<Lenght>80</Lenght>
<Height>30</Height>
<Width>80</Width>
</Dimensions>
</Item>
</Items>
<Products>
<Product>
<SKUCode>Art.002</SKUCode>
<Description>Table</Description>
<Quantity>1.0</Quantity>
</Product>
</Products>
<Notes>Test for Is Draft - API</Notes>
<IsDraft>true</IsDraft>
</Shipment>
</RequestContainer>
</ns2:ShipmentRequest>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
The response behaviour for a ShipmentRequest with IsDraft parameter set at true is:
The system does not attempt to finalize the shipment or request a label from the carrier.
The API response confirms the successful creation of the draft, as it already happens today when the MOL user is not enabled to print the waybill (returning the MBE Tracking ID, the base64 PDF, etc.)
The system internally flags this shipment to identify it as an "API Draft" (e.g. by setting a specific field), distinguishing it from legacy drafts created due to a lack of user permissions.
The response behaviour for a ShipmentRequest with IsDraft parameter set at false (or the parameter is omitted entirely) is:
The system maintains its current behavior (==> attempts to finalize the shipment and generate a label based on user permissions and data completeness).
The internal "API Draft" flag is NOT set.