@gr4vy/sdk 1.5.8 → 1.6.1

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 (49) 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/checkoutsession.d.ts +15 -0
  6. package/models/components/checkoutsession.d.ts.map +1 -1
  7. package/models/components/checkoutsession.js +8 -0
  8. package/models/components/checkoutsession.js.map +1 -1
  9. package/models/components/checkoutsessioncreate.d.ts +15 -0
  10. package/models/components/checkoutsessioncreate.d.ts.map +1 -1
  11. package/models/components/checkoutsessioncreate.js +8 -0
  12. package/models/components/checkoutsessioncreate.js.map +1 -1
  13. package/package.json +1 -1
  14. package/src/lib/config.ts +3 -3
  15. package/src/models/components/checkoutsession.ts +23 -0
  16. package/src/models/components/checkoutsessioncreate.ts +23 -0
  17. package/docs/sdks/all/README.md +0 -98
  18. package/docs/sdks/auditlogs/README.md +0 -100
  19. package/docs/sdks/balances/README.md +0 -123
  20. package/docs/sdks/buyers/README.md +0 -461
  21. package/docs/sdks/cardschemedefinitions/README.md +0 -96
  22. package/docs/sdks/checkoutsessions/README.md +0 -367
  23. package/docs/sdks/cryptogram/README.md +0 -103
  24. package/docs/sdks/digitalwallets/README.md +0 -465
  25. package/docs/sdks/domains/README.md +0 -197
  26. package/docs/sdks/events/README.md +0 -99
  27. package/docs/sdks/executions/README.md +0 -285
  28. package/docs/sdks/giftcards/README.md +0 -376
  29. package/docs/sdks/gr4vygiftcards/README.md +0 -98
  30. package/docs/sdks/gr4vypaymentmethods/README.md +0 -96
  31. package/docs/sdks/gr4vyrefunds/README.md +0 -279
  32. package/docs/sdks/jobs/README.md +0 -107
  33. package/docs/sdks/merchantaccounts/README.md +0 -382
  34. package/docs/sdks/networktokens/README.md +0 -467
  35. package/docs/sdks/paymentlinks/README.md +0 -381
  36. package/docs/sdks/paymentmethods/README.md +0 -376
  37. package/docs/sdks/paymentoptions/README.md +0 -97
  38. package/docs/sdks/paymentservicedefinitions/README.md +0 -281
  39. package/docs/sdks/paymentservices/README.md +0 -706
  40. package/docs/sdks/paymentservicetokens/README.md +0 -286
  41. package/docs/sdks/payouts/README.md +0 -298
  42. package/docs/sdks/refunds/README.md +0 -97
  43. package/docs/sdks/reportexecutions/README.md +0 -100
  44. package/docs/sdks/reports/README.md +0 -403
  45. package/docs/sdks/sessions/README.md +0 -289
  46. package/docs/sdks/settlements/README.md +0 -188
  47. package/docs/sdks/shippingdetails/README.md +0 -462
  48. package/docs/sdks/transactions/README.md +0 -752
  49. package/examples/README.md +0 -31
@@ -1,97 +0,0 @@
1
- # Refunds
2
- (*refunds*)
3
-
4
- ## Overview
5
-
6
- ### Available Operations
7
-
8
- * [get](#get) - Get refund
9
-
10
- ## get
11
-
12
- Fetch a refund.
13
-
14
- ### Example Usage
15
-
16
- <!-- UsageSnippet language="typescript" operationID="get_refund" method="get" path="/refunds/{refund_id}" -->
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.refunds.get("6a1d4e46-14ed-4fe1-a45f-eff4e025d211");
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 { refundsGet } from "@gr4vy/sdk/funcs/refundsGet.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 refundsGet(gr4vy, "6a1d4e46-14ed-4fe1-a45f-eff4e025d211");
56
- if (res.ok) {
57
- const { value: result } = res;
58
- console.log(result);
59
- } else {
60
- console.log("refundsGet failed:", res.error);
61
- }
62
- }
63
-
64
- run();
65
- ```
66
-
67
- ### Parameters
68
-
69
- | Parameter | Type | Required | Description | Example |
70
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
71
- | `refundId` | *string* | :heavy_check_mark: | The ID of the refund | [object Object] |
72
- | `merchantAccountId` | *string* | :heavy_minus_sign: | The ID of the merchant account to use for this request. | |
73
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | |
74
- | `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. | |
75
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | |
76
-
77
- ### Response
78
-
79
- **Promise\<[components.Refund](../../models/components/refund.md)\>**
80
-
81
- ### Errors
82
-
83
- | Error Type | Status Code | Content Type |
84
- | -------------------------- | -------------------------- | -------------------------- |
85
- | errors.Error400 | 400 | application/json |
86
- | errors.Error401 | 401 | application/json |
87
- | errors.Error403 | 403 | application/json |
88
- | errors.Error404 | 404 | application/json |
89
- | errors.Error405 | 405 | application/json |
90
- | errors.Error409 | 409 | application/json |
91
- | errors.HTTPValidationError | 422 | application/json |
92
- | errors.Error425 | 425 | application/json |
93
- | errors.Error429 | 429 | application/json |
94
- | errors.Error500 | 500 | application/json |
95
- | errors.Error502 | 502 | application/json |
96
- | errors.Error504 | 504 | application/json |
97
- | errors.SDKError | 4XX, 5XX | \*/\* |
@@ -1,100 +0,0 @@
1
- # ReportExecutions
2
- (*reportExecutions*)
3
-
4
- ## Overview
5
-
6
- ### Available Operations
7
-
8
- * [list](#list) - List executed reports
9
-
10
- ## list
11
-
12
- List all executed reports that have been generated.
13
-
14
- ### Example Usage
15
-
16
- <!-- UsageSnippet language="typescript" operationID="list_all_report_executions" method="get" path="/report-executions" -->
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.reportExecutions.list();
32
-
33
- for await (const page of result) {
34
- console.log(page);
35
- }
36
- }
37
-
38
- run();
39
- ```
40
-
41
- ### Standalone function
42
-
43
- The standalone function version of this method:
44
-
45
- ```typescript
46
- import { Gr4vyCore } from "@gr4vy/sdk/core.js";
47
- import { reportExecutionsList } from "@gr4vy/sdk/funcs/reportExecutionsList.js";
48
-
49
- // Use `Gr4vyCore` for best tree-shaking performance.
50
- // You can create one instance of it to use across an application.
51
- const gr4vy = new Gr4vyCore({
52
- merchantAccountId: "<id>",
53
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
54
- });
55
-
56
- async function run() {
57
- const res = await reportExecutionsList(gr4vy);
58
- if (res.ok) {
59
- const { value: result } = res;
60
- for await (const page of result) {
61
- console.log(page);
62
- }
63
- } else {
64
- console.log("reportExecutionsList failed:", res.error);
65
- }
66
- }
67
-
68
- run();
69
- ```
70
-
71
- ### Parameters
72
-
73
- | Parameter | Type | Required | Description |
74
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
75
- | `request` | [operations.ListAllReportExecutionsRequest](../../models/operations/listallreportexecutionsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
76
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
77
- | `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. |
78
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
79
-
80
- ### Response
81
-
82
- **Promise\<[operations.ListAllReportExecutionsResponse](../../models/operations/listallreportexecutionsresponse.md)\>**
83
-
84
- ### Errors
85
-
86
- | Error Type | Status Code | Content Type |
87
- | -------------------------- | -------------------------- | -------------------------- |
88
- | errors.Error400 | 400 | application/json |
89
- | errors.Error401 | 401 | application/json |
90
- | errors.Error403 | 403 | application/json |
91
- | errors.Error404 | 404 | application/json |
92
- | errors.Error405 | 405 | application/json |
93
- | errors.Error409 | 409 | application/json |
94
- | errors.HTTPValidationError | 422 | application/json |
95
- | errors.Error425 | 425 | application/json |
96
- | errors.Error429 | 429 | application/json |
97
- | errors.Error500 | 500 | application/json |
98
- | errors.Error502 | 502 | application/json |
99
- | errors.Error504 | 504 | application/json |
100
- | errors.SDKError | 4XX, 5XX | \*/\* |
@@ -1,403 +0,0 @@
1
- # Reports
2
- (*reports*)
3
-
4
- ## Overview
5
-
6
- ### Available Operations
7
-
8
- * [list](#list) - List configured reports
9
- * [create](#create) - Add a report
10
- * [get](#get) - Get a report
11
- * [put](#put) - Update a report
12
-
13
- ## list
14
-
15
- List all configured reports that can be generated.
16
-
17
- ### Example Usage
18
-
19
- <!-- UsageSnippet language="typescript" operationID="list_reports" method="get" path="/reports" -->
20
- ```typescript
21
- import { Gr4vy, withToken } from "@gr4vy/sdk";
22
- import fs from "fs";
23
-
24
- const gr4vy = new Gr4vy({
25
- id: "example",
26
- server: "sandbox",
27
- merchantAccountId: "default",
28
- bearerAuth: withToken({
29
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
30
- }),
31
- });
32
-
33
- async function run() {
34
- const result = await gr4vy.reports.list();
35
-
36
- for await (const page of result) {
37
- console.log(page);
38
- }
39
- }
40
-
41
- run();
42
- ```
43
-
44
- ### Standalone function
45
-
46
- The standalone function version of this method:
47
-
48
- ```typescript
49
- import { Gr4vyCore } from "@gr4vy/sdk/core.js";
50
- import { reportsList } from "@gr4vy/sdk/funcs/reportsList.js";
51
-
52
- // Use `Gr4vyCore` for best tree-shaking performance.
53
- // You can create one instance of it to use across an application.
54
- const gr4vy = new Gr4vyCore({
55
- merchantAccountId: "<id>",
56
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
57
- });
58
-
59
- async function run() {
60
- const res = await reportsList(gr4vy);
61
- if (res.ok) {
62
- const { value: result } = res;
63
- for await (const page of result) {
64
- console.log(page);
65
- }
66
- } else {
67
- console.log("reportsList failed:", res.error);
68
- }
69
- }
70
-
71
- run();
72
- ```
73
-
74
- ### Parameters
75
-
76
- | Parameter | Type | Required | Description |
77
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
78
- | `request` | [operations.ListReportsRequest](../../models/operations/listreportsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
79
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
80
- | `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. |
81
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
82
-
83
- ### Response
84
-
85
- **Promise\<[operations.ListReportsResponse](../../models/operations/listreportsresponse.md)\>**
86
-
87
- ### Errors
88
-
89
- | Error Type | Status Code | Content Type |
90
- | -------------------------- | -------------------------- | -------------------------- |
91
- | errors.Error400 | 400 | application/json |
92
- | errors.Error401 | 401 | application/json |
93
- | errors.Error403 | 403 | application/json |
94
- | errors.Error404 | 404 | application/json |
95
- | errors.Error405 | 405 | application/json |
96
- | errors.Error409 | 409 | application/json |
97
- | errors.HTTPValidationError | 422 | application/json |
98
- | errors.Error425 | 425 | application/json |
99
- | errors.Error429 | 429 | application/json |
100
- | errors.Error500 | 500 | application/json |
101
- | errors.Error502 | 502 | application/json |
102
- | errors.Error504 | 504 | application/json |
103
- | errors.SDKError | 4XX, 5XX | \*/\* |
104
-
105
- ## create
106
-
107
- Create a new report.
108
-
109
- ### Example Usage
110
-
111
- <!-- UsageSnippet language="typescript" operationID="add_report" method="post" path="/reports" -->
112
- ```typescript
113
- import { Gr4vy, withToken } from "@gr4vy/sdk";
114
- import fs from "fs";
115
-
116
- const gr4vy = new Gr4vy({
117
- id: "example",
118
- server: "sandbox",
119
- merchantAccountId: "default",
120
- bearerAuth: withToken({
121
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
122
- }),
123
- });
124
-
125
- async function run() {
126
- const result = await gr4vy.reports.create({
127
- name: "Monthly Transaction Report",
128
- schedule: "daily",
129
- scheduleEnabled: true,
130
- scheduleTimezone: "UTC",
131
- spec: {
132
- model: "detailed_settlement",
133
- params: {
134
- "filters": {
135
- "ingested_at": {
136
- "end": "day_end",
137
- "start": "day_start",
138
- },
139
- },
140
- },
141
- },
142
- });
143
-
144
- console.log(result);
145
- }
146
-
147
- run();
148
- ```
149
-
150
- ### Standalone function
151
-
152
- The standalone function version of this method:
153
-
154
- ```typescript
155
- import { Gr4vyCore } from "@gr4vy/sdk/core.js";
156
- import { reportsCreate } from "@gr4vy/sdk/funcs/reportsCreate.js";
157
-
158
- // Use `Gr4vyCore` for best tree-shaking performance.
159
- // You can create one instance of it to use across an application.
160
- const gr4vy = new Gr4vyCore({
161
- merchantAccountId: "<id>",
162
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
163
- });
164
-
165
- async function run() {
166
- const res = await reportsCreate(gr4vy, {
167
- name: "Monthly Transaction Report",
168
- schedule: "daily",
169
- scheduleEnabled: true,
170
- scheduleTimezone: "UTC",
171
- spec: {
172
- model: "detailed_settlement",
173
- params: {
174
- "filters": {
175
- "ingested_at": {
176
- "end": "day_end",
177
- "start": "day_start",
178
- },
179
- },
180
- },
181
- },
182
- });
183
- if (res.ok) {
184
- const { value: result } = res;
185
- console.log(result);
186
- } else {
187
- console.log("reportsCreate failed:", res.error);
188
- }
189
- }
190
-
191
- run();
192
- ```
193
-
194
- ### Parameters
195
-
196
- | Parameter | Type | Required | Description |
197
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
198
- | `reportCreate` | [components.ReportCreate](../../models/components/reportcreate.md) | :heavy_check_mark: | N/A |
199
- | `merchantAccountId` | *string* | :heavy_minus_sign: | The ID of the merchant account to use for this request. |
200
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
201
- | `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. |
202
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
203
-
204
- ### Response
205
-
206
- **Promise\<[components.Report](../../models/components/report.md)\>**
207
-
208
- ### Errors
209
-
210
- | Error Type | Status Code | Content Type |
211
- | -------------------------- | -------------------------- | -------------------------- |
212
- | errors.Error400 | 400 | application/json |
213
- | errors.Error401 | 401 | application/json |
214
- | errors.Error403 | 403 | application/json |
215
- | errors.Error404 | 404 | application/json |
216
- | errors.Error405 | 405 | application/json |
217
- | errors.Error409 | 409 | application/json |
218
- | errors.HTTPValidationError | 422 | application/json |
219
- | errors.Error425 | 425 | application/json |
220
- | errors.Error429 | 429 | application/json |
221
- | errors.Error500 | 500 | application/json |
222
- | errors.Error502 | 502 | application/json |
223
- | errors.Error504 | 504 | application/json |
224
- | errors.SDKError | 4XX, 5XX | \*/\* |
225
-
226
- ## get
227
-
228
- Fetches a report by its ID.
229
-
230
- ### Example Usage
231
-
232
- <!-- UsageSnippet language="typescript" operationID="get_report" method="get" path="/reports/{report_id}" -->
233
- ```typescript
234
- import { Gr4vy, withToken } from "@gr4vy/sdk";
235
- import fs from "fs";
236
-
237
- const gr4vy = new Gr4vy({
238
- id: "example",
239
- server: "sandbox",
240
- merchantAccountId: "default",
241
- bearerAuth: withToken({
242
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
243
- }),
244
- });
245
-
246
- async function run() {
247
- const result = await gr4vy.reports.get("4d4c7123-b794-4fad-b1b9-5ab2606e6bbe");
248
-
249
- console.log(result);
250
- }
251
-
252
- run();
253
- ```
254
-
255
- ### Standalone function
256
-
257
- The standalone function version of this method:
258
-
259
- ```typescript
260
- import { Gr4vyCore } from "@gr4vy/sdk/core.js";
261
- import { reportsGet } from "@gr4vy/sdk/funcs/reportsGet.js";
262
-
263
- // Use `Gr4vyCore` for best tree-shaking performance.
264
- // You can create one instance of it to use across an application.
265
- const gr4vy = new Gr4vyCore({
266
- merchantAccountId: "<id>",
267
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
268
- });
269
-
270
- async function run() {
271
- const res = await reportsGet(gr4vy, "4d4c7123-b794-4fad-b1b9-5ab2606e6bbe");
272
- if (res.ok) {
273
- const { value: result } = res;
274
- console.log(result);
275
- } else {
276
- console.log("reportsGet failed:", res.error);
277
- }
278
- }
279
-
280
- run();
281
- ```
282
-
283
- ### Parameters
284
-
285
- | Parameter | Type | Required | Description | Example |
286
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
287
- | `reportId` | *string* | :heavy_check_mark: | The ID of the report to retrieve details for. | [object Object] |
288
- | `merchantAccountId` | *string* | :heavy_minus_sign: | The ID of the merchant account to use for this request. | |
289
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | |
290
- | `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. | |
291
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | |
292
-
293
- ### Response
294
-
295
- **Promise\<[components.Report](../../models/components/report.md)\>**
296
-
297
- ### Errors
298
-
299
- | Error Type | Status Code | Content Type |
300
- | -------------------------- | -------------------------- | -------------------------- |
301
- | errors.Error400 | 400 | application/json |
302
- | errors.Error401 | 401 | application/json |
303
- | errors.Error403 | 403 | application/json |
304
- | errors.Error404 | 404 | application/json |
305
- | errors.Error405 | 405 | application/json |
306
- | errors.Error409 | 409 | application/json |
307
- | errors.HTTPValidationError | 422 | application/json |
308
- | errors.Error425 | 425 | application/json |
309
- | errors.Error429 | 429 | application/json |
310
- | errors.Error500 | 500 | application/json |
311
- | errors.Error502 | 502 | application/json |
312
- | errors.Error504 | 504 | application/json |
313
- | errors.SDKError | 4XX, 5XX | \*/\* |
314
-
315
- ## put
316
-
317
- Updates the configuration of a report.
318
-
319
- ### Example Usage
320
-
321
- <!-- UsageSnippet language="typescript" operationID="update_report" method="put" path="/reports/{report_id}" -->
322
- ```typescript
323
- import { Gr4vy, withToken } from "@gr4vy/sdk";
324
- import fs from "fs";
325
-
326
- const gr4vy = new Gr4vy({
327
- id: "example",
328
- server: "sandbox",
329
- merchantAccountId: "default",
330
- bearerAuth: withToken({
331
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
332
- }),
333
- });
334
-
335
- async function run() {
336
- const result = await gr4vy.reports.put({}, "4d4c7123-b794-4fad-b1b9-5ab2606e6bbe");
337
-
338
- console.log(result);
339
- }
340
-
341
- run();
342
- ```
343
-
344
- ### Standalone function
345
-
346
- The standalone function version of this method:
347
-
348
- ```typescript
349
- import { Gr4vyCore } from "@gr4vy/sdk/core.js";
350
- import { reportsPut } from "@gr4vy/sdk/funcs/reportsPut.js";
351
-
352
- // Use `Gr4vyCore` for best tree-shaking performance.
353
- // You can create one instance of it to use across an application.
354
- const gr4vy = new Gr4vyCore({
355
- merchantAccountId: "<id>",
356
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
357
- });
358
-
359
- async function run() {
360
- const res = await reportsPut(gr4vy, {}, "4d4c7123-b794-4fad-b1b9-5ab2606e6bbe");
361
- if (res.ok) {
362
- const { value: result } = res;
363
- console.log(result);
364
- } else {
365
- console.log("reportsPut failed:", res.error);
366
- }
367
- }
368
-
369
- run();
370
- ```
371
-
372
- ### Parameters
373
-
374
- | Parameter | Type | Required | Description | Example |
375
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
376
- | `reportId` | *string* | :heavy_check_mark: | The ID of the report to edit. | [object Object] |
377
- | `reportUpdate` | [components.ReportUpdate](../../models/components/reportupdate.md) | :heavy_check_mark: | N/A | |
378
- | `merchantAccountId` | *string* | :heavy_minus_sign: | The ID of the merchant account to use for this request. | |
379
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | |
380
- | `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. | |
381
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | |
382
-
383
- ### Response
384
-
385
- **Promise\<[components.Report](../../models/components/report.md)\>**
386
-
387
- ### Errors
388
-
389
- | Error Type | Status Code | Content Type |
390
- | -------------------------- | -------------------------- | -------------------------- |
391
- | errors.Error400 | 400 | application/json |
392
- | errors.Error401 | 401 | application/json |
393
- | errors.Error403 | 403 | application/json |
394
- | errors.Error404 | 404 | application/json |
395
- | errors.Error405 | 405 | application/json |
396
- | errors.Error409 | 409 | application/json |
397
- | errors.HTTPValidationError | 422 | application/json |
398
- | errors.Error425 | 425 | application/json |
399
- | errors.Error429 | 429 | application/json |
400
- | errors.Error500 | 500 | application/json |
401
- | errors.Error502 | 502 | application/json |
402
- | errors.Error504 | 504 | application/json |
403
- | errors.SDKError | 4XX, 5XX | \*/\* |