DHL-TarekFadel / MyDHL-API-Reference-Implementation

Showing you how to use MyDHL API in a .NET project using best practices
MIT License
6 stars 7 forks source link

RateRequest requires contact information for sender and receiver #2

Closed chachkovivan closed 4 years ago

chachkovivan commented 4 years ago

Hello Tarek, I am starting on DHL integration and trying to use your library. I am currently getting an error 999 with every invocation of RateRequest call. After combing through the reference documentation from DHL v1.6 I noticed that they mark contact person as "M" which I presume stands for the mandatory field. Do you know if the contact person fields are mandatory in the API? Can you provide implementation if they are?

Thank you for publishing the library. Ivan

DHL-TarekFadel commented 4 years ago

Hi Ivan,

Thank you for doing the investigative work on this. However, the library is working as expected.

For Rate Queries, there is no need to send the Contact element at all (if you do send it for whatever reason, then the PersonName field becomes mandatory). For using the library though, you need to use the Address class in the MyDHLAPI_REST_Library.Objects.RateQuery namespace for rate queries.

Moreover, the PersonName field is marked as required for the Address class in the MyDHLAPI_REST_Library.Objects.Common namespace which should be used for shipment creation since the entire Contact object is required for shipment creation.