MODULE
UPS Shipping API Integration
Integrate UPS shipping services into custom shipping software through a dedicated .NET carrier integration layer. The implementation handles UPS authentication, shipment construction, carrier service selection, sender and receiver information, package dimensions, package weights and multi-package shipments. The shipping workflow prepares UPS shipment data, serializes the request as JSON, communicates with the UPS shipping API and processes the carrier response back into the centralized shipping platform. UPS shipping integration can support shipment creation, shipping label generation, tracking number processing, international shipping requirements and carrier-specific service selection while keeping UPS API communication isolated within the carrier integration layer. This allows UPS to operate as part of a broader multi-carrier shipping platform alongside DHL, DPD and Asendia.
UPS Shipment API Integration — C# / .NET// Sanitized UPS shipping API integration example
var root = new ShipWSSample.Entity.Root();
root.ShipmentRequest = new ShipWSSample.Entity.ShipmentRequest();
root.ShipmentRequest.Request = new ShipWSSample.Entity.Request();
root.ShipmentRequest.Request.RequestOption = "nonvalidate";
root.ShipmentRequest.Shipment = new ShipWSSample.Entity.Shipment();
root.ShipmentRequest.Shipment.Service = new ShipWSSample.Entity.Service();
root.ShipmentRequest.Shipment.Service.Code = shipment.ServiceCode;
root.ShipmentRequest.Shipment.Package = new List<ShipWSSample.Entity.Package>();
var package = new ShipWSSample.Entity.Package();
package.PackageWeight = new ShipWSSample.Entity.PackageWeight();
package.PackageWeight.UnitOfMeasurement = new ShipWSSample.Entity.UnitOfMeasurement();
package.PackageWeight.UnitOfMeasurement.Code = "KGS";
package.PackageWeight.Weight = objPackage.Weight.ToString(CultureInfo.InvariantCulture);
package.Dimensions = new ShipWSSample.Entity.Dimensions();
package.Dimensions.Height = objPackage.Height.ToString(CultureInfo.InvariantCulture);
package.Dimensions.Width = objPackage.Width.ToString(CultureInfo.InvariantCulture);
package.Dimensions.Length = objPackage.Length.ToString(CultureInfo.InvariantCulture);
package.Dimensions.UnitOfMeasurement = new ShipWSSample.Entity.UnitOfMeasurement();
package.Dimensions.UnitOfMeasurement.Code = "CM";
root.ShipmentRequest.Shipment.Package.Add(package);
string json = JsonConvert.SerializeObject(root, Formatting.Indented);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await httpClient.PostAsync(upsShipmentEndpoint, content);
var responseJson = await response.Content.ReadAsStringAsync();
The carrier response can then be processed to extract shipment identifiers, tracking numbers and generated shipping documents. This keeps UPS-specific request and response handling behind the shipping API integration layer while exposing a consistent shipment result to the rest of the application.
UPS Shipping API Integration
UPS Carrier API Integration
UPS Shipment Creation
UPS Authentication
UPS Service Selection
UPS Shipping Label Generation
UPS Shipment Tracking
UPS Tracking Number Processing
UPS Rate and Service Integration
JSON API Communication
Multi-Package Shipment Processing
International Shipping
Carrier Response Processing
C# .NET Integration
Multi-Carrier Shipping Architecture