diff --git a/Koha/REST/V1/Checkouts.pm b/Koha/REST/V1/Checkouts.pm index 214c4a4020..1571c227b6 100644 --- a/Koha/REST/V1/Checkouts.pm +++ b/Koha/REST/V1/Checkouts.pm @@ -161,7 +161,7 @@ sub get_availability { $c->_check_availability( $patron, $item ); my $confirm_keys = join( ":", sort keys %{$confirmation} ); - $confirm_keys = $user->id . ":" . $item->id . ":" . $confirm_keys; + $confirm_keys = $user ? $user->id : '' . ":" . $item->id . ":" . $confirm_keys; my $token = Koha::Token->new->generate_jwt( { id => $confirm_keys } ); my $response = {