@vexpay/node 0.3.0 → 0.5.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/dist/index.d.cts CHANGED
@@ -66,6 +66,11 @@ interface components {
66
66
  * @example 0.00
67
67
  */
68
68
  convertedVes: string;
69
+ /**
70
+ * @description Net card chargeback fees charged (fees minus fees returned on won disputes).
71
+ * @example 0.00
72
+ */
73
+ chargebackFeesVes: string;
69
74
  /** @example 100.00 */
70
75
  reserveVes: string;
71
76
  /** @example 8650.00 */
@@ -91,6 +96,48 @@ interface components {
91
96
  /** @example 0.00 */
92
97
  feeFixedUsd: string;
93
98
  };
99
+ BalanceTransactionDto: {
100
+ /**
101
+ * Format: uuid
102
+ * @description Stable id of the movement; never changes or disappears.
103
+ */
104
+ id: string;
105
+ /**
106
+ * @example chargeback
107
+ * @enum {string}
108
+ */
109
+ type: "payment" | "fee" | "payment_reversal" | "fee_reversal" | "payout" | "payout_reversal" | "chargeback" | "chargeback_fee" | "chargeback_reversal" | "adjustment" | "seller_transfer" | "seller_transfer_reversal" | "conversion" | "conversion_reversal";
110
+ /**
111
+ * @description Signed VES amount (negative = money out of your balance).
112
+ * @example -4000.00
113
+ */
114
+ amountVes: string;
115
+ /** Format: uuid */
116
+ paymentId?: string;
117
+ /** Format: uuid */
118
+ payoutId?: string;
119
+ /**
120
+ * Format: uuid
121
+ * @description Present on chargeback movements.
122
+ */
123
+ chargebackId?: string;
124
+ /** Format: uuid */
125
+ merchantId?: string;
126
+ /**
127
+ * @description externalRef of the linked payment or payout.
128
+ * @example order-1042
129
+ */
130
+ externalRef?: string;
131
+ /** @example Card chargeback (fraud) */
132
+ description: string;
133
+ /** Format: date-time */
134
+ createdAt: string;
135
+ };
136
+ BalanceTransactionListDto: {
137
+ items: components["schemas"]["BalanceTransactionDto"][];
138
+ /** @description Pass as `cursor` to get the next (older) page; null on the last page. */
139
+ nextCursor: string | null;
140
+ };
94
141
  CreateWebhookDto: {
95
142
  /**
96
143
  * Format: uri
@@ -108,7 +155,7 @@ interface components {
108
155
  * "payment.failed"
109
156
  * ]
110
157
  */
111
- events: ("payment.pending" | "payment.completed" | "payment.failed" | "payment.canceled" | "payment.reversed" | "merchant.verified" | "merchant.rejected" | "merchant.deactivated" | "merchant.reactivated" | "merchant.balance.updated" | "merchant.created" | "merchant.activated" | "merchant.updated" | "merchant.kyb_required" | "merchant.restricted" | "merchant.capability.updated" | "merchant.wallet_credit" | "payout.completed" | "payout.failed" | "conversion.completed" | "conversion.canceled" | "tenant.status_changed" | "tenant.api_key.created" | "tenant.api_key.rotated" | "tenant.api_key.revoked" | "tenant.live_status_changed" | "notification.test")[];
158
+ events: ("payment.pending" | "payment.completed" | "payment.failed" | "payment.canceled" | "payment.reversed" | "payment.chargeback" | "payment.chargeback_closed" | "merchant.verified" | "merchant.rejected" | "merchant.deactivated" | "merchant.reactivated" | "merchant.balance.updated" | "merchant.created" | "merchant.activated" | "merchant.updated" | "merchant.kyb_required" | "merchant.restricted" | "merchant.capability.updated" | "merchant.wallet_credit" | "payout.completed" | "payout.failed" | "conversion.completed" | "conversion.canceled" | "tenant.status_changed" | "tenant.api_key.created" | "tenant.api_key.rotated" | "tenant.api_key.revoked" | "tenant.live_status_changed" | "notification.test")[];
112
159
  };
113
160
  WebhookEndpointDto: {
114
161
  /** Format: uuid */
@@ -117,7 +164,7 @@ interface components {
117
164
  tenantId: string;
118
165
  /** Format: uri */
119
166
  url: string;
120
- events: ("payment.pending" | "payment.completed" | "payment.failed" | "payment.canceled" | "payment.reversed" | "merchant.verified" | "merchant.rejected" | "merchant.deactivated" | "merchant.reactivated" | "merchant.balance.updated" | "merchant.created" | "merchant.activated" | "merchant.updated" | "merchant.kyb_required" | "merchant.restricted" | "merchant.capability.updated" | "merchant.wallet_credit" | "payout.completed" | "payout.failed" | "conversion.completed" | "conversion.canceled" | "tenant.status_changed" | "tenant.api_key.created" | "tenant.api_key.rotated" | "tenant.api_key.revoked" | "tenant.live_status_changed" | "notification.test")[];
167
+ events: ("payment.pending" | "payment.completed" | "payment.failed" | "payment.canceled" | "payment.reversed" | "payment.chargeback" | "payment.chargeback_closed" | "merchant.verified" | "merchant.rejected" | "merchant.deactivated" | "merchant.reactivated" | "merchant.balance.updated" | "merchant.created" | "merchant.activated" | "merchant.updated" | "merchant.kyb_required" | "merchant.restricted" | "merchant.capability.updated" | "merchant.wallet_credit" | "payout.completed" | "payout.failed" | "conversion.completed" | "conversion.canceled" | "tenant.status_changed" | "tenant.api_key.created" | "tenant.api_key.rotated" | "tenant.api_key.revoked" | "tenant.live_status_changed" | "notification.test")[];
121
168
  isActive: boolean;
122
169
  /** Format: date-time */
123
170
  createdAt: string;
@@ -138,7 +185,7 @@ interface components {
138
185
  * "payout.completed"
139
186
  * ]
140
187
  */
141
- events?: ("payment.pending" | "payment.completed" | "payment.failed" | "payment.canceled" | "payment.reversed" | "merchant.verified" | "merchant.rejected" | "merchant.deactivated" | "merchant.reactivated" | "merchant.balance.updated" | "merchant.created" | "merchant.activated" | "merchant.updated" | "merchant.kyb_required" | "merchant.restricted" | "merchant.capability.updated" | "merchant.wallet_credit" | "payout.completed" | "payout.failed" | "conversion.completed" | "conversion.canceled" | "tenant.status_changed" | "tenant.api_key.created" | "tenant.api_key.rotated" | "tenant.api_key.revoked" | "tenant.live_status_changed" | "notification.test")[];
188
+ events?: ("payment.pending" | "payment.completed" | "payment.failed" | "payment.canceled" | "payment.reversed" | "payment.chargeback" | "payment.chargeback_closed" | "merchant.verified" | "merchant.rejected" | "merchant.deactivated" | "merchant.reactivated" | "merchant.balance.updated" | "merchant.created" | "merchant.activated" | "merchant.updated" | "merchant.kyb_required" | "merchant.restricted" | "merchant.capability.updated" | "merchant.wallet_credit" | "payout.completed" | "payout.failed" | "conversion.completed" | "conversion.canceled" | "tenant.status_changed" | "tenant.api_key.created" | "tenant.api_key.rotated" | "tenant.api_key.revoked" | "tenant.live_status_changed" | "notification.test")[];
142
189
  /** @example true */
143
190
  isActive?: boolean;
144
191
  };
@@ -1855,8 +1902,8 @@ interface components {
1855
1902
  * ]
1856
1903
  */
1857
1904
  allowedOrigins?: string[];
1858
- /** @description Payment methods offered. Defaults to every method your account can accept. */
1859
- methods?: ("c2p" | "vpos" | "usdt" | "usdc")[];
1905
+ /** @description Payment methods offered. Defaults to every method your account can accept. `cop` (Colombian pesos: Bre-B, Nequi, Daviplata) needs the COP method on your account. */
1906
+ methods?: ("c2p" | "vpos" | "usdt" | "usdc" | "cop")[];
1860
1907
  /**
1861
1908
  * @description Up to 20 string key/value pairs (keys ≤ 40 chars, values ≤ 500 chars).
1862
1909
  * @example {
@@ -1892,7 +1939,7 @@ interface components {
1892
1939
  [key: string]: string;
1893
1940
  };
1894
1941
  allowedOrigins: string[];
1895
- methods: ("c2p" | "vpos" | "usdt" | "usdc")[];
1942
+ methods: ("c2p" | "vpos" | "usdt" | "usdc" | "cop")[];
1896
1943
  successUrl?: string | null;
1897
1944
  cancelUrl?: string | null;
1898
1945
  /** @description Latest payment for this session, once one exists. */
@@ -2062,6 +2109,85 @@ interface operations {
2062
2109
  };
2063
2110
  };
2064
2111
  };
2112
+ Balance_listTransactions: {
2113
+ parameters: {
2114
+ query?: {
2115
+ /** @description ISO 8601, exclusive (createdAt). */
2116
+ to?: string;
2117
+ /** @description ISO 8601, inclusive (createdAt). */
2118
+ from?: string;
2119
+ /** @description Only movements of this payout. */
2120
+ payoutId?: string;
2121
+ /** @description Only movements of this payment. */
2122
+ paymentId?: string;
2123
+ /** @description One or more types (repeat or comma-separate). */
2124
+ type?: ("payment" | "fee" | "payment_reversal" | "fee_reversal" | "payout" | "payout_reversal" | "chargeback" | "chargeback_fee" | "chargeback_reversal" | "adjustment" | "seller_transfer" | "seller_transfer_reversal" | "conversion" | "conversion_reversal")[];
2125
+ /** @description `nextCursor` from the previous page. */
2126
+ cursor?: string;
2127
+ /** @description 1–100, default 50. */
2128
+ limit?: number;
2129
+ };
2130
+ header?: never;
2131
+ path?: never;
2132
+ cookie?: never;
2133
+ };
2134
+ requestBody?: never;
2135
+ responses: {
2136
+ 200: {
2137
+ headers: {
2138
+ [name: string]: unknown;
2139
+ };
2140
+ content: {
2141
+ "application/json": components["schemas"]["BalanceTransactionListDto"];
2142
+ };
2143
+ };
2144
+ /** @description `invalid_data` — a parameter is invalid. */
2145
+ 400: {
2146
+ headers: {
2147
+ [name: string]: unknown;
2148
+ };
2149
+ content: {
2150
+ "application/json": components["schemas"]["ApiErrorDto"];
2151
+ };
2152
+ };
2153
+ /** @description Missing, invalid, or inactive tenant API key. */
2154
+ 401: {
2155
+ headers: {
2156
+ [name: string]: unknown;
2157
+ };
2158
+ content: {
2159
+ "application/json": components["schemas"]["ApiErrorDto"];
2160
+ };
2161
+ };
2162
+ /** @description Live mode not activated (`live_mode_not_activated`): the live account is pending VEX Pay review or suspended. Test keys are unaffected. */
2163
+ 403: {
2164
+ headers: {
2165
+ [name: string]: unknown;
2166
+ };
2167
+ content: {
2168
+ "application/json": components["schemas"]["ApiErrorDto"];
2169
+ };
2170
+ };
2171
+ /** @description Client error. */
2172
+ "4XX": {
2173
+ headers: {
2174
+ [name: string]: unknown;
2175
+ };
2176
+ content: {
2177
+ "application/json": components["schemas"]["ApiErrorDto"];
2178
+ };
2179
+ };
2180
+ /** @description Server or upstream bank error. */
2181
+ "5XX": {
2182
+ headers: {
2183
+ [name: string]: unknown;
2184
+ };
2185
+ content: {
2186
+ "application/json": components["schemas"]["ApiErrorDto"];
2187
+ };
2188
+ };
2189
+ };
2190
+ };
2065
2191
  Webhooks_listWebhooks: {
2066
2192
  parameters: {
2067
2193
  query?: never;
@@ -7881,8 +8007,28 @@ declare class Quotes extends APIResource {
7881
8007
  };
7882
8008
  }>;
7883
8009
  }
8010
+ /** Every movement in your VES balance (payments, fees, payouts, chargebacks, …), newest first. */
8011
+ declare class BalanceTransactions extends APIResource {
8012
+ /** Await for one page, or `for await` over every movement. The amounts sum to `ledgerNetVes`. */
8013
+ list(params?: QueryParams<'Balance_listTransactions'>, options?: RequestOptions): PagePromise<{
8014
+ items: components["schemas"]["BalanceTransactionDto"][];
8015
+ nextCursor: string | null;
8016
+ }, {
8017
+ id: string;
8018
+ type: "payment" | "fee" | "payment_reversal" | "fee_reversal" | "payout" | "payout_reversal" | "chargeback" | "chargeback_fee" | "chargeback_reversal" | "adjustment" | "seller_transfer" | "seller_transfer_reversal" | "conversion" | "conversion_reversal";
8019
+ amountVes: string;
8020
+ paymentId?: string;
8021
+ payoutId?: string;
8022
+ chargebackId?: string;
8023
+ merchantId?: string;
8024
+ externalRef?: string;
8025
+ description: string;
8026
+ createdAt: string;
8027
+ }>;
8028
+ }
7884
8029
  /** Your platform balance. */
7885
8030
  declare class Balance extends APIResource {
8031
+ readonly transactions: BalanceTransactions;
7886
8032
  retrieve(options?: RequestOptions): Promise<{
7887
8033
  tenantId: string;
7888
8034
  platformId: string;
@@ -7890,6 +8036,7 @@ declare class Balance extends APIResource {
7890
8036
  feesVes: string;
7891
8037
  paidOutVes: string;
7892
8038
  convertedVes: string;
8039
+ chargebackFeesVes: string;
7893
8040
  reserveVes: string;
7894
8041
  ledgerNetVes: string;
7895
8042
  availableVes: string;
@@ -8081,7 +8228,7 @@ declare class WebhookEndpoints extends APIResource {
8081
8228
  id: string;
8082
8229
  tenantId: string;
8083
8230
  url: string;
8084
- events: ("payment.pending" | "payment.completed" | "payment.failed" | "payment.canceled" | "payment.reversed" | "merchant.verified" | "merchant.rejected" | "merchant.deactivated" | "merchant.reactivated" | "merchant.balance.updated" | "merchant.created" | "merchant.activated" | "merchant.updated" | "merchant.kyb_required" | "merchant.restricted" | "merchant.capability.updated" | "merchant.wallet_credit" | "payout.completed" | "payout.failed" | "conversion.completed" | "conversion.canceled" | "tenant.status_changed" | "tenant.api_key.created" | "tenant.api_key.rotated" | "tenant.api_key.revoked" | "tenant.live_status_changed" | "notification.test")[];
8231
+ events: ("payment.pending" | "payment.completed" | "payment.failed" | "payment.canceled" | "payment.reversed" | "payment.chargeback" | "payment.chargeback_closed" | "merchant.verified" | "merchant.rejected" | "merchant.deactivated" | "merchant.reactivated" | "merchant.balance.updated" | "merchant.created" | "merchant.activated" | "merchant.updated" | "merchant.kyb_required" | "merchant.restricted" | "merchant.capability.updated" | "merchant.wallet_credit" | "payout.completed" | "payout.failed" | "conversion.completed" | "conversion.canceled" | "tenant.status_changed" | "tenant.api_key.created" | "tenant.api_key.rotated" | "tenant.api_key.revoked" | "tenant.live_status_changed" | "notification.test")[];
8085
8232
  isActive: boolean;
8086
8233
  createdAt: string;
8087
8234
  secret?: string;
@@ -8090,7 +8237,7 @@ declare class WebhookEndpoints extends APIResource {
8090
8237
  id: string;
8091
8238
  tenantId: string;
8092
8239
  url: string;
8093
- events: ("payment.pending" | "payment.completed" | "payment.failed" | "payment.canceled" | "payment.reversed" | "merchant.verified" | "merchant.rejected" | "merchant.deactivated" | "merchant.reactivated" | "merchant.balance.updated" | "merchant.created" | "merchant.activated" | "merchant.updated" | "merchant.kyb_required" | "merchant.restricted" | "merchant.capability.updated" | "merchant.wallet_credit" | "payout.completed" | "payout.failed" | "conversion.completed" | "conversion.canceled" | "tenant.status_changed" | "tenant.api_key.created" | "tenant.api_key.rotated" | "tenant.api_key.revoked" | "tenant.live_status_changed" | "notification.test")[];
8240
+ events: ("payment.pending" | "payment.completed" | "payment.failed" | "payment.canceled" | "payment.reversed" | "payment.chargeback" | "payment.chargeback_closed" | "merchant.verified" | "merchant.rejected" | "merchant.deactivated" | "merchant.reactivated" | "merchant.balance.updated" | "merchant.created" | "merchant.activated" | "merchant.updated" | "merchant.kyb_required" | "merchant.restricted" | "merchant.capability.updated" | "merchant.wallet_credit" | "payout.completed" | "payout.failed" | "conversion.completed" | "conversion.canceled" | "tenant.status_changed" | "tenant.api_key.created" | "tenant.api_key.rotated" | "tenant.api_key.revoked" | "tenant.live_status_changed" | "notification.test")[];
8094
8241
  isActive: boolean;
8095
8242
  createdAt: string;
8096
8243
  secret?: string;
@@ -8099,7 +8246,7 @@ declare class WebhookEndpoints extends APIResource {
8099
8246
  id: string;
8100
8247
  tenantId: string;
8101
8248
  url: string;
8102
- events: ("payment.pending" | "payment.completed" | "payment.failed" | "payment.canceled" | "payment.reversed" | "merchant.verified" | "merchant.rejected" | "merchant.deactivated" | "merchant.reactivated" | "merchant.balance.updated" | "merchant.created" | "merchant.activated" | "merchant.updated" | "merchant.kyb_required" | "merchant.restricted" | "merchant.capability.updated" | "merchant.wallet_credit" | "payout.completed" | "payout.failed" | "conversion.completed" | "conversion.canceled" | "tenant.status_changed" | "tenant.api_key.created" | "tenant.api_key.rotated" | "tenant.api_key.revoked" | "tenant.live_status_changed" | "notification.test")[];
8249
+ events: ("payment.pending" | "payment.completed" | "payment.failed" | "payment.canceled" | "payment.reversed" | "payment.chargeback" | "payment.chargeback_closed" | "merchant.verified" | "merchant.rejected" | "merchant.deactivated" | "merchant.reactivated" | "merchant.balance.updated" | "merchant.created" | "merchant.activated" | "merchant.updated" | "merchant.kyb_required" | "merchant.restricted" | "merchant.capability.updated" | "merchant.wallet_credit" | "payout.completed" | "payout.failed" | "conversion.completed" | "conversion.canceled" | "tenant.status_changed" | "tenant.api_key.created" | "tenant.api_key.rotated" | "tenant.api_key.revoked" | "tenant.live_status_changed" | "notification.test")[];
8103
8250
  isActive: boolean;
8104
8251
  createdAt: string;
8105
8252
  secret?: string;
@@ -8131,7 +8278,7 @@ declare class CheckoutSessions extends APIResource {
8131
8278
  [key: string]: string;
8132
8279
  };
8133
8280
  allowedOrigins: string[];
8134
- methods: ("c2p" | "vpos" | "usdt" | "usdc")[];
8281
+ methods: ("c2p" | "vpos" | "usdt" | "usdc" | "cop")[];
8135
8282
  successUrl?: string | null;
8136
8283
  cancelUrl?: string | null;
8137
8284
  paymentId?: string | null;
@@ -8152,7 +8299,7 @@ declare class CheckoutSessions extends APIResource {
8152
8299
  [key: string]: string;
8153
8300
  };
8154
8301
  allowedOrigins: string[];
8155
- methods: ("c2p" | "vpos" | "usdt" | "usdc")[];
8302
+ methods: ("c2p" | "vpos" | "usdt" | "usdc" | "cop")[];
8156
8303
  successUrl?: string | null;
8157
8304
  cancelUrl?: string | null;
8158
8305
  paymentId?: string | null;
@@ -8995,7 +9142,7 @@ declare class Payments extends APIResource {
8995
9142
  }>;
8996
9143
  }
8997
9144
 
8998
- declare const WEBHOOK_EVENT_NAMES: readonly ["payment.pending", "payment.completed", "payment.failed", "payment.canceled", "payment.reversed", "merchant.verified", "merchant.rejected", "merchant.deactivated", "merchant.reactivated", "merchant.balance.updated", "merchant.created", "merchant.activated", "merchant.updated", "merchant.kyb_required", "merchant.restricted", "merchant.capability.updated", "merchant.wallet_credit", "payout.completed", "payout.failed", "conversion.completed", "conversion.canceled", "tenant.status_changed", "tenant.api_key.created", "tenant.api_key.rotated", "tenant.api_key.revoked", "tenant.live_status_changed", "notification.test"];
9145
+ declare const WEBHOOK_EVENT_NAMES: readonly ["payment.pending", "payment.completed", "payment.failed", "payment.canceled", "payment.reversed", "payment.chargeback", "payment.chargeback_closed", "merchant.verified", "merchant.rejected", "merchant.deactivated", "merchant.reactivated", "merchant.balance.updated", "merchant.created", "merchant.activated", "merchant.updated", "merchant.kyb_required", "merchant.restricted", "merchant.capability.updated", "merchant.wallet_credit", "payout.completed", "payout.failed", "conversion.completed", "conversion.canceled", "tenant.status_changed", "tenant.api_key.created", "tenant.api_key.rotated", "tenant.api_key.revoked", "tenant.live_status_changed", "notification.test"];
8999
9146
  type WebhookEventName = (typeof WEBHOOK_EVENT_NAMES)[number];
9000
9147
  /** `data` of every `payment.*` event. */
9001
9148
  interface PaymentWebhookData {
@@ -9148,6 +9295,6 @@ declare class VexPayTimeoutError extends VexPayConnectionError {
9148
9295
  declare class VexPaySignatureVerificationError extends VexPayError {
9149
9296
  }
9150
9297
 
9151
- declare const VERSION = "0.3.0";
9298
+ declare const VERSION = "0.5.0";
9152
9299
 
9153
9300
  export { type CursorPage, DEFAULT_BASE_URL, DEFAULT_TOLERANCE_SECONDS, type OperationId, PagePromise, type PathParams, type PaymentWebhookData, type QueryParams, type RequestBody, type RequestOptions, type ResponseBody, SIGNATURE_HEADER, type Schemas, VERSION, VexPay, VexPayAPIError, VexPayAuthenticationError, VexPayConfigurationError, VexPayConflictError, VexPayConnectionError, VexPayError, VexPayInvalidRequestError, VexPayNotFoundError, type VexPayOptions, VexPayRateLimitError, VexPaySignatureVerificationError, VexPayTimeoutError, WEBHOOK_EVENT_NAMES, type WebhookEvent, type WebhookEventName, Webhooks, VexPay as default };
package/dist/index.d.ts CHANGED
@@ -66,6 +66,11 @@ interface components {
66
66
  * @example 0.00
67
67
  */
68
68
  convertedVes: string;
69
+ /**
70
+ * @description Net card chargeback fees charged (fees minus fees returned on won disputes).
71
+ * @example 0.00
72
+ */
73
+ chargebackFeesVes: string;
69
74
  /** @example 100.00 */
70
75
  reserveVes: string;
71
76
  /** @example 8650.00 */
@@ -91,6 +96,48 @@ interface components {
91
96
  /** @example 0.00 */
92
97
  feeFixedUsd: string;
93
98
  };
99
+ BalanceTransactionDto: {
100
+ /**
101
+ * Format: uuid
102
+ * @description Stable id of the movement; never changes or disappears.
103
+ */
104
+ id: string;
105
+ /**
106
+ * @example chargeback
107
+ * @enum {string}
108
+ */
109
+ type: "payment" | "fee" | "payment_reversal" | "fee_reversal" | "payout" | "payout_reversal" | "chargeback" | "chargeback_fee" | "chargeback_reversal" | "adjustment" | "seller_transfer" | "seller_transfer_reversal" | "conversion" | "conversion_reversal";
110
+ /**
111
+ * @description Signed VES amount (negative = money out of your balance).
112
+ * @example -4000.00
113
+ */
114
+ amountVes: string;
115
+ /** Format: uuid */
116
+ paymentId?: string;
117
+ /** Format: uuid */
118
+ payoutId?: string;
119
+ /**
120
+ * Format: uuid
121
+ * @description Present on chargeback movements.
122
+ */
123
+ chargebackId?: string;
124
+ /** Format: uuid */
125
+ merchantId?: string;
126
+ /**
127
+ * @description externalRef of the linked payment or payout.
128
+ * @example order-1042
129
+ */
130
+ externalRef?: string;
131
+ /** @example Card chargeback (fraud) */
132
+ description: string;
133
+ /** Format: date-time */
134
+ createdAt: string;
135
+ };
136
+ BalanceTransactionListDto: {
137
+ items: components["schemas"]["BalanceTransactionDto"][];
138
+ /** @description Pass as `cursor` to get the next (older) page; null on the last page. */
139
+ nextCursor: string | null;
140
+ };
94
141
  CreateWebhookDto: {
95
142
  /**
96
143
  * Format: uri
@@ -108,7 +155,7 @@ interface components {
108
155
  * "payment.failed"
109
156
  * ]
110
157
  */
111
- events: ("payment.pending" | "payment.completed" | "payment.failed" | "payment.canceled" | "payment.reversed" | "merchant.verified" | "merchant.rejected" | "merchant.deactivated" | "merchant.reactivated" | "merchant.balance.updated" | "merchant.created" | "merchant.activated" | "merchant.updated" | "merchant.kyb_required" | "merchant.restricted" | "merchant.capability.updated" | "merchant.wallet_credit" | "payout.completed" | "payout.failed" | "conversion.completed" | "conversion.canceled" | "tenant.status_changed" | "tenant.api_key.created" | "tenant.api_key.rotated" | "tenant.api_key.revoked" | "tenant.live_status_changed" | "notification.test")[];
158
+ events: ("payment.pending" | "payment.completed" | "payment.failed" | "payment.canceled" | "payment.reversed" | "payment.chargeback" | "payment.chargeback_closed" | "merchant.verified" | "merchant.rejected" | "merchant.deactivated" | "merchant.reactivated" | "merchant.balance.updated" | "merchant.created" | "merchant.activated" | "merchant.updated" | "merchant.kyb_required" | "merchant.restricted" | "merchant.capability.updated" | "merchant.wallet_credit" | "payout.completed" | "payout.failed" | "conversion.completed" | "conversion.canceled" | "tenant.status_changed" | "tenant.api_key.created" | "tenant.api_key.rotated" | "tenant.api_key.revoked" | "tenant.live_status_changed" | "notification.test")[];
112
159
  };
113
160
  WebhookEndpointDto: {
114
161
  /** Format: uuid */
@@ -117,7 +164,7 @@ interface components {
117
164
  tenantId: string;
118
165
  /** Format: uri */
119
166
  url: string;
120
- events: ("payment.pending" | "payment.completed" | "payment.failed" | "payment.canceled" | "payment.reversed" | "merchant.verified" | "merchant.rejected" | "merchant.deactivated" | "merchant.reactivated" | "merchant.balance.updated" | "merchant.created" | "merchant.activated" | "merchant.updated" | "merchant.kyb_required" | "merchant.restricted" | "merchant.capability.updated" | "merchant.wallet_credit" | "payout.completed" | "payout.failed" | "conversion.completed" | "conversion.canceled" | "tenant.status_changed" | "tenant.api_key.created" | "tenant.api_key.rotated" | "tenant.api_key.revoked" | "tenant.live_status_changed" | "notification.test")[];
167
+ events: ("payment.pending" | "payment.completed" | "payment.failed" | "payment.canceled" | "payment.reversed" | "payment.chargeback" | "payment.chargeback_closed" | "merchant.verified" | "merchant.rejected" | "merchant.deactivated" | "merchant.reactivated" | "merchant.balance.updated" | "merchant.created" | "merchant.activated" | "merchant.updated" | "merchant.kyb_required" | "merchant.restricted" | "merchant.capability.updated" | "merchant.wallet_credit" | "payout.completed" | "payout.failed" | "conversion.completed" | "conversion.canceled" | "tenant.status_changed" | "tenant.api_key.created" | "tenant.api_key.rotated" | "tenant.api_key.revoked" | "tenant.live_status_changed" | "notification.test")[];
121
168
  isActive: boolean;
122
169
  /** Format: date-time */
123
170
  createdAt: string;
@@ -138,7 +185,7 @@ interface components {
138
185
  * "payout.completed"
139
186
  * ]
140
187
  */
141
- events?: ("payment.pending" | "payment.completed" | "payment.failed" | "payment.canceled" | "payment.reversed" | "merchant.verified" | "merchant.rejected" | "merchant.deactivated" | "merchant.reactivated" | "merchant.balance.updated" | "merchant.created" | "merchant.activated" | "merchant.updated" | "merchant.kyb_required" | "merchant.restricted" | "merchant.capability.updated" | "merchant.wallet_credit" | "payout.completed" | "payout.failed" | "conversion.completed" | "conversion.canceled" | "tenant.status_changed" | "tenant.api_key.created" | "tenant.api_key.rotated" | "tenant.api_key.revoked" | "tenant.live_status_changed" | "notification.test")[];
188
+ events?: ("payment.pending" | "payment.completed" | "payment.failed" | "payment.canceled" | "payment.reversed" | "payment.chargeback" | "payment.chargeback_closed" | "merchant.verified" | "merchant.rejected" | "merchant.deactivated" | "merchant.reactivated" | "merchant.balance.updated" | "merchant.created" | "merchant.activated" | "merchant.updated" | "merchant.kyb_required" | "merchant.restricted" | "merchant.capability.updated" | "merchant.wallet_credit" | "payout.completed" | "payout.failed" | "conversion.completed" | "conversion.canceled" | "tenant.status_changed" | "tenant.api_key.created" | "tenant.api_key.rotated" | "tenant.api_key.revoked" | "tenant.live_status_changed" | "notification.test")[];
142
189
  /** @example true */
143
190
  isActive?: boolean;
144
191
  };
@@ -1855,8 +1902,8 @@ interface components {
1855
1902
  * ]
1856
1903
  */
1857
1904
  allowedOrigins?: string[];
1858
- /** @description Payment methods offered. Defaults to every method your account can accept. */
1859
- methods?: ("c2p" | "vpos" | "usdt" | "usdc")[];
1905
+ /** @description Payment methods offered. Defaults to every method your account can accept. `cop` (Colombian pesos: Bre-B, Nequi, Daviplata) needs the COP method on your account. */
1906
+ methods?: ("c2p" | "vpos" | "usdt" | "usdc" | "cop")[];
1860
1907
  /**
1861
1908
  * @description Up to 20 string key/value pairs (keys ≤ 40 chars, values ≤ 500 chars).
1862
1909
  * @example {
@@ -1892,7 +1939,7 @@ interface components {
1892
1939
  [key: string]: string;
1893
1940
  };
1894
1941
  allowedOrigins: string[];
1895
- methods: ("c2p" | "vpos" | "usdt" | "usdc")[];
1942
+ methods: ("c2p" | "vpos" | "usdt" | "usdc" | "cop")[];
1896
1943
  successUrl?: string | null;
1897
1944
  cancelUrl?: string | null;
1898
1945
  /** @description Latest payment for this session, once one exists. */
@@ -2062,6 +2109,85 @@ interface operations {
2062
2109
  };
2063
2110
  };
2064
2111
  };
2112
+ Balance_listTransactions: {
2113
+ parameters: {
2114
+ query?: {
2115
+ /** @description ISO 8601, exclusive (createdAt). */
2116
+ to?: string;
2117
+ /** @description ISO 8601, inclusive (createdAt). */
2118
+ from?: string;
2119
+ /** @description Only movements of this payout. */
2120
+ payoutId?: string;
2121
+ /** @description Only movements of this payment. */
2122
+ paymentId?: string;
2123
+ /** @description One or more types (repeat or comma-separate). */
2124
+ type?: ("payment" | "fee" | "payment_reversal" | "fee_reversal" | "payout" | "payout_reversal" | "chargeback" | "chargeback_fee" | "chargeback_reversal" | "adjustment" | "seller_transfer" | "seller_transfer_reversal" | "conversion" | "conversion_reversal")[];
2125
+ /** @description `nextCursor` from the previous page. */
2126
+ cursor?: string;
2127
+ /** @description 1–100, default 50. */
2128
+ limit?: number;
2129
+ };
2130
+ header?: never;
2131
+ path?: never;
2132
+ cookie?: never;
2133
+ };
2134
+ requestBody?: never;
2135
+ responses: {
2136
+ 200: {
2137
+ headers: {
2138
+ [name: string]: unknown;
2139
+ };
2140
+ content: {
2141
+ "application/json": components["schemas"]["BalanceTransactionListDto"];
2142
+ };
2143
+ };
2144
+ /** @description `invalid_data` — a parameter is invalid. */
2145
+ 400: {
2146
+ headers: {
2147
+ [name: string]: unknown;
2148
+ };
2149
+ content: {
2150
+ "application/json": components["schemas"]["ApiErrorDto"];
2151
+ };
2152
+ };
2153
+ /** @description Missing, invalid, or inactive tenant API key. */
2154
+ 401: {
2155
+ headers: {
2156
+ [name: string]: unknown;
2157
+ };
2158
+ content: {
2159
+ "application/json": components["schemas"]["ApiErrorDto"];
2160
+ };
2161
+ };
2162
+ /** @description Live mode not activated (`live_mode_not_activated`): the live account is pending VEX Pay review or suspended. Test keys are unaffected. */
2163
+ 403: {
2164
+ headers: {
2165
+ [name: string]: unknown;
2166
+ };
2167
+ content: {
2168
+ "application/json": components["schemas"]["ApiErrorDto"];
2169
+ };
2170
+ };
2171
+ /** @description Client error. */
2172
+ "4XX": {
2173
+ headers: {
2174
+ [name: string]: unknown;
2175
+ };
2176
+ content: {
2177
+ "application/json": components["schemas"]["ApiErrorDto"];
2178
+ };
2179
+ };
2180
+ /** @description Server or upstream bank error. */
2181
+ "5XX": {
2182
+ headers: {
2183
+ [name: string]: unknown;
2184
+ };
2185
+ content: {
2186
+ "application/json": components["schemas"]["ApiErrorDto"];
2187
+ };
2188
+ };
2189
+ };
2190
+ };
2065
2191
  Webhooks_listWebhooks: {
2066
2192
  parameters: {
2067
2193
  query?: never;
@@ -7881,8 +8007,28 @@ declare class Quotes extends APIResource {
7881
8007
  };
7882
8008
  }>;
7883
8009
  }
8010
+ /** Every movement in your VES balance (payments, fees, payouts, chargebacks, …), newest first. */
8011
+ declare class BalanceTransactions extends APIResource {
8012
+ /** Await for one page, or `for await` over every movement. The amounts sum to `ledgerNetVes`. */
8013
+ list(params?: QueryParams<'Balance_listTransactions'>, options?: RequestOptions): PagePromise<{
8014
+ items: components["schemas"]["BalanceTransactionDto"][];
8015
+ nextCursor: string | null;
8016
+ }, {
8017
+ id: string;
8018
+ type: "payment" | "fee" | "payment_reversal" | "fee_reversal" | "payout" | "payout_reversal" | "chargeback" | "chargeback_fee" | "chargeback_reversal" | "adjustment" | "seller_transfer" | "seller_transfer_reversal" | "conversion" | "conversion_reversal";
8019
+ amountVes: string;
8020
+ paymentId?: string;
8021
+ payoutId?: string;
8022
+ chargebackId?: string;
8023
+ merchantId?: string;
8024
+ externalRef?: string;
8025
+ description: string;
8026
+ createdAt: string;
8027
+ }>;
8028
+ }
7884
8029
  /** Your platform balance. */
7885
8030
  declare class Balance extends APIResource {
8031
+ readonly transactions: BalanceTransactions;
7886
8032
  retrieve(options?: RequestOptions): Promise<{
7887
8033
  tenantId: string;
7888
8034
  platformId: string;
@@ -7890,6 +8036,7 @@ declare class Balance extends APIResource {
7890
8036
  feesVes: string;
7891
8037
  paidOutVes: string;
7892
8038
  convertedVes: string;
8039
+ chargebackFeesVes: string;
7893
8040
  reserveVes: string;
7894
8041
  ledgerNetVes: string;
7895
8042
  availableVes: string;
@@ -8081,7 +8228,7 @@ declare class WebhookEndpoints extends APIResource {
8081
8228
  id: string;
8082
8229
  tenantId: string;
8083
8230
  url: string;
8084
- events: ("payment.pending" | "payment.completed" | "payment.failed" | "payment.canceled" | "payment.reversed" | "merchant.verified" | "merchant.rejected" | "merchant.deactivated" | "merchant.reactivated" | "merchant.balance.updated" | "merchant.created" | "merchant.activated" | "merchant.updated" | "merchant.kyb_required" | "merchant.restricted" | "merchant.capability.updated" | "merchant.wallet_credit" | "payout.completed" | "payout.failed" | "conversion.completed" | "conversion.canceled" | "tenant.status_changed" | "tenant.api_key.created" | "tenant.api_key.rotated" | "tenant.api_key.revoked" | "tenant.live_status_changed" | "notification.test")[];
8231
+ events: ("payment.pending" | "payment.completed" | "payment.failed" | "payment.canceled" | "payment.reversed" | "payment.chargeback" | "payment.chargeback_closed" | "merchant.verified" | "merchant.rejected" | "merchant.deactivated" | "merchant.reactivated" | "merchant.balance.updated" | "merchant.created" | "merchant.activated" | "merchant.updated" | "merchant.kyb_required" | "merchant.restricted" | "merchant.capability.updated" | "merchant.wallet_credit" | "payout.completed" | "payout.failed" | "conversion.completed" | "conversion.canceled" | "tenant.status_changed" | "tenant.api_key.created" | "tenant.api_key.rotated" | "tenant.api_key.revoked" | "tenant.live_status_changed" | "notification.test")[];
8085
8232
  isActive: boolean;
8086
8233
  createdAt: string;
8087
8234
  secret?: string;
@@ -8090,7 +8237,7 @@ declare class WebhookEndpoints extends APIResource {
8090
8237
  id: string;
8091
8238
  tenantId: string;
8092
8239
  url: string;
8093
- events: ("payment.pending" | "payment.completed" | "payment.failed" | "payment.canceled" | "payment.reversed" | "merchant.verified" | "merchant.rejected" | "merchant.deactivated" | "merchant.reactivated" | "merchant.balance.updated" | "merchant.created" | "merchant.activated" | "merchant.updated" | "merchant.kyb_required" | "merchant.restricted" | "merchant.capability.updated" | "merchant.wallet_credit" | "payout.completed" | "payout.failed" | "conversion.completed" | "conversion.canceled" | "tenant.status_changed" | "tenant.api_key.created" | "tenant.api_key.rotated" | "tenant.api_key.revoked" | "tenant.live_status_changed" | "notification.test")[];
8240
+ events: ("payment.pending" | "payment.completed" | "payment.failed" | "payment.canceled" | "payment.reversed" | "payment.chargeback" | "payment.chargeback_closed" | "merchant.verified" | "merchant.rejected" | "merchant.deactivated" | "merchant.reactivated" | "merchant.balance.updated" | "merchant.created" | "merchant.activated" | "merchant.updated" | "merchant.kyb_required" | "merchant.restricted" | "merchant.capability.updated" | "merchant.wallet_credit" | "payout.completed" | "payout.failed" | "conversion.completed" | "conversion.canceled" | "tenant.status_changed" | "tenant.api_key.created" | "tenant.api_key.rotated" | "tenant.api_key.revoked" | "tenant.live_status_changed" | "notification.test")[];
8094
8241
  isActive: boolean;
8095
8242
  createdAt: string;
8096
8243
  secret?: string;
@@ -8099,7 +8246,7 @@ declare class WebhookEndpoints extends APIResource {
8099
8246
  id: string;
8100
8247
  tenantId: string;
8101
8248
  url: string;
8102
- events: ("payment.pending" | "payment.completed" | "payment.failed" | "payment.canceled" | "payment.reversed" | "merchant.verified" | "merchant.rejected" | "merchant.deactivated" | "merchant.reactivated" | "merchant.balance.updated" | "merchant.created" | "merchant.activated" | "merchant.updated" | "merchant.kyb_required" | "merchant.restricted" | "merchant.capability.updated" | "merchant.wallet_credit" | "payout.completed" | "payout.failed" | "conversion.completed" | "conversion.canceled" | "tenant.status_changed" | "tenant.api_key.created" | "tenant.api_key.rotated" | "tenant.api_key.revoked" | "tenant.live_status_changed" | "notification.test")[];
8249
+ events: ("payment.pending" | "payment.completed" | "payment.failed" | "payment.canceled" | "payment.reversed" | "payment.chargeback" | "payment.chargeback_closed" | "merchant.verified" | "merchant.rejected" | "merchant.deactivated" | "merchant.reactivated" | "merchant.balance.updated" | "merchant.created" | "merchant.activated" | "merchant.updated" | "merchant.kyb_required" | "merchant.restricted" | "merchant.capability.updated" | "merchant.wallet_credit" | "payout.completed" | "payout.failed" | "conversion.completed" | "conversion.canceled" | "tenant.status_changed" | "tenant.api_key.created" | "tenant.api_key.rotated" | "tenant.api_key.revoked" | "tenant.live_status_changed" | "notification.test")[];
8103
8250
  isActive: boolean;
8104
8251
  createdAt: string;
8105
8252
  secret?: string;
@@ -8131,7 +8278,7 @@ declare class CheckoutSessions extends APIResource {
8131
8278
  [key: string]: string;
8132
8279
  };
8133
8280
  allowedOrigins: string[];
8134
- methods: ("c2p" | "vpos" | "usdt" | "usdc")[];
8281
+ methods: ("c2p" | "vpos" | "usdt" | "usdc" | "cop")[];
8135
8282
  successUrl?: string | null;
8136
8283
  cancelUrl?: string | null;
8137
8284
  paymentId?: string | null;
@@ -8152,7 +8299,7 @@ declare class CheckoutSessions extends APIResource {
8152
8299
  [key: string]: string;
8153
8300
  };
8154
8301
  allowedOrigins: string[];
8155
- methods: ("c2p" | "vpos" | "usdt" | "usdc")[];
8302
+ methods: ("c2p" | "vpos" | "usdt" | "usdc" | "cop")[];
8156
8303
  successUrl?: string | null;
8157
8304
  cancelUrl?: string | null;
8158
8305
  paymentId?: string | null;
@@ -8995,7 +9142,7 @@ declare class Payments extends APIResource {
8995
9142
  }>;
8996
9143
  }
8997
9144
 
8998
- declare const WEBHOOK_EVENT_NAMES: readonly ["payment.pending", "payment.completed", "payment.failed", "payment.canceled", "payment.reversed", "merchant.verified", "merchant.rejected", "merchant.deactivated", "merchant.reactivated", "merchant.balance.updated", "merchant.created", "merchant.activated", "merchant.updated", "merchant.kyb_required", "merchant.restricted", "merchant.capability.updated", "merchant.wallet_credit", "payout.completed", "payout.failed", "conversion.completed", "conversion.canceled", "tenant.status_changed", "tenant.api_key.created", "tenant.api_key.rotated", "tenant.api_key.revoked", "tenant.live_status_changed", "notification.test"];
9145
+ declare const WEBHOOK_EVENT_NAMES: readonly ["payment.pending", "payment.completed", "payment.failed", "payment.canceled", "payment.reversed", "payment.chargeback", "payment.chargeback_closed", "merchant.verified", "merchant.rejected", "merchant.deactivated", "merchant.reactivated", "merchant.balance.updated", "merchant.created", "merchant.activated", "merchant.updated", "merchant.kyb_required", "merchant.restricted", "merchant.capability.updated", "merchant.wallet_credit", "payout.completed", "payout.failed", "conversion.completed", "conversion.canceled", "tenant.status_changed", "tenant.api_key.created", "tenant.api_key.rotated", "tenant.api_key.revoked", "tenant.live_status_changed", "notification.test"];
8999
9146
  type WebhookEventName = (typeof WEBHOOK_EVENT_NAMES)[number];
9000
9147
  /** `data` of every `payment.*` event. */
9001
9148
  interface PaymentWebhookData {
@@ -9148,6 +9295,6 @@ declare class VexPayTimeoutError extends VexPayConnectionError {
9148
9295
  declare class VexPaySignatureVerificationError extends VexPayError {
9149
9296
  }
9150
9297
 
9151
- declare const VERSION = "0.3.0";
9298
+ declare const VERSION = "0.5.0";
9152
9299
 
9153
9300
  export { type CursorPage, DEFAULT_BASE_URL, DEFAULT_TOLERANCE_SECONDS, type OperationId, PagePromise, type PathParams, type PaymentWebhookData, type QueryParams, type RequestBody, type RequestOptions, type ResponseBody, SIGNATURE_HEADER, type Schemas, VERSION, VexPay, VexPayAPIError, VexPayAuthenticationError, VexPayConfigurationError, VexPayConflictError, VexPayConnectionError, VexPayError, VexPayInvalidRequestError, VexPayNotFoundError, type VexPayOptions, VexPayRateLimitError, VexPaySignatureVerificationError, VexPayTimeoutError, WEBHOOK_EVENT_NAMES, type WebhookEvent, type WebhookEventName, Webhooks, VexPay as default };
package/dist/index.js CHANGED
@@ -62,7 +62,7 @@ function errorFromResponse(status, body, requestId) {
62
62
  }
63
63
 
64
64
  // src/version.ts
65
- var VERSION = "0.3.0";
65
+ var VERSION = "0.5.0";
66
66
 
67
67
  // src/core.ts
68
68
  var INITIAL_RETRY_DELAY_MS = 500;
@@ -213,6 +213,7 @@ var PagePromise = class {
213
213
  // src/generated/routes.ts
214
214
  var ROUTES = {
215
215
  Balance_getBalance: { method: "GET", path: "/v1/balance" },
216
+ Balance_listTransactions: { method: "GET", path: "/v1/balance/transactions" },
216
217
  CheckoutSessions_create: { method: "POST", path: "/v1/checkout/sessions" },
217
218
  CheckoutSessions_retrieve: { method: "GET", path: "/v1/checkout/sessions/{id}" },
218
219
  Conversions_cancel: { method: "POST", path: "/v1/conversions/{id}/cancel" },
@@ -324,7 +325,17 @@ var Quotes = class extends APIResource {
324
325
  return this.call("Payments_getQuote", { query: params }, options);
325
326
  }
326
327
  };
328
+ var BalanceTransactions = class extends APIResource {
329
+ /** Await for one page, or `for await` over every movement. The amounts sum to `ledgerNetVes`. */
330
+ list(params = {}, options) {
331
+ return new PagePromise(
332
+ (cursor) => this.call("Balance_listTransactions", { query: { ...params, cursor } }, options),
333
+ params.cursor
334
+ );
335
+ }
336
+ };
327
337
  var Balance = class extends APIResource {
338
+ transactions = new BalanceTransactions(this.http);
328
339
  retrieve(options) {
329
340
  return this.call("Balance_getBalance", {}, options);
330
341
  }
@@ -685,6 +696,8 @@ var WEBHOOK_EVENT_NAMES = [
685
696
  "payment.failed",
686
697
  "payment.canceled",
687
698
  "payment.reversed",
699
+ "payment.chargeback",
700
+ "payment.chargeback_closed",
688
701
  "merchant.verified",
689
702
  "merchant.rejected",
690
703
  "merchant.deactivated",