Esempio n. 1
0
        public ShippingServiceClient(string url, string platformExternalId, string bearerToken, bool useHttps)
        {
            Requester requester = new Requester(url);

            //authentication via token
            requester.AddBearerAuth(bearerToken);

            ShippingConfigurations           = new ShippingConfigurationsEndpoint(requester, $"/tenants/{platformExternalId}/shippingConfigurations", useHttps);
            ShippingPreferences              = new ShippingPreferencesEndpoint(requester, $"/tenants/{platformExternalId}/ShippingPreferences", useHttps);
            ShippingAccountMasterPreferences = new AccountMasterShippingEndpoint(requester, $"/tenants/{platformExternalId}/accountMasters", useHttps);
            FlatRateSchedules              = new FlatRateSchedulesEndpoint(requester, $"/tenants/{platformExternalId}/flatRateSchedules", useHttps);
            HandlingSchedules              = new HandlingSchedulesEndpoint(requester, $"/tenants/{platformExternalId}/handlingSchedules", useHttps);
            FlatRateScheduleGroups         = new FlatRateScheduleGroupsEndpoint(requester, $"/tenants/{platformExternalId}/flatRateScheduleGroups", useHttps);
            HandlingScheduleGroups         = new HandlingScheduleGroupsEndpoint(requester, $"/tenants/{platformExternalId}/handlingScheduleGroups", useHttps);
            FlatRateScheduleConfigurations = new FlatRateSchedulesConfigurationEndpoint(requester, $"/tenants/{platformExternalId}/configurations", useHttps);
            HandlingScheduleConfigurations = new HandlingSchedulesConfigurationEndpoint(requester, $"/tenants/{platformExternalId}/configurations", useHttps);
            Shipments = new ShipmentEndpoint(requester, $"/tenants/{platformExternalId}/accountmasters", useHttps);
            Token     = new ShippingAuthEndpoint(requester, $"/token/authenticate", useHttps);
        }