oauth-2.0integrationups

UPS Outh Rating API return Invalid Authentication Information


I am facing an issue in UPS Rating API integration. My request body is:

{
    "RateRequest": {
        "shipper": {
            "address": {
                "postal_code": "12345",
                "country_code": "US"
            }
        },
        "shipTo": {
            "address": {
                "postal_code": "54321",
                "country_code": "US"
            }
        },
        "shipment": {
            "package": {
                "dimensions": {
                    "unit_of_measurement": "IN",
                    "length": "10",
                    "width": "6",
                    "height": "4"
                },
                "weight": {
                    "unit_of_measurement": "LBS",
                    "weight": "1"
                }
            }
        }
    }
}

URL - https://wwwcie.ups.com/api/rating/v1/Rate?additionalinfo=string

Even though I'm passing an access-token in header it always returns:

{
    "response": {
        "errors": [
            {
                "code": "250002",
                "message": "Invalid Authentication Information."
            }
        ]
    }
}

Solution

  • I found the answer. I didn't add Rating API permission to my app. That was the issue. After adding, it's working fine.

    To add the Rating API, login to your developer account and go to your Apps page at

    https://developer.ups.com/apps?loc=en_US

    Then edit your app and add the Rating API.