Skip to main content

checkOutVisit

Requires permission visits:visit:execute.

Checks the signed-in rep out of a visit, stamping the departure time and an optional location on the open check-in. A replay whose check-out already landed returns the current visit. Requires permission to run visits.

Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.

Example:

mutation CheckOutVisit($visitId: ID!) {
checkOutVisit(visitId: $visitId) {
id
partnerName
status
createdAt
completedAt
hasUnreadMessage
checkIns {
id
createdAt
checkInAt
checkOutAt
checkOutLatitude
checkOutLongitude
}
}
}

Variables:

{
"visitId": "id"
}

Response:

{
"data": {
"checkOutVisit": {
"id": "id",
"partnerName": "string",
"status": "CANCELLED",
"createdAt": "2025-01-15T00:00:00Z",
"completedAt": "2025-01-15T00:00:00Z",
"hasUnreadMessage": true,
"checkIns": [
{
"id": "id",
"createdAt": "2025-01-15T00:00:00Z",
"checkInAt": "2025-01-15T00:00:00Z",
"checkOutAt": "2025-01-15T00:00:00Z",
"checkOutLatitude": 0,
"checkOutLongitude": 0
}
]
}
}
}
checkOutVisit(
clientCheckOutAt: DateTime
latitude: Float
longitude: Float
visitId: ID!
): Visit!

Arguments​

checkOutVisit.clientCheckOutAt ● DateTime scalar​

When the rep tapped check-out, for an offline replay. It is never before the check-in.

checkOutVisit.latitude ● Float scalar​

The rep's latitude at check-out. Optional.

checkOutVisit.longitude ● Float scalar​

The rep's longitude at check-out. Optional.

checkOutVisit.visitId ● ID! non-null scalar​

The ID of the visit.

Type​

Visit object​

A planned or unplanned visit to a customer.