Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shipment/ReferenceNumber is not allowed for this shipment (120541) #333

Open
WEBMASTERV2 opened this issue Oct 13, 2021 · 2 comments
Open

Comments

@WEBMASTERV2
Copy link

HI,
I am using gabrill php - ups api for my ERP.
Label is generated successful but without a reference number.
when i use the code for the same it shows the following error :

Shipment/ReferenceNumber is not allowed for this shipment (120541)

can some help me about that?

// Set service
$service = new \Ups\Entity\Service;
$service->setCode(\Ups\Entity\Service::S_STANDARD);
$service->setDescription($service->getName());
$shipment->setService($service);


//------------GET REFERENCE NUMBER
$order_id0 = $_POST['invoice_nu'];

$referencenumber=new \Ups\Entity\ReferenceNumber;
    //$referencenumber->setCode('RZ');
    $referencenumber->setValue($order_id0);
    $shipment->setReferenceNumber($referencenumber);

above code shows me an error, if i will not use this it generate label successfully ..

@mfrederico
Copy link

Duplicate of ##327

@timramseyjr
Copy link

I ran into a similar situation and fixed it by adding the reference number to the package instead of the shipment

$package->setReferenceNumber($referencenumber);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants