title: Query purchase products info returns Invalid Value use Google Play Developer API
body: <p>this problem may be similar <a href="https://stackoverflow.com/questions/35019357/google-play-developer-api-query-purchase-token-returns-invalid-value">here</a>, but some different</p>
  
  <p>1、I get client_id client_secret by <a href="https://developers.google.com/android-publisher/getting_started" rel="nofollow noreferrer">this</a></p>
  
  <p>2、I get authorization_code by:
  <code>https://accounts.google.com/o/oauth2/auth?scope=https://www.googleapis.com/auth/androidpublisher&amp;response_type=code&amp;access_type=offline&amp;redirect_uri={REDIRECT_URIS}&amp;client_id={CLIENT_ID}</code></p>
  
  <p>3、get refresh_token by:</p>
  
  <pre><code>urls := "https://www.googleapis.com/oauth2/v4/token"
  
  postData := "redirect_uri=%s&amp;grant_type=authorization_code&amp;client_id=%s&amp;client_secret=%s&amp;code=%s"
  postData = fmt.Sprintf(postData, url.QueryEscape(REDIRECT_URL), url.QueryEscape(CLIENT_ID), url.QueryEscape(CLIENT_SECRET), url.QueryEscape(CODE))
  beego.Debug("postData:", postData)
  
  body, err := service.Post(urls, "application/x-www-form-urlencoded", bytes.NewReader([]byte(postData)))
  </code></pre>
  
  <p>4、I get access_token by:</p>
  
  <pre><code>urls := "https://www.googleapis.com/oauth2/v4/token"
  
  postData := "grant_type=refresh_token&amp;client_id=%s&amp;client_secret=%s&amp;refresh_token=%s"
  postData = fmt.Sprintf(postData, url.QueryEscape(CLIENT_ID), url.QueryEscape(CLIENT_SECRET), url.QueryEscape(REFRESH_TOKEN))
  beego.Debug("postData:", postData)
  
  body, err := service.Post(urls, "application/x-www-form-urlencoded", bytes.NewReader([]byte(postData)))
  </code></pre>
  
  <p>and I want get products info:</p>
  
  <pre><code>urls := "https://www.googleapis.com/androidpublisher/v2/applications/%s/purchases/products/%s/tokens/%s"
  urls = fmt.Sprintf(urls, url.QueryEscape("cn.wps.moffice_premium"), url.QueryEscape("premium_sub_m"), url.QueryEscape("fngalnikxxxxxxcncnbfa.AO-J1OxEoo9RnI-tFqxxxxxxB6u-xbsnp74QYZQYsw_yDyLxxxxxxxaAohBFeafRTZBIioiljUt_ZVbexxxxxxPV7jD_QPQTpmftxpoQGzGloApv9mJnxBe5thDxxxxxxxLhpRRRWlK"))
  header := http.Header{}
  header.Add("Authorization", "Bearer "+accessToken)
  body, err := service.Get(urls, header)
  </code></pre>
  
  <p>and I get err:</p>
  
  <pre><code> {
   "error": {
   "errors": [
    {
      "domain": "global",
      "reason": "invalid",
      "message": "Invalid Value"
     }
    ],
    "code": 400,
    "message": "Invalid Value"
   }
  }
  </code></pre>
  
  <p>I try this url can return valid value:</p>
  
  <pre><code>"https://www.googleapis.com/androidpublisher/v2/applications/%s/purchases/subscriptions/%s/tokens/%s"
  </code></pre>
  
  <p>not sure what else to try.
  Thanks for help and replies</p>