AfterShip / aftership-sdk-php

The PHP SDK of AfterShip API
65 stars 46 forks source link

How to delete trackings with carrier that require tracking_postal_code? #37

Closed ewgRa closed 7 years ago

ewgRa commented 7 years ago

We register tracking with carrier that require tracking_postal_code, when we try to delete it, we have "BadRequest: 4009 - tracking_postal_code is required".

In sdk there is even no params argument in Trackings::delete method, same as nothing says about any parameters in API docs.

We try to send delete request with params, similar to "GET" or "POST" requests, but have same "bad request" exception.

  1. How we can delete such trackings?

  2. I think there is same problem with "update", "retrack" and "get". At least same in "GET /trackings/:slug/:tracking_number", in API docs there is nothings says about sending tracking_postal code, but it not works without it.

Can you please clarify?

hans-lizihan commented 7 years ago

Hi @ewgRa could you please kindly provide the tracking number/ tracking id you are trying to delete?

Our API dose not require any parameters to delete a tracking number by default. So a simple call with

DELETE https://api.aftership.com/v4/trackings/dhl/LN00000-EXAMPLE

or

DELETE https://api.aftership.com/v4/trackings/{tracking_id}

will do the trick.

you can play with it with out console https://www.aftership.com/docs/api/4/api-console as well.

Happy hacking~

ewgRa commented 7 years ago

@hans-lizihan thanks for replay!

I sent you email with some details, since there is some sensitive private data. Please check.