@naturalpay/sdk 0.10.0 → 0.12.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.
- package/CHANGELOG.md +17 -0
- package/package.json +1 -1
- package/resources/payment-requests.d.mts +63 -65
- package/resources/payment-requests.d.mts.map +1 -1
- package/resources/payment-requests.d.ts +63 -65
- package/resources/payment-requests.d.ts.map +1 -1
- package/resources/payment-requests.js +36 -47
- package/resources/payment-requests.js.map +1 -1
- package/resources/payment-requests.mjs +36 -47
- package/resources/payment-requests.mjs.map +1 -1
- package/resources/payments.d.mts +43 -34
- package/resources/payments.d.mts.map +1 -1
- package/resources/payments.d.ts +43 -34
- package/resources/payments.d.ts.map +1 -1
- package/resources/payments.js +23 -30
- package/resources/payments.js.map +1 -1
- package/resources/payments.mjs +23 -30
- package/resources/payments.mjs.map +1 -1
- package/resources/transactions.d.mts +16 -18
- package/resources/transactions.d.mts.map +1 -1
- package/resources/transactions.d.ts +16 -18
- package/resources/transactions.d.ts.map +1 -1
- package/resources/transactions.js +6 -18
- package/resources/transactions.js.map +1 -1
- package/resources/transactions.mjs +6 -18
- package/resources/transactions.mjs.map +1 -1
- package/resources/transfers.d.mts +44 -37
- package/resources/transfers.d.mts.map +1 -1
- package/resources/transfers.d.ts +44 -37
- package/resources/transfers.d.ts.map +1 -1
- package/resources/transfers.js +20 -29
- package/resources/transfers.js.map +1 -1
- package/resources/transfers.mjs +20 -29
- package/resources/transfers.mjs.map +1 -1
- package/resources/wallet.d.mts +8 -24
- package/resources/wallet.d.mts.map +1 -1
- package/resources/wallet.d.ts +8 -24
- package/resources/wallet.d.ts.map +1 -1
- package/resources/wallet.js +4 -4
- package/resources/wallet.mjs +4 -4
- package/src/resources/payment-requests.ts +74 -111
- package/src/resources/payments.ts +53 -71
- package/src/resources/transactions.ts +22 -39
- package/src/resources/transfers.ts +52 -68
- package/src/resources/wallet.ts +8 -28
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -11,7 +11,9 @@ import { path } from '../internal/utils/path';
|
|
|
11
11
|
*/
|
|
12
12
|
export class PaymentRequests extends APIResource {
|
|
13
13
|
/**
|
|
14
|
-
* Create a payment request
|
|
14
|
+
* Create a payment request. Natural notifies the payer directly — email/phone
|
|
15
|
+
* payers receive the pay link, on-platform parties receive a dashboard deep-link,
|
|
16
|
+
* and agent payers receive only the in-app webhook.
|
|
15
17
|
*
|
|
16
18
|
* @example
|
|
17
19
|
* ```ts
|
|
@@ -19,6 +21,8 @@ export class PaymentRequests extends APIResource {
|
|
|
19
21
|
* amount: 1,
|
|
20
22
|
* payer: { type: 'email', value: 'dev@stainless.com' },
|
|
21
23
|
* 'Idempotency-Key': 'Idempotency-Key',
|
|
24
|
+
* 'X-Agent-ID': 'X-Agent-ID',
|
|
25
|
+
* 'X-Instance-ID': 'X-Instance-ID',
|
|
22
26
|
* });
|
|
23
27
|
* ```
|
|
24
28
|
*/
|
|
@@ -36,11 +40,7 @@ export class PaymentRequests extends APIResource {
|
|
|
36
40
|
body,
|
|
37
41
|
...options,
|
|
38
42
|
headers: buildHeaders([
|
|
39
|
-
{
|
|
40
|
-
'Idempotency-Key': idempotencyKey,
|
|
41
|
-
...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
|
|
42
|
-
...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
|
|
43
|
-
},
|
|
43
|
+
{ 'Idempotency-Key': idempotencyKey, 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID },
|
|
44
44
|
options?.headers,
|
|
45
45
|
]),
|
|
46
46
|
});
|
|
@@ -51,24 +51,18 @@ export class PaymentRequests extends APIResource {
|
|
|
51
51
|
*
|
|
52
52
|
* @example
|
|
53
53
|
* ```ts
|
|
54
|
-
* const paymentRequests = await client.paymentRequests.list(
|
|
54
|
+
* const paymentRequests = await client.paymentRequests.list({
|
|
55
|
+
* 'X-Agent-ID': 'X-Agent-ID',
|
|
56
|
+
* 'X-Instance-ID': 'X-Instance-ID',
|
|
57
|
+
* });
|
|
55
58
|
* ```
|
|
56
59
|
*/
|
|
57
|
-
list(
|
|
58
|
-
|
|
59
|
-
options?: RequestOptions,
|
|
60
|
-
): APIPromise<PaymentRequestListResponse> {
|
|
61
|
-
const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID, ...query } = params ?? {};
|
|
60
|
+
list(params: PaymentRequestListParams, options?: RequestOptions): APIPromise<PaymentRequestListResponse> {
|
|
61
|
+
const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID, ...query } = params;
|
|
62
62
|
return this._client.get('/payment-requests', {
|
|
63
63
|
query,
|
|
64
64
|
...options,
|
|
65
|
-
headers: buildHeaders([
|
|
66
|
-
{
|
|
67
|
-
...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
|
|
68
|
-
...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
|
|
69
|
-
},
|
|
70
|
-
options?.headers,
|
|
71
|
-
]),
|
|
65
|
+
headers: buildHeaders([{ 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID }, options?.headers]),
|
|
72
66
|
});
|
|
73
67
|
}
|
|
74
68
|
|
|
@@ -80,7 +74,11 @@ export class PaymentRequests extends APIResource {
|
|
|
80
74
|
* ```ts
|
|
81
75
|
* const response = await client.paymentRequests.decline(
|
|
82
76
|
* 'prq_ecc2efdd09bd231a9ad9bd2aada37aa7',
|
|
83
|
-
* {
|
|
77
|
+
* {
|
|
78
|
+
* 'Idempotency-Key': 'Idempotency-Key',
|
|
79
|
+
* 'X-Agent-ID': 'X-Agent-ID',
|
|
80
|
+
* 'X-Instance-ID': 'X-Instance-ID',
|
|
81
|
+
* },
|
|
84
82
|
* );
|
|
85
83
|
* ```
|
|
86
84
|
*/
|
|
@@ -97,11 +95,7 @@ export class PaymentRequests extends APIResource {
|
|
|
97
95
|
return this._client.post(path`/payment-requests/${paymentRequestID}/decline`, {
|
|
98
96
|
...options,
|
|
99
97
|
headers: buildHeaders([
|
|
100
|
-
{
|
|
101
|
-
'Idempotency-Key': idempotencyKey,
|
|
102
|
-
...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
|
|
103
|
-
...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
|
|
104
|
-
},
|
|
98
|
+
{ 'Idempotency-Key': idempotencyKey, 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID },
|
|
105
99
|
options?.headers,
|
|
106
100
|
]),
|
|
107
101
|
});
|
|
@@ -120,6 +114,8 @@ export class PaymentRequests extends APIResource {
|
|
|
120
114
|
* walletId: 'wal_ecc2efdd09bd231a9ad9bd2aada37aa7',
|
|
121
115
|
* },
|
|
122
116
|
* 'Idempotency-Key': 'Idempotency-Key',
|
|
117
|
+
* 'X-Agent-ID': 'X-Agent-ID',
|
|
118
|
+
* 'X-Instance-ID': 'X-Instance-ID',
|
|
123
119
|
* },
|
|
124
120
|
* );
|
|
125
121
|
* ```
|
|
@@ -139,11 +135,7 @@ export class PaymentRequests extends APIResource {
|
|
|
139
135
|
body,
|
|
140
136
|
...options,
|
|
141
137
|
headers: buildHeaders([
|
|
142
|
-
{
|
|
143
|
-
'Idempotency-Key': idempotencyKey,
|
|
144
|
-
...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
|
|
145
|
-
...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
|
|
146
|
-
},
|
|
138
|
+
{ 'Idempotency-Key': idempotencyKey, 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID },
|
|
147
139
|
options?.headers,
|
|
148
140
|
]),
|
|
149
141
|
});
|
|
@@ -156,24 +148,22 @@ export class PaymentRequests extends APIResource {
|
|
|
156
148
|
* ```ts
|
|
157
149
|
* const paymentRequest = await client.paymentRequests.get(
|
|
158
150
|
* 'prq_ecc2efdd09bd231a9ad9bd2aada37aa7',
|
|
151
|
+
* {
|
|
152
|
+
* 'X-Agent-ID': 'X-Agent-ID',
|
|
153
|
+
* 'X-Instance-ID': 'X-Instance-ID',
|
|
154
|
+
* },
|
|
159
155
|
* );
|
|
160
156
|
* ```
|
|
161
157
|
*/
|
|
162
158
|
get(
|
|
163
159
|
paymentRequestID: string,
|
|
164
|
-
params: PaymentRequestGetParams
|
|
160
|
+
params: PaymentRequestGetParams,
|
|
165
161
|
options?: RequestOptions,
|
|
166
162
|
): APIPromise<PaymentRequestGetResponse> {
|
|
167
|
-
const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID } = params
|
|
163
|
+
const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID } = params;
|
|
168
164
|
return this._client.get(path`/payment-requests/${paymentRequestID}`, {
|
|
169
165
|
...options,
|
|
170
|
-
headers: buildHeaders([
|
|
171
|
-
{
|
|
172
|
-
...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
|
|
173
|
-
...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
|
|
174
|
-
},
|
|
175
|
-
options?.headers,
|
|
176
|
-
]),
|
|
166
|
+
headers: buildHeaders([{ 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID }, options?.headers]),
|
|
177
167
|
});
|
|
178
168
|
}
|
|
179
169
|
|
|
@@ -182,25 +172,21 @@ export class PaymentRequests extends APIResource {
|
|
|
182
172
|
*
|
|
183
173
|
* @example
|
|
184
174
|
* ```ts
|
|
185
|
-
* const response =
|
|
186
|
-
*
|
|
175
|
+
* const response = await client.paymentRequests.listIncoming({
|
|
176
|
+
* 'X-Agent-ID': 'X-Agent-ID',
|
|
177
|
+
* 'X-Instance-ID': 'X-Instance-ID',
|
|
178
|
+
* });
|
|
187
179
|
* ```
|
|
188
180
|
*/
|
|
189
181
|
listIncoming(
|
|
190
|
-
params: PaymentRequestListIncomingParams
|
|
182
|
+
params: PaymentRequestListIncomingParams,
|
|
191
183
|
options?: RequestOptions,
|
|
192
184
|
): APIPromise<PaymentRequestListIncomingResponse> {
|
|
193
|
-
const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID, ...query } = params
|
|
185
|
+
const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID, ...query } = params;
|
|
194
186
|
return this._client.get('/payment-requests/incoming', {
|
|
195
187
|
query,
|
|
196
188
|
...options,
|
|
197
|
-
headers: buildHeaders([
|
|
198
|
-
{
|
|
199
|
-
...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
|
|
200
|
-
...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
|
|
201
|
-
},
|
|
202
|
-
options?.headers,
|
|
203
|
-
]),
|
|
189
|
+
headers: buildHeaders([{ 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID }, options?.headers]),
|
|
204
190
|
});
|
|
205
191
|
}
|
|
206
192
|
}
|
|
@@ -1654,6 +1640,16 @@ export interface PaymentRequestCreateParams {
|
|
|
1654
1640
|
*/
|
|
1655
1641
|
'Idempotency-Key': string;
|
|
1656
1642
|
|
|
1643
|
+
/**
|
|
1644
|
+
* Header param: Agent ID (agt_xxx) used for attribution and audit.
|
|
1645
|
+
*/
|
|
1646
|
+
'X-Agent-ID': string;
|
|
1647
|
+
|
|
1648
|
+
/**
|
|
1649
|
+
* Header param: Stable run, session, or conversation ID for agent observability.
|
|
1650
|
+
*/
|
|
1651
|
+
'X-Instance-ID': string;
|
|
1652
|
+
|
|
1657
1653
|
/**
|
|
1658
1654
|
* Body param: Currency code (currently only USD)
|
|
1659
1655
|
*/
|
|
@@ -1675,28 +1671,11 @@ export interface PaymentRequestCreateParams {
|
|
|
1675
1671
|
*/
|
|
1676
1672
|
payerName?: string;
|
|
1677
1673
|
|
|
1678
|
-
/**
|
|
1679
|
-
* Body param: If provided, immediately deliver the payment link to the payer via
|
|
1680
|
-
* the named channel
|
|
1681
|
-
*/
|
|
1682
|
-
sendLink?: PaymentRequestCreateParams.SendLink;
|
|
1683
|
-
|
|
1684
1674
|
/**
|
|
1685
1675
|
* Body param: Wallet that should receive the funds. Omit to use the requester
|
|
1686
1676
|
* party's default wallet.
|
|
1687
1677
|
*/
|
|
1688
1678
|
walletId?: string;
|
|
1689
|
-
|
|
1690
|
-
/**
|
|
1691
|
-
* Header param: Agent ID (agt_xxx) identifying which agent is making the request.
|
|
1692
|
-
*/
|
|
1693
|
-
'X-Agent-ID'?: string;
|
|
1694
|
-
|
|
1695
|
-
/**
|
|
1696
|
-
* Header param: Required when X-Agent-ID is present. Session or conversation ID
|
|
1697
|
-
* for agent observability.
|
|
1698
|
-
*/
|
|
1699
|
-
'X-Instance-ID'?: string;
|
|
1700
1679
|
}
|
|
1701
1680
|
|
|
1702
1681
|
export namespace PaymentRequestCreateParams {
|
|
@@ -1735,40 +1714,28 @@ export namespace PaymentRequestCreateParams {
|
|
|
1735
1714
|
*/
|
|
1736
1715
|
value: string;
|
|
1737
1716
|
}
|
|
1738
|
-
|
|
1739
|
-
/**
|
|
1740
|
-
* If provided, immediately deliver the payment link to the payer via the named
|
|
1741
|
-
* channel
|
|
1742
|
-
*/
|
|
1743
|
-
export interface SendLink {
|
|
1744
|
-
/**
|
|
1745
|
-
* Channel to deliver the payment link
|
|
1746
|
-
*/
|
|
1747
|
-
channel: 'EMAIL' | 'SMS';
|
|
1748
|
-
}
|
|
1749
1717
|
}
|
|
1750
1718
|
|
|
1751
1719
|
export interface PaymentRequestListParams {
|
|
1752
1720
|
/**
|
|
1753
|
-
*
|
|
1721
|
+
* Header param: Agent ID (agt_xxx) used for attribution and audit.
|
|
1754
1722
|
*/
|
|
1755
|
-
|
|
1723
|
+
'X-Agent-ID': string;
|
|
1756
1724
|
|
|
1757
1725
|
/**
|
|
1758
|
-
*
|
|
1726
|
+
* Header param: Stable run, session, or conversation ID for agent observability.
|
|
1759
1727
|
*/
|
|
1760
|
-
|
|
1728
|
+
'X-Instance-ID': string;
|
|
1761
1729
|
|
|
1762
1730
|
/**
|
|
1763
|
-
*
|
|
1731
|
+
* Query param: Pagination cursor returned by the previous response
|
|
1764
1732
|
*/
|
|
1765
|
-
|
|
1733
|
+
cursor?: string;
|
|
1766
1734
|
|
|
1767
1735
|
/**
|
|
1768
|
-
*
|
|
1769
|
-
* for agent observability.
|
|
1736
|
+
* Query param: Results per page (1-100)
|
|
1770
1737
|
*/
|
|
1771
|
-
|
|
1738
|
+
limit?: number;
|
|
1772
1739
|
}
|
|
1773
1740
|
|
|
1774
1741
|
export interface PaymentRequestDeclineParams {
|
|
@@ -1779,15 +1746,14 @@ export interface PaymentRequestDeclineParams {
|
|
|
1779
1746
|
'Idempotency-Key': string;
|
|
1780
1747
|
|
|
1781
1748
|
/**
|
|
1782
|
-
* Agent ID (agt_xxx)
|
|
1749
|
+
* Agent ID (agt_xxx) used for attribution and audit.
|
|
1783
1750
|
*/
|
|
1784
|
-
'X-Agent-ID'
|
|
1751
|
+
'X-Agent-ID': string;
|
|
1785
1752
|
|
|
1786
1753
|
/**
|
|
1787
|
-
*
|
|
1788
|
-
* observability.
|
|
1754
|
+
* Stable run, session, or conversation ID for agent observability.
|
|
1789
1755
|
*/
|
|
1790
|
-
'X-Instance-ID'
|
|
1756
|
+
'X-Instance-ID': string;
|
|
1791
1757
|
}
|
|
1792
1758
|
|
|
1793
1759
|
export interface PaymentRequestFulfillParams {
|
|
@@ -1803,15 +1769,14 @@ export interface PaymentRequestFulfillParams {
|
|
|
1803
1769
|
'Idempotency-Key': string;
|
|
1804
1770
|
|
|
1805
1771
|
/**
|
|
1806
|
-
* Header param: Agent ID (agt_xxx)
|
|
1772
|
+
* Header param: Agent ID (agt_xxx) used for attribution and audit.
|
|
1807
1773
|
*/
|
|
1808
|
-
'X-Agent-ID'
|
|
1774
|
+
'X-Agent-ID': string;
|
|
1809
1775
|
|
|
1810
1776
|
/**
|
|
1811
|
-
* Header param:
|
|
1812
|
-
* for agent observability.
|
|
1777
|
+
* Header param: Stable run, session, or conversation ID for agent observability.
|
|
1813
1778
|
*/
|
|
1814
|
-
'X-Instance-ID'
|
|
1779
|
+
'X-Instance-ID': string;
|
|
1815
1780
|
}
|
|
1816
1781
|
|
|
1817
1782
|
export namespace PaymentRequestFulfillParams {
|
|
@@ -1830,38 +1795,36 @@ export namespace PaymentRequestFulfillParams {
|
|
|
1830
1795
|
|
|
1831
1796
|
export interface PaymentRequestGetParams {
|
|
1832
1797
|
/**
|
|
1833
|
-
* Agent ID (agt_xxx)
|
|
1798
|
+
* Agent ID (agt_xxx) used for attribution and audit.
|
|
1834
1799
|
*/
|
|
1835
|
-
'X-Agent-ID'
|
|
1800
|
+
'X-Agent-ID': string;
|
|
1836
1801
|
|
|
1837
1802
|
/**
|
|
1838
|
-
*
|
|
1839
|
-
* observability.
|
|
1803
|
+
* Stable run, session, or conversation ID for agent observability.
|
|
1840
1804
|
*/
|
|
1841
|
-
'X-Instance-ID'
|
|
1805
|
+
'X-Instance-ID': string;
|
|
1842
1806
|
}
|
|
1843
1807
|
|
|
1844
1808
|
export interface PaymentRequestListIncomingParams {
|
|
1845
1809
|
/**
|
|
1846
|
-
*
|
|
1810
|
+
* Header param: Agent ID (agt_xxx) used for attribution and audit.
|
|
1847
1811
|
*/
|
|
1848
|
-
|
|
1812
|
+
'X-Agent-ID': string;
|
|
1849
1813
|
|
|
1850
1814
|
/**
|
|
1851
|
-
*
|
|
1815
|
+
* Header param: Stable run, session, or conversation ID for agent observability.
|
|
1852
1816
|
*/
|
|
1853
|
-
|
|
1817
|
+
'X-Instance-ID': string;
|
|
1854
1818
|
|
|
1855
1819
|
/**
|
|
1856
|
-
*
|
|
1820
|
+
* Query param: Pagination cursor returned by the previous response
|
|
1857
1821
|
*/
|
|
1858
|
-
|
|
1822
|
+
cursor?: string;
|
|
1859
1823
|
|
|
1860
1824
|
/**
|
|
1861
|
-
*
|
|
1862
|
-
* for agent observability.
|
|
1825
|
+
* Query param: Results per page (1-100)
|
|
1863
1826
|
*/
|
|
1864
|
-
|
|
1827
|
+
limit?: number;
|
|
1865
1828
|
}
|
|
1866
1829
|
|
|
1867
1830
|
export declare namespace PaymentRequests {
|
|
@@ -22,6 +22,8 @@ export class Payments extends APIResource {
|
|
|
22
22
|
* value: 'dev@stainless.com',
|
|
23
23
|
* },
|
|
24
24
|
* 'Idempotency-Key': 'Idempotency-Key',
|
|
25
|
+
* 'X-Agent-ID': 'X-Agent-ID',
|
|
26
|
+
* 'X-Instance-ID': 'X-Instance-ID',
|
|
25
27
|
* });
|
|
26
28
|
* ```
|
|
27
29
|
*/
|
|
@@ -36,11 +38,7 @@ export class Payments extends APIResource {
|
|
|
36
38
|
body,
|
|
37
39
|
...options,
|
|
38
40
|
headers: buildHeaders([
|
|
39
|
-
{
|
|
40
|
-
'Idempotency-Key': idempotencyKey,
|
|
41
|
-
...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
|
|
42
|
-
...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
|
|
43
|
-
},
|
|
41
|
+
{ 'Idempotency-Key': idempotencyKey, 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID },
|
|
44
42
|
options?.headers,
|
|
45
43
|
]),
|
|
46
44
|
});
|
|
@@ -51,24 +49,18 @@ export class Payments extends APIResource {
|
|
|
51
49
|
*
|
|
52
50
|
* @example
|
|
53
51
|
* ```ts
|
|
54
|
-
* const payments = await client.payments.list(
|
|
52
|
+
* const payments = await client.payments.list({
|
|
53
|
+
* 'X-Agent-ID': 'X-Agent-ID',
|
|
54
|
+
* 'X-Instance-ID': 'X-Instance-ID',
|
|
55
|
+
* });
|
|
55
56
|
* ```
|
|
56
57
|
*/
|
|
57
|
-
list(
|
|
58
|
-
|
|
59
|
-
options?: RequestOptions,
|
|
60
|
-
): APIPromise<PaymentListResponse> {
|
|
61
|
-
const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID, ...query } = params ?? {};
|
|
58
|
+
list(params: PaymentListParams, options?: RequestOptions): APIPromise<PaymentListResponse> {
|
|
59
|
+
const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID, ...query } = params;
|
|
62
60
|
return this._client.get('/payments', {
|
|
63
61
|
query,
|
|
64
62
|
...options,
|
|
65
|
-
headers: buildHeaders([
|
|
66
|
-
{
|
|
67
|
-
...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
|
|
68
|
-
...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
|
|
69
|
-
},
|
|
70
|
-
options?.headers,
|
|
71
|
-
]),
|
|
63
|
+
headers: buildHeaders([{ 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID }, options?.headers]),
|
|
72
64
|
});
|
|
73
65
|
}
|
|
74
66
|
|
|
@@ -79,7 +71,11 @@ export class Payments extends APIResource {
|
|
|
79
71
|
* ```ts
|
|
80
72
|
* const response = await client.payments.cancel(
|
|
81
73
|
* 'pay_ecc2efdd09bd231a9ad9bd2aada37aa7',
|
|
82
|
-
* {
|
|
74
|
+
* {
|
|
75
|
+
* 'Idempotency-Key': 'Idempotency-Key',
|
|
76
|
+
* 'X-Agent-ID': 'X-Agent-ID',
|
|
77
|
+
* 'X-Instance-ID': 'X-Instance-ID',
|
|
78
|
+
* },
|
|
83
79
|
* );
|
|
84
80
|
* ```
|
|
85
81
|
*/
|
|
@@ -96,11 +92,7 @@ export class Payments extends APIResource {
|
|
|
96
92
|
return this._client.post(path`/payments/${paymentID}/cancel`, {
|
|
97
93
|
...options,
|
|
98
94
|
headers: buildHeaders([
|
|
99
|
-
{
|
|
100
|
-
'Idempotency-Key': idempotencyKey,
|
|
101
|
-
...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
|
|
102
|
-
...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
|
|
103
|
-
},
|
|
95
|
+
{ 'Idempotency-Key': idempotencyKey, 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID },
|
|
104
96
|
options?.headers,
|
|
105
97
|
]),
|
|
106
98
|
});
|
|
@@ -113,25 +105,19 @@ export class Payments extends APIResource {
|
|
|
113
105
|
* ```ts
|
|
114
106
|
* const payment = await client.payments.get(
|
|
115
107
|
* 'pay_ecc2efdd09bd231a9ad9bd2aada37aa7',
|
|
108
|
+
* {
|
|
109
|
+
* 'X-Agent-ID': 'X-Agent-ID',
|
|
110
|
+
* 'X-Instance-ID': 'X-Instance-ID',
|
|
111
|
+
* },
|
|
116
112
|
* );
|
|
117
113
|
* ```
|
|
118
114
|
*/
|
|
119
|
-
get(
|
|
120
|
-
|
|
121
|
-
params: PaymentGetParams | null | undefined = {},
|
|
122
|
-
options?: RequestOptions,
|
|
123
|
-
): APIPromise<PaymentGetResponse> {
|
|
124
|
-
const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID, ...query } = params ?? {};
|
|
115
|
+
get(paymentID: string, params: PaymentGetParams, options?: RequestOptions): APIPromise<PaymentGetResponse> {
|
|
116
|
+
const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID, ...query } = params;
|
|
125
117
|
return this._client.get(path`/payments/${paymentID}`, {
|
|
126
118
|
query,
|
|
127
119
|
...options,
|
|
128
|
-
headers: buildHeaders([
|
|
129
|
-
{
|
|
130
|
-
...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
|
|
131
|
-
...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
|
|
132
|
-
},
|
|
133
|
-
options?.headers,
|
|
134
|
-
]),
|
|
120
|
+
headers: buildHeaders([{ 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID }, options?.headers]),
|
|
135
121
|
});
|
|
136
122
|
}
|
|
137
123
|
}
|
|
@@ -1060,6 +1046,16 @@ export interface PaymentCreateParams {
|
|
|
1060
1046
|
*/
|
|
1061
1047
|
'Idempotency-Key': string;
|
|
1062
1048
|
|
|
1049
|
+
/**
|
|
1050
|
+
* Header param: Agent ID (agt_xxx) used for attribution and audit.
|
|
1051
|
+
*/
|
|
1052
|
+
'X-Agent-ID': string;
|
|
1053
|
+
|
|
1054
|
+
/**
|
|
1055
|
+
* Header param: Stable run, session, or conversation ID for agent observability.
|
|
1056
|
+
*/
|
|
1057
|
+
'X-Instance-ID': string;
|
|
1058
|
+
|
|
1063
1059
|
/**
|
|
1064
1060
|
* Body param: Currency code
|
|
1065
1061
|
*/
|
|
@@ -1075,17 +1071,6 @@ export interface PaymentCreateParams {
|
|
|
1075
1071
|
* Body param: Payment description. Maximum 500 characters.
|
|
1076
1072
|
*/
|
|
1077
1073
|
description?: string;
|
|
1078
|
-
|
|
1079
|
-
/**
|
|
1080
|
-
* Header param: Agent ID (agt_xxx) identifying which agent is making the request.
|
|
1081
|
-
*/
|
|
1082
|
-
'X-Agent-ID'?: string;
|
|
1083
|
-
|
|
1084
|
-
/**
|
|
1085
|
-
* Header param: Required when X-Agent-ID is present. Session or conversation ID
|
|
1086
|
-
* for agent observability.
|
|
1087
|
-
*/
|
|
1088
|
-
'X-Instance-ID'?: string;
|
|
1089
1074
|
}
|
|
1090
1075
|
|
|
1091
1076
|
export namespace PaymentCreateParams {
|
|
@@ -1128,30 +1113,29 @@ export namespace PaymentCreateParams {
|
|
|
1128
1113
|
|
|
1129
1114
|
export interface PaymentListParams {
|
|
1130
1115
|
/**
|
|
1131
|
-
*
|
|
1116
|
+
* Header param: Agent ID (agt_xxx) used for attribution and audit.
|
|
1132
1117
|
*/
|
|
1133
|
-
|
|
1118
|
+
'X-Agent-ID': string;
|
|
1134
1119
|
|
|
1135
1120
|
/**
|
|
1136
|
-
*
|
|
1121
|
+
* Header param: Stable run, session, or conversation ID for agent observability.
|
|
1137
1122
|
*/
|
|
1138
|
-
|
|
1123
|
+
'X-Instance-ID': string;
|
|
1139
1124
|
|
|
1140
1125
|
/**
|
|
1141
|
-
* Query param:
|
|
1126
|
+
* Query param: Pagination cursor from previous response
|
|
1142
1127
|
*/
|
|
1143
|
-
|
|
1128
|
+
cursor?: string;
|
|
1144
1129
|
|
|
1145
1130
|
/**
|
|
1146
|
-
*
|
|
1131
|
+
* Query param: Results per page
|
|
1147
1132
|
*/
|
|
1148
|
-
|
|
1133
|
+
limit?: number;
|
|
1149
1134
|
|
|
1150
1135
|
/**
|
|
1151
|
-
*
|
|
1152
|
-
* for agent observability.
|
|
1136
|
+
* Query param: Party ID for delegated payment lookup
|
|
1153
1137
|
*/
|
|
1154
|
-
|
|
1138
|
+
partyId?: string;
|
|
1155
1139
|
}
|
|
1156
1140
|
|
|
1157
1141
|
export interface PaymentCancelParams {
|
|
@@ -1162,33 +1146,31 @@ export interface PaymentCancelParams {
|
|
|
1162
1146
|
'Idempotency-Key': string;
|
|
1163
1147
|
|
|
1164
1148
|
/**
|
|
1165
|
-
* Agent ID (agt_xxx)
|
|
1149
|
+
* Agent ID (agt_xxx) used for attribution and audit.
|
|
1166
1150
|
*/
|
|
1167
|
-
'X-Agent-ID'
|
|
1151
|
+
'X-Agent-ID': string;
|
|
1168
1152
|
|
|
1169
1153
|
/**
|
|
1170
|
-
*
|
|
1171
|
-
* observability.
|
|
1154
|
+
* Stable run, session, or conversation ID for agent observability.
|
|
1172
1155
|
*/
|
|
1173
|
-
'X-Instance-ID'
|
|
1156
|
+
'X-Instance-ID': string;
|
|
1174
1157
|
}
|
|
1175
1158
|
|
|
1176
1159
|
export interface PaymentGetParams {
|
|
1177
1160
|
/**
|
|
1178
|
-
*
|
|
1161
|
+
* Header param: Agent ID (agt_xxx) used for attribution and audit.
|
|
1179
1162
|
*/
|
|
1180
|
-
|
|
1163
|
+
'X-Agent-ID': string;
|
|
1181
1164
|
|
|
1182
1165
|
/**
|
|
1183
|
-
* Header param:
|
|
1166
|
+
* Header param: Stable run, session, or conversation ID for agent observability.
|
|
1184
1167
|
*/
|
|
1185
|
-
'X-
|
|
1168
|
+
'X-Instance-ID': string;
|
|
1186
1169
|
|
|
1187
1170
|
/**
|
|
1188
|
-
*
|
|
1189
|
-
* for agent observability.
|
|
1171
|
+
* Query param: Party ID for delegated payment lookup
|
|
1190
1172
|
*/
|
|
1191
|
-
|
|
1173
|
+
partyId?: string;
|
|
1192
1174
|
}
|
|
1193
1175
|
|
|
1194
1176
|
export declare namespace Payments {
|