Location Availability Changed
5 min
A location becomes available or unavailable for delivery orders.
Set the webhook (sandbox)
Send this mutation with your urlPath. Expressoft then sends a message to urlPath each time the availability of the location with locationKey changes.
Query
mutation LocationAvailabilityChanged($urlPath: String!, $locationKey: Guid!, $isAvailable: Boolean!) {
miscellaneous {
webHooks {
post_LocationAvailabilityChanged (
payload: {
urlPath:$urlPath
locationKey: $locationKey
isAvailable: $isAvailable
}
)
}
}
}Variables
{
"urlPath": "<your callback URL>",
"locationKey": "<locationKey>",
"isAvailable": true
}cURL
curl --location 'https://sandbox.expressoft.eu/connect/api/interopgql' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data '{"query": "mutation LocationAvailabilityChanged($urlPath: String!, $locationKey: Guid!, $isAvailable: Boolean!) { miscellaneous { webHooks { post_LocationAvailabilityChanged ( payload: { urlPath:$urlPath locationKey: $locationKey isAvailable: $isAvailable } ) } } }", "variables": {"urlPath": "<your callback URL>", "locationKey": "<locationKey>", "isAvailable": true}}'Response
{
"data": {
"miscellaneous": {
"webHooks": {
"post_LocationAvailabilityChanged": "<string>"
}
}
}
}The mutation returns a String (the type is confirmed by the schema). Your callback URL is called later, when the event happens.
Payload sent to your URL
Expressoft sends a POST request with this JSON body:
{
"is_available": false,
"location_key": "00000000-0000-0000-0000-000000000051"
}Field | Type | Description |
|---|---|---|
is_available | boolean | true if the location can take orders, false if it can't. |
location_key | GUID | The publicKey of the location. |