@maxim_mazurok/gapi.client.merchantapi-inventories_v1 0.0.20250804

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.d.ts +380 -0
  2. package/package.json +20 -0
  3. package/readme.md +73 -0
package/index.d.ts ADDED
@@ -0,0 +1,380 @@
1
+ /* Type definitions for non-npm package Merchant API inventories_v1 0.0 */
2
+ // Project: https://developers.google.com/merchant/api
3
+ // Definitions by: Maxim Mazurok <https://github.com/Maxim-Mazurok>
4
+ // Nick Amoscato <https://github.com/namoscato>
5
+ // Declan Vong <https://github.com/declanvong>
6
+ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
7
+
8
+ // IMPORTANT
9
+ // This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
10
+ // In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
11
+ // Generated from: https://merchantapi.googleapis.com/$discovery/rest?version=inventories_v1
12
+ // Revision: 20250804
13
+
14
+ /// <reference types="gapi.client" />
15
+
16
+ declare namespace gapi.client {
17
+ /** Load Merchant API inventories_v1 */
18
+ function load(
19
+ urlOrObject: 'https://merchantapi.googleapis.com/$discovery/rest?version=inventories_v1',
20
+ ): Promise<void>;
21
+ /** @deprecated Please load APIs with discovery documents. */
22
+ function load(name: 'merchantapi', version: 'inventories_v1'): Promise<void>;
23
+ /** @deprecated Please load APIs with discovery documents. */
24
+ function load(
25
+ name: 'merchantapi',
26
+ version: 'inventories_v1',
27
+ callback: () => any,
28
+ ): void;
29
+
30
+ namespace merchantapi {
31
+ interface Empty {}
32
+ interface Interval {
33
+ /** Optional. Exclusive end of the interval. If specified, a Timestamp matching this interval will have to be before the end. */
34
+ endTime?: string;
35
+ /** Optional. Inclusive start of the interval. If specified, a Timestamp matching this interval will have to be the same or after the start. */
36
+ startTime?: string;
37
+ }
38
+ interface ListLocalInventoriesResponse {
39
+ /** The `LocalInventory` resources for the given product from the specified account. */
40
+ localInventories?: LocalInventory[];
41
+ /** A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted, there are no subsequent pages. */
42
+ nextPageToken?: string;
43
+ }
44
+ interface ListRegionalInventoriesResponse {
45
+ /** A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted, there are no subsequent pages. */
46
+ nextPageToken?: string;
47
+ /** The `RegionalInventory` resources for the given product from the specified account. */
48
+ regionalInventories?: RegionalInventory[];
49
+ }
50
+ interface LocalInventory {
51
+ /** Output only. The account that owns the product. This field will be ignored if set by the client. */
52
+ account?: string;
53
+ /** Optional. A list of local inventory attributes. */
54
+ localInventoryAttributes?: LocalInventoryAttributes;
55
+ /** Output only. The name of the `LocalInventory` resource. Format: `accounts/{account}/products/{product}/localInventories/{store_code}` */
56
+ name?: string;
57
+ /** Required. Immutable. Store code (the store ID from your Business Profile) of the physical store the product is sold in. See the [Local product inventory data specification](https://support.google.com/merchants/answer/3061342) for more information. */
58
+ storeCode?: string;
59
+ }
60
+ interface LocalInventoryAttributes {
61
+ /** [Availability](https://support.google.com/merchants/answer/3061342) of the product at this store. */
62
+ availability?: string;
63
+ /** Optional. Location of the product inside the store. Maximum length is 20 bytes. */
64
+ instoreProductLocation?: string;
65
+ /** Optional. Supported [pickup method](https://support.google.com/merchants/answer/3061342) for this product. Unless the value is `"not supported"`, this field must be submitted together with `pickupSla`. */
66
+ pickupMethod?: string;
67
+ /** Optional. Relative time period from the order date for an order for this product, from this store, to be ready for pickup. Must be submitted with `pickupMethod`. See more details [here](https://support.google.com/merchants/answer/3061342). */
68
+ pickupSla?: string;
69
+ /** Optional. Price of the product at this store. */
70
+ price?: Price;
71
+ /** Optional. Quantity of the product available at this store. Must be greater than or equal to zero. */
72
+ quantity?: string;
73
+ /** Optional. Sale price of the product at this store. Mandatory if `salePriceEffectiveDate` is defined. */
74
+ salePrice?: Price;
75
+ /** Optional. The `TimePeriod` of the sale at this store. */
76
+ salePriceEffectiveDate?: Interval;
77
+ }
78
+ interface Price {
79
+ /** The price represented as a number in micros (1 million micros is an equivalent to one's currency standard unit, for example, 1 USD = 1000000 micros). */
80
+ amountMicros?: string;
81
+ /** The currency of the price using three-letter acronyms according to [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217). */
82
+ currencyCode?: string;
83
+ }
84
+ interface ProductChange {
85
+ /** The new value of the changed resource or attribute. If empty, it means that the product was deleted. Will have one of these values : (`approved`, `pending`, `disapproved`, ``) */
86
+ newValue?: string;
87
+ /** The old value of the changed resource or attribute. If empty, it means that the product was created. Will have one of these values : (`approved`, `pending`, `disapproved`, ``) */
88
+ oldValue?: string;
89
+ /** Countries that have the change (if applicable). Represented in the ISO 3166 format. */
90
+ regionCode?: string;
91
+ /** Reporting contexts that have the change (if applicable). Currently this field supports only (`SHOPPING_ADS`, `LOCAL_INVENTORY_ADS`, `YOUTUBE_SHOPPING`, `YOUTUBE_CHECKOUT`, `YOUTUBE_AFFILIATE`) from the enum value [ReportingContextEnum](/merchant/api/reference/rest/Shared.Types/ReportingContextEnum) */
92
+ reportingContext?: string;
93
+ }
94
+ interface ProductStatusChangeMessage {
95
+ /** The target account that owns the entity that changed. Format : `accounts/{merchant_id}` */
96
+ account?: string;
97
+ /** The attribute in the resource that changed, in this case it will be always `Status`. */
98
+ attribute?: string;
99
+ /** A message to describe the change that happened to the product */
100
+ changes?: ProductChange[];
101
+ /** The time at which the event was generated. If you want to order the notification messages you receive you should rely on this field not on the order of receiving the notifications. */
102
+ eventTime?: string;
103
+ /** Optional. The product expiration time. This field will not be set if the notification is sent for a product deletion event. */
104
+ expirationTime?: string;
105
+ /** The account that manages the merchant's account. can be the same as merchant id if it is standalone account. Format : `accounts/{service_provider_id}` */
106
+ managingAccount?: string;
107
+ /** The product name. Format: `accounts/{account}/products/{product}` */
108
+ resource?: string;
109
+ /** The product id. */
110
+ resourceId?: string;
111
+ /** The resource that changed, in this case it will always be `Product`. */
112
+ resourceType?: string;
113
+ }
114
+ interface RegionalInventory {
115
+ /** Output only. The account that owns the product. This field will be ignored if set by the client. */
116
+ account?: string;
117
+ /** Output only. The name of the `RegionalInventory` resource. Format: `{regional_inventory.name=accounts/{account}/products/{product}/regionalInventories/{region}` */
118
+ name?: string;
119
+ /** Required. Immutable. ID of the region for this `RegionalInventory` resource. See the [Regional availability and pricing](https://support.google.com/merchants/answer/9698880) for more details. */
120
+ region?: string;
121
+ /** Optional. A list of regional inventory attributes. */
122
+ regionalInventoryAttributes?: RegionalInventoryAttributes;
123
+ }
124
+ interface RegionalInventoryAttributes {
125
+ /** Optional. [Availability](https://support.google.com/merchants/answer/14644124) of the product in this region. */
126
+ availability?: string;
127
+ /** Optional. Price of the product in this region. */
128
+ price?: Price;
129
+ /** Optional. Sale price of the product in this region. Mandatory if `salePriceEffectiveDate` is defined. */
130
+ salePrice?: Price;
131
+ /** Optional. The `TimePeriod` of the sale price in this region. */
132
+ salePriceEffectiveDate?: Interval;
133
+ }
134
+ interface LocalInventoriesResource {
135
+ /** Deletes the specified `LocalInventory` from the given product in your merchant account. It might take a up to an hour for the `LocalInventory` to be deleted from the specific product. Once you have received a successful delete response, wait for that period before attempting a delete again. */
136
+ delete(request?: {
137
+ /** V1 error format. */
138
+ '$.xgafv'?: string;
139
+ /** OAuth access token. */
140
+ access_token?: string;
141
+ /** Data format for response. */
142
+ alt?: string;
143
+ /** JSONP */
144
+ callback?: string;
145
+ /** Selector specifying which fields to include in a partial response. */
146
+ fields?: string;
147
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
148
+ key?: string;
149
+ /** Required. The name of the local inventory for the given product to delete. Format: `accounts/{account}/products/{product}/localInventories/{store_code}` */
150
+ name: string;
151
+ /** OAuth 2.0 token for the current user. */
152
+ oauth_token?: string;
153
+ /** Returns response with indentations and line breaks. */
154
+ prettyPrint?: boolean;
155
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
156
+ quotaUser?: string;
157
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
158
+ upload_protocol?: string;
159
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
160
+ uploadType?: string;
161
+ }): Request<{}>;
162
+ /** Inserts a `LocalInventory` resource to a product in your merchant account. Replaces the full `LocalInventory` resource if an entry with the same `storeCode` already exists for the product. It might take up to 30 minutes for the new or updated `LocalInventory` resource to appear in products. */
163
+ insert(request: {
164
+ /** V1 error format. */
165
+ '$.xgafv'?: string;
166
+ /** OAuth access token. */
167
+ access_token?: string;
168
+ /** Data format for response. */
169
+ alt?: string;
170
+ /** JSONP */
171
+ callback?: string;
172
+ /** Selector specifying which fields to include in a partial response. */
173
+ fields?: string;
174
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
175
+ key?: string;
176
+ /** OAuth 2.0 token for the current user. */
177
+ oauth_token?: string;
178
+ /** Required. The account and product where this inventory will be inserted. Format: `accounts/{account}/products/{product}` */
179
+ parent: string;
180
+ /** Returns response with indentations and line breaks. */
181
+ prettyPrint?: boolean;
182
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
183
+ quotaUser?: string;
184
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
185
+ upload_protocol?: string;
186
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
187
+ uploadType?: string;
188
+ /** Request body */
189
+ resource: LocalInventory;
190
+ }): Request<LocalInventory>;
191
+ insert(
192
+ request: {
193
+ /** V1 error format. */
194
+ '$.xgafv'?: string;
195
+ /** OAuth access token. */
196
+ access_token?: string;
197
+ /** Data format for response. */
198
+ alt?: string;
199
+ /** JSONP */
200
+ callback?: string;
201
+ /** Selector specifying which fields to include in a partial response. */
202
+ fields?: string;
203
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
204
+ key?: string;
205
+ /** OAuth 2.0 token for the current user. */
206
+ oauth_token?: string;
207
+ /** Required. The account and product where this inventory will be inserted. Format: `accounts/{account}/products/{product}` */
208
+ parent: string;
209
+ /** Returns response with indentations and line breaks. */
210
+ prettyPrint?: boolean;
211
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
212
+ quotaUser?: string;
213
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
214
+ upload_protocol?: string;
215
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
216
+ uploadType?: string;
217
+ },
218
+ body: LocalInventory,
219
+ ): Request<LocalInventory>;
220
+ /** Lists the `LocalInventory` resources for the given product in your merchant account. The response might contain fewer items than specified by `pageSize`. If `pageToken` was returned in previous request, it can be used to obtain additional results. `LocalInventory` resources are listed per product for a given account. */
221
+ list(request?: {
222
+ /** V1 error format. */
223
+ '$.xgafv'?: string;
224
+ /** OAuth access token. */
225
+ access_token?: string;
226
+ /** Data format for response. */
227
+ alt?: string;
228
+ /** JSONP */
229
+ callback?: string;
230
+ /** Selector specifying which fields to include in a partial response. */
231
+ fields?: string;
232
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
233
+ key?: string;
234
+ /** OAuth 2.0 token for the current user. */
235
+ oauth_token?: string;
236
+ /** The maximum number of `LocalInventory` resources for the given product to return. The service returns fewer than this value if the number of inventories for the given product is less that than the `pageSize`. The default value is 25000. The maximum value is 25000; If a value higher than the maximum is specified, then the `pageSize` will default to the maximum */
237
+ pageSize?: number;
238
+ /** A page token, received from a previous `ListLocalInventories` call. Provide the page token to retrieve the subsequent page. When paginating, all other parameters provided to `ListLocalInventories` must match the call that provided the page token. The token returned as nextPageToken in the response to the previous request. */
239
+ pageToken?: string;
240
+ /** Required. The `name` of the parent product to list local inventories for. Format: `accounts/{account}/products/{product}` */
241
+ parent: string;
242
+ /** Returns response with indentations and line breaks. */
243
+ prettyPrint?: boolean;
244
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
245
+ quotaUser?: string;
246
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
247
+ upload_protocol?: string;
248
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
249
+ uploadType?: string;
250
+ }): Request<ListLocalInventoriesResponse>;
251
+ }
252
+ interface RegionalInventoriesResource {
253
+ /** Deletes the specified `RegionalInventory` resource from the given product in your merchant account. It might take up to an hour for the `RegionalInventory` to be deleted from the specific product. Once you have received a successful delete response, wait for that period before attempting a delete again. */
254
+ delete(request?: {
255
+ /** V1 error format. */
256
+ '$.xgafv'?: string;
257
+ /** OAuth access token. */
258
+ access_token?: string;
259
+ /** Data format for response. */
260
+ alt?: string;
261
+ /** JSONP */
262
+ callback?: string;
263
+ /** Selector specifying which fields to include in a partial response. */
264
+ fields?: string;
265
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
266
+ key?: string;
267
+ /** Required. The name of the `RegionalInventory` resource to delete. Format: `accounts/{account}/products/{product}/regionalInventories/{region}` */
268
+ name: string;
269
+ /** OAuth 2.0 token for the current user. */
270
+ oauth_token?: string;
271
+ /** Returns response with indentations and line breaks. */
272
+ prettyPrint?: boolean;
273
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
274
+ quotaUser?: string;
275
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
276
+ upload_protocol?: string;
277
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
278
+ uploadType?: string;
279
+ }): Request<{}>;
280
+ /** Inserts a `RegionalInventory` to a given product in your merchant account. Replaces the full `RegionalInventory` resource if an entry with the same `region` already exists for the product. It might take up to 30 minutes for the new or updated `RegionalInventory` resource to appear in products. */
281
+ insert(request: {
282
+ /** V1 error format. */
283
+ '$.xgafv'?: string;
284
+ /** OAuth access token. */
285
+ access_token?: string;
286
+ /** Data format for response. */
287
+ alt?: string;
288
+ /** JSONP */
289
+ callback?: string;
290
+ /** Selector specifying which fields to include in a partial response. */
291
+ fields?: string;
292
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
293
+ key?: string;
294
+ /** OAuth 2.0 token for the current user. */
295
+ oauth_token?: string;
296
+ /** Required. The account and product where this inventory will be inserted. Format: `accounts/{account}/products/{product}` */
297
+ parent: string;
298
+ /** Returns response with indentations and line breaks. */
299
+ prettyPrint?: boolean;
300
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
301
+ quotaUser?: string;
302
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
303
+ upload_protocol?: string;
304
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
305
+ uploadType?: string;
306
+ /** Request body */
307
+ resource: RegionalInventory;
308
+ }): Request<RegionalInventory>;
309
+ insert(
310
+ request: {
311
+ /** V1 error format. */
312
+ '$.xgafv'?: string;
313
+ /** OAuth access token. */
314
+ access_token?: string;
315
+ /** Data format for response. */
316
+ alt?: string;
317
+ /** JSONP */
318
+ callback?: string;
319
+ /** Selector specifying which fields to include in a partial response. */
320
+ fields?: string;
321
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
322
+ key?: string;
323
+ /** OAuth 2.0 token for the current user. */
324
+ oauth_token?: string;
325
+ /** Required. The account and product where this inventory will be inserted. Format: `accounts/{account}/products/{product}` */
326
+ parent: string;
327
+ /** Returns response with indentations and line breaks. */
328
+ prettyPrint?: boolean;
329
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
330
+ quotaUser?: string;
331
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
332
+ upload_protocol?: string;
333
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
334
+ uploadType?: string;
335
+ },
336
+ body: RegionalInventory,
337
+ ): Request<RegionalInventory>;
338
+ /** Lists the `RegionalInventory` resources for the given product in your merchant account. The response might contain fewer items than specified by `pageSize`. If `pageToken` was returned in previous request, it can be used to obtain additional results. `RegionalInventory` resources are listed per product for a given account. */
339
+ list(request?: {
340
+ /** V1 error format. */
341
+ '$.xgafv'?: string;
342
+ /** OAuth access token. */
343
+ access_token?: string;
344
+ /** Data format for response. */
345
+ alt?: string;
346
+ /** JSONP */
347
+ callback?: string;
348
+ /** Selector specifying which fields to include in a partial response. */
349
+ fields?: string;
350
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
351
+ key?: string;
352
+ /** OAuth 2.0 token for the current user. */
353
+ oauth_token?: string;
354
+ /** The maximum number of `RegionalInventory` resources for the given product to return. The service returns fewer than this value if the number of inventories for the given product is less that than the `pageSize`. The default value is 25000. The maximum value is 100000; If a value higher than the maximum is specified, then the `pageSize` will default to the maximum. */
355
+ pageSize?: number;
356
+ /** A page token, received from a previous `ListRegionalInventories` call. Provide the page token to retrieve the subsequent page. When paginating, all other parameters provided to `ListRegionalInventories` must match the call that provided the page token. The token returned as nextPageToken in the response to the previous request. */
357
+ pageToken?: string;
358
+ /** Required. The `name` of the parent product to list `RegionalInventory` resources for. Format: `accounts/{account}/products/{product}` */
359
+ parent: string;
360
+ /** Returns response with indentations and line breaks. */
361
+ prettyPrint?: boolean;
362
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
363
+ quotaUser?: string;
364
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
365
+ upload_protocol?: string;
366
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
367
+ uploadType?: string;
368
+ }): Request<ListRegionalInventoriesResponse>;
369
+ }
370
+ interface ProductsResource {
371
+ localInventories: LocalInventoriesResource;
372
+ regionalInventories: RegionalInventoriesResource;
373
+ }
374
+ interface AccountsResource {
375
+ products: ProductsResource;
376
+ }
377
+
378
+ const accounts: AccountsResource;
379
+ }
380
+ }
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@maxim_mazurok/gapi.client.merchantapi-inventories_v1",
3
+ "version": "0.0.20250804",
4
+ "description": "TypeScript typings for Merchant API inventories_v1",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/Maxim-Mazurok/google-api-typings-generator.git"
8
+ },
9
+ "license": "MIT",
10
+ "author": {
11
+ "name": "Maxim Mazurok",
12
+ "email": "maxim@mazurok.com",
13
+ "url": "https://maxim.mazurok.com"
14
+ },
15
+ "types": "index.d.ts",
16
+ "dependencies": {
17
+ "@types/gapi.client": "*",
18
+ "@types/gapi.client.discovery-v1": "*"
19
+ }
20
+ }
package/readme.md ADDED
@@ -0,0 +1,73 @@
1
+ # TypeScript typings for Merchant API inventories_v1
2
+
3
+ Programmatically manage your Merchant Center Accounts.
4
+ For detailed description please check [documentation](https://developers.google.com/merchant/api).
5
+
6
+ ## Installing
7
+
8
+ Install typings for Merchant API:
9
+
10
+ ```
11
+ npm install @types/gapi.client.merchantapi-inventories_v1 --save-dev
12
+ ```
13
+
14
+ ## Usage
15
+
16
+ You need to initialize Google API client in your code:
17
+
18
+ ```typescript
19
+ gapi.load('client', () => {
20
+ // now we can use gapi.client
21
+ // ...
22
+ });
23
+ ```
24
+
25
+ Then load api client wrapper:
26
+
27
+ ```typescript
28
+ gapi.client.load(
29
+ 'https://merchantapi.googleapis.com/$discovery/rest?version=inventories_v1',
30
+ () => {
31
+ // now we can use:
32
+ // gapi.client.merchantapi
33
+ },
34
+ );
35
+ ```
36
+
37
+ ```typescript
38
+ // Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
39
+ gapi.client.load('merchantapi', 'inventories_v1', () => {
40
+ // now we can use:
41
+ // gapi.client.merchantapi
42
+ });
43
+ ```
44
+
45
+ Don't forget to authenticate your client before sending any request to resources:
46
+
47
+ ```typescript
48
+ // declare client_id registered in Google Developers Console
49
+ var client_id = '',
50
+ scope = [
51
+ // Manage your product listings and accounts for Google Shopping
52
+ 'https://www.googleapis.com/auth/content',
53
+ ],
54
+ immediate = true;
55
+ // ...
56
+
57
+ gapi.auth.authorize(
58
+ {client_id: client_id, scope: scope, immediate: immediate},
59
+ authResult => {
60
+ if (authResult && !authResult.error) {
61
+ /* handle successful authorization */
62
+ } else {
63
+ /* handle authorization error */
64
+ }
65
+ },
66
+ );
67
+ ```
68
+
69
+ After that you can use Merchant API resources: <!-- TODO: make this work for multiple namespaces -->
70
+
71
+ ```typescript
72
+
73
+ ```