curl_setopt($URD, CURLOPT_POST,true);
curl_setopt($URD, CURLOPT_CUSTOMREQUEST, 'PATCH');
You delcare both POST and PATCH, so not sure which one succeeded. PATCH should of won. But it may not have done.
Also a typo here
curl_setopt($UCR, CURLOPT_POSTFIELDS,$URDinput);
should be
curl_setopt($URD, CURLOPT_POSTFIELDS,$URDinput);
URD not UCR