code: public function confirm(
          $validation,
          Shipment $shipment,
          ShipmentRequestLabelSpecification $labelSpec = null,
          ShipmentRequestReceiptSpecification $receiptSpec = null
      ) {
          $request = $this->createConfirmRequest($validation, $shipment, $labelSpec, $receiptSpec);
          $this->response = $this->getRequest()->request($this->createAccess(), $request, $this->compileEndpointUrl($this->shipConfirmEndpoint));
          $response = $this->response->getResponse();
  
          if (null === $response) {
              throw new Exception('Failure (0): Unknown error', 0);
          }
  
          if ($response instanceof SimpleXMLElement && $response->Response->ResponseStatusCode == 0) {
              throw new Exception(
                  "Failure ({$response->Response->Error->ErrorSeverity}): {$response->Response->Error->ErrorDescription}",
                  (int)$response->Response->Error->ErrorCode
              );
          } else {
              return $this->formatResponse($response);
          }
      }
docs: Create a Shipment Confirm request (generate a digest).
  
  @param string $validation A UPS_Shipping::REQ_* constant (or null)
  @param Shipment $shipment Shipment data container.
  @param ShipmentRequestLabelSpecification|null $labelSpec LabelSpecification data. Optional
  @param ShipmentRequestReceiptSpecification|null $receiptSpec ShipmentRequestReceiptSpecification data. Optional
  
  @throws Exception
  
  @return \stdClass