shipengine-php/docs/voidLabelExample.md at main · DoNotCarry/shipengine-php · GitHub
Skip to content

Latest commit

 

History

History
42 lines (34 loc) · 1.12 KB

File metadata and controls

42 lines (34 loc) · 1.12 KB

Void Label With Label Id

ShipEngine allows you to attempt to void a previously purchased label. Please see our docs to learn more about voiding a label.

Input Parameters

The voidLabelWithLabelId method accepts a string that contains the label Id that is being voided.

Output

The voidLabelWithLabelId method returns an object that indicates the status of the void label request.

Example

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();

Example Output

Successful Void Label

Array
(
    [approved] =>
    [message] => No shipment found within the allowed void period
)