Introduction

Systems Involved

  • TOTVS Otimização Logística / TOTVS Roteirização e Entrega
  • External System: ERPs that connect or intend to connect with TOL/TRE

Scope

Installation/Deployment/Usage Prerequisites

  • Minimum versions

    • TOL/TRE:  6.4.0
    • Protheus:  ?
    • Datasul: ?
  • This integration requires no additional installations or updates.

Requisition Layout

createOrders/updateOrders/deleteOrders: SOAP Integration, Synchronous
NameTypeMandatorySizeDescriptionObservation
regionSourceIdStringYes30Regional identifier;Must be a valid regional;
identifier (order)StringYes30transport order ID;The transport order ID must be unique per shipper;
codeStringYes255Transport order code ("description" of the transport order);Does not exist in TRE (R2);
shipperIdStringYes255Shipper ID;

Does not exist in TRE (R2);

This field must be from a valid shipper;

orderTypeSourceIdStringYes30Order type code;This field must be the sourceId of a valid order type;
orderSubTypeSourceIdStringNo30Do not use. It will be removed in future releases.

Does not exist in TRE (R2);

Alternatively, use an order classification.

priorityInteiroYes2Transport request priority;

Does not exist in TRE (R2);

This field must be a number between 0 and 10; the higher the number, the higher the priority;

pickupStartDate/hour (String)Yes29Start date/time of departure window;PickupStart must always be less than deliveryEnd; pickupStart must always be less than pickupEnd (when this is informed);
When there is no time in the external system, always send 00:01 start of the day;
pickupEndDate/hour (String)No29End date/time of boarding window;PickupEnd (when informed) must always be less than or equal to deliveryEnd;
deliveryStartDate/hour (String)No29Delivery window start date/time;DeliveryStart (when informed) must always be less than or equal to deliveryEnd; When there is no time in the external system, always send 23:59 end of the day;
deliveryEndDate/hour (String)Yes29End date/time of the delivery window;
billingLimitDate/hour (String)No29Deadline date/time for billing;Does not exist in TRE (R2);
destinationIdStringYes30Transport order destination locality ID (main delivery address);The informed locality must have the logistical role of "destination" or "both" (It cannot be just "origin"); if the delivery address to be considered is the alternative one, a "dummy" code can be sent in this field (this only applies to the transport order creation operation);
addressCountryAcronymStringNo2Acronym of the country of the transport request (alternative delivery address);It must be a valid acronym; If zip code is not informed, this field is mandatory;
addressStateAcronymStringNo2Acronym of the status of the transport order (alternative delivery address);It must be a valid acronym; If zip code is not informed, this field is mandatory;
addressCityStringNo50City of transport request (alternative delivery address);If zip code is not informed, this field is mandatory;
addressDistrictStringNo50District of the transportation request (alternative delivery address);
addressStreetStringNo200Transport order Street (alternative delivery address);
addressNumberStringNo30Transport order number (alternative delivery address);
addressComplementStringNo30Complement of the transport order address (alternative delivery address);
addressZipCodeStringNo10Zip code of the transport order address (alternative delivery address);

The value cannot be invalid; if the state and city are not informed, this field is mandatory;

addressLatitudeFloatNo13Latitude of the transportation request (alternative delivery address);

If this field is provided, the longitude of the locality must also be provided; the value of this field must be in the range -90.0 to 90.0;

Observations:- The TOL/TRE can be configured to allow the automatic geocoding of the localitys in the integration; if this behavior is enabled, the geo-coordinates will be obtained automatically via a GIS service during the acquisition process itself;

addressLongitudeFloatNo13Longitude of the transportation request (alternative delivery address);

If this field is provided, the latitude of the locality must also be provided; the value of this field must be in the range -180.0 to 180.0;

Observations:- The TOL/TRE can be configured to allow the automatic geocoding of the localitys in the integration; if this behavior is enabled, the geo-coordinates will be obtained automatically via a GIS service during the acquisition process itself;

integrationDataSourceStringYes30data source ID;

Does not exist in TRE (R2);

This field must be from a valid data source;

modalInteiroNo1Do not use. It will be removed in future releases.

Does not exist in TRE (R2);

Alternatively, use an order classification.

passingHubUsageTypeStringNo10Type of use of the pass-through hub;

Does not exist in TRE (R2);

MANDATORY / OPTIONAL/ INVALID
(this field is case sensitive and must be completely capitalized)

possiblePassingHubsIdsLista <String>No30List of branch IDs of localitys that can be pass-through hubs;

Does not exist in TRE (R2);

This field should have a list of branch IDs from localitys that are valid gateway hubs;

destinationHubUsageTypeStringNo10Type of use of the destination hub;

Does not exist in TRE (R2);

MANDATORY / OPTIONAL/ INVALID
(this field is case sensitive and must be completely capitalized)

possibleDestinationHubsIdsLista <String>No30List of locality branch IDs that can be destination hubs;

Does not exist in TRE (R2);

This field should have a list of branch IDs from localitys that are valid destination hubs;

allowedVehicleIdsLista <String>No255Do not use. It will be removed in future releases.

Does not exist in TRE (R2);

There is no default alternative. Each case will be assessed individually.

forbiddenVehicleIdsLista <String>No255Do not use. It will be removed in future releases.

Does not exist in TRE (R2);

There is no default alternative. Each case will be assessed individually.

deliveryExclusivityBooleanNo1Flag indicating if the order is for exclusive delivery;

Does not exist in TRE (R2);

If an order has this flag checked, trips will be assembled in such a way that only orders from the same customer of this order will be grouped in the same load;

Example: suppose the following requests:
- Order 1: customer C1 and with exclusive delivery;
- Order 2: customer C2 and without exclusive delivery;
- Order 3: customer C1 and without exclusive delivery;
In this scenario, orders 1 and 3 will be sent together in the same load;

Comments:
- Note that order 3, even though it is not for exclusive delivery, will be sent together with order 1 as it is from the same customer;

incotermInteiroNo1Incoterm of the transportation request;

Does not exist in TRE (R2);

0=FOB; 1=CIF; 2=FOBT; 3=OP

erpCreationDtDate/hour (String)No29Date of creation of the transport request in the external system;

Does not exist in TRE (R2);

This field's requirement may vary by shipper (OrderSysParams parameters);

reference (order)StringNo500Free text field;
observationsStringNo500Free text field;
auxiliary1StringNo500Do not use. It will be removed in future releases.

Does not exist in TRE (R2);

Alternatively use a request attribute.

auxiliary2StringNo500Do not use. It will be removed in future releases.

Does not exist in TRE (R2);

Alternatively use a request attribute.

auxiliary3StringNo500Do not use. It will be removed in future releases.

Does not exist in TRE (R2);

Alternatively use a request attribute.

auxiliary4StringNo500Do not use. It will be removed in future releases.

Does not exist in TRE (R2);

Alternatively use a request attribute.

auxiliary5StringNo500Do not use. It will be removed in future releases.

Does not exist in TRE (R2);

Alternatively use a request attribute.

auxiliary6StringNo500Do not use. It will be removed in future releases.

Does not exist in TRE (R2);

Alternatively use a request attribute.

auxiliary7StringNo500Do not use. It will be removed in future releases.

Does not exist in TRE (R2);

Alternatively use a request attribute.

auxiliary8StringNo500Do not use. It will be removed in future releases.

Does not exist in TRE (R2);

Alternatively use a request attribute.

auxiliary9StringNo500Do not use. It will be removed in future releases.

Does not exist in TRE (R2);

Alternatively use a request attribute.

auxiliary10StringNo500Do not use. It will be removed in future releases.

Does not exist in TRE (R2);
Alternatively use a request attribute.

classificationsclassifications []NoN/AGrouping element of all classifications of an order;
attributes attributes[]NoN/AGrouping element of all the attributes of an order;
itemsorderitem[]YesN/AGrouping element of all items of an order;
deliveryUnitsdeliveryUnit[]NoN/AGrouping element of all delivery units of an order;

Does not exist in TRE (R2);
Do not use. It will be removed in future releases.

orderitem, data type used in TOL/TRE integrations
NameTypeMandatorySizeDescriptionObservation
orderIdStringYes30
transport order ID;
Same value as the identifier field (order);
sourceIdStringYes30Transport order item ID;Order item list Cannot contain repeating sourceIds; the sourceId will uniquely identify the item of an order; the sourceId of an item Cannot be repeated even between other requests;
orderItemClassificationSourceIdStringNo30Do not use. It will be removed in future releases.Alternatively, use an order item classification.
productIdStringYes30ID do SKU;This field must be from a valid SKU; if the palletization parameter in the order is enabled and the destination locality supports palletization, this SKU must have an associated pallet already defined;
originIdStringYes30ID of the place of origin of the order item;This field must be from a valid locality, must have the logistical role of "origin" and must be different from the destination locality of the transport request (see field "destinationId");
proportionalityIdStringNo255proportionality keyIndicator of which products must be kept in the same proportion within a load (example: 1 pot = 1 lid + 1 bottle);
SKUs that must have this proportionality respected must have the same value in this field;
shipmentUnitWrapperCodeStringYes30Shipping unit enclosure code;This field must be from a valid UE wrapper sourceId and cannot be a composite wrapper.
priceFloatNo13Total value of product units in all shipment units of this item;Scenario 1: Shipping Wrap is per product;
This field will be "overwritten" by the respective value registered in the product;
Scenario 2: Shipping Wrap is per item;
The value informed in the item will be used;
heightFloatNo13Height of shipping envelope (unit);

Scenario 1: Shipping Wrap is per product;
This field will be "overwritten" by the respective value registered in the product;

Scenario 2: Shipping Wrap is per item;
If informed, this field must be greater than zero and its value must be informed in meters; if the wrapper category policy is per order item, this field is required; this field must necessarily be provided with the value 0 (zero) for the categories of enclosures that are of the "coil" and "bundle of tubes" type; if the palletization parameter in the order is enabled and the destination locality supports palletization, the height of the SKU must be less than the maximum height supported for pallets at the destination locality;

lengthFloatNo13Length of shipping envelope (unit);

Scenario 1: Shipping Wrap is per product;
This field will be "overwritten" by the respective value registered in the product;

Scenario 2: Shipping Wrap is per item;
If informed, this field must be greater than zero and its value must be informed in meters; if the wrapper category policy is per order item, this field is required;

widthFloatNo13Width of the shipping envelope (unit);

Scenario 1: Shipping Wrap is per product;
This field will be "overwritten" by the respective value registered in the product;

Scenario 2: Shipping Wrap is per item;
If informed, this field must be greater than zero and its value must be informed in meters; if the wrapper category policy is per order item, this field is required; if the type of enclosure category is "tube", the value of this field must be less than or equal to the value of the "height" field (when informed);

weightFloatNo13Weight of the shipping envelope (unit);

Scenario 1: Shipping Wrap is per product;
This field will be "overwritten" by the respective value registered in the product;

Scenario 2: Shipping Wrap is per item;
If informed, this field must be greater than zero and its value must be informed in kilograms; if the wrapper category policy is per order item, this field is required;

volumeFloatNo13Do not use. It will be removed in future releases.Not necessary. The system will calculate the volume automatically based on the dimensions and enclosure of the shipping unit.
quantityFloatYes13Total quantity of product units in all shipment units of this item;This field must be greater than zero; if the container category is not of the "non-unitizable bulk" type, this field must have an integer value;
quantityInShipmentUnitsFloatYes13Number of shipping units;This field must be greater than zero; if the enclosure category is of the "bundle of tubes" type, the division of "quantity" by this field must not leave a remainder (i.e., the "quantity" field must be divisible by this field); if the container category is of the "pallet" type, and the system is not enabled to work with fractional shipment units (UE), this field must have an integer value;
palletFractionationForbiddenBooleanNo1Do not use. It will be removed in future releases.Alternatively, use an order item classification.
hlwAllowBooleanNo1Flag indicating whether the shipping envelope can be tipped in the ACL orientation;A=Height; L=Width; C=Length; see possible orientations of a SKU; a shipping envelope cannot be tipped in all its orientations;
hwlAllowBooleanNo1Flag indicating whether the shipping envelope can be overturned in the ALC orientation;A=Height; L=Width; C=Length; see possible orientations of a SKU; a shipping envelope cannot be tipped in all its orientations;
lhwAllowBooleanNo1Flag indicating whether the shipping envelope can be tipped in the CAL orientation;A=Height; L=Width; C=Length; see possible orientations of a SKU; a shipping envelope cannot be tipped in all its orientations;
lwhAllowBooleanNo1Flag indicating whether the shipping envelope can be tipped in the CLA orientation;A=Height; L=Width; C=Length; see possible orientations of a SKU; a shipping envelope cannot be tipped in all its orientations;
whlAllowBooleanNo1Flag indicating whether the shipping envelope can be overturned in the LAC orientation;A=Height; L=Width; C=Length; see possible orientations of a SKU; a shipping envelope cannot be tipped in all its orientations;
wlhAllowBooleanNo1Flag indicating whether the shipping envelope can be tipped in the LCA orientation;A=Height; L=Width; C=Length; see possible orientations of a SKU; a shipping envelope cannot be tipped in all its orientations;
MITStringNo50"Merge in Transit";

Order items that have the same MIT will be transported in the same cargo; order items that have different MITs may be transported in the same cargo; this restriction is applied only in the last leg of the "web" (i.e., when the actual delivery to the customer will be made); if DSK is provided, order items with the same DSK must have the same MITs, which in turn must be different from all other order items' MITs;

DSKStringNo50"Delivery Schedule Key";

Order items that have the same DSK will be transported in the same load; order items that have different DSKs will be transported in different loads; this restriction is applied only in the last leg of the "web" (i.e., when the actual delivery to the customer will be made); if MIT is given, order items with the same DSK must have the same MITs, which in turn must be different from all other order items' MITs;

reference (order item)StringNo255Free text field;
classificationsclassifications []NoN/AGrouping element of all classifications of an order item;
attributes attributes[]NoN/AGrouping element of all attributes of an order item;

deliveryUnit, data type used in TOL/TRE integrations
NameTypeMandatorySizeDescriptionObservation
deliveryUnitShipmentUnitsQuantityInteiroYes10Do not use. It will be removed in future releases.
shipmentUnitWrapperCodeStringYes30Do not use. It will be removed in future releases.
orderItems List <String>YesN/ADo not use. It will be removed in future releases.

Orderitem

OrderitemSourceid

orderItemShipmentUnitsQuantityInteiroYes10Do not use. It will be removed in future releases.

classifications, data type used in TOL/TRE integrations
NameTypeMandatorySizeDescriptionObservation
typeStringYes255Order classification type;
valueStringYes255Order classification value;

attributes, data type used in TOL/TRE integrations
NameTypeMandatorySizeDescriptionObservation
nameStringYes255Order attribute name;
valueStringYes255Order attribute value;

Answer Layout

ordersResponse, data type used in TOL/TRE integrations
NameTypeMandatorySizeDescriptionObservation
resultresult[]YesN/A

Grouping element of all results

There must be at least 1 result in this list;

sucessBooleanYes1

Success or failure flag


result, data type used in TOL/TRE integrations
NameTypeMandatorySizeDescriptionObservation
errorCodesStringNo30

List of error codes


errorMessageStringNo255

Error messages


identifierStringNo30

Error table identifier


sucessBooleanYes1

Success or failure flag


Error catalog

CodeMessageDescription

Incoterm

FOB:

  • They represent orders that will be picked up by customers at the plants (the customer is responsible for shipping);
  • FOB orders are never mixed with CIF orders in the same trip;
  • As these orders are picked up by customers at the plants, they are never distributed to carriers (The trips for these orders are born with the status "Created" and not with the status "Distributed");

CIF:

  • Represent orders that will be delivered to customers by the Shipper (shipper is responsible for freight)
  • CIF orders are never mixed with FOB orders in the same trip;
  • As these orders are delivered by the Shipper, they need to be distributed to carriers that will make the delivery (The trips of these orders are born with the status "Distributed" and not with the status "Created");

FOBT:

  • It is equivalent to a FOB order with the difference that the carrier that will collect it is already known. The cargo is automatically linked to this carrier;
  • FOBT orders will never be mixed with FOB orders;

OP:

  • Equivalent to a CIF application;

  • OP orders will never be mixed with CIF orders;

Attachments

  Arquivo Modificado
Arquivo R2_OrderAcquisitionService.wsdl 04 mai, 2023 by Julio Vinicius Oliveira dos Santos
Arquivo XML R2_order-example.xml 04 mai, 2023 by Julio Vinicius Oliveira dos Santos
Arquivo XML R2_order-alternative-address-example.xml 04 mai, 2023 by Julio Vinicius Oliveira dos Santos
Arquivo XML OrderAcquisitionService.xml 04 mai, 2023 by Julio Vinicius Oliveira dos Santos
Arquivo Order Aquisition draw.io diagram 09 mai, 2023 by Julio Vinicius Oliveira dos Santos
Arquivo PNG Order Aquisition.png Order Aquisition exported to image 09 mai, 2023 by Julio Vinicius Oliveira dos Santos

  • Sem rótulos