Closed beta · run Worlds on your machineBrowse worlds →
Docs menu · UPS API

Worlds / Logistics

UPS API

A local UPS with shipments, labels, tracking activity, delivery windows and address validation. Test the customer service agent that tracks packages, changes deliveries and files returns.

Base path
/api
Auth
OAuth 2.0 client credentials bearer token, the world key
Endpoints
13
Status
Active today

This reference previews the surface the UPS world serves in the closed beta. Paths mirror the public UPS API; the exact subset is confirmed when your workflow is scoped.

Connect

The run gives your agent these bindings. Keep your SDK; change only where it sends requests.

bindingmeaning
WORLDS_UPS_URLThis world's origin followed by /api
WORLDS_API_KEYThe world key, accepted wherever UPS expects a credential
WORLDS_WORLD_IDThe isolated world's identity
js · fetch
const base = process.env.WORLDS_UPS_URL + "/api";

const res = await fetch(base + "/track/v1/details/1Z999AA10123456784?locale=en_US", {
  headers: {
    Authorization: "Bearer " + process.env.WORLDS_API_KEY,
    transId: "agent-001",
    transactionSrc: "sparta",
  },
});

const { trackResponse } = await res.json();

API reference

Tracking

Package tracking details.

  • GET/api/track/v1/details/{inquiryNumber}Get tracking details
  • GET/api/track/v1/reference/details/{referenceNumber}Track by reference
Fields · 5
trackingNumberstring1Z tracking number
packageobject[]Package activity and status
currentStatusobjectDescription and code
deliveryDateobject[]Scheduled or actual date
activityobject[]Scan events

Rating

Rates and transit estimates.

  • POST/api/rating/v2205/RateGet a rate for one service
  • POST/api/rating/v2205/ShopCompare all services
  • POST/api/shipments/v1/transittimesGet time in transit
Fields · 4
ServiceobjectService code
TotalChargesobjectCurrency and amount
GuaranteedDeliveryobjectGuaranteed days
RatedPackageobject[]Per-package charges

Shipping

Create and void shipments and labels.

  • POST/api/shipments/v2205/shipCreate a shipment
  • DELETE/api/shipments/v2205/void/cancel/{shipmentidentificationnumber}Void a shipment
  • POST/api/labels/v1/recoveryRecover a label
Fields · 4
ShipmentIdentificationNumberstringShipment id
PackageResultsobject[]Tracking number and label
ShipmentChargesobjectCharge breakdown
ShipToobjectRecipient

Address validation

Street-level address checks.

  • POST/api/addressvalidation/v2/{requestoption}Validate an address
  • POST/api/locations/v2/search/availabilities/{reqOption}Find access point locations
Fields · 4
ValidAddressIndicatorstringAddress is valid
AmbiguousAddressIndicatorstringSeveral matches
Candidateobject[]Suggested addresses
AddressClassificationobjectCommercial or residential

Pickups

Schedule and cancel pickups.

  • POST/api/shipments/v1/pickup/{pickuptype}Create a pickup
  • DELETE/api/shipments/v1/pickup/{CancelBy}Cancel a pickup
  • GET/api/shipments/v1/pickup/pendingList pending pickups
Fields · 5
PRNstringPickup request number
PickupDatestringPickup date, YYYYMMDD
ReadyTimestringReady time
CloseTimestringClose time
PickupAddressobjectPickup address

Test workflow

  1. Prepare. Select the UPS setup for your workflow and review its starting records, including tracking, rating, shipping.
  2. Connect. Configure your agent with this world's URL and key using the SDK example. Check that it reaches the intended API before running a test.
  3. Define. Describe the task, expected final changes and records that must stay untouched. Keep expected outcomes separate from the agent's instructions.
  4. Run and inspect. Use the dashboard or your workflow's generated CLI setup. Review final records and changes, then rerun from the same starting setup with the relevant failure conditions. Use Deployment and CI to automate the same workflow.

What to verify

  • 1Z999AA10123456781 held at the nearest access point
  • 1Z999AA10123456782 redirected to the work address
  • No change requested on 1Z999AA10123456783, it was delivered
  • Return created for 1Z999AA10123456785 linked to its original
  • No delivery change on a package out for delivery

Test file

A task file names the jobs, the policy your agent is given and what the grader reads back from the world's final state. The agent never sees the expected outcomes.

yaml · worlds/tasks.yaml
# worlds/tasks.yaml · UPS
version: 2
connector: ups
seed: ups-starter
mode: isolated
policy: >
  Work the open inquiries. Hold or redirect packages only while they are still
  in transit, explain the exception on the stuck one, and create returns for
  approved requests only.
tasks:
  - id: answer-where-is-my-package-with-tracking-activity
    prompt: Answer where is my package with tracking activity
  - id: redirect-or-hold-packages-before-delivery
    prompt: Redirect or hold packages before delivery
  - id: create-return-shipments-for-approved-returns
    prompt: Create return shipments for approved returns
expected:
  - 1Z999AA10123456781 held at the nearest access point
  - 1Z999AA10123456782 redirected to the work address
  - "No change requested on 1Z999AA10123456783, it was delivered"
  - Return created for 1Z999AA10123456785 linked to its original
  - No delivery change on a package out for delivery
scenarios:
  - token-expires
  - change-not-allowed
  - tracking-not-found

See Tasks and outcomes for every field, and Deployment and CI to run the file on every pull request.

Failure conditions

Each one fires before the handler, at the same step on every run.

conditionwhat the agent sees
token-expiresThe OAuth access token returns 401 mid run
change-not-allowedA delivery change is refused once the package is out for delivery
tracking-not-foundA new label returns no tracking activity yet
rate-limitedTracking calls return 429

Starting data

Start each run from the same records and relationships. The overview below describes the UPS starter; use the setup supplied for your workflow when preparing your own snapshot.

RecordsStarting setup
shipments50 with 1Z tracking numbers
trackingActivity across label created, in transit, out for delivery, delivered and exception
delivery windowsEstimated windows on out for delivery packages
addressesShipper and consignee addresses, some residential
returns6 approved return requests

The record shapes below reuse this world's API field definitions. They show illustrative values and placeholders, not an importable seed. API responses and seed input can differ; include all required records and references in the accepted import format for your workflow.

Tracking records

Tracking

Package tracking details.

FieldTypeMeaning / relationship
trackingNumberstring1Z tracking number
packageobject[]Package activity and status
currentStatusobjectDescription and code
deliveryDateobject[]Scheduled or actual date
activityobject[]Scan events
json · illustrative record shape
{
  "trackingNumber": "<1Z tracking number>",
  "package": [],
  "currentStatus": {},
  "deliveryDate": [],
  "activity": []
}

See tracking operations

Rating records

Rating

Rates and transit estimates.

FieldTypeMeaning / relationship
ServiceobjectService code
TotalChargesobjectCurrency and amount
GuaranteedDeliveryobjectGuaranteed days
RatedPackageobject[]Per-package charges
json · illustrative record shape
{
  "Service": {},
  "TotalCharges": {},
  "GuaranteedDelivery": {},
  "RatedPackage": []
}

See rating operations

Shipping records

Shipping

Create and void shipments and labels.

FieldTypeMeaning / relationship
ShipmentIdentificationNumberstringShipment id
PackageResultsobject[]Tracking number and label
ShipmentChargesobjectCharge breakdown
ShipToobjectRecipient
json · illustrative record shape
{
  "ShipmentIdentificationNumber": "<Shipment id>",
  "PackageResults": [],
  "ShipmentCharges": {},
  "ShipTo": {}
}

See shipping operations

Address validation records

Address validation

Street-level address checks.

FieldTypeMeaning / relationship
ValidAddressIndicatorstringAddress is valid
AmbiguousAddressIndicatorstringSeveral matches
Candidateobject[]Suggested addresses
AddressClassificationobjectCommercial or residential
json · illustrative record shape
{
  "ValidAddressIndicator": "<Address is valid>",
  "AmbiguousAddressIndicator": "<Several matches>",
  "Candidate": [],
  "AddressClassification": {}
}

See address validation operations

Pickups records

Pickups

Schedule and cancel pickups.

FieldTypeMeaning / relationship
PRNstringPickup request number
PickupDatestringPickup date, YYYYMMDD
ReadyTimestringReady time
CloseTimestringClose time
PickupAddressobjectPickup address
json · illustrative record shape
{
  "PRN": "<Pickup request number>",
  "PickupDate": "<Pickup date, YYYYMMDD>",
  "ReadyTime": "<Ready time>",
  "CloseTime": "<Close time>",
  "PickupAddress": {}
}

See pickups operations

See the UPS world in the catalog