christoph-schaeffer / dhl-business-shipping

An unofficial library for the DHL business shipping soap API (Version 3.3) and the dhl shipment tracking rest API written in PHP.
MIT License
29 stars 8 forks source link

Die angegebene Sendungsnummer konnte nicht gefunden werden. Status 2000 #16

Closed ahmadtechnik closed 2 years ago

ahmadtechnik commented 2 years ago

Hello Christoph,

I am trying to call a getLabel, but all responses end with code 2000 and the message "The specified tracking number could not be found".

I also have other questions:

Thanks in advance.

christoph-schaeffer commented 2 years ago

Hello @ahmadtechnik,

first of all thanks for using the library and i'm sorry for replying so late...

I'm going to answer the questions one by one as good as i can.

I am trying to call a getLabel, but all responses end with code 2000 and the message "The specified tracking number could not be found".

What tracking numbers did you use? Did you try it in sandbox mode? It is only possible to get labels for shipments you have created with the same dhl bussiness customer account, also the sandbox and production databases are seperated. I'm not sure about that, but i think they also wipe the Sandbox database from day to day. For testing purposes please use "createShipmentOrder" and use the shipmentNumber you did get there. Usually you shouldn't need the getLabel function to begin with, because createShipmentOrder supplies you with everything getLabel does as well. The only difference is that getLabel needs an existing label and createShipmentOrder creates a new one.

Does the getLabel function only work with tickets that were created with the API or also come from the ticket archive ?

I don't really know that either to be honest. You could try asking the DHL Developer support on entwickler.dhl.de You can open a Ticket there. You could also test it yourself if you can. Personally i don't see why it shouldn't work...

Is it possible to get a finished label (I mean the package has been delivered) ?

I don't really know that as well, but i highly advise you to save labels you have created on your system. DHL limits the requests you can send to the api per second. If you overdo it and keep requesting stuff you could've cached you may reach that limit. I personally just save the pdf myself for X days and autodelete it with a cron job after some time.

What type must the label number be? string or integer (integer removes the first 2 zeros).

Hmmm so far it has been an array of strings, because it was possible to request multiple labels in one request, however, this seems to have changed... There might be a bug in there now. I will review that in the next weeks. You could try an array of strings or just a string meanwhile.

Edit: it is an array of strings. you can request multiple shipment numbers at the same time.

christoph-schaeffer commented 2 years ago

closing due to inactivity