Sending a new Customer

To send a new customer to Digital Customer Base, you will just to know the ServiceType and the vehicle registration number.

Step 1 - Initialization 

var dgc = new DigitalCustomers("AADEUserID", "OcpApimSubscriptionKey", "EntityVatNumber", "Arbitrans User", "Arbitrans Key", false);
 DigitalCustomers.Customer cust = dgc.newCustomer;					
This language is not supported or no code example is available.
Dim dgc as DigitalCustomers = new DigitalCustomers("AADEUserID", "OcpApimSubscriptionKey", "EntityVatNumber", "Arbitrans User", "Arbitrans Key", False)
 Dim cust as DigitalCustomers.Customer = dgc.newCustomer					
This language is not supported or no code example is available.

Step 2 - Selecting a Service Type 
Depending on the company's services, you must select ONLY ONE of the following service types
This type is going to be terermed in two fields:

  1. Field Customer.clientServiceType
  2. Field Customer.useCase

     a. Rental Service Type

cust.clientServiceType = 1; //Determines that the Service Type is "Rental"
 
 var rent = new DigitalCustomers.RentalType();
 rent.vehicleRegistrationNumber = "ZZZ9999"; // For Greek Vehicles
 // rent.foreignVehicleRegistrationNumber = "BD99 SMR" 'For non-Greek vehicles
 rent.vehicleCategory = "Passenger Car";
 rent.vehicleMovementPurpose = 1; // Determines that this vehicle is going to be rented in exchange for money.
 rent.isDiffVehPickupLocation = true; // Determines that the car is going to be picked up from a different place than the
 rent.vehiclePickupLocation = "Parking Lot 1";
 
 cust.useCase.rental = rent;
 cust.useCase.parkingCarWash = (object)null;
 cust.useCase.garage = (object)null;					
This language is not supported or no code example is available.
cust.clientServiceType = 1 'Determines that the Service Type is "Rental"
 
 Dim rent As New DigitalCustomers.RentalType
 rent.vehicleRegistrationNumber = "ZZZ9999" 'For Greek Vehicles
 'rent.foreignVehicleRegistrationNumber = "BD99 SMR" 'For non-Greek vehicles
 rent.vehicleCategory = "Passenger Car"
 rent.vehicleMovementPurpose = 1 'Determines that this vehicle is going to be rented in exchange for money.
 rent.isDiffVehPickupLocation = True 'Determines that the car is going to be picked up from a different place than the
 rent.vehiclePickupLocation = "Parking Lot 1"
 
 cust.useCase.rental = rent
 cust.useCase.parkingCarWash = Nothing
 cust.useCase.garage = Nothing					
This language is not supported or no code example is available.

     b. Parking/Car Wash Service Type

cust.clientServiceType = 2; // Determines that the Service Type is "Parking/Car Wash"
 
 var parking = new DigitalCustomers.ParkingCarWashType();
 parking.vehicleRegistrationNumber = "ZZZ9999"; // For Greek Vehicles
 // parking.foreignVehicleRegistrationNumber = "BD99 SMR" 'For non-Greek vehicles
  parking.vehicleCategory = "Passenger Car";
 
 cust.useCase.rental = (object)null;
 cust.useCase.parkingCarWash = parking;
 cust.useCase.garage = (object)null;					
This language is not supported or no code example is available.
cust.clientServiceType = 2 'Determines that the Service Type is "Parking/Car Wash"
 
 Dim parking As New DigitalCustomers.ParkingCarWashType
 parking.vehicleRegistrationNumber = "ZZZ9999" 'For Greek Vehicles
 'parking.foreignVehicleRegistrationNumber = "BD99 SMR" 'For non-Greek vehicles
 parking.vehicleCategory = "Passenger Car"
 
 cust.useCase.rental = Nothing
 cust.useCase.parkingCarWash = parking
 cust.useCase.garage = Nothing					
This language is not supported or no code example is available.

     c. Garage Service Type

cust.clientServiceType = 3; // Determines that the Service Type is "Garage"
 
 var garage = new DigitalCustomers.GarageType();
 garage.vehicleRegistrationNumber = "ZZZ9999"; // For Greek Vehicles
 // garage.foreignVehicleRegistrationNumber = "BD99 SMR" 'For non-Greek vehicles
 garage.vehicleCategory = "Passenger Car";
 
 cust.useCase.rental = (object)null;
 cust.useCase.parkingCarWash = (object)null;
 cust.useCase.garage = garage;					
This language is not supported or no code example is available.
cust.clientServiceType = 3 'Determines that the Service Type is "Garage"
 
 Dim garage As New DigitalCustomers.GarageType
 garage.vehicleRegistrationNumber = "ZZZ9999" 'For Greek Vehicles
 'garage.foreignVehicleRegistrationNumber = "BD99 SMR" 'For non-Greek vehicles
 garage.vehicleCategory = "Passenger Car"
 
 cust.useCase.rental = Nothing
 cust.useCase.parkingCarWash = Nothing
 cust.useCase.garage = garage					
This language is not supported or no code example is available.

Important: If two or more Service Types added into Customer.useCase field of the structure, the customer will be rejected by AADE.

Step 3 - Send the customer to Digital Customer Base

string result = dgc.SendCustomer(cust);
 
 if (!result.StartWith("DCLID:"))
 {
     // contains errors
 }
 else
 {
     MessageBox.Show("Customer sent to Digital Customer Base" + Constants.vbNewLine + result, "Success");
 }					
This language is not supported or no code example is available.
Dim result as String = dgc.SendCustomer(cust)
 
 If not result.StartWith("DCLID:") Then
    'contains errors
 Else
    MessageBox.Show("Customer sent to Digital Customer Base" & vbNewLine & result, "Success")
 End If					
This language is not supported or no code example is available.

FINAL CODE (Steps 1 to 3) - Service Type: Garage

The final code of the above steps, for a garage service type, is as follows:

var dgc = new DigitalCustomers("AADEUserID", "OcpApimSubscriptionKey", "EntityVatNumber", "Arbitrans User", "Arbitrans Key", false);
 DigitalCustomers.Customer cust = dgc.newCustomer;
 
 cust.clientServiceType = 3; // Determines that the Service Type is "Garage" 
 
 var garage = new DigitalCustomers.GarageType();
 garage.vehicleRegistrationNumber = "ZZZ9999"; // For Greek Vehicles
 // garage.foreignVehicleRegistrationNumber = "BD99 SMR" 'For non-Greek vehicles
 garage.vehicleCategory = "Passenger Car";
  
 cust.useCase.rental = (object)null;
 cust.useCase.parkingCarWash = (object)null;
 cust.useCase.garage = garage;
  
 string result = dgc.SendCustomer(cust);
  
 if (!result.StartWith("DCLID:"))
 {
     // contains errors
 }
 else
 {
     MessageBox.Show("Customer sent to Digital Customer Base" + Constants.vbNewLine + result, "Success");
 }					
This language is not supported or no code example is available.
Dim dgc as DigitalCustomers = new DigitalCustomers("AADEUserID", "OcpApimSubscriptionKey", "EntityVatNumber", "Arbitrans User", "Arbitrans Key", False)
 Dim cust as DigitalCustomers.Customer = dgc.newCustomer
 
 cust.clientServiceType = 3 'Determines that the Service Type is "Garage"
 
 Dim garage As New DigitalCustomers.GarageType
 garage.vehicleRegistrationNumber = "ZZZ9999" 'For Greek Vehicles
 'garage.foreignVehicleRegistrationNumber = "BD99 SMR" 'For non-Greek vehicles
 garage.vehicleCategory = "Passenger Car"
 
 cust.useCase.rental = Nothing
 cust.useCase.parkingCarWash = Nothing
 cust.useCase.garage = garage
 
 Dim result as String = dgc.SendCustomer(cust)
 
 If not result.StartWith("DCLID:") Then
    'contains errors
 Else
    MessageBox.Show("Customer sent to Digital Customer Base" & vbNewLine & result, "Success")
 End If					
This language is not supported or no code example is available.

SOME IMPORTANT MATTERS:

  1. You may need to find the available service types. Get them using myDATATools.getDclClientServiceType.
  2. You may need to find the available vehicle movement purposes. Get them using myDATATools.getDclVehicleMovementPurpose.
Remarks
 

In order to cover every single possible scenario, you have to predict several fields in your software, in case you don't already have them. 
For that:

  1. Check the full Customer Structure.
  2. Check the full RentalType Structure.

The common fields in every structure are the:

  1. vehicleRegistrationNumber
  2. foreignVehicleRegistrationNumber
  3. vehicleCategory
  4. vehicleFactory

You can cancel a customer using the CancelCustomer Method.

In this article

Definition