ShipEngine allows you to attempt to void a previously purchased label. Please see our docs to learn more about voiding a label.
The voidLabelWithLabelId method accepts a string that contains the label Id that is being voided.
The voidLabelWithLabelId method returns an object that indicates the status of the void label request.
use ShipEngine\ShipEngine;
use ShipEngine\Message\ShipEngineException;
function voidLabelWithLabelIdDemoFunction() {
$client = new ShipEngine('API-Key');
try {
print_r($client->voidLabelWithLabelId('se-75449505'));
} catch (ShipEngineException $e) {
print_r($e -> getMessage());
}
}
voidLabelWithLabelIdDemoFunction();Array
(
[approved] =>
[message] => No shipment found within the allowed void period
)