hugops
August 28, 2024, 4:42pm
1
I’m testing this endpoint to fetch pickup points
https://developers.vtex.com/docs/api-reference/checkout-api#get-/api/checkout/pub/pickup-points
Using coordinates always returns this error
{
"fields": {},
"error": {
"code": "001",
"message": "Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')",
"exception": null
},
"operationId": "68a7597b-296e-47d9-b016-bf59ff3231b2"
}
Example of the request I’m using
api/checkout/pub/pickup-points?geoCoordinates=-47.924747467041016&geoCoordinates=-15.832582473754883
But using the postalCode and countryCode fields works fine
Hey, @hugops !
You’re duplicating the query param, try it like in the image or one of the other ways below:
https://{accountName}.{environment}.com.br/api/checkout/pub/pickup-points?geoCoordinates=[-47.924747467041016,-15.832582473754883]
https://{accountName}.{environment}.com.br/api/checkout/pub/pickup-points?geoCoordinates=[-47.924747467041016;-15.832582473754883]
https://{accountName}.{environment}.com.br/api/checkout/pub/pickup-points?geoCoordinates=-47.924747467041016;-15.832582473754883
https://{accountName}.{environment}.com.br/api/checkout/pub/pickup-points?geoCoordinates=-47.924747467041016,-15.832582473754883
hugops
August 28, 2024, 6:08pm
3
Good afternoon,
Thank you for getting back to me!
Of the examples you provided, only this one worked:
api/checkout/pub/pickup-points?geoCoordinates=-47.924747467041016;-18.832582473754883
It was duplicated because I was making the request based on the example generated by the documentation
curl --request get \
--url 'https://apiexamples.vtexcommercestable.com.br/api/checkout/pub/pickup-points?geoCoordinates=-47.924747467041016&geoCoordinates=-15.832582473754883' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json'
Thank you for your help
Hi, @hugops !
I’ve already opened a documentation fix request so that other people don’t run into the same issue. Sorry for the confusion, and thanks for flagging it here in the Community