WP Manifestindependent plugin directory
manifest / ecommerce / live-shipping-rates

Live Shipping Rates (EasyPost)

WooCommerce live shipping rates from EasyPost and the UPS REST API (OAuth), built from scratch in PHP

★ 0stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/riazahmad0027/live-shipping-rates/archive/refs/heads/main.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

Live Shipping Rates for WooCommerce

A custom WooCommerce shipping method that shows live carrier rates at checkout, from the EasyPost API (USPS and more) or directly from the UPS REST API. Built from scratch in PHP as a learning and portfolio project.

Status: version 0.2.0. Works with a demo mode (sample answers in the real API formats) and with real API keys. 30 automated tests pass inside WooCommerce 11.2.

Features

  • WooCommerce shipping method that works per shipping zone (WC_Shipping_Method)
  • Two providers:
    • EasyPost: API key (Basic auth), weight in ounces
    • UPS REST API: OAuth 2.0 client-credentials token, weight in pounds
  • UPS token cached until it expires, with an automatic new token and retry on HTTP 401
  • Handles the UPS "single RatedShipment object" answer (a common cause of broken plugins)
  • Converts the store weight unit (kg, g, lbs, oz) to the unit each carrier needs
  • Default weight for products without a weight
  • Currency multiplier (carrier rates in USD, store in another currency) and markup percent
  • Service filter (show only chosen services), cheapest rate first, delivery days in the label
  • Rates cached for 30 minutes, so the API is not called on every page load
  • Fallback "Standard shipping" price if the API fails or returns nothing
  • Debug mode for shop managers, plus logs in WooCommerce → Status → Logs
  • Demo mode for EasyPost and UPS, for learning without an account

How it works

  1. WooCommerce calls calculate_shipping() with the cart.
  2. The plugin adds up the weight, builds the from and to addresses and the box size.
  3. It asks the carrier API for rates (UPS: gets or reuses an OAuth token first).
  4. It turns the answer into a simple list and adds each rate as a shipping option.

Files

  • live-shipping-rates.php: registers the shipping method
  • includes/class-lsr-shipping-method.php: settings, API calls, parsing, conversion, caching, debug

Setup

  1. Install WooCommerce, then upload and activate this plugin.
  2. Go to WooCommerce → Settings → Shipping, add a zone (for example United States), and add Live rates (EasyPost).
  3. Choose EasyPost or UPS, add your keys (or tick Demo mode), set the ship-from address and box size, and save.
  4. Make sure your products have a weight.

Tested with

WordPress 7.1 and 7.2-alpha, WooCommerce 11.2.1, PHP 8.3.

Author

Riaz Ahmad, WordPress and WooCommerce developer

License

GPL-2.0-or-later