alexeybusygin / ShippingRates

.NET wrapper for UPS, FedEx, USPS and DHL shipping rate APIs
MIT License
45 stars 15 forks source link

UPS GetRates for Standard List Prices with CustomerClassification="53" #75

Closed ebaj-tech closed 5 days ago

ebaj-tech commented 2 weeks ago

We need to query the standard list price to determine our shipping costs. To achieve this, according to the UPS documentation, see https://developer.ups.com/api/reference?loc=en_US#operation/Rate ...the CustomerClassification.Code = "53" must be preset. In the library I can only find an internal class for this, which cannot be used externally. How can I still query the list price from UPS?

Here is the UPS documentation: CustomerClassification object (RateRequest_CustomerClassification) <= 1 Customer classification container. Valid if ShipFrom country or territory is "US"

Code required string = 2 characters <= 1 Customer classification code. Valid values:00 - Rates Associated with Shipper Number01 - Daily Rates04 - Retail Rates05 - Regional Rates06 - General List Rates53 - Standard List RatesLength is not validated.If customer classification code is not a valid value please refer to Rate Types Table on page 11. Description string [ 1 .. 35 ] characters <= 1 Customer classification description of the code above. Ignored if provided in the request. Length is not validated.

alexeybusygin commented 2 weeks ago

That's a bug (CustomerClassification is not filled properly at all right now) and a feature (add support for code 53). It's in progress now.

alexeybusygin commented 5 days ago

That's fixed in version 2.2.2. Now, you can specify a customer classification code like this:

new UPSProviderConfiguration()
{
    CustomerClassification = UPSCustomerClassification.StandardListRates
}

And that will put "53" in the request.