sgrCriarAEv4
Generates the Shipment Authorization (national).
PARAMETERS:
Field | Type | Req. | Description |
---|---|---|---|
keyaccess | string | Yes | Key returned by the sgrLogin method. |
cdpas | integer | Yes | PAS code, returned by the sgrListPASUser method |
cdclienteopentech | integer | Yes | Customer code, returned by the sgrListaEmpresasUsuario method. |
nrplacacavalo | string | Yes | Horse license plate. |
nrplacacarreta1 | string | No | License plate of the first trailer. Send '' (blank) when there is none. |
nrplacacarreta2 | string | No | License plate of the second trailer. Send '' (blank) when there isn't one. |
nrdocmotorista1 | string | Yes | Document number of the first driver. |
nrdocmotorist2 | string | No | Document number of the second driver. Send '' (blank) when the information does not exist. |
dtprevini | string | Yes | Estimated date and time for the start of the trip. Send the date in “YYYY-MM-DD HH:MM” format. |
dtprevfim | string | Yes | Estimated date and time of end of trip. Send the date in the format “YYYY-MM-DD HH:MM”. |
cdcidibgeorigem | integer | Yes | IBGE code of the city of origin. This code is returned by the sgrListaCidades method. |
cdcidibgedestino | integer | Yes | IBGE code of the destination city. This code is returned by the sgrListCities method. |
cdrotaopentech | integer | Yes | Route code in Opentech, returned by the sgrListRoutes method. |
cdrouteclient | string | No | Route code in the client. This code must be filled in when the cdrotaopentech field is not entered. Send '' (blank) when there is no information. The use of this field implies the registration of the customer's route codes in Opentech (The ratio must be 1 customer route code to 1 Opentech route code). |
nrcnpjcpftransporter | string | No | CNPJ/CPF of the transporter. This field must be filled in if the cdtransporterclient field is not used. Send '' (blank) when not used. |
cdtransporterclient | string | No | Transporter code on the client. This field must be filled in if the nrcnpjcpftransporter field is not used. |
nrfonecelular | string | Yes | Cell phone number of the driver of the trip. |
cdtipooperacao | integer | Yes | Operation type code, returned by the sgrListaTiposOperacao method. |
nrcnpjcpfembarcador | string | No | CNPJ/CPF of the shipper. This field must be filled in if the cdembarcadorcliente field is not used. Send '' (blank) when not used. |
cdembarcadorcliente | string | No | Code of the shipper in the client. This field must be filled in if the nrcnpjcpfembarcador field is not used. |
nrcontrolecargo | string | No | Field for free use by the customer. Send '' (blank) when it doesn't exist. |
nrfrota | string | No | Vehicle fleet number. Send '' (blank) when it doesn't exist. |
distanciatotal | decimal | No | Total distance of the trip. Send 0 (zero) when it doesn't exist. |
loadweight | decimal | No | Load weight. Send 0 (zero) when the information does not exist. |
dscontroleviag(1 to 10) | string | No | Trip controls. Send “” (blank) when it doesn't exist. |
products | array | Yes | List of products in the Shipment Authorization. To use this parameter, you must create an array of type sgrProduct. This array will be the summary of the transported cargo. It is not allowed to repeat a product code in this list. |
documents | array | Yes | List of Shipment Authorization documents. To use this parameter, you must create an array of type sgrDocumentAE. |
stops | array | No | List of Support Points, returned by the sgrListRoutePoints method. To use this parameter, you must create an array of type sgrTravelSupportPoint. For certain clients, this field may be required to be filled in. When no stops are entered, send an empty array. |
sensortemperature | array | No | List of Temperature Sensors. To use this parameter, an array of type sgrSensorTemperature must be created. When no temperature parameters are entered, send an empty array. |
nrdddfonecellular | string | Yes | DDD of driver's phone |
dsnomerespviag | string | No | Name of the person responsible for the trip. Send '' (blank) when it doesn't exist. |
dsfone1respviag | string | No* | Phone number of the person responsible for the trip. * Only required if there are no phone numbers registered on the [Customer Contact] screen for the Operational contact type. |
dsfone2respviag | string | No | Additional phone number of the person responsible for the trip. |
baits | list | No* | List of baits. To use this parameter, an array of type sgrIsca must be created. When no bait parameters are entered, an empty array must be sent. * Only required if the bait requirement is checked in the customer's GR rule configuration. |
Observation: To make it easier to understand the secondary methods, which must be called to return the codes required in the parameters listed above, an analogy between the secondary methods and the registration screen in Clipas NET will be presented below. It should be noted that, as they are different systems, the Web Service and Clipas NET do not necessarily have to contain the same fields.
Figure 1: AE registration screen in Clipas NET, Shipping authorization tab. In blue, the names of the parameters have been written. In red are the secondary methods.
Figure 2: AE registration screen in Clipas NET, Documents tab.
Figure 1: AE cadastre fabric not Clipas NET, aba Temperature Sensors.
METHOD RETURN:
ReturnDataset: If the parameters are valid, the Shipment Authorization is created and the dataset is displayed:
Field | Type | Description |
---|---|---|
CDVIAG | integer | Number of the AE created in the execution of the method |
ReturnDescription: If there is an error in the execution of the method, the property will be displayed:
Error | Description |
---|---|
Invalid Start/End Forecast Date | The format of the date entered for the start and/or end forecast is invalid. It is necessary to fill in the format “YYYY-MM-DDhh:mm”. |
It was not possible to generate the Shipment Authorization. | The errors that made it impossible to register are listed in the dataset, and can be seen in Table 1. |
| Boarding Authorization already created! There is already a boarding authorization with the data entered.
The following method is more complete and can be used when traveling through MERCOSUL. (sgrGerarAEv9)