Hey, I have the same problem, i've tried for countless hours to get this thing working with every possible combination of every possible variable. During this i've used a handful of resources, but mainly: - Chrome Web Store Tutorial <https://developer.chrome.com/webstore/one_time_payments> - One time payment Sample App <https://github.com/GoogleChrome/chrome-app-samples/tree/master/samples/one-time-payment> - Chromium Apps Announce Forum post regarding 500's on the /userlicenses/ endpoint <https://groups.google.com/a/chromium.org/d/msg/chromium-apps/UXE_ASCN0gc/gYxAdy-4nDQJ> I don't know if this is relevant, but the extension i'm trying to get this working with has this i the *Chrome Web Store Developer Dashboard* : > This item is paid and uses *Chrome Web Store Payments*. > Subscription type: *subscription charged per month* So, this is the code that i try to get working:async function get_token () {let tokentry {token = await chromep.identity.getAuthToken({ interactive: true })} catch (e) {return console.error(e.message)}if (token) {console.log('Chrome.identity.getAuthToken returned a token', token)return token}}async function get_license () {const CWS_LICENSE_API_URL =const license = await fetch(`${CWS_LICENSE_API_URL}/<ID>`, {method: 'GET',headers: new Headers({ Authorization: `Bearer ${await get_token()}` })})}
I've tried every possible combination i find relevant to the task. As far as i see there is 4 different variables that matter for the request: - The *"key" *property in the manifest - The *id* to retrieve the license([...]/v1.1/userlicenses/<EXTENSION_ID>) - The oauth2.*scope *property in the manifest.json - The generated *oauth2.client_id *in the manifest.json. - I generate this in the same account as a published the Chrome extension. I used Google API Console> Credentials > Create Credentials > OAuth Client ID > Chrome App For every variable described above i've tried to use: - The ID of the dev build i'm that's i'm developing in. - The ID of the published extension - Installed the published Chrome extension and used the* "key"* found in *~/Library/Application Support/Google/Chrome/Default/Extensions/<PUBLISHED_CHROME_EXTENSION_ID>/manifest.json* - I even tried to use all the variable supplied Sample app <https://github.com/GoogleChrome/chrome-app-samples/tree/master/samples/one-time-payment> The token retrieval works great, i get prompted and see the correct scopes and logo, *but *when i then use the token i get a 500 with the following response:
{"error": {"errors": [{"domain": "global","reason": "backendError","message": "Backend Error"}],"code": 500,"message": "Backend Error"}}
The strange thing here is when i use the same token for *https://www.googleapis.com/chromewebstore/v1.1/items/<EXTENSION_ID>?projection=draft *i get a *200* with the following payload:{"kind": "chromewebstore#item","id": "<EXTENSION_ID>","publicKey": "<PUB_KEY>","uploadState": "NOT_FOUND","crxVersion": "<VERSION>"}
Hopefully this helps to debug the problem. Regards, Adam