ZOHO Book Access+Refresh Token

ZOHO Book Access+Refresh Token

Hi,
I have written PHP code to generate oAuth token for zohobook (india region) for offline access and this process working perfectly fine.  Whenever I try to create refresh token and access token, it is always giving me access token only, and there is no refresh token given, also next time when I try to generate access token again, it is saying invalid code, meaning the auth token generated with oAuth is no longer valid. 

Here is the URL for oAuth
https://accounts.zoho.in/oauth/v2/auth?client_id=1000.***&response_type=code&scope=ZohoBooks.fullaccess.all&redirect_uri=http://jayshree.local/site/oauthclient&access_type=offline

And here is the code for refresh and access token
$curl = curl_init();
$client_id=1000.*****;
$client_secret=6****;
$auth_token = TOKEN_GENERATED_FROM_OAUTH_URL;

curl_setopt_array($curl,
array(
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => 'client_id='.$client_id.
'&grant_type=authorization_code'.
'&client_secret='.$client_secret.
'&redirect_uri='.$redirect_uri.
'&code='.$auth_token,
CURLOPT_HTTPHEADER => array(
'Content-Type: application/x-www-form-urlencoded'
),
)
);

$response = curl_exec($curl);

curl_close($curl);

This returns to me "invalid_code" error always. Please suggest what is wrong and what should be corrected