@gr4vy/sdk 1.5.7 → 1.6.0

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 (54) hide show
  1. package/examples/package-lock.json +1 -1
  2. package/jsr.json +1 -1
  3. package/lib/config.d.ts +3 -3
  4. package/lib/config.js +3 -3
  5. package/models/components/index.d.ts +1 -0
  6. package/models/components/index.d.ts.map +1 -1
  7. package/models/components/index.js +1 -0
  8. package/models/components/index.js.map +1 -1
  9. package/models/components/monatospeioptions.d.ts +32 -0
  10. package/models/components/monatospeioptions.d.ts.map +1 -0
  11. package/models/components/monatospeioptions.js +78 -0
  12. package/models/components/monatospeioptions.js.map +1 -0
  13. package/models/components/transactionconnectionoptions.d.ts +6 -0
  14. package/models/components/transactionconnectionoptions.d.ts.map +1 -1
  15. package/models/components/transactionconnectionoptions.js +5 -0
  16. package/models/components/transactionconnectionoptions.js.map +1 -1
  17. package/package.json +1 -1
  18. package/src/lib/config.ts +3 -3
  19. package/src/models/components/index.ts +1 -0
  20. package/src/models/components/monatospeioptions.ts +78 -0
  21. package/src/models/components/transactionconnectionoptions.ts +15 -0
  22. package/docs/sdks/all/README.md +0 -98
  23. package/docs/sdks/auditlogs/README.md +0 -100
  24. package/docs/sdks/balances/README.md +0 -123
  25. package/docs/sdks/buyers/README.md +0 -461
  26. package/docs/sdks/cardschemedefinitions/README.md +0 -96
  27. package/docs/sdks/checkoutsessions/README.md +0 -367
  28. package/docs/sdks/cryptogram/README.md +0 -103
  29. package/docs/sdks/digitalwallets/README.md +0 -465
  30. package/docs/sdks/domains/README.md +0 -197
  31. package/docs/sdks/events/README.md +0 -99
  32. package/docs/sdks/executions/README.md +0 -285
  33. package/docs/sdks/giftcards/README.md +0 -376
  34. package/docs/sdks/gr4vygiftcards/README.md +0 -98
  35. package/docs/sdks/gr4vypaymentmethods/README.md +0 -96
  36. package/docs/sdks/gr4vyrefunds/README.md +0 -279
  37. package/docs/sdks/jobs/README.md +0 -107
  38. package/docs/sdks/merchantaccounts/README.md +0 -382
  39. package/docs/sdks/networktokens/README.md +0 -467
  40. package/docs/sdks/paymentlinks/README.md +0 -381
  41. package/docs/sdks/paymentmethods/README.md +0 -376
  42. package/docs/sdks/paymentoptions/README.md +0 -97
  43. package/docs/sdks/paymentservicedefinitions/README.md +0 -281
  44. package/docs/sdks/paymentservices/README.md +0 -706
  45. package/docs/sdks/paymentservicetokens/README.md +0 -286
  46. package/docs/sdks/payouts/README.md +0 -298
  47. package/docs/sdks/refunds/README.md +0 -97
  48. package/docs/sdks/reportexecutions/README.md +0 -100
  49. package/docs/sdks/reports/README.md +0 -403
  50. package/docs/sdks/sessions/README.md +0 -289
  51. package/docs/sdks/settlements/README.md +0 -188
  52. package/docs/sdks/shippingdetails/README.md +0 -462
  53. package/docs/sdks/transactions/README.md +0 -752
  54. package/examples/README.md +0 -31
@@ -1,461 +0,0 @@
1
- # Buyers
2
- (*buyers*)
3
-
4
- ## Overview
5
-
6
- ### Available Operations
7
-
8
- * [list](#list) - List all buyers
9
- * [create](#create) - Add a buyer
10
- * [get](#get) - Get a buyer
11
- * [update](#update) - Update a buyer
12
- * [delete](#delete) - Delete a buyer
13
-
14
- ## list
15
-
16
- List all buyers or search for a specific buyer.
17
-
18
- ### Example Usage
19
-
20
- <!-- UsageSnippet language="typescript" operationID="list_buyers" method="get" path="/buyers" -->
21
- ```typescript
22
- import { Gr4vy, withToken } from "@gr4vy/sdk";
23
- import fs from "fs";
24
-
25
- const gr4vy = new Gr4vy({
26
- id: "example",
27
- server: "sandbox",
28
- merchantAccountId: "default",
29
- bearerAuth: withToken({
30
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
31
- }),
32
- });
33
-
34
- async function run() {
35
- const result = await gr4vy.buyers.list();
36
-
37
- for await (const page of result) {
38
- console.log(page);
39
- }
40
- }
41
-
42
- run();
43
- ```
44
-
45
- ### Standalone function
46
-
47
- The standalone function version of this method:
48
-
49
- ```typescript
50
- import { Gr4vyCore } from "@gr4vy/sdk/core.js";
51
- import { buyersList } from "@gr4vy/sdk/funcs/buyersList.js";
52
-
53
- // Use `Gr4vyCore` for best tree-shaking performance.
54
- // You can create one instance of it to use across an application.
55
- const gr4vy = new Gr4vyCore({
56
- merchantAccountId: "<id>",
57
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
58
- });
59
-
60
- async function run() {
61
- const res = await buyersList(gr4vy);
62
- if (res.ok) {
63
- const { value: result } = res;
64
- for await (const page of result) {
65
- console.log(page);
66
- }
67
- } else {
68
- console.log("buyersList failed:", res.error);
69
- }
70
- }
71
-
72
- run();
73
- ```
74
-
75
- ### Parameters
76
-
77
- | Parameter | Type | Required | Description |
78
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
79
- | `request` | [operations.ListBuyersRequest](../../models/operations/listbuyersrequest.md) | :heavy_check_mark: | The request object to use for the request. |
80
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
81
- | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
82
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
83
-
84
- ### Response
85
-
86
- **Promise\<[operations.ListBuyersResponse](../../models/operations/listbuyersresponse.md)\>**
87
-
88
- ### Errors
89
-
90
- | Error Type | Status Code | Content Type |
91
- | -------------------------- | -------------------------- | -------------------------- |
92
- | errors.Error400 | 400 | application/json |
93
- | errors.Error401 | 401 | application/json |
94
- | errors.Error403 | 403 | application/json |
95
- | errors.Error404 | 404 | application/json |
96
- | errors.Error405 | 405 | application/json |
97
- | errors.Error409 | 409 | application/json |
98
- | errors.HTTPValidationError | 422 | application/json |
99
- | errors.Error425 | 425 | application/json |
100
- | errors.Error429 | 429 | application/json |
101
- | errors.Error500 | 500 | application/json |
102
- | errors.Error502 | 502 | application/json |
103
- | errors.Error504 | 504 | application/json |
104
- | errors.SDKError | 4XX, 5XX | \*/\* |
105
-
106
- ## create
107
-
108
- Create a new buyer record.
109
-
110
- ### Example Usage
111
-
112
- <!-- UsageSnippet language="typescript" operationID="add_buyer" method="post" path="/buyers" -->
113
- ```typescript
114
- import { Gr4vy, withToken } from "@gr4vy/sdk";
115
- import fs from "fs";
116
-
117
- const gr4vy = new Gr4vy({
118
- id: "example",
119
- server: "sandbox",
120
- merchantAccountId: "default",
121
- bearerAuth: withToken({
122
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
123
- }),
124
- });
125
-
126
- async function run() {
127
- const result = await gr4vy.buyers.create({});
128
-
129
- console.log(result);
130
- }
131
-
132
- run();
133
- ```
134
-
135
- ### Standalone function
136
-
137
- The standalone function version of this method:
138
-
139
- ```typescript
140
- import { Gr4vyCore } from "@gr4vy/sdk/core.js";
141
- import { buyersCreate } from "@gr4vy/sdk/funcs/buyersCreate.js";
142
-
143
- // Use `Gr4vyCore` for best tree-shaking performance.
144
- // You can create one instance of it to use across an application.
145
- const gr4vy = new Gr4vyCore({
146
- merchantAccountId: "<id>",
147
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
148
- });
149
-
150
- async function run() {
151
- const res = await buyersCreate(gr4vy, {});
152
- if (res.ok) {
153
- const { value: result } = res;
154
- console.log(result);
155
- } else {
156
- console.log("buyersCreate failed:", res.error);
157
- }
158
- }
159
-
160
- run();
161
- ```
162
-
163
- ### Parameters
164
-
165
- | Parameter | Type | Required | Description |
166
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
167
- | `buyerCreate` | [components.BuyerCreate](../../models/components/buyercreate.md) | :heavy_check_mark: | N/A |
168
- | `merchantAccountId` | *string* | :heavy_minus_sign: | The ID of the merchant account to use for this request. |
169
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
170
- | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
171
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
172
-
173
- ### Response
174
-
175
- **Promise\<[components.Buyer](../../models/components/buyer.md)\>**
176
-
177
- ### Errors
178
-
179
- | Error Type | Status Code | Content Type |
180
- | -------------------------- | -------------------------- | -------------------------- |
181
- | errors.Error400 | 400 | application/json |
182
- | errors.Error401 | 401 | application/json |
183
- | errors.Error403 | 403 | application/json |
184
- | errors.Error404 | 404 | application/json |
185
- | errors.Error405 | 405 | application/json |
186
- | errors.Error409 | 409 | application/json |
187
- | errors.HTTPValidationError | 422 | application/json |
188
- | errors.Error425 | 425 | application/json |
189
- | errors.Error429 | 429 | application/json |
190
- | errors.Error500 | 500 | application/json |
191
- | errors.Error502 | 502 | application/json |
192
- | errors.Error504 | 504 | application/json |
193
- | errors.SDKError | 4XX, 5XX | \*/\* |
194
-
195
- ## get
196
-
197
- Fetches a buyer by its ID.
198
-
199
- ### Example Usage
200
-
201
- <!-- UsageSnippet language="typescript" operationID="get_buyer" method="get" path="/buyers/{buyer_id}" -->
202
- ```typescript
203
- import { Gr4vy, withToken } from "@gr4vy/sdk";
204
- import fs from "fs";
205
-
206
- const gr4vy = new Gr4vy({
207
- id: "example",
208
- server: "sandbox",
209
- merchantAccountId: "default",
210
- bearerAuth: withToken({
211
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
212
- }),
213
- });
214
-
215
- async function run() {
216
- const result = await gr4vy.buyers.get("fe26475d-ec3e-4884-9553-f7356683f7f9");
217
-
218
- console.log(result);
219
- }
220
-
221
- run();
222
- ```
223
-
224
- ### Standalone function
225
-
226
- The standalone function version of this method:
227
-
228
- ```typescript
229
- import { Gr4vyCore } from "@gr4vy/sdk/core.js";
230
- import { buyersGet } from "@gr4vy/sdk/funcs/buyersGet.js";
231
-
232
- // Use `Gr4vyCore` for best tree-shaking performance.
233
- // You can create one instance of it to use across an application.
234
- const gr4vy = new Gr4vyCore({
235
- merchantAccountId: "<id>",
236
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
237
- });
238
-
239
- async function run() {
240
- const res = await buyersGet(gr4vy, "fe26475d-ec3e-4884-9553-f7356683f7f9");
241
- if (res.ok) {
242
- const { value: result } = res;
243
- console.log(result);
244
- } else {
245
- console.log("buyersGet failed:", res.error);
246
- }
247
- }
248
-
249
- run();
250
- ```
251
-
252
- ### Parameters
253
-
254
- | Parameter | Type | Required | Description | Example |
255
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
256
- | `buyerId` | *string* | :heavy_check_mark: | The ID of the buyer to retrieve. | [object Object] |
257
- | `merchantAccountId` | *string* | :heavy_minus_sign: | The ID of the merchant account to use for this request. | |
258
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | |
259
- | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | |
260
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | |
261
-
262
- ### Response
263
-
264
- **Promise\<[components.Buyer](../../models/components/buyer.md)\>**
265
-
266
- ### Errors
267
-
268
- | Error Type | Status Code | Content Type |
269
- | -------------------------- | -------------------------- | -------------------------- |
270
- | errors.Error400 | 400 | application/json |
271
- | errors.Error401 | 401 | application/json |
272
- | errors.Error403 | 403 | application/json |
273
- | errors.Error404 | 404 | application/json |
274
- | errors.Error405 | 405 | application/json |
275
- | errors.Error409 | 409 | application/json |
276
- | errors.HTTPValidationError | 422 | application/json |
277
- | errors.Error425 | 425 | application/json |
278
- | errors.Error429 | 429 | application/json |
279
- | errors.Error500 | 500 | application/json |
280
- | errors.Error502 | 502 | application/json |
281
- | errors.Error504 | 504 | application/json |
282
- | errors.SDKError | 4XX, 5XX | \*/\* |
283
-
284
- ## update
285
-
286
- Updates a buyer record.
287
-
288
- ### Example Usage
289
-
290
- <!-- UsageSnippet language="typescript" operationID="update_buyer" method="put" path="/buyers/{buyer_id}" -->
291
- ```typescript
292
- import { Gr4vy, withToken } from "@gr4vy/sdk";
293
- import fs from "fs";
294
-
295
- const gr4vy = new Gr4vy({
296
- id: "example",
297
- server: "sandbox",
298
- merchantAccountId: "default",
299
- bearerAuth: withToken({
300
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
301
- }),
302
- });
303
-
304
- async function run() {
305
- const result = await gr4vy.buyers.update({}, "fe26475d-ec3e-4884-9553-f7356683f7f9");
306
-
307
- console.log(result);
308
- }
309
-
310
- run();
311
- ```
312
-
313
- ### Standalone function
314
-
315
- The standalone function version of this method:
316
-
317
- ```typescript
318
- import { Gr4vyCore } from "@gr4vy/sdk/core.js";
319
- import { buyersUpdate } from "@gr4vy/sdk/funcs/buyersUpdate.js";
320
-
321
- // Use `Gr4vyCore` for best tree-shaking performance.
322
- // You can create one instance of it to use across an application.
323
- const gr4vy = new Gr4vyCore({
324
- merchantAccountId: "<id>",
325
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
326
- });
327
-
328
- async function run() {
329
- const res = await buyersUpdate(gr4vy, {}, "fe26475d-ec3e-4884-9553-f7356683f7f9");
330
- if (res.ok) {
331
- const { value: result } = res;
332
- console.log(result);
333
- } else {
334
- console.log("buyersUpdate failed:", res.error);
335
- }
336
- }
337
-
338
- run();
339
- ```
340
-
341
- ### Parameters
342
-
343
- | Parameter | Type | Required | Description | Example |
344
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
345
- | `buyerId` | *string* | :heavy_check_mark: | The ID of the buyer to edit. | [object Object] |
346
- | `buyerUpdate` | [components.BuyerUpdate](../../models/components/buyerupdate.md) | :heavy_check_mark: | N/A | |
347
- | `merchantAccountId` | *string* | :heavy_minus_sign: | The ID of the merchant account to use for this request. | |
348
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | |
349
- | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | |
350
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | |
351
-
352
- ### Response
353
-
354
- **Promise\<[components.Buyer](../../models/components/buyer.md)\>**
355
-
356
- ### Errors
357
-
358
- | Error Type | Status Code | Content Type |
359
- | -------------------------- | -------------------------- | -------------------------- |
360
- | errors.Error400 | 400 | application/json |
361
- | errors.Error401 | 401 | application/json |
362
- | errors.Error403 | 403 | application/json |
363
- | errors.Error404 | 404 | application/json |
364
- | errors.Error405 | 405 | application/json |
365
- | errors.Error409 | 409 | application/json |
366
- | errors.HTTPValidationError | 422 | application/json |
367
- | errors.Error425 | 425 | application/json |
368
- | errors.Error429 | 429 | application/json |
369
- | errors.Error500 | 500 | application/json |
370
- | errors.Error502 | 502 | application/json |
371
- | errors.Error504 | 504 | application/json |
372
- | errors.SDKError | 4XX, 5XX | \*/\* |
373
-
374
- ## delete
375
-
376
- Permanently removes a buyer record.
377
-
378
- ### Example Usage
379
-
380
- <!-- UsageSnippet language="typescript" operationID="delete_buyer" method="delete" path="/buyers/{buyer_id}" -->
381
- ```typescript
382
- import { Gr4vy, withToken } from "@gr4vy/sdk";
383
- import fs from "fs";
384
-
385
- const gr4vy = new Gr4vy({
386
- id: "example",
387
- server: "sandbox",
388
- merchantAccountId: "default",
389
- bearerAuth: withToken({
390
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
391
- }),
392
- });
393
-
394
- async function run() {
395
- await gr4vy.buyers.delete("fe26475d-ec3e-4884-9553-f7356683f7f9");
396
-
397
-
398
- }
399
-
400
- run();
401
- ```
402
-
403
- ### Standalone function
404
-
405
- The standalone function version of this method:
406
-
407
- ```typescript
408
- import { Gr4vyCore } from "@gr4vy/sdk/core.js";
409
- import { buyersDelete } from "@gr4vy/sdk/funcs/buyersDelete.js";
410
-
411
- // Use `Gr4vyCore` for best tree-shaking performance.
412
- // You can create one instance of it to use across an application.
413
- const gr4vy = new Gr4vyCore({
414
- merchantAccountId: "<id>",
415
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
416
- });
417
-
418
- async function run() {
419
- const res = await buyersDelete(gr4vy, "fe26475d-ec3e-4884-9553-f7356683f7f9");
420
- if (res.ok) {
421
- const { value: result } = res;
422
-
423
- } else {
424
- console.log("buyersDelete failed:", res.error);
425
- }
426
- }
427
-
428
- run();
429
- ```
430
-
431
- ### Parameters
432
-
433
- | Parameter | Type | Required | Description | Example |
434
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
435
- | `buyerId` | *string* | :heavy_check_mark: | The ID of the buyer to delete. | [object Object] |
436
- | `merchantAccountId` | *string* | :heavy_minus_sign: | The ID of the merchant account to use for this request. | |
437
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | |
438
- | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | |
439
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | |
440
-
441
- ### Response
442
-
443
- **Promise\<void\>**
444
-
445
- ### Errors
446
-
447
- | Error Type | Status Code | Content Type |
448
- | -------------------------- | -------------------------- | -------------------------- |
449
- | errors.Error400 | 400 | application/json |
450
- | errors.Error401 | 401 | application/json |
451
- | errors.Error403 | 403 | application/json |
452
- | errors.Error404 | 404 | application/json |
453
- | errors.Error405 | 405 | application/json |
454
- | errors.Error409 | 409 | application/json |
455
- | errors.HTTPValidationError | 422 | application/json |
456
- | errors.Error425 | 425 | application/json |
457
- | errors.Error429 | 429 | application/json |
458
- | errors.Error500 | 500 | application/json |
459
- | errors.Error502 | 502 | application/json |
460
- | errors.Error504 | 504 | application/json |
461
- | errors.SDKError | 4XX, 5XX | \*/\* |
@@ -1,96 +0,0 @@
1
- # CardSchemeDefinitions
2
- (*cardSchemeDefinitions*)
3
-
4
- ## Overview
5
-
6
- ### Available Operations
7
-
8
- * [list](#list) - List card scheme definitions
9
-
10
- ## list
11
-
12
- Fetch a list of the definitions of each card scheme.
13
-
14
- ### Example Usage
15
-
16
- <!-- UsageSnippet language="typescript" operationID="list_card_scheme_definitions" method="get" path="/card-scheme-definitions" -->
17
- ```typescript
18
- import { Gr4vy, withToken } from "@gr4vy/sdk";
19
- import fs from "fs";
20
-
21
- const gr4vy = new Gr4vy({
22
- id: "example",
23
- server: "sandbox",
24
- merchantAccountId: "default",
25
- bearerAuth: withToken({
26
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
27
- }),
28
- });
29
-
30
- async function run() {
31
- const result = await gr4vy.cardSchemeDefinitions.list();
32
-
33
- console.log(result);
34
- }
35
-
36
- run();
37
- ```
38
-
39
- ### Standalone function
40
-
41
- The standalone function version of this method:
42
-
43
- ```typescript
44
- import { Gr4vyCore } from "@gr4vy/sdk/core.js";
45
- import { cardSchemeDefinitionsList } from "@gr4vy/sdk/funcs/cardSchemeDefinitionsList.js";
46
-
47
- // Use `Gr4vyCore` for best tree-shaking performance.
48
- // You can create one instance of it to use across an application.
49
- const gr4vy = new Gr4vyCore({
50
- merchantAccountId: "<id>",
51
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
52
- });
53
-
54
- async function run() {
55
- const res = await cardSchemeDefinitionsList(gr4vy);
56
- if (res.ok) {
57
- const { value: result } = res;
58
- console.log(result);
59
- } else {
60
- console.log("cardSchemeDefinitionsList failed:", res.error);
61
- }
62
- }
63
-
64
- run();
65
- ```
66
-
67
- ### Parameters
68
-
69
- | Parameter | Type | Required | Description |
70
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
71
- | `merchantAccountId` | *string* | :heavy_minus_sign: | The ID of the merchant account to use for this request. |
72
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
73
- | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
74
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
75
-
76
- ### Response
77
-
78
- **Promise\<[components.CardSchemeDefinitions](../../models/components/cardschemedefinitions.md)\>**
79
-
80
- ### Errors
81
-
82
- | Error Type | Status Code | Content Type |
83
- | -------------------------- | -------------------------- | -------------------------- |
84
- | errors.Error400 | 400 | application/json |
85
- | errors.Error401 | 401 | application/json |
86
- | errors.Error403 | 403 | application/json |
87
- | errors.Error404 | 404 | application/json |
88
- | errors.Error405 | 405 | application/json |
89
- | errors.Error409 | 409 | application/json |
90
- | errors.HTTPValidationError | 422 | application/json |
91
- | errors.Error425 | 425 | application/json |
92
- | errors.Error429 | 429 | application/json |
93
- | errors.Error500 | 500 | application/json |
94
- | errors.Error502 | 502 | application/json |
95
- | errors.Error504 | 504 | application/json |
96
- | errors.SDKError | 4XX, 5XX | \*/\* |