LocationCourierQuoteList Resource
Use the LocationCourierQuoteList
resource to fetch delivery fee estimates for a given location.
Resources:
Schema type
Use location-courier-quote-list
to reference this resource in the template schema.
Querying
Using the LocationCourierQuoteList resource will make the source template render uncacheable as the quote fee is dynamic. Refer to this guide on how to load uncacheable resources with the template API.
Sorting required
-
from object
Sort locations by latitude/longitude or by
place_id
. Theplace_id
can be fetched using the places API or an IdealPostcode can be provided{ "sort": { "from": { "lat": 40.7291108, "lng": -73.9928264 // or "place_id": "G:ChIJhczEaaxghYTT7_8flgRgQQ4" } } }
Output
[
{
"location_id": "LW8Y1AQ0V7D3R",
"resource_type": "LOCATION_COURIER_QUOTE",
"square_online_location_id": "11ecdbb1f3706c61a4ab2c600c83e955",
"location_name": "Widgets and Co.",
"DELIVERY": {
"fee": {
"amount": 600,
"currency": "USD",
"formatted": "$6.00"
}
},
"__SO_RESOURCE_TYPE__": "location_courier_quote",
"location": {
... // see Location resource
}
}
]
LocationCourierQuoteList resources
LocationCourierQuote
Delivery fee information for a given location.
Field | Type | Description |
---|---|---|
location_id | String | Location ID |
location_name | String | Location name |
DELIVERY.fee | Money | Delivery fee for the location |
resource_type | String | The resource type identifier |
square_online_location_id | String | Store Location ID in Square Online |
location | Location | The Location resource for this quote. Note that even though the location is included with this resource, you should not use the LocationCourierQuoteList as a replacement for Location or LocationList due to the uncacheable nature |
Money
Information about monetary amounts.
Field | Type | Description |
---|---|---|
amount | Number | Amount in the smallest subunit of the given currency |
currency | String | The ISO 4217 three-letter currency code |
formatted | String | Amount formatted with the symbol of the given currency. Formatted according to the site’s locale |