Skip to content

Commit 9936159

Browse files
authored
docs: updating readme scopes (#752)
The scopes provided in this readme do not accurately reflect the scopes required in order to be able to execute the examples. `accounting.settings` is required in order to be able to fetch information about
1 parent 45f0415 commit 9936159

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ const xero = new XeroClient({
7575
clientId: 'YOUR_CLIENT_ID',
7676
clientSecret: 'YOUR_CLIENT_SECRET',
7777
redirectUris: [`http://localhost:${port}/callback`],
78-
scopes: 'openid profile email accounting.transactions offline_access'.split(" "),
78+
scopes: 'openid profile email accounting.settings accounting.transactions offline_access'.split(" "),
7979
state: 'returnPage=my-sweet-dashboard', // custom params (optional)
8080
httpTimeout: 3000, // ms (optional)
8181
clockTolerance: 10 // seconds (optional)
@@ -113,7 +113,7 @@ It is recommended that you store this token set JSON in a datastore in relation
113113
| access_token: | "xxx.yyy.zzz" | [Bearer token](https://oauth.net/2/jwt/) with a 30 minute expiration required for all API calls |
114114
| expires_in: | 1800 | Time in seconds till the token expires - 1800s is 30m |
115115
| refresh_token: | "XXXXXXX" | Alphanumeric string used to obtain a new Token Set w/ a fresh access_token - 60 day expiry |
116-
| scope: | ["email", "profile", "openid", "accounting.transactions", "offline_access"] | The Xero permissions that are embedded in the `access_token` |
116+
| scope: | ["email", "profile", "openid", "accounting.settings", "accounting.transactions", "offline_access"] | The Xero permissions that are embedded in the `access_token` |
117117
118118
Example Token Set JSON:
119119
```
@@ -123,7 +123,7 @@ Example Token Set JSON:
123123
"expires_in": 1800,
124124
"token_type": "Bearer",
125125
"refresh_token": "xxxxxxxxx",
126-
"scope": ["email", "profile", "openid", "accounting.transactions", "offline_access"]
126+
"scope": ["email", "profile", "openid", "accounting.settings", "accounting.transactions", "offline_access"]
127127
}
128128
```
129129
@@ -233,7 +233,7 @@ const xero = new XeroClient({
233233
clientSecret: 'YOUR_CLIENT_SECRET', // required
234234
redirectUris: [`http://localhost:${port}/callback`], // not used for client_credentials auth flow
235235
grantType: 'client_credentials', // only used for client_credentials auth flow
236-
scopes: 'openid profile email accounting.transactions offline_access'.split(" "), // not used for client_credentials auth flow
236+
scopes: 'openid profile email accounting.settings accounting.transactions offline_access'.split(" "), // not used for client_credentials auth flow
237237
state: 'returnPage=my-sweet-dashboard', // custom params (optional), not used for client_credentials auth flow
238238
httpTimeout: 3000, // ms (optional)
239239
clockTolerance: 10 // seconds (optional)
@@ -261,7 +261,7 @@ const xero = new XeroClient({
261261
clientId: 'YOUR_CLIENT_ID',
262262
clientSecret: 'YOUR_CLIENT_SECRET',
263263
redirectUris: [`http://localhost:${port}/callback`],
264-
scopes: 'openid profile email accounting.transactions offline_access'.split(" ")
264+
scopes: 'openid profile email accounting.settings accounting.transactions offline_access'.split(" ")
265265
});
266266

267267
await xero.initialize();
@@ -316,7 +316,7 @@ const xero = new XeroClient({
316316
clientId: 'YOUR_CLIENT_ID',
317317
clientSecret: 'YOUR_CLIENT_SECRET',
318318
redirectUris: [`http://localhost:${port}/callback`],
319-
scopes: 'openid profile email accounting.transactions offline_access'.split(" ")
319+
scopes: 'openid profile email accounting.settings accounting.transactions offline_access'.split(" ")
320320
});
321321

322322
await xero.initialize();

0 commit comments

Comments
 (0)