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

Unable to set reference for the package. #126

Closed lYesterdaYl closed 4 years ago

lYesterdaYl commented 4 years ago
        $rateRequest->RequestedShipment->RequestedPackageLineItems[0]->CustomerReferences->CustomerReferenceType = 'CUSTOMER_REFERENCE';
        $rateRequest->RequestedShipment->RequestedPackageLineItems[0]->CustomerReferences->Value = 'Test Ref';

image

This is how it is done in the API documentation image

What did I do wrong? I am not sure if this is bug or not.

graffxdesign commented 4 years ago

Same issue, did you fix it?

senter-logistics commented 3 years ago

+1

senter-logistics commented 3 years ago

got the solution . You need to add this in the ship method not in the rates one

   $packageLineItem = new ComplexTypeShip\RequestedPackageLineItem();
        $packageLineItem
        ->setSequenceNumber($p)
        ->setCustomerReferences([
          'CustomerReferenceType' =>'CUSTOMER_REFERENCE',
          'Value' => $to_reference
        ])