diff --git a/Koha/REST/V1/Patrons/Account.pm b/Koha/REST/V1/Patrons/Account.pm index f0f6ac17eb..71bc9f3c7b 100644 --- a/Koha/REST/V1/Patrons/Account.pm +++ b/Koha/REST/V1/Patrons/Account.pm @@ -220,9 +220,9 @@ sub add_debit { my $debit = $patron->account->add_debit($data); $debit = Koha::Account::Debit->_new_from_dbic( $debit->{_result} ); + $debit->discard_changes; $c->res->headers->location( $c->req->url->to_string . '/' . $debit->id ); - $debit->discard_changes; return $c->render( status => 201,