UPS-API / api-documentation

MIT License
39 stars 19 forks source link

WWE DDU: Weight issue during shipment creation #122

Closed itiievskyi closed 1 month ago

itiievskyi commented 3 months ago

Hi,

I'm currently using the latest REST API specification (version 2403) to communicate with UPS. When attempting to create a shipment using the service "17" (Worldwide Economy DDU), I encounter the following error:


{
    "code": "9370246",
    "message": "Missing or Invalid Unit of Measurement Code for Shipment Total Weight."
}

Request Body:


{
    "ShipmentRequest": {
        "Request": {
            "RequestOption": "validate",
            "TransactionReference": {
                "CustomerContext": "80bbabda14f34b40969ebc2427cc51aa"
            }
        },
        "Shipment": {
            "Shipper": {
                "Name": "Acme LLC",
                "AttentionName": "Warehouse Service",
                "Phone": {
                    "Number": "+12670000000"
                },
                "ShipperNumber": "XXXXXX",
                "Address": {
                    "AddressLine": "123 Example ave.",
                    "City": "Trevose, PA",
                    "StateProvinceCode": "PA",
                    "PostalCode": "19053",
                    "CountryCode": "US"
                },
                "TaxIdentificationNumber": "xx",
                "VendorInfo": {
                    "VendorCollectIDTypeCode": "xx",
                    "VendorCollectIDNumber": "xx",
                    "ConsigneeType": "01"
                }
            },
            "ShipTo": {
                "Name": "Joel Doe",
                "AttentionName": "Joel Doe",
                "Phone": {
                    "Number": "+4900000000000"
                },
                "Address": {
                    "AddressLine": [
                        "345 Example str."
                    ],
                    "City": "Löningen",
                    "StateProvinceCode": "None",
                    "PostalCode": "49624",
                    "CountryCode": "DE"
                }
            },
            "Package": {
                "Packaging": {
                    "Code": "02"
                },
                "PackageWeight": {
                    "UnitOfMeasurement": {
                        "Code": "OZS"
                    },
                    "Weight": "2.8"
                },
                "Dimensions": {
                    "UnitOfMeasurement": {
                        "Code": "IN",
                        "Description": "inches"
                    },
                    "Length": "5.91",
                    "Width": "3.54",
                    "Height": "0.39"
                }
            },
            "ShipmentRatingOptions": {
                "NegotiatedRatesIndicator": "1"
            },
            "Service": {
                "Code": "17",
                "Description": "Worldwide Economy DDU"
            },
            "PaymentInformation": {
                "ShipmentCharge": {
                    "Type": "01",
                    "BillShipper": {
                        "AccountNumber": "XXXXXX"
                    }
                }
            },
            "Description": "White pink pearls hair comb",
            "NumOfPiecesInShipment": 1,
            "ShipmentServiceOptions": {
                "InternationalForms": {
                    "FormType": "01",
                    "InvoiceNumber": "xx",
                    "InvoiceDate": "xx",
                    "ReasonForExport": "SALE",
                    "CurrencyCode": "USD",
                    "Contacts": {
                        "SoldTo": {
                            "Name": "Joel Doe",
                            "AttentionName": "Joel Doe",
                            "Phone": {
                                "Number": "+4900000000000"
                            },
                            "ShipperNumber": "XXXXXX",
                            "Address": {
                                "AddressLine": [
                                    "345 Example str."
                                ],
                                "City": "Löningen",
                                "StateProvinceCode": "None",
                                "PostalCode": "49624",
                                "CountryCode": "DE"
                            }
                        }
                    },
                    "Product": [
                        {
                            "Description": "White pink pearls hair comb (handm)",
                            "Unit": {
                                "Number": "1",
                                "UnitOfMeasurement": {
                                    "Code": "EA",
                                    "Description": "Each"
                                },
                                "Value": "37.50"
                            },
                            "OriginCountryCode": "UA",
                            "ScheduleB": {
                                "Number": "9615900000",
                                "Quantity": 1,
                                "UnitOfMeasurement": {
                                    "Code": "EA"
                                }
                            }
                        }
                    ]
                }
            },
            "TaxInformationIndicator": "1",
            "ShipmentCharges": 11.88,
            "ShipFrom": {
                "Name": "Acme LLC",
                "AttentionName": "Warehouse Service",
                "Phone": {
                    "Number": "+12670000000"
                },
                "ShipperNumber": "XXXXXX",
                "Address": {
                    "AddressLine": "123 Example ave.",
                    "City": "Trevose, PA",
                    "StateProvinceCode": "PA",
                    "PostalCode": "19053",
                    "CountryCode": "US"
                },
                "TaxIdentificationNumber": "xx",
                "VendorInfo": {
                    "VendorCollectIDTypeCode": "xx",
                    "VendorCollectIDNumber": "xx",
                    "ConsigneeType": "01"
                }
            }
        },
        "LabelSpecification": {
            "LabelImageFormat": {
                "Code": "GIF",
                "Description": "GIF"
            }
        }
    }
}

Issue Description:

In earlier versions of the API (which are deprecated but still functional), I successfully used "LBS" as the Unit of Measurement (UOM) for the Package container, and everything worked as expected. However, in the latest version, this approach no longer seems valid for Worldwide Economy (WWE), as it does for Mail Innovations service. According to the documentation and my testing, "OZS" is the only acceptable UOM for WWE now.

When I include "OZS" as the UOM, I receive the aforementioned error. I am aware of the ShipmentTotalWeight container, which is typically used in some Rating API requests. Adding this container to my shipment creation request does not resolve the issue. Additionally, all US domestic services (including Mail Innovations) process without any problems, and labels are generated as expected.

I also attempted to use Request -> SubVersion without success. Request for Assistance:

Has anyone else encountered and resolved this issue? Any guidance on how to correctly specify the Unit of Measurement for WWE DDU in the latest API version would be greatly appreciated.

Thank you for your support and assistance.

nightcoding2021 commented 3 months ago

Have you tried using KGS for the UOM?

I'm converting between international Imperial, US Imperial, and metric all the time depending which API and UOM I'm working with.

UPSRahul commented 1 month ago

Hi, thank you for your comment. In order to investigate this, we require more information. Please reach out to the UPS Help Desk via the information here: https://developer.ups.com/contactus.