UPS (Apps step)

Updated Nov 23, 2026
DataMagik Automate

UPS

Tracks UPS packages, quotes rates, creates shipments with labels and checks US addresses through the UPS REST APIs.

Use it to ship and follow UPS packages from a workflow: print a label when an order is packed, compare service prices before choosing one, or check every open shipment's tracking status each morning.

Beta. This step has not yet been checked against a live UPS account, so treat its first runs as a test, and tell us if an operation does not answer as described.

Find it in the workflow editor's palette under Apps. See Apps steps for what every Apps step has in common.

Set it up

  1. Sign in at developer.ups.com with the UPS account the plant ships on, open Apps › Add Apps, link your UPS shipper account number and add the Tracking, Rating, Shipping and Address Validation products the workflow uses.
  2. Copy the app's Client ID and Client Secret.
  3. In DataMagik, open Script Engine › Credentials and add an OAuth 2.0 credential with grant "Client credentials", the Client ID and Client Secret, token URL https://onlinetools.ups.com/security/v1/oauth/token, the client sent as a Basic header, and the scope left empty.
  4. Add onlinetools.ups.com (or wwwcie.ups.com for the UPS test environment) to Allowed Domains in the workflow's Script settings.

Credential: An OAuth 2.0 client credentials credential for an app on developer.ups.com: its Client ID and Client Secret, sent as a Basic header to the UPS token URL.

Signing in with OAuth 2.0

Grant typeClient credentials
Token URLhttps://onlinetools.ups.com/security/v1/oauth/token
ScopeLeave it empty.

UPS takes no scope, so leave the credential's Scope empty. Send the client as a Basic header (the credential's default). For the test environment use the token URL https://wwwcie.ups.com/security/v1/oauth/token in a second credential. The app signs in as itself, so no one clicks Connect.

Hosts it calls: onlinetools.ups.com, wwwcie.ups.com

Connection

FieldRequiredWhat to put
UPS environmentYesonlinetools.ups.com for real shipments; wwwcie.ups.com for the UPS test environment, which makes sample labels that are never billed (its credential's token URL is https://wwwcie.ups.com/security/v1/oauth/token). For example onlinetools.ups.com.

Operations

OperationWhat it does
Tracking › TrackReads the status and scan history of one package by its tracking number.
Rating › RateQuotes the price of a shipment for one UPS service, or for every service at once (Shop).
Shipping › ShipCreates a shipment and its labels; on onlinetools.ups.com the shipment is real and billed to the account.
Address › ValidateChecks a US or Puerto Rico street address, suggests corrected ones and can tell a business from a residence.

Tracking › Track

Reads the status and scan history of one package by its tracking number.

Calls GET /track/v1/details/{inquiryNumber}.

FieldRequiredWhat to put
Tracking numberYesThe package's UPS tracking number, such as 1Z999AA10123456784. For example 1Z999AA10123456784.
LanguageNoThe language of the status descriptions, as language_COUNTRY: en_US, es_MX, fr_CA.
Transaction IDNoAn ID for this request, at most 32 characters, that UPS logs. The default is the time and the item's position, unique for each call.
Transaction sourceNoThe name of the application calling UPS, which UPS logs.

What comes out: One item: UPS's answer, with the package under {{ $json.trackResponse.shipment[0].package[0] }}: its {{ $json.trackResponse.shipment[0].package[0].currentStatus.description }} (such as Delivered), {{ $json.trackResponse.shipment[0].package[0].deliveryDate }} and {{ $json.trackResponse.shipment[0].package[0].activity }}, the list of scans with their location, status, date and time.

Example: Track {{ $json.tracking_no }} for each open shipment and email the customer service team the ones whose status is an exception.

Rating › Rate

Quotes the price of a shipment for one UPS service, or for every service at once (Shop).

Calls POST /rating/{version}/{requestoption}.

FieldRequiredWhat to put
API versionYesThe version of the UPS API, as in the UPS reference's address for it, such as v2409.
Rate forYesRate prices the service named in Service.Code; Shop prices every service UPS offers between the two addresses. One of: The service in the request, Every available service.
Rate requestYesThe whole request body: a RateRequest object as in the UPS Rating API reference. Service code 03 is Ground, 02 is 2nd Day Air, 01 is Next Day Air; packaging 02 is your own box. For example {"RateRequest": {"Shipment": {"Shipper": {"ShipperNumber": "A1B2C3", "Address": {"PostalCode": "46526", "CountryCode": "US"}}, "ShipTo": {"Address": {"PostalCode": "{{ $json.zip }}", "CountryCode": "US"}}, "ShipFrom": {"Address": {"PostalCode": "46526", "CountryCode": "US"}}, "Service": {"Code": "03"}, "Package": {"PackagingType": {"Code": "02"}, "PackageWeight": {"UnitOfMeasurement": {"Code": "LBS"}, "Weight": "{{ $json.weight }}"}}}}}.
Transaction IDNoAn ID for this request, at most 32 characters, that UPS logs. The default is the time and the item's position, unique for each call.
Transaction sourceNoThe name of the application calling UPS, which UPS logs.

What comes out: One item: UPS's answer. {{ $json.RateResponse.RatedShipment }} holds the quote (a list of quotes, one per service, for Shop), each with {{ $json.RateResponse.RatedShipment.Service.Code }} and {{ $json.RateResponse.RatedShipment.TotalCharges.MonetaryValue }}; with negotiated rates on the account, NegotiatedRateCharges.TotalCharge holds your price.

Example: Shop the rates for each order's ZIP code and weight, then pick the cheapest service that arrives by the promised date.

Shipping › Ship

Creates a shipment and its labels; on onlinetools.ups.com the shipment is real and billed to the account.

Calls POST /shipments/{version}/ship.

FieldRequiredWhat to put
API versionYesThe version of the UPS API, as in the UPS reference's address for it, such as v2409.
Shipment requestYesThe whole request body: a ShipmentRequest object as in the UPS Shipping API reference. LabelImageFormat GIF gives an image; ZPL or EPL gives a label ready for a thermal printer. For example {"ShipmentRequest": {"Shipment": {"Shipper": {"Name": "Acme Plant 1", "ShipperNumber": "A1B2C3", "Address": {…}}, "ShipTo": {"Name": "{{ $json.customer }}", "Address": {…}}, "PaymentInformation": {"ShipmentCharge": {"Type": "01", "BillShipper": {"AccountNumber": "A1B2C3"}}}, "Service": {"Code": "03"}, "Package": {"Packaging": {"Code": "02"}, "PackageWeight": {"UnitOfMeasurement": {"Code": "LBS"}, "Weight": "{{ $json.weight }}"}}}, "LabelSpecification": {"LabelImageFormat": {"Code": "ZPL"}, "LabelStockSize": {"Height": "6", "Width": "4"}}}}.
Transaction IDNoAn ID for this request, at most 32 characters, that UPS logs. The default is the time and the item's position, unique for each call.
Transaction sourceNoThe name of the application calling UPS, which UPS logs.

What comes out: One item: UPS's answer. {{ $json.ShipmentResponse.ShipmentResults.ShipmentIdentificationNumber }} is the shipment's number and {{ $json.ShipmentResponse.ShipmentResults.PackageResults }} the package (a list when the shipment has several): its {{ $json.ShipmentResponse.ShipmentResults.PackageResults.TrackingNumber }}, and the label in {{ $json.ShipmentResponse.ShipmentResults.PackageResults.ShippingLabel.GraphicImage }} as base64 text in the format the request asked for (GIF, ZPL or EPL), not a file.

Example: When an order is packed, Ship it with a ZPL label, save the tracking number on the order, and send the decoded GraphicImage to the dock's Zebra printer.

Address › Validate

Checks a US or Puerto Rico street address, suggests corrected ones and can tell a business from a residence.

Calls POST /addressvalidation/{avVersion}/{avRequestOption}.

FieldRequiredWhat to put
Address API versionYesThe version of the UPS Address Validation API, as in the UPS reference's address for it, such as v2.
CheckYesWhat UPS checks: whether the address is valid (with suggestions), whether it is a business or a residence, or both. One of: The address, Business or residence, Both.
Address requestYesThe whole request body: an XAVRequest object as in the UPS Address Validation API reference. PoliticalDivision2 is the city and PoliticalDivision1 the state. For example {"XAVRequest": {"AddressKeyFormat": {"AddressLine": ["{{ $json.street }}"], "PoliticalDivision2": "{{ $json.city }}", "PoliticalDivision1": "{{ $json.state }}", "PostcodePrimaryLow": "{{ $json.zip }}", "CountryCode": "US"}}}.
Transaction IDNoAn ID for this request, at most 32 characters, that UPS logs. The default is the time and the item's position, unique for each call.
Transaction sourceNoThe name of the application calling UPS, which UPS logs.

What comes out: One item: UPS's answer. {{ $json.XAVResponse.ValidAddressIndicator }} is there (as an empty value) when the address is valid, {{ $json.XAVResponse.AmbiguousAddressIndicator }} when UPS has several suggestions and {{ $json.XAVResponse.NoCandidatesIndicator }} when it has none; {{ $json.XAVResponse.Candidate }} holds the suggested addresses, and {{ $json.XAVResponse.AddressClassification.Description }} says Commercial or Residential.

Example: Validate each new customer ship-to address before the first order ships, and send the ones with no candidates to customer service to correct.

Example

A Schedule trigger lists yesterday's shipped orders from Plex; UPS › Track reads each tracking number, and the ones whose {{ $json.trackResponse.shipment[0].package[0].currentStatus.description }} is Delivered are marked delivered in the order's lookup table row.

Tips

  • The Rate, Ship and Validate address bodies are the JSON UPS documents for each API (RateRequest, ShipmentRequest, XAVRequest); copy the example from the UPS API reference and put {{ }} expressions where the order's values go.
  • Your UPS account number goes in the body as ShipperNumber (Shipper.ShipperNumber in Rate and Ship, and PaymentInformation.ShipmentCharge.BillShipper.AccountNumber in Ship).
  • Transaction ID and Transaction source are sent on every call; UPS Track requires them. The defaults give each call its own ID, so leave them unless UPS support asks for something else.
  • Ship creates a real, billed shipment on onlinetools.ups.com, on test runs too: build and test the workflow against wwwcie.ups.com first.

Settings every Apps step has

  • More query parameters: any query parameter the fields do not offer, sent as is.
  • More body fields: a JSON object merged into the request body; nested objects merge, other values replace.
  • Most requests per second: spaces the calls out for rate limits. A "too many requests" (429) answer is retried after the wait the API asks for.
  • Most pages: for operations that follow pages, the most pages to fetch (10 unless you change it, up to 100). The run warns when it stops with more to get.
  • Fail on a non-2xx response: on by default. Turn it off to handle errors yourself.

UPS's own API documentation: https://developer.ups.com/catalog

Was this page helpful?