Version 3.0.0

Overview

Jscriptz UPSv3 is a modern UPS shipping integration module for Magento 2 that uses UPS's latest REST APIs with OAuth2 authentication. It provides real-time shipping rates, delivery date estimates, and address validation capabilities.

Why UPSv3? This module uses UPS's new REST APIs, which are replacing the legacy XML/SOAP APIs. The new APIs offer better performance, OAuth2 security, and additional features like Time in Transit.

Requirements

  • Magento 2.4.x
  • PHP 8.1 or higher
  • UPS Developer Account with API credentials
  • UPS Account Number (shipper number)

Features

Real-Time Rates

Get accurate shipping rates directly from UPS Rating API with support for negotiated rates.

Time in Transit

Show estimated delivery dates for each shipping method to help customers choose.

Address Validation

Validate shipping addresses to reduce delivery failures and returns.

OAuth2 Security

Modern authentication with automatic token management and secure credential storage.

Smart Caching

Rate caching with configurable TTL and fallback to cached rates when API is unavailable.

Flexible Configuration

Configure allowed methods, handling fees, free shipping thresholds, and more.

Installation

Prerequisites

  • Magento 2.4.4 or higher
  • PHP 8.1 or higher
  • Composer 2.x
  • Valid Jscriptz license (purchased from mage.jscriptz.com)

Step 1: Get Your Composer Access Token

After purchasing the extension, log in to your Jscriptz account to get your Composer authentication token:

Login to Your Account

Go to mage.jscriptz.com/customer/account

Access GitHub Access Page

Click on GitHub Access in the left sidebar

Generate Token

Click Generate New Token and copy the token. It's valid for 50 minutes.

Step 2: Configure Composer Authentication

Create or update your auth.json file in your Magento root directory:

{
    "http-basic": {
        "packages.jscriptz.com": {
            "username": "YOUR_LICENSE_KEY",
            "password": "YOUR_ACCESS_TOKEN"
        }
    }
}

Replace YOUR_LICENSE_KEY with your license key from My Licenses page, and YOUR_ACCESS_TOKEN with the token from Step 1.

Step 3: Install via Composer

# Add the Jscriptz repository (first time only)
composer config repositories.jscriptz composer https://packages.jscriptz.com

# Install UPSv3 (includes ShippingCore dependency)
composer require jscriptz/module-upsv3

Step 4: Run Magento Setup

# Enable the modules
bin/magento module:enable Jscriptz_ShippingCore Jscriptz_UPSv3

# Run setup upgrade
bin/magento setup:upgrade

# Compile DI (production mode)
bin/magento setup:di:compile

# Deploy static content (production mode)
bin/magento setup:static-content:deploy -f

# Clear cache
bin/magento cache:flush

Step 5: Activate Your License

After installation, activate your license in the Magento admin:

Navigate to Configuration

Go to Stores → Configuration → Sales → Shipping Methods → Jscriptz UPSv3

Enter License Key

Expand the License section and enter your license key from your Jscriptz License Account

Verify License

Click Save Config, then click Verify License to confirm activation. You'll see a green "Active" badge when successful.

Domain Verification: Your license is tied to the domain(s) you specified during purchase. If you see a "Domain mismatch" error, update your domains in your License Account.

UPS Developer Portal Setup

Before configuring the module in Magento, you need to set up your application on the UPS Developer Portal to obtain API credentials.

Step 1: Create a UPS Developer Account

Go to UPS Developer Portal

Navigate to https://developer.ups.com

Sign In or Register

Use your existing UPS.com credentials or create a new account. Your UPS.com login works for the Developer Portal.

Step 2: Create an Application

Navigate to My Apps

Click "My Apps" in the top navigation bar.

UPS Developer Portal - My Apps
My Apps page in UPS Developer Portal

Create New App

Click "Add Apps" or "Create New App" button. Enter a name for your application (e.g., "Magento Store Integration").

Select Billing Account

Choose your UPS account number that will be used for billing and shipments.

Add the Rating API

In the "Add Products" section, search for "Rating" and enable it. This is required for getting shipping rates.

Step 3: Add Additional APIs

After creating your app, you can add more APIs for enhanced functionality:

Click Edit App

From your app details page, click the "Edit App" button.

UPS App Details
App details showing credentials and current APIs

Search for Time in Transit

In the "Add Products" panel, search for "Time in Transit" and toggle it on.

Search Time in Transit
Adding Time in Transit API to your application

Search for Address Validation

Search for "Address Validation" and toggle it on for address verification capabilities.

Search Address Validation
Adding Address Validation API

Save Your Changes

Click "Save" to submit your changes. APIs are typically approved instantly.

All APIs Approved
All APIs approved and ready to use
APIs Ready! Once all APIs show "approved" status, copy your Client ID and Client Secret for use in Magento configuration.

Magento Configuration

Navigate to Stores > Configuration > Sales > Shipping Methods > UPS V2 to configure the module.

General Settings

Setting Description Default
active Enable or disable the UPS V2 carrier No
title Carrier title shown to customers at checkout UPS
environment API environment: Sandbox (testing) or Production Sandbox
Testing First! Always test in Sandbox mode before switching to Production. Sandbox uses test API endpoints that won't affect real shipments.

API Credentials

Setting Description
client_id OAuth Client ID from UPS Developer Portal
client_secret OAuth Client Secret from UPS Developer Portal
account_number Your UPS Account/Shipper Number (e.g., 10H42B)

Shipping Options

Setting Description Default
allowed_methods Select which UPS services to offer customers All
package_type Default package type (Customer Packaging, UPS Letter, etc.) 02 (Customer Packaging)
max_weight Maximum package weight in pounds 150
handling_fee Additional fee added to each shipping rate 0.00
free_shipping_threshold Cart subtotal for free shipping (0 = disabled) 0

Time in Transit Settings

Setting Description Default
transit_enabled Show estimated delivery dates with shipping methods No
pickup_days Days of the week when UPS picks up packages Mon-Fri
cutoff_time Daily cutoff time for same-day shipping (24hr format) 14:00
Cutoff Time Example If cutoff is 14:00 (2 PM) and a customer orders at 3 PM on Monday, the ship date will be Tuesday (assuming Tuesday is a pickup day).

Per-Service Cutoff Times

Configure different cutoff times for different UPS services. Express services typically have later cutoffs than Ground services.

Setting Description Default
cutoff_time_source Source for cutoff times: "config" (use per-service JSON) or "default" (use single cutoff time) default
cutoff_time_json JSON object mapping service codes to cutoff hours (24-hour format) {"03": 14, "12": 14, "02": 16, "59": 16, "01": 17, "13": 17, "14": 10}

Per-Service Cutoff JSON Format

The JSON maps UPS service codes to their cutoff hour in 24-hour format:

{
    "03": 14,  // Ground - 2:00 PM
    "12": 14,  // 3 Day Select - 2:00 PM
    "02": 16,  // 2nd Day Air - 4:00 PM
    "59": 16,  // 2nd Day Air A.M. - 4:00 PM
    "01": 17,  // Next Day Air - 5:00 PM
    "13": 17,  // Next Day Air Saver - 5:00 PM
    "14": 10   // Next Day Air Early - 10:00 AM
}
Fallback Behavior If a service code is not in the JSON, the default cutoff_time setting is used.

Rate Caching

Setting Description Default
cache_enabled Cache API responses to reduce API calls Yes
cache_ttl Cache lifetime in seconds 3600 (1 hour)
cache_fallback Use expired cache if API fails Yes

Label Generation

UPSv3 provides full label generation capabilities directly from the Magento admin. Create shipping labels, view/download them, and void shipments when needed.

Creating Shipping Labels

After an order is shipped, you can create UPS shipping labels from the shipment view page in admin.

Navigate to Shipment

Go to Sales > Shipments and click on the shipment you want to create a label for.

Click Create Shipping Label

In the "Shipping and Tracking Information" section, click the Create Shipping Label button.

Label Created

The label will be generated via UPS API. You'll see:

  • View Label - Opens label in new tab (PDF or GIF format)
  • Download Label - Downloads the label file
  • Tracking Number - Auto-added to the shipment

Label Configuration

Setting Description Default
label_format Output format: GIF (thermal printers) or PDF GIF
label_size Label dimensions: 4x6, 4x8, etc. 4x6

Canceling/Voiding Labels

If you need to void a shipment (e.g., order cancelled, wrong address), you can cancel it directly from admin.

Navigate to Shipment

Go to the shipment that has a label you want to cancel.

Click Cancel Shipment

Click the Cancel Shipment button. Confirm the action when prompted.

Label Voided

The label is voided with UPS and the tracking number is removed from the shipment. You can then create a new label if needed.

Void Window Labels can only be voided before the package is picked up by UPS. Once scanned, the shipment cannot be cancelled through the API.

Webhook Tracking

UPSv3 supports real-time tracking updates via UPS Track Alert webhooks. When enabled, UPS sends tracking events directly to your Magento store as they happen—no polling required.

Real-Time Updates

Receive tracking events instantly as they happen—picked up, in transit, delivered.

Email Notifications

Automatically send tracking update emails to customers for key events.

Full History

Complete tracking timeline stored in database and displayed in admin and storefront.

Webhook Setup

UPS Developer Portal Requirements

Before enabling webhooks, add the Track Alert API to your UPS application:

  1. Go to developer.ups.com
  2. Navigate to My Apps and edit your application
  3. Search for "Track Alert" in Add Products
  4. Enable the API and save your changes

Magento Configuration

Navigate to Stores > Configuration > Jscriptz > Jscriptz UPSv3 > Webhook Tracking

Setting Description Default
webhook_enabled Enable webhook tracking functionality No
webhook_subscription_type Subscription type: "tracking" (per-shipment) or "account" (all shipments) tracking
webhook_send_emails Send customer email notifications for tracking updates Yes
webhook_email_events Which events trigger emails (picked_up, out_for_delivery, delivered, exception) All

Register Webhook

After enabling webhook tracking, use the Register Webhook button in the configuration to set up the webhook with UPS. The status will show:

  • Registered - Webhook is active and receiving events
  • Not Configured - Click Register to set up
  • Per-Shipment - Webhooks registered automatically per tracking number
Per-Shipment vs Account Webhooks

Per-Shipment (tracking): Webhooks are registered for each tracking number when labels are created. Best for most stores.

Account-Level (account): Single webhook for all shipments on your UPS account. Requires additional UPS approval.

Tracking Events

The following tracking event types are captured and stored:

Event Type Description Email
label_created Shipping label created, awaiting pickup Optional
picked_up Package picked up by UPS Yes
in_transit Package in transit (scanned at facility) Optional
out_for_delivery Out for delivery today Yes
delivered Package delivered Yes
exception Delivery exception (failed attempt, address issue) Yes

Admin Tracking History

View complete tracking history in admin by navigating to Sales > Shipments and viewing a UPS shipment. The "UPS Tracking History" section shows all events with timestamps and locations.

Customer Tracking View

Customers can view their tracking history on the frontend order shipment page. The tracking timeline displays all events with:

  • Current delivery status with visual indicator
  • Full event timeline with timestamps
  • Location information for each scan
  • Direct link to track on UPS.com
  • Proof of delivery photo (when available)
  • Signature confirmation (when captured)
Guest Orders Supported Tracking history is available for both logged-in customers and guest orders via the "Orders and Returns" lookup.

Webhook Simulator (Sandbox Testing)

Test your UPS webhook integration without creating real shipments. The webhook simulator lets you send mock tracking events to verify your setup is working correctly before going live.

Sandbox Mode Required The webhook simulator is only available when UPSv3 is configured in Sandbox mode with webhooks enabled.

Requirements

  • Environment: Set to Sandbox (Stores > Configuration > Jscriptz > Jscriptz UPSv3 > General > Environment)
  • Webhook Tracking: Enabled (Webhook Tracking > Enable Webhook Tracking = Yes)
  • Simulator Enabled: Yes (Stores > Configuration > Jscriptz > Shipping Preferences > Webhook Testing)

Accessing the Simulator

  1. Navigate to Stores > Configuration > Jscriptz > Shipping Preferences
  2. Expand the Webhook Testing (Sandbox) section
  3. Ensure "Enable Webhook Simulator" is set to Yes
  4. Select UPS from the Carrier dropdown

Available Event Types

Event Description
Label Created / Shipment Ready Shipping label created, package ready for pickup
Picked Up Package picked up by UPS driver
Arrived at UPS Facility Package arrived at a UPS facility
Departed UPS Facility Package left a UPS facility
In Transit Package in transit to destination
Out for Delivery Package on UPS vehicle for delivery
Delivered Package delivered (includes POD photo simulation)
Delivery Exception Unable to deliver (weather, access issue, etc.)
Return to Sender Package being returned to sender

Running a Simulation

Select Carrier and Event

Choose UPS from the Carrier dropdown, then select the event type you want to simulate.

Enter Tracking Number (Optional)

Leave empty to auto-generate a mock tracking number, or enter a real tracking number from an existing UPS shipment to test with actual order data.

Click "Send Test Webhook"

The simulator sends a mock webhook to your store's UPS webhook endpoint.

Verify Results

Check that:

  • Success message appears in admin
  • Tracking event appears in shipment tracking history (if using real tracking number)
  • Customer email notification sent (check email logs or inbox)

Testing with Real Shipment Data

For the most realistic testing:

  1. Go to Sales > Shipments and find a UPS shipment
  2. Copy the UPS tracking number
  3. Paste it into the simulator's tracking number field
  4. Simulate events like "In Transit" or "Delivered"
  5. View the shipment to see tracking events appear in history
POD Photo Simulation When simulating a "Delivered" event, the simulator includes mock proof-of-delivery photo URLs if POD photos are enabled in your webhook configuration.

UPS Service Codes

The following UPS services are supported by this module:

Code Service Name Type
01 Next Day Air Express
02 2nd Day Air Express
03 Ground Standard
12 3 Day Select Select
13 Next Day Air Saver Express
14 Next Day Air Early Express
59 2nd Day Air A.M. Express
65 Saver International

Troubleshooting

No Shipping Rates Displayed

  • Verify API credentials are correct
  • Check that the carrier is enabled (active = Yes)
  • Ensure environment matches your credentials (Sandbox vs Production)
  • Check var/log/jscriptz_upsv3.log for API errors
  • Verify shipping origin is configured in Magento (Stores > Configuration > Sales > Shipping Settings > Origin)

Authentication Errors (401)

  • Verify Client ID and Client Secret are correct
  • Check that the API is approved in your UPS Developer Portal app
  • Clear Magento cache: bin/magento cache:clean

Time in Transit Not Showing

  • Ensure transit_enabled is set to Yes
  • Verify "Time In Transit" API is added and approved in UPS Developer Portal
  • Check that pickup days and cutoff time are configured

Label Generation Issues

  • Ensure "Shipping" API is enabled in your UPS Developer Portal app
  • Verify shipper address is complete and valid
  • Check that package weight doesn't exceed service limits
  • For void errors, verify the label hasn't been scanned by UPS yet

Webhook Not Receiving Events

  • Verify "Track Alert" API is enabled in UPS Developer Portal
  • Check that your store URL is accessible from the internet (not localhost)
  • Ensure SSL certificate is valid (UPS requires HTTPS)
  • Check var/log/jscriptz_upsv3.log for webhook errors
  • For per-shipment webhooks, tracking is only received for labels created after enabling

Debug Mode

Enable debug mode to log all API requests and responses:

bin/magento config:set carriers/upsv3/debug 1
bin/magento cache:clean config

Logs are written to: var/log/jscriptz_upsv3.log

API Reference

This module uses the following UPS REST API endpoints:

API Sandbox URL Production URL
OAuth Token wwwcie.ups.com/security/v1/oauth/token onlinetools.ups.com/security/v1/oauth/token
Rating wwwcie.ups.com/api/rating/v2205/Shop onlinetools.ups.com/api/rating/v2205/Shop
Time in Transit wwwcie.ups.com/api/shipments/v1/transittimes onlinetools.ups.com/api/shipments/v1/transittimes
Address Validation wwwcie.ups.com/api/addressvalidation/v1/1 onlinetools.ups.com/api/addressvalidation/v1/1
Shipping (Label) wwwcie.ups.com/api/shipments/v1/ship onlinetools.ups.com/api/shipments/v1/ship
Void Shipment wwwcie.ups.com/api/shipments/v1/void/cancel/{shipmentId} onlinetools.ups.com/api/shipments/v1/void/cancel/{shipmentId}
Track Alert (Subscribe) wwwcie.ups.com/api/track/v1/subscription/package onlinetools.ups.com/api/track/v1/subscription/package
Track Alert (Status) wwwcie.ups.com/api/track/v1/subscription onlinetools.ups.com/api/track/v1/subscription
Track Alert (Delete) wwwcie.ups.com/api/track/v1/subscription/{subscriptionId} onlinetools.ups.com/api/track/v1/subscription/{subscriptionId}

Useful Commands

# Check current configuration
bin/magento config:show carriers/upsv3

# Enable the carrier
bin/magento config:set carriers/upsv3/active 1

# Switch to production
bin/magento config:set carriers/upsv3/environment production

# Clear cache after changes
bin/magento cache:clean config

ShippingCore Integration

UPSv3 integrates with the Jscriptz_ShippingCore companion module to provide enhanced admin and checkout features.

Companion Module: ShippingCore is a separate module that enhances the shipping experience for all Jscriptz carrier modules (UPSv3, FEDEXv3, USPSv3). Install it alongside your carrier modules to unlock these features.

Enhanced Shipments Grid

ShippingCore extends the Sales > Shipments grid with additional columns and mass actions:

Additional Columns

Column Description
Tracking Number All tracking numbers for the shipment
Carrier The carrier name (UPS, FedEx, USPS)
Label Status "Has Label" or "No Label" indicator
Tracking Status "Sent" or "Not Sent" for tracking emails
Shipping Price The order's shipping amount
Label Quick links to view/download or create labels

Mass Actions

  • Send Tracking Info: Bulk send tracking emails to customers
  • Create Shipping Label: Generate labels for multiple shipments
    • Combined PDF: All labels in a single file
    • ZIP of Separate PDFs: Individual label files
  • Create Label + Send Tracking: Combined workflow for efficiency

Checkout Features

  • Carrier Logos: Official UPS logo at checkout instead of text
  • Transit Badges: "Fastest" and "Best Value" badges on shipping methods
  • Cutoff Countdown: "Order within X hours" timer
  • Delivery Preferences: Signature and location options
  • Dark Mode Support: Automatic adaptation to user preferences

For complete documentation, see the ShippingCore User Guide.