EasyPost / easypost-node

EasyPost Shipping API Client Library for Node
https://easypost.com/docs/api
MIT License
139 stars 54 forks source link

Near Zero Documentation on Smart Estimates #464

Closed Fihy closed 2 weeks ago

Fihy commented 1 month ago

The retrieveEstimatedDeliveryDate doesn't appear to line up with the endpoint documentation, leaving too much ambiguity in development.

Can I find a description of this, and where the carriers are specified? The carrier specification is as seen here: https://docs.easypost.com/docs/smartrate

The docs don't describe any of this in detail either: https://easypost.github.io/easypost-node/global.html#estimateDeliveryDate

Would this be the intended usage?

const statement = await easy_post.Shipment.create({
      from_address: {
        street1: "----",
        street2: "----",
        city: "----",
        state: "----",
        zip: "----",
        country: "----",
        company: "----",
      },
      to_address: address,
      parcel: {
        length: box.dimensions_inches.x,
        width: box.dimensions_inches.y,
        height: box.dimensions_inches.z,
        weight: box.weight_lb,
      },
      carriers: ["UPS"],
    });

    const estimates = await easy_post.Shipment.retrieveEstimatedDeliveryDate(
      statement.id,
      get_next_monday(time_needed)
    );

Also, what does it return? It says The array of estimated delivery dates and rates. but what is that supposed to mean? Is it the rates object? It is specified to return an array of plain Objects, yet the the docs specify the response of the endpoint is a single object- which is not a rate- containing an array, which again do not match the Rate interface. image image image

I lack understanding of internals of your business, but I'm going to comment and say that this is a dissuasive weak point in the experience of working with you. I cannot be wasting development time on figuring out your architecture.

Go ahead and let me know if I missed some piece of instruction though, because I admit that I do from time to time.

Fihy commented 1 month ago

I went ahead and hit the method only to receive duplicate keys in the response... image

Justintime50 commented 1 month ago

Hi @Fihy, you can find up-to-date information about all of our endpoints, their required parameters, and API responses via our official documentation at docs.easypost.com. For this particular function, you will want to reference the following: https://docs.easypost.com/docs/shipments/shipping-smartrate#delivery-date - based on the details you shared, the docs referenced may have been for another SmartRate endpoint. This new function and endpoint were just released, if you haven't yet you will want to ensure you are running the most recent version of the Node client library to take advantage of this new functionality.

Let me know if these details were what you were after.