JeremyDunn / php-fedex-api-wrapper

This library provides a fluid interface for constructing requests to the FedEx web service API.
269 stars 184 forks source link

Please help setting Ref: and PO: on label #157

Closed graffxdesign closed 4 years ago

graffxdesign commented 4 years ago

Hello,

I have tried to set the REF: and/or PO: on the label and am unable to.

I am thinking it just needs to be set in the PackageLineItem section but am having no luck. If you know please let me know, I have exhausted my sources.

$packageLineItem1 ->setSequenceNumber(1) ->setItemDescription('Damaged Item') ->setDimensions(new ComplexType\Dimensions(array( 'Width' => 12, 'Height' => 12, 'Length' => 12, 'Units' => SimpleType\LinearUnits::_IN ))) ->setWeight(new ComplexType\Weight(array( 'Value' => 2, 'Units' => SimpleType\WeightUnits::_LB )));

TheGr8 commented 4 years ago

You are correct - it goes on the package line item level. Here's an excerpt from my code:

$refCust = new ComplexType\CustomerReference();
$refCust->setCustomerReferenceType('P_O_NUMBER')
  ->setValue('PO 123');

$refDept = new ComplexType\CustomerReference();
$refDept->setCustomerReferenceType('DEPARTMENT_NUMBER')
    ->setValue('DEPT123');

$refPO = new ComplexType\CustomerReference();
$refPO->setCustomerReferenceType('CUSTOMER_REFERENCE')
    ->setValue('12345'); 

and then:

  $item = new ComplexType\RequestedPackageLineItem();
    $item
        ->setWeight($itemWeight)
        ->setCustomerReferences([$refCust, $refDept, $refPO])
        ->setInsuredValue($itemValue)
        ->setSequenceNumber($item_seq);
graffxdesign commented 4 years ago

Thank you so much!