UPS - Create Shipment / Label
Description
Section titled “Description”This module creates a shipment in UPS through the Shipments v1 API. It receives the shipper and recipient data in JSON format, service code, weight, optional dimensions, label format, and reference. It builds the complete ShipmentRequest payload including payment information (bill to shipper), label specification, and package details. It makes a POST request to the /api/shipments/v1/ship endpoint and returns the tracking number, base64 label, total charges, and currency.
Configuration
Section titled “Configuration”| Parameter | Type | Required | Description |
|---|---|---|---|
| credentials_id | credentials | Yes | UPS credential (provider: ups) |
| shipper | textarea | Yes | Shipper data in JSON with Name, ShipperNumber, and Address |
| ship_to | textarea | Yes | Recipient data in JSON with Name and Address |
| service_code | select | Yes | Service code: 01 (Next Day Air), 02 (2nd Day Air), 03 (Ground), 07 (Express), 08 (Expedited), 11 (Standard), 65 (Saver) |
| package_weight | text | Yes | Package weight in kilograms |
| package_dimensions | textarea | No | Dimensions in JSON (Length, Width, Height) |
| label_format | select | No | Label format: PDF (default), PNG, ZPL, GIF |
| reference | text | No | Internal shipment reference |
Credentials
Section titled “Credentials”A ups type credential is required with the following fields:
- client_id: UPS API Client ID
- client_secret: UPS API Client Secret
- account_number: UPS account number (optional, can be in the shipper JSON)
Credentials are obtained from the UPS Developer Portal (https://developer.ups.com/).
Output
Section titled “Output”{ "success": true, "tracking_number": "1Z999AA10123456784", "shipment_id": "1Z999AA10123456784", "label_base64": "iVBORw0KGgo...", "label_format": "PDF", "total_charges": "25.50", "currency": "EUR", "service_code": "11", "status": "CREATED", "message": "Envio UPS creado - Tracking: 1Z999AA10123456784"}Usage Example
Section titled “Usage Example”Basic case
Section titled “Basic case”{ "credentials_id": "mi_credencial_ups", "shipper": "{\"Name\":\"Mi Empresa\",\"ShipperNumber\":\"ABC123\",\"Address\":{\"AddressLine\":[\"Calle Gran Via 1\"],\"City\":\"Madrid\",\"StateProvinceCode\":\"M\",\"PostalCode\":\"28001\",\"CountryCode\":\"ES\"}}", "ship_to": "{\"Name\":\"Cliente\",\"Address\":{\"AddressLine\":[\"Av Diagonal 100\"],\"City\":\"Barcelona\",\"PostalCode\":\"08001\",\"CountryCode\":\"ES\"}}", "service_code": "11", "package_weight": "2.5", "label_format": "PDF"}API Used
Section titled “API Used”- Endpoint: POST
/api/shipments/v1/ship - Base: UPS API (via helper
_upsHelper) - Documentation: https://developer.ups.com/api/reference
- Authentication uses OAuth2 with client_id and client_secret
- Payment is automatically configured as bill to shipper (BillShipper)
- For ZPL format, the label size is automatically set to 6x4
- The ShipperNumber can come from the shipper JSON or from the credentials
- The API SubVersion is 1801
- Dimensions are expressed in centimeters and weight in kilograms