Issue with UPS API connection

UPS API Integration - 401 “Invalid Authentication Information” Error

Problem Summary

I’m getting a 401 authentication error when trying to create UPS shipments via their API in n8n, despite having OAuth2 credentials configured.

Error Message

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

Current Setup

Workflow Overview:

  1. HTML Form (GET/POST webhooks)

  2. Code node for data parsing

  3. Switch node (label creation vs pickup only)

  4. HTTP Request node for UPS API call

  5. Function node to extract label

  6. Response nodes

HTTP Request Node Configuration:

  • Method: POST

  • URL: https://wwwcie.ups.com/api/shipments/v2403/ship

  • Authentication: Generic Credential Type → OAuth2 API

  • OAuth2 Credential: “Unnamed credential 3” (configured)

  • Headers:

    • Content-Type: application/json

    • Accept: application/json

OAuth2 Credential Configuration

I have an OAuth2 credential configured with:

  • Grant Type: Client Credentials

  • Client ID and Secret from UPS Developer account

  • Using UPS CIE (Customer Integration Environment) for testing

What I’ve Tried

  1. :white_check_mark: Verified UPS account and developer credentials

  2. :white_check_mark: Double-checked client ID and secret

  3. :white_check_mark: Confirmed account number (KX5262) is correct

  4. :cross_mark: Still getting 401 errors

Questions

  1. UPS API Endpoints: Should I be using wwwcie.ups.com (test) or onlinetools.ups.com (production)? Documentation is unclear.

  2. OAuth2 URLs: What are the correct OAuth2 endpoints for UPS?

    • Authorization URL: ?

    • Token URL: ?

  3. Required Headers: Does UPS API require additional headers like transactionId or transId?

  4. Alternative Approach: Should I manually handle OAuth2 token generation instead of using n8n’s built-in OAuth2 authentication?

Environment

  • n8n version: [Current]

  • UPS Environment: CIE (Customer Integration Environment)

  • Region: Germany/Europe

Screenshots

[Error output showing 401 with AxiosError details]

Has anyone successfully integrated UPS shipping API with n8n? Any help would be greatly appreciated!


Tags: #ups #api oauth2 #shipping #authentication #401error

i finally made it work with the following flow. I later had some trouble finding the right API URL from UPS which is https://onlinetools.ups.com/api/shipments/v2403/ship and https://onlinetools.ups.com/security/v2403/oauth/token