// load the preference object zkups__UPSShipmatePreference__c pref = [SELECT Id,Name from zkups__UPSShipmatePreference__c WHERE ID = 'YOUR_PREFRENCE_ID']; // Create the new shipment object zkups__UPSShipment__c shipment = new zkups__UPSShipment__c(); // set the tracking number of the shipment you'd like to add shipment.zkups__MasterTrackingId__c = '1z1w7w420374732280'; // live example // Set the preference ID shipment.zkups__UPSShipmatePreference__c = pref.Id; // Set the ModKey (enables you to edit the shipment object) shipment.zkups__ModKey__c = 'Please email support@zenkraft.com to obtain'; // Insert the shipment object insert shipment;