Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Rates retrieve method does not return individual rates #78

Open
mersedsv opened this issue Mar 19, 2022 · 1 comment
Open

Rates retrieve method does not return individual rates #78

mersedsv opened this issue Mar 19, 2022 · 1 comment

Comments

@mersedsv
Copy link

Rates retrieve does not work. Method does not return individual shipping rates, nor it expects individual shipment object id.

Documentation: https://goshippo.com/docs/reference/js#rates-retrieve

Expectations:
Providing object id (which was created using shippo.shipment.create) and getting single rate as referenced in the doc.
Request will be send to https://api.goshippo.com/rates/ as per documentation.

Actual behaviour:
const shippingRate = await shippo.shipment.retrieve(shippingRateId);

{
    type: 'ShippoNotFoundError',
    code: undefined,
    detail: { detail: 'Not found' },
    path: '/shipments/a58a355b5eb94522ac89d357be2b916d',
    statusCode: 404
}

It seems that shippo.shipment.retrieve method actually does not expects shippingRateId ... instead it expects shipping id. If I provide shipping id, it simply returns all shipping rates, which is different behaviour then explained within documentation.

Request is sent to the https://api.goshippo.com/shipments/

@cquark7
Copy link

cquark7 commented Aug 3, 2022

@mersedsv Just stumbled upon this problem. You are using the wrong API call, you should use:
await shippo.rate.retrieve(shippingRateId)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants