Closed linaori closed 2 years ago
@linaori Your best bet is to use a debugger like XDebug and step debug through the part that actually returns the CIFException with the error message in it. The unable to generate label is a sort of catch-all exception. Difficult to say otherwise what's wrong, But if I had to make a wild guess it's the barcode.
I'm not actually getting a CIFException, which is why I was curious if there was anything I missed in the Shipment setup. Is there any way to verify if the barcode is compatible with the given product code? The PostNL API is rather poorly documented so I can't make heads or tails of what's supposed to happen :(
In the client there is also generateBarcodeByCountryCode()
see if using that function with DE
al ISO code helps.
https://github.com/firstred/postnl-api-php/blob/v1.3.x/src/Service/LabellingService.php#L152
Is where that exception gets thrown, it's basicly the Nothing happened exception
also check if your Sandbox environment and Live environment in PostNL are equal with the same product codes, we have some that work on sandbox and some that don't work. Maybe contact your Account Manager to verify that.
I think you'll have to contact your account manager at PostNL. We are in the process of sending packages from NL to DE using PostNL, and it needs some configuration on the side of PostNL.
Thanks, I feared as much. The PostNL API contact form is broken and won't let me submit a question, so that's going to be fun. I was hoping this would just work in sandbox mode but alas.
Thanks for the pointers!
I'm trying to figure out how to send a package from NL to DE, but I'm getting a
NotFoundException('Unable to generate label')
. I suspect that I'm not configuring theShipment
properly but I also can't really find out what I should be doing in the first place. The PostNL API seems to have no examples for anything foreign other than BE. If i understand the flow correctly PostNL just doesn't generate any labels? It does mention something about "combilabels", but I couldn't find anything in the code in regards to that.https://developer.postnl.nl/browse-apis/send-and-track/products/#destination-EU
A snippet of the code I'm using:
The documentation does mention something for a partner barcode, but I can't find what that is supposed to be or how to pass it into the Shipment.