@vexpay/node 0.4.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1140,6 +1140,143 @@ interface components {
1140
1140
  /** Format: date-time */
1141
1141
  completedAt?: string;
1142
1142
  };
1143
+ CopBuyerDto: {
1144
+ /** @example Juan */
1145
+ firstName?: string;
1146
+ /** @example Pérez */
1147
+ lastName?: string;
1148
+ /**
1149
+ * @description Required for Nequi and Daviplata.
1150
+ * @example juan@example.com
1151
+ */
1152
+ email?: string;
1153
+ /**
1154
+ * @description Colombian mobile number (10 digits starting with 3, with or without +57). Required for Nequi (it receives the push) and Daviplata.
1155
+ * @example 3001234567
1156
+ */
1157
+ phone?: string;
1158
+ /**
1159
+ * @description Required for Nequi and Daviplata. Daviplata accepts CC, CE and TI only.
1160
+ * @example CC
1161
+ * @enum {string}
1162
+ */
1163
+ documentType?: "CC" | "CE" | "TI" | "NIT" | "PP";
1164
+ /**
1165
+ * @description National document number. Required for Nequi and Daviplata.
1166
+ * @example 1234567890
1167
+ */
1168
+ documentNumber?: string;
1169
+ };
1170
+ CreateCopPaymentDto: {
1171
+ /**
1172
+ * @description Amount in whole Colombian pesos.
1173
+ * @example 100000
1174
+ */
1175
+ amountCop: number;
1176
+ /**
1177
+ * @description `breb`: QR code / transfer key the buyer pays from any Colombian bank app. `nequi`: push to the buyer's Nequi app. `daviplata`: SMS code the buyer reads to you.
1178
+ * @example breb
1179
+ * @enum {string}
1180
+ */
1181
+ channel: "breb" | "nequi" | "daviplata";
1182
+ /**
1183
+ * @description Shown to the buyer.
1184
+ * @example Order 1042
1185
+ */
1186
+ description?: string;
1187
+ /**
1188
+ * @description Your reference, echoed in reads and webhooks.
1189
+ * @example order-1042
1190
+ */
1191
+ reference?: string;
1192
+ /**
1193
+ * @description Up to 20 string key/value pairs (keys ≤ 40 chars, values ≤ 500 chars).
1194
+ * @example {
1195
+ * "orderId": "1042"
1196
+ * }
1197
+ */
1198
+ metadata?: {
1199
+ [key: string]: string;
1200
+ };
1201
+ /** @description Required for `nequi` and `daviplata`; optional for `breb`. */
1202
+ buyer?: components["schemas"]["CopBuyerDto"];
1203
+ };
1204
+ CopNextActionDto: {
1205
+ /** @enum {string} */
1206
+ type: "show_qr" | "approve_in_app" | "submit_otp";
1207
+ /** @description Bre-B: base64 PNG of the payment QR. Returned only when the payment is created. */
1208
+ qrPngBase64?: string;
1209
+ /** @description Bre-B: transfer key the buyer can enter instead of scanning. */
1210
+ transferKey?: string;
1211
+ /**
1212
+ * @description Nequi: masked phone that received the push.
1213
+ * @example ****567
1214
+ */
1215
+ phoneMasked?: string;
1216
+ };
1217
+ CopPaymentDto: {
1218
+ /** Format: uuid */
1219
+ id: string;
1220
+ /** @enum {string} */
1221
+ status: "pending" | "completed" | "failed" | "canceled" | "refunded";
1222
+ /** @enum {string} */
1223
+ method: "COP";
1224
+ /** @enum {string} */
1225
+ channel: "breb" | "nequi" | "daviplata";
1226
+ /** @example 100000 */
1227
+ amountCop: number;
1228
+ /**
1229
+ * @description Present once completed.
1230
+ * @example 3500
1231
+ */
1232
+ feeCop?: number;
1233
+ /**
1234
+ * @description Hosted checkout payments only: the USD price the peso amount was computed from.
1235
+ * @example 5.00
1236
+ */
1237
+ amountUsd?: string;
1238
+ /**
1239
+ * @description Hosted checkout payments only: COP per USD the buyer was charged at.
1240
+ * @example 3316.382375
1241
+ */
1242
+ copRate?: string;
1243
+ /** @example order-1042 */
1244
+ reference?: string;
1245
+ metadata: {
1246
+ [key: string]: string;
1247
+ };
1248
+ /** @enum {string} */
1249
+ failureCode?: "expired" | "rejected" | "processor_error" | "processor_unknown";
1250
+ /** Format: date-time */
1251
+ expiresAt?: string;
1252
+ /** Format: date-time */
1253
+ createdAt: string;
1254
+ /** Format: date-time */
1255
+ completedAt?: string;
1256
+ /** @description What the buyer must do next. Returned when the payment is created. */
1257
+ next?: components["schemas"]["CopNextActionDto"];
1258
+ };
1259
+ SubmitCopOtpDto: {
1260
+ /**
1261
+ * @description The code the buyer received by SMS.
1262
+ * @example 123456
1263
+ */
1264
+ otp: string;
1265
+ };
1266
+ CopBalanceDto: {
1267
+ /**
1268
+ * @description Whole pesos available for payout.
1269
+ * @example 96500
1270
+ */
1271
+ availableCop: number;
1272
+ /**
1273
+ * @description Whole pesos reserved by payouts in progress.
1274
+ * @example 0
1275
+ */
1276
+ pendingPayoutCop: number;
1277
+ /** Format: date-time */
1278
+ asOf: string;
1279
+ };
1143
1280
  CreateConversionQuoteDto: {
1144
1281
  /**
1145
1282
  * @description VES to spend. Send this or `targetAmountUsdt`, not both.
@@ -1902,8 +2039,8 @@ interface components {
1902
2039
  * ]
1903
2040
  */
1904
2041
  allowedOrigins?: string[];
1905
- /** @description Payment methods offered. Defaults to every method your account can accept. */
1906
- methods?: ("c2p" | "vpos" | "usdt" | "usdc")[];
2042
+ /** @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. */
2043
+ methods?: ("c2p" | "vpos" | "usdt" | "usdc" | "cop")[];
1907
2044
  /**
1908
2045
  * @description Up to 20 string key/value pairs (keys ≤ 40 chars, values ≤ 500 chars).
1909
2046
  * @example {
@@ -1939,7 +2076,7 @@ interface components {
1939
2076
  [key: string]: string;
1940
2077
  };
1941
2078
  allowedOrigins: string[];
1942
- methods: ("c2p" | "vpos" | "usdt" | "usdc")[];
2079
+ methods: ("c2p" | "vpos" | "usdt" | "usdc" | "cop")[];
1943
2080
  successUrl?: string | null;
1944
2081
  cancelUrl?: string | null;
1945
2082
  /** @description Latest payment for this session, once one exists. */
@@ -4086,8 +4223,413 @@ interface operations {
4086
4223
  "application/json": components["schemas"]["ChangePaymentResponseDto"];
4087
4224
  };
4088
4225
  };
4089
- /** @description Validation or business-rule failure. */
4090
- 400: {
4226
+ /** @description Validation or business-rule failure. */
4227
+ 400: {
4228
+ headers: {
4229
+ [name: string]: unknown;
4230
+ };
4231
+ content: {
4232
+ "application/json": components["schemas"]["ApiErrorDto"];
4233
+ };
4234
+ };
4235
+ /** @description Missing, invalid, or inactive tenant API key. */
4236
+ 401: {
4237
+ headers: {
4238
+ [name: string]: unknown;
4239
+ };
4240
+ content: {
4241
+ "application/json": components["schemas"]["ApiErrorDto"];
4242
+ };
4243
+ };
4244
+ /** @description This method (débito or crédito) is not enabled on this account, or live mode is not activated (`live_mode_not_activated`). */
4245
+ 403: {
4246
+ headers: {
4247
+ [name: string]: unknown;
4248
+ };
4249
+ content: {
4250
+ "application/json": components["schemas"]["ApiErrorDto"];
4251
+ };
4252
+ };
4253
+ /** @description The banking network rejected the operation. */
4254
+ 422: {
4255
+ headers: {
4256
+ [name: string]: unknown;
4257
+ };
4258
+ content: {
4259
+ "application/json": components["schemas"]["ApiErrorDto"];
4260
+ };
4261
+ };
4262
+ /** @description Advanced payments are not available in this environment. */
4263
+ 503: {
4264
+ headers: {
4265
+ [name: string]: unknown;
4266
+ };
4267
+ content: {
4268
+ "application/json": components["schemas"]["ApiErrorDto"];
4269
+ };
4270
+ };
4271
+ /** @description Client error. */
4272
+ "4XX": {
4273
+ headers: {
4274
+ [name: string]: unknown;
4275
+ };
4276
+ content: {
4277
+ "application/json": components["schemas"]["ApiErrorDto"];
4278
+ };
4279
+ };
4280
+ /** @description Server or upstream bank error. */
4281
+ "5XX": {
4282
+ headers: {
4283
+ [name: string]: unknown;
4284
+ };
4285
+ content: {
4286
+ "application/json": components["schemas"]["ApiErrorDto"];
4287
+ };
4288
+ };
4289
+ };
4290
+ };
4291
+ Crypto_getBalance: {
4292
+ parameters: {
4293
+ query?: {
4294
+ currency?: "USDT" | "USDC";
4295
+ };
4296
+ header?: never;
4297
+ path?: never;
4298
+ cookie?: never;
4299
+ };
4300
+ requestBody?: never;
4301
+ responses: {
4302
+ 200: {
4303
+ headers: {
4304
+ [name: string]: unknown;
4305
+ };
4306
+ content: {
4307
+ "application/json": components["schemas"]["CryptoBalanceDto"];
4308
+ };
4309
+ };
4310
+ /** @description `unsupported_currency`. */
4311
+ 400: {
4312
+ headers: {
4313
+ [name: string]: unknown;
4314
+ };
4315
+ content: {
4316
+ "application/json": components["schemas"]["ApiErrorDto"];
4317
+ };
4318
+ };
4319
+ /** @description Missing, invalid, or inactive tenant API key. */
4320
+ 401: {
4321
+ headers: {
4322
+ [name: string]: unknown;
4323
+ };
4324
+ content: {
4325
+ "application/json": components["schemas"]["ApiErrorDto"];
4326
+ };
4327
+ };
4328
+ /** @description `method_not_allowed` — USDC is not enabled for this account. */
4329
+ 403: {
4330
+ headers: {
4331
+ [name: string]: unknown;
4332
+ };
4333
+ content: {
4334
+ "application/json": components["schemas"]["ApiErrorDto"];
4335
+ };
4336
+ };
4337
+ /** @description Client error. */
4338
+ "4XX": {
4339
+ headers: {
4340
+ [name: string]: unknown;
4341
+ };
4342
+ content: {
4343
+ "application/json": components["schemas"]["ApiErrorDto"];
4344
+ };
4345
+ };
4346
+ /** @description Server or upstream bank error. */
4347
+ "5XX": {
4348
+ headers: {
4349
+ [name: string]: unknown;
4350
+ };
4351
+ content: {
4352
+ "application/json": components["schemas"]["ApiErrorDto"];
4353
+ };
4354
+ };
4355
+ };
4356
+ };
4357
+ Crypto_getBalances: {
4358
+ parameters: {
4359
+ query?: never;
4360
+ header?: never;
4361
+ path?: never;
4362
+ cookie?: never;
4363
+ };
4364
+ requestBody?: never;
4365
+ responses: {
4366
+ 200: {
4367
+ headers: {
4368
+ [name: string]: unknown;
4369
+ };
4370
+ content: {
4371
+ "application/json": components["schemas"]["CryptoBalancesDto"];
4372
+ };
4373
+ };
4374
+ /** @description Missing, invalid, or inactive tenant API key. */
4375
+ 401: {
4376
+ headers: {
4377
+ [name: string]: unknown;
4378
+ };
4379
+ content: {
4380
+ "application/json": components["schemas"]["ApiErrorDto"];
4381
+ };
4382
+ };
4383
+ /** @description Live mode not activated (`live_mode_not_activated`): the live account is pending VEX Pay review or suspended. Test keys are unaffected. */
4384
+ 403: {
4385
+ headers: {
4386
+ [name: string]: unknown;
4387
+ };
4388
+ content: {
4389
+ "application/json": components["schemas"]["ApiErrorDto"];
4390
+ };
4391
+ };
4392
+ /** @description Client error. */
4393
+ "4XX": {
4394
+ headers: {
4395
+ [name: string]: unknown;
4396
+ };
4397
+ content: {
4398
+ "application/json": components["schemas"]["ApiErrorDto"];
4399
+ };
4400
+ };
4401
+ /** @description Server or upstream bank error. */
4402
+ "5XX": {
4403
+ headers: {
4404
+ [name: string]: unknown;
4405
+ };
4406
+ content: {
4407
+ "application/json": components["schemas"]["ApiErrorDto"];
4408
+ };
4409
+ };
4410
+ };
4411
+ };
4412
+ Crypto_createDepositAddress: {
4413
+ parameters: {
4414
+ query?: never;
4415
+ header?: {
4416
+ /** @description Optional. Same key + same body within 24h replays the stored response (`Idempotent-Replayed: true`); a different body returns 409 `idempotency_key_reused`. */
4417
+ "Idempotency-Key"?: string;
4418
+ };
4419
+ path?: never;
4420
+ cookie?: never;
4421
+ };
4422
+ requestBody: {
4423
+ content: {
4424
+ "application/json": components["schemas"]["CreateDepositAddressDto"];
4425
+ };
4426
+ };
4427
+ responses: {
4428
+ 200: {
4429
+ headers: {
4430
+ [name: string]: unknown;
4431
+ };
4432
+ content: {
4433
+ "application/json": components["schemas"]["DepositAddressDto"];
4434
+ };
4435
+ };
4436
+ /** @description `unsupported_currency`, `unsupported_network` or invalid `customerRef`. */
4437
+ 400: {
4438
+ headers: {
4439
+ [name: string]: unknown;
4440
+ };
4441
+ content: {
4442
+ "application/json": components["schemas"]["ApiErrorDto"];
4443
+ };
4444
+ };
4445
+ /** @description Missing, invalid, or inactive tenant API key. */
4446
+ 401: {
4447
+ headers: {
4448
+ [name: string]: unknown;
4449
+ };
4450
+ content: {
4451
+ "application/json": components["schemas"]["ApiErrorDto"];
4452
+ };
4453
+ };
4454
+ /** @description `method_not_allowed` — that stablecoin is not enabled for this account. */
4455
+ 403: {
4456
+ headers: {
4457
+ [name: string]: unknown;
4458
+ };
4459
+ content: {
4460
+ "application/json": components["schemas"]["ApiErrorDto"];
4461
+ };
4462
+ };
4463
+ /** @description Client error. */
4464
+ "4XX": {
4465
+ headers: {
4466
+ [name: string]: unknown;
4467
+ };
4468
+ content: {
4469
+ "application/json": components["schemas"]["ApiErrorDto"];
4470
+ };
4471
+ };
4472
+ /** @description Server or upstream bank error. */
4473
+ "5XX": {
4474
+ headers: {
4475
+ [name: string]: unknown;
4476
+ };
4477
+ content: {
4478
+ "application/json": components["schemas"]["ApiErrorDto"];
4479
+ };
4480
+ };
4481
+ };
4482
+ };
4483
+ Crypto_listNetworks: {
4484
+ parameters: {
4485
+ query?: {
4486
+ /** @description Alias of `amount`. */
4487
+ amountUsdt?: string;
4488
+ currency?: "USDT" | "USDC";
4489
+ amount?: string;
4490
+ };
4491
+ header?: never;
4492
+ path?: never;
4493
+ cookie?: never;
4494
+ };
4495
+ requestBody?: never;
4496
+ responses: {
4497
+ 200: {
4498
+ headers: {
4499
+ [name: string]: unknown;
4500
+ };
4501
+ content: {
4502
+ "application/json": components["schemas"]["CryptoNetworkDto"][];
4503
+ };
4504
+ };
4505
+ /** @description `unsupported_currency`. */
4506
+ 400: {
4507
+ headers: {
4508
+ [name: string]: unknown;
4509
+ };
4510
+ content: {
4511
+ "application/json": components["schemas"]["ApiErrorDto"];
4512
+ };
4513
+ };
4514
+ /** @description Missing, invalid, or inactive tenant API key. */
4515
+ 401: {
4516
+ headers: {
4517
+ [name: string]: unknown;
4518
+ };
4519
+ content: {
4520
+ "application/json": components["schemas"]["ApiErrorDto"];
4521
+ };
4522
+ };
4523
+ /** @description `method_not_allowed` — that stablecoin is not enabled for this account. */
4524
+ 403: {
4525
+ headers: {
4526
+ [name: string]: unknown;
4527
+ };
4528
+ content: {
4529
+ "application/json": components["schemas"]["ApiErrorDto"];
4530
+ };
4531
+ };
4532
+ /** @description Client error. */
4533
+ "4XX": {
4534
+ headers: {
4535
+ [name: string]: unknown;
4536
+ };
4537
+ content: {
4538
+ "application/json": components["schemas"]["ApiErrorDto"];
4539
+ };
4540
+ };
4541
+ /** @description Server or upstream bank error. */
4542
+ "5XX": {
4543
+ headers: {
4544
+ [name: string]: unknown;
4545
+ };
4546
+ content: {
4547
+ "application/json": components["schemas"]["ApiErrorDto"];
4548
+ };
4549
+ };
4550
+ };
4551
+ };
4552
+ Crypto_createPayout: {
4553
+ parameters: {
4554
+ query?: never;
4555
+ header?: {
4556
+ /** @description Optional. Same key + same body within 24h replays the stored response (`Idempotent-Replayed: true`); a different body returns 409 `idempotency_key_reused`. */
4557
+ "Idempotency-Key"?: string;
4558
+ };
4559
+ path?: never;
4560
+ cookie?: never;
4561
+ };
4562
+ requestBody: {
4563
+ content: {
4564
+ "application/json": components["schemas"]["CreateCryptoPayoutDto"];
4565
+ };
4566
+ };
4567
+ responses: {
4568
+ /** @description Idempotent replay of an existing payout. */
4569
+ 200: {
4570
+ headers: {
4571
+ [name: string]: unknown;
4572
+ };
4573
+ content: {
4574
+ "application/json": components["schemas"]["CryptoPayoutDto"];
4575
+ };
4576
+ };
4577
+ /** @description Payout created. */
4578
+ 201: {
4579
+ headers: {
4580
+ [name: string]: unknown;
4581
+ };
4582
+ content: {
4583
+ "application/json": components["schemas"]["CryptoPayoutDto"];
4584
+ };
4585
+ };
4586
+ /** @description `unsupported_currency`, `unsupported_network`, `invalid_address` or `invalid_data`. */
4587
+ 400: {
4588
+ headers: {
4589
+ [name: string]: unknown;
4590
+ };
4591
+ content: {
4592
+ "application/json": components["schemas"]["ApiErrorDto"];
4593
+ };
4594
+ };
4595
+ /** @description Missing, invalid, or inactive tenant API key. */
4596
+ 401: {
4597
+ headers: {
4598
+ [name: string]: unknown;
4599
+ };
4600
+ content: {
4601
+ "application/json": components["schemas"]["ApiErrorDto"];
4602
+ };
4603
+ };
4604
+ /** @description `method_not_allowed` — that stablecoin is not enabled for this account. */
4605
+ 403: {
4606
+ headers: {
4607
+ [name: string]: unknown;
4608
+ };
4609
+ content: {
4610
+ "application/json": components["schemas"]["ApiErrorDto"];
4611
+ };
4612
+ };
4613
+ /** @description `idempotency_key_reused` with a different request. */
4614
+ 409: {
4615
+ headers: {
4616
+ [name: string]: unknown;
4617
+ };
4618
+ content: {
4619
+ "application/json": components["schemas"]["ApiErrorDto"];
4620
+ };
4621
+ };
4622
+ /** @description `insufficient_balance` or `amount_below_minimum`. */
4623
+ 422: {
4624
+ headers: {
4625
+ [name: string]: unknown;
4626
+ };
4627
+ content: {
4628
+ "application/json": components["schemas"]["ApiErrorDto"];
4629
+ };
4630
+ };
4631
+ /** @description Client error. */
4632
+ "4XX": {
4091
4633
  headers: {
4092
4634
  [name: string]: unknown;
4093
4635
  };
@@ -4095,8 +4637,8 @@ interface operations {
4095
4637
  "application/json": components["schemas"]["ApiErrorDto"];
4096
4638
  };
4097
4639
  };
4098
- /** @description Missing, invalid, or inactive tenant API key. */
4099
- 401: {
4640
+ /** @description Server or upstream bank error. */
4641
+ "5XX": {
4100
4642
  headers: {
4101
4643
  [name: string]: unknown;
4102
4644
  };
@@ -4104,17 +4646,29 @@ interface operations {
4104
4646
  "application/json": components["schemas"]["ApiErrorDto"];
4105
4647
  };
4106
4648
  };
4107
- /** @description This method (débito or crédito) is not enabled on this account, or live mode is not activated (`live_mode_not_activated`). */
4108
- 403: {
4649
+ };
4650
+ };
4651
+ Crypto_getPayout: {
4652
+ parameters: {
4653
+ query?: never;
4654
+ header?: never;
4655
+ path: {
4656
+ id: string;
4657
+ };
4658
+ cookie?: never;
4659
+ };
4660
+ requestBody?: never;
4661
+ responses: {
4662
+ 200: {
4109
4663
  headers: {
4110
4664
  [name: string]: unknown;
4111
4665
  };
4112
4666
  content: {
4113
- "application/json": components["schemas"]["ApiErrorDto"];
4667
+ "application/json": components["schemas"]["CryptoPayoutDto"];
4114
4668
  };
4115
4669
  };
4116
- /** @description The banking network rejected the operation. */
4117
- 422: {
4670
+ /** @description Missing, invalid, or inactive tenant API key. */
4671
+ 401: {
4118
4672
  headers: {
4119
4673
  [name: string]: unknown;
4120
4674
  };
@@ -4122,8 +4676,8 @@ interface operations {
4122
4676
  "application/json": components["schemas"]["ApiErrorDto"];
4123
4677
  };
4124
4678
  };
4125
- /** @description Advanced payments are not available in this environment. */
4126
- 503: {
4679
+ /** @description Live mode not activated (`live_mode_not_activated`): the live account is pending VEX Pay review or suspended. Test keys are unaffected. */
4680
+ 403: {
4127
4681
  headers: {
4128
4682
  [name: string]: unknown;
4129
4683
  };
@@ -4151,26 +4705,31 @@ interface operations {
4151
4705
  };
4152
4706
  };
4153
4707
  };
4154
- Crypto_getBalance: {
4708
+ CopPayments_create: {
4155
4709
  parameters: {
4156
- query?: {
4157
- currency?: "USDT" | "USDC";
4710
+ query?: never;
4711
+ header?: {
4712
+ /** @description Optional. Same key + same body within 24h replays the stored response (`Idempotent-Replayed: true`); a different body returns 409 `idempotency_key_reused`. */
4713
+ "Idempotency-Key"?: string;
4158
4714
  };
4159
- header?: never;
4160
4715
  path?: never;
4161
4716
  cookie?: never;
4162
4717
  };
4163
- requestBody?: never;
4718
+ requestBody: {
4719
+ content: {
4720
+ "application/json": components["schemas"]["CreateCopPaymentDto"];
4721
+ };
4722
+ };
4164
4723
  responses: {
4165
- 200: {
4724
+ 201: {
4166
4725
  headers: {
4167
4726
  [name: string]: unknown;
4168
4727
  };
4169
4728
  content: {
4170
- "application/json": components["schemas"]["CryptoBalanceDto"];
4729
+ "application/json": components["schemas"]["CopPaymentDto"];
4171
4730
  };
4172
4731
  };
4173
- /** @description `unsupported_currency`. */
4732
+ /** @description `invalid_data` (names the field) or `amount_out_of_range`. */
4174
4733
  400: {
4175
4734
  headers: {
4176
4735
  [name: string]: unknown;
@@ -4188,7 +4747,7 @@ interface operations {
4188
4747
  "application/json": components["schemas"]["ApiErrorDto"];
4189
4748
  };
4190
4749
  };
4191
- /** @description `method_not_allowed` — USDC is not enabled for this account. */
4750
+ /** @description `method_not_allowed` — COP is not enabled for this account. */
4192
4751
  403: {
4193
4752
  headers: {
4194
4753
  [name: string]: unknown;
@@ -4197,6 +4756,24 @@ interface operations {
4197
4756
  "application/json": components["schemas"]["ApiErrorDto"];
4198
4757
  };
4199
4758
  };
4759
+ /** @description `processor_unavailable` — the payment network did not answer; read the payment before retrying. */
4760
+ 502: {
4761
+ headers: {
4762
+ [name: string]: unknown;
4763
+ };
4764
+ content: {
4765
+ "application/json": components["schemas"]["ApiErrorDto"];
4766
+ };
4767
+ };
4768
+ /** @description `method_unavailable` — the channel is not available right now. */
4769
+ 503: {
4770
+ headers: {
4771
+ [name: string]: unknown;
4772
+ };
4773
+ content: {
4774
+ "application/json": components["schemas"]["ApiErrorDto"];
4775
+ };
4776
+ };
4200
4777
  /** @description Client error. */
4201
4778
  "4XX": {
4202
4779
  headers: {
@@ -4217,11 +4794,13 @@ interface operations {
4217
4794
  };
4218
4795
  };
4219
4796
  };
4220
- Crypto_getBalances: {
4797
+ CopPayments_get: {
4221
4798
  parameters: {
4222
4799
  query?: never;
4223
4800
  header?: never;
4224
- path?: never;
4801
+ path: {
4802
+ id: string;
4803
+ };
4225
4804
  cookie?: never;
4226
4805
  };
4227
4806
  requestBody?: never;
@@ -4231,7 +4810,7 @@ interface operations {
4231
4810
  [name: string]: unknown;
4232
4811
  };
4233
4812
  content: {
4234
- "application/json": components["schemas"]["CryptoBalancesDto"];
4813
+ "application/json": components["schemas"]["CopPaymentDto"];
4235
4814
  };
4236
4815
  };
4237
4816
  /** @description Missing, invalid, or inactive tenant API key. */
@@ -4252,6 +4831,14 @@ interface operations {
4252
4831
  "application/json": components["schemas"]["ApiErrorDto"];
4253
4832
  };
4254
4833
  };
4834
+ 404: {
4835
+ headers: {
4836
+ [name: string]: unknown;
4837
+ };
4838
+ content: {
4839
+ "application/json": components["schemas"]["ApiErrorDto"];
4840
+ };
4841
+ };
4255
4842
  /** @description Client error. */
4256
4843
  "4XX": {
4257
4844
  headers: {
@@ -4272,19 +4859,21 @@ interface operations {
4272
4859
  };
4273
4860
  };
4274
4861
  };
4275
- Crypto_createDepositAddress: {
4862
+ CopPayments_submitOtp: {
4276
4863
  parameters: {
4277
4864
  query?: never;
4278
4865
  header?: {
4279
4866
  /** @description Optional. Same key + same body within 24h replays the stored response (`Idempotent-Replayed: true`); a different body returns 409 `idempotency_key_reused`. */
4280
4867
  "Idempotency-Key"?: string;
4281
4868
  };
4282
- path?: never;
4869
+ path: {
4870
+ id: string;
4871
+ };
4283
4872
  cookie?: never;
4284
4873
  };
4285
4874
  requestBody: {
4286
4875
  content: {
4287
- "application/json": components["schemas"]["CreateDepositAddressDto"];
4876
+ "application/json": components["schemas"]["SubmitCopOtpDto"];
4288
4877
  };
4289
4878
  };
4290
4879
  responses: {
@@ -4293,10 +4882,10 @@ interface operations {
4293
4882
  [name: string]: unknown;
4294
4883
  };
4295
4884
  content: {
4296
- "application/json": components["schemas"]["DepositAddressDto"];
4885
+ "application/json": components["schemas"]["CopPaymentDto"];
4297
4886
  };
4298
4887
  };
4299
- /** @description `unsupported_currency`, `unsupported_network` or invalid `customerRef`. */
4888
+ /** @description `invalid_otp` — the payment stays pending until it expires. */
4300
4889
  400: {
4301
4890
  headers: {
4302
4891
  [name: string]: unknown;
@@ -4314,7 +4903,7 @@ interface operations {
4314
4903
  "application/json": components["schemas"]["ApiErrorDto"];
4315
4904
  };
4316
4905
  };
4317
- /** @description `method_not_allowed` — that stablecoin is not enabled for this account. */
4906
+ /** @description Live mode not activated (`live_mode_not_activated`): the live account is pending VEX Pay review or suspended. Test keys are unaffected. */
4318
4907
  403: {
4319
4908
  headers: {
4320
4909
  [name: string]: unknown;
@@ -4323,6 +4912,23 @@ interface operations {
4323
4912
  "application/json": components["schemas"]["ApiErrorDto"];
4324
4913
  };
4325
4914
  };
4915
+ 404: {
4916
+ headers: {
4917
+ [name: string]: unknown;
4918
+ };
4919
+ content: {
4920
+ "application/json": components["schemas"]["ApiErrorDto"];
4921
+ };
4922
+ };
4923
+ /** @description `invalid_state` — not a pending Daviplata payment. */
4924
+ 409: {
4925
+ headers: {
4926
+ [name: string]: unknown;
4927
+ };
4928
+ content: {
4929
+ "application/json": components["schemas"]["ApiErrorDto"];
4930
+ };
4931
+ };
4326
4932
  /** @description Client error. */
4327
4933
  "4XX": {
4328
4934
  headers: {
@@ -4343,16 +4949,16 @@ interface operations {
4343
4949
  };
4344
4950
  };
4345
4951
  };
4346
- Crypto_listNetworks: {
4952
+ CopPayments_cancel: {
4347
4953
  parameters: {
4348
- query?: {
4349
- /** @description Alias of `amount`. */
4350
- amountUsdt?: string;
4351
- currency?: "USDT" | "USDC";
4352
- amount?: string;
4954
+ query?: never;
4955
+ header?: {
4956
+ /** @description Optional. Same key + same body within 24h replays the stored response (`Idempotent-Replayed: true`); a different body returns 409 `idempotency_key_reused`. */
4957
+ "Idempotency-Key"?: string;
4958
+ };
4959
+ path: {
4960
+ id: string;
4353
4961
  };
4354
- header?: never;
4355
- path?: never;
4356
4962
  cookie?: never;
4357
4963
  };
4358
4964
  requestBody?: never;
@@ -4362,11 +4968,11 @@ interface operations {
4362
4968
  [name: string]: unknown;
4363
4969
  };
4364
4970
  content: {
4365
- "application/json": components["schemas"]["CryptoNetworkDto"][];
4971
+ "application/json": components["schemas"]["CopPaymentDto"];
4366
4972
  };
4367
4973
  };
4368
- /** @description `unsupported_currency`. */
4369
- 400: {
4974
+ /** @description Missing, invalid, or inactive tenant API key. */
4975
+ 401: {
4370
4976
  headers: {
4371
4977
  [name: string]: unknown;
4372
4978
  };
@@ -4374,8 +4980,8 @@ interface operations {
4374
4980
  "application/json": components["schemas"]["ApiErrorDto"];
4375
4981
  };
4376
4982
  };
4377
- /** @description Missing, invalid, or inactive tenant API key. */
4378
- 401: {
4983
+ /** @description Live mode not activated (`live_mode_not_activated`): the live account is pending VEX Pay review or suspended. Test keys are unaffected. */
4984
+ 403: {
4379
4985
  headers: {
4380
4986
  [name: string]: unknown;
4381
4987
  };
@@ -4383,8 +4989,16 @@ interface operations {
4383
4989
  "application/json": components["schemas"]["ApiErrorDto"];
4384
4990
  };
4385
4991
  };
4386
- /** @description `method_not_allowed` — that stablecoin is not enabled for this account. */
4387
- 403: {
4992
+ 404: {
4993
+ headers: {
4994
+ [name: string]: unknown;
4995
+ };
4996
+ content: {
4997
+ "application/json": components["schemas"]["ApiErrorDto"];
4998
+ };
4999
+ };
5000
+ /** @description `invalid_state` — the payment is not pending. */
5001
+ 409: {
4388
5002
  headers: {
4389
5003
  [name: string]: unknown;
4390
5004
  };
@@ -4412,47 +5026,26 @@ interface operations {
4412
5026
  };
4413
5027
  };
4414
5028
  };
4415
- Crypto_createPayout: {
5029
+ CopPayments_refund: {
4416
5030
  parameters: {
4417
5031
  query?: never;
4418
5032
  header?: {
4419
5033
  /** @description Optional. Same key + same body within 24h replays the stored response (`Idempotent-Replayed: true`); a different body returns 409 `idempotency_key_reused`. */
4420
5034
  "Idempotency-Key"?: string;
4421
5035
  };
4422
- path?: never;
4423
- cookie?: never;
4424
- };
4425
- requestBody: {
4426
- content: {
4427
- "application/json": components["schemas"]["CreateCryptoPayoutDto"];
5036
+ path: {
5037
+ id: string;
4428
5038
  };
5039
+ cookie?: never;
4429
5040
  };
5041
+ requestBody?: never;
4430
5042
  responses: {
4431
- /** @description Idempotent replay of an existing payout. */
4432
5043
  200: {
4433
5044
  headers: {
4434
5045
  [name: string]: unknown;
4435
5046
  };
4436
5047
  content: {
4437
- "application/json": components["schemas"]["CryptoPayoutDto"];
4438
- };
4439
- };
4440
- /** @description Payout created. */
4441
- 201: {
4442
- headers: {
4443
- [name: string]: unknown;
4444
- };
4445
- content: {
4446
- "application/json": components["schemas"]["CryptoPayoutDto"];
4447
- };
4448
- };
4449
- /** @description `unsupported_currency`, `unsupported_network`, `invalid_address` or `invalid_data`. */
4450
- 400: {
4451
- headers: {
4452
- [name: string]: unknown;
4453
- };
4454
- content: {
4455
- "application/json": components["schemas"]["ApiErrorDto"];
5048
+ "application/json": components["schemas"]["CopPaymentDto"];
4456
5049
  };
4457
5050
  };
4458
5051
  /** @description Missing, invalid, or inactive tenant API key. */
@@ -4464,7 +5057,7 @@ interface operations {
4464
5057
  "application/json": components["schemas"]["ApiErrorDto"];
4465
5058
  };
4466
5059
  };
4467
- /** @description `method_not_allowed` — that stablecoin is not enabled for this account. */
5060
+ /** @description Live mode not activated (`live_mode_not_activated`): the live account is pending VEX Pay review or suspended. Test keys are unaffected. */
4468
5061
  403: {
4469
5062
  headers: {
4470
5063
  [name: string]: unknown;
@@ -4473,8 +5066,7 @@ interface operations {
4473
5066
  "application/json": components["schemas"]["ApiErrorDto"];
4474
5067
  };
4475
5068
  };
4476
- /** @description `idempotency_key_reused` with a different request. */
4477
- 409: {
5069
+ 404: {
4478
5070
  headers: {
4479
5071
  [name: string]: unknown;
4480
5072
  };
@@ -4482,8 +5074,8 @@ interface operations {
4482
5074
  "application/json": components["schemas"]["ApiErrorDto"];
4483
5075
  };
4484
5076
  };
4485
- /** @description `insufficient_balance` or `amount_below_minimum`. */
4486
- 422: {
5077
+ /** @description `invalid_state`, `refund_window_expired` or `insufficient_balance`. */
5078
+ 409: {
4487
5079
  headers: {
4488
5080
  [name: string]: unknown;
4489
5081
  };
@@ -4511,13 +5103,11 @@ interface operations {
4511
5103
  };
4512
5104
  };
4513
5105
  };
4514
- Crypto_getPayout: {
5106
+ CopPayments_balance: {
4515
5107
  parameters: {
4516
5108
  query?: never;
4517
5109
  header?: never;
4518
- path: {
4519
- id: string;
4520
- };
5110
+ path?: never;
4521
5111
  cookie?: never;
4522
5112
  };
4523
5113
  requestBody?: never;
@@ -4527,7 +5117,7 @@ interface operations {
4527
5117
  [name: string]: unknown;
4528
5118
  };
4529
5119
  content: {
4530
- "application/json": components["schemas"]["CryptoPayoutDto"];
5120
+ "application/json": components["schemas"]["CopBalanceDto"];
4531
5121
  };
4532
5122
  };
4533
5123
  /** @description Missing, invalid, or inactive tenant API key. */
@@ -4539,7 +5129,7 @@ interface operations {
4539
5129
  "application/json": components["schemas"]["ApiErrorDto"];
4540
5130
  };
4541
5131
  };
4542
- /** @description Live mode not activated (`live_mode_not_activated`): the live account is pending VEX Pay review or suspended. Test keys are unaffected. */
5132
+ /** @description `method_not_allowed` — COP is not enabled for this account. */
4543
5133
  403: {
4544
5134
  headers: {
4545
5135
  [name: string]: unknown;
@@ -8278,7 +8868,7 @@ declare class CheckoutSessions extends APIResource {
8278
8868
  [key: string]: string;
8279
8869
  };
8280
8870
  allowedOrigins: string[];
8281
- methods: ("c2p" | "vpos" | "usdt" | "usdc")[];
8871
+ methods: ("c2p" | "vpos" | "usdt" | "usdc" | "cop")[];
8282
8872
  successUrl?: string | null;
8283
8873
  cancelUrl?: string | null;
8284
8874
  paymentId?: string | null;
@@ -8299,7 +8889,7 @@ declare class CheckoutSessions extends APIResource {
8299
8889
  [key: string]: string;
8300
8890
  };
8301
8891
  allowedOrigins: string[];
8302
- methods: ("c2p" | "vpos" | "usdt" | "usdc")[];
8892
+ methods: ("c2p" | "vpos" | "usdt" | "usdc" | "cop")[];
8303
8893
  successUrl?: string | null;
8304
8894
  cancelUrl?: string | null;
8305
8895
  paymentId?: string | null;
@@ -8498,6 +9088,130 @@ declare class Conversions extends APIResource {
8498
9088
  }>;
8499
9089
  }
8500
9090
 
9091
+ /**
9092
+ * Colombian peso payments: Bre-B (QR / transfer key), Nequi (push approval) or Daviplata (SMS
9093
+ * code). Payments complete asynchronously — listen for `payment.completed` / `payment.failed`.
9094
+ * COP must be enabled on your account (403 `method_not_allowed` otherwise).
9095
+ */
9096
+ declare class CopPayments extends APIResource {
9097
+ /**
9098
+ * Create a payment in whole pesos. `buyer` is required for `nequi` and `daviplata`. The response
9099
+ * `next` says what the buyer does: `show_qr`, `approve_in_app` or `submit_otp`.
9100
+ * Pass `idempotencyKey` in options to retry safely.
9101
+ */
9102
+ create(params: RequestBody<'CopPayments_create'>, options?: RequestOptions): Promise<{
9103
+ id: string;
9104
+ status: "pending" | "completed" | "failed" | "canceled" | "refunded";
9105
+ method: "COP";
9106
+ channel: "breb" | "nequi" | "daviplata";
9107
+ amountCop: number;
9108
+ feeCop?: number;
9109
+ amountUsd?: string;
9110
+ copRate?: string;
9111
+ reference?: string;
9112
+ metadata: {
9113
+ [key: string]: string;
9114
+ };
9115
+ failureCode?: "expired" | "rejected" | "processor_error" | "processor_unknown";
9116
+ expiresAt?: string;
9117
+ createdAt: string;
9118
+ completedAt?: string;
9119
+ next?: components["schemas"]["CopNextActionDto"];
9120
+ }>;
9121
+ retrieve(id: string, options?: RequestOptions): Promise<{
9122
+ id: string;
9123
+ status: "pending" | "completed" | "failed" | "canceled" | "refunded";
9124
+ method: "COP";
9125
+ channel: "breb" | "nequi" | "daviplata";
9126
+ amountCop: number;
9127
+ feeCop?: number;
9128
+ amountUsd?: string;
9129
+ copRate?: string;
9130
+ reference?: string;
9131
+ metadata: {
9132
+ [key: string]: string;
9133
+ };
9134
+ failureCode?: "expired" | "rejected" | "processor_error" | "processor_unknown";
9135
+ expiresAt?: string;
9136
+ createdAt: string;
9137
+ completedAt?: string;
9138
+ next?: components["schemas"]["CopNextActionDto"];
9139
+ }>;
9140
+ /** Daviplata: submit the code the buyer received by SMS. A wrong code fails with `invalid_otp`. */
9141
+ submitOtp(id: string, params: RequestBody<'CopPayments_submitOtp'>, options?: RequestOptions): Promise<{
9142
+ id: string;
9143
+ status: "pending" | "completed" | "failed" | "canceled" | "refunded";
9144
+ method: "COP";
9145
+ channel: "breb" | "nequi" | "daviplata";
9146
+ amountCop: number;
9147
+ feeCop?: number;
9148
+ amountUsd?: string;
9149
+ copRate?: string;
9150
+ reference?: string;
9151
+ metadata: {
9152
+ [key: string]: string;
9153
+ };
9154
+ failureCode?: "expired" | "rejected" | "processor_error" | "processor_unknown";
9155
+ expiresAt?: string;
9156
+ createdAt: string;
9157
+ completedAt?: string;
9158
+ next?: components["schemas"]["CopNextActionDto"];
9159
+ }>;
9160
+ /** Cancel a pending payment. */
9161
+ cancel(id: string, options?: RequestOptions): Promise<{
9162
+ id: string;
9163
+ status: "pending" | "completed" | "failed" | "canceled" | "refunded";
9164
+ method: "COP";
9165
+ channel: "breb" | "nequi" | "daviplata";
9166
+ amountCop: number;
9167
+ feeCop?: number;
9168
+ amountUsd?: string;
9169
+ copRate?: string;
9170
+ reference?: string;
9171
+ metadata: {
9172
+ [key: string]: string;
9173
+ };
9174
+ failureCode?: "expired" | "rejected" | "processor_error" | "processor_unknown";
9175
+ expiresAt?: string;
9176
+ createdAt: string;
9177
+ completedAt?: string;
9178
+ next?: components["schemas"]["CopNextActionDto"];
9179
+ }>;
9180
+ /** Full refund of a completed payment, within 96 hours. */
9181
+ refund(id: string, options?: RequestOptions): Promise<{
9182
+ id: string;
9183
+ status: "pending" | "completed" | "failed" | "canceled" | "refunded";
9184
+ method: "COP";
9185
+ channel: "breb" | "nequi" | "daviplata";
9186
+ amountCop: number;
9187
+ feeCop?: number;
9188
+ amountUsd?: string;
9189
+ copRate?: string;
9190
+ reference?: string;
9191
+ metadata: {
9192
+ [key: string]: string;
9193
+ };
9194
+ failureCode?: "expired" | "rejected" | "processor_error" | "processor_unknown";
9195
+ expiresAt?: string;
9196
+ createdAt: string;
9197
+ completedAt?: string;
9198
+ next?: components["schemas"]["CopNextActionDto"];
9199
+ }>;
9200
+ }
9201
+ /** Your COP balance, in whole pesos. Kept apart from VES and stablecoins. */
9202
+ declare class CopBalance extends APIResource {
9203
+ retrieve(options?: RequestOptions): Promise<{
9204
+ availableCop: number;
9205
+ pendingPayoutCop: number;
9206
+ asOf: string;
9207
+ }>;
9208
+ }
9209
+ /** Collect Colombian pesos (Bre-B, Nequi, Daviplata). */
9210
+ declare class Cop extends APIResource {
9211
+ readonly payments: CopPayments;
9212
+ readonly balance: CopBalance;
9213
+ }
9214
+
8501
9215
  /** One stablecoin balance (`currency`: USDT by default, or USDC). Never converted to VES. */
8502
9216
  declare class CryptoBalance extends APIResource {
8503
9217
  retrieve(params?: QueryParams<'Crypto_getBalance'>, options?: RequestOptions): Promise<{
@@ -9149,7 +9863,8 @@ interface PaymentWebhookData {
9149
9863
  paymentId: string;
9150
9864
  externalRef?: string;
9151
9865
  status: 'PENDING' | 'COMPLETED' | 'FAILED' | 'CANCELED' | 'REVERSED';
9152
- method: 'C2P' | 'VPOS' | 'PAGO_MOVIL' | 'DEBITO_INMEDIATO';
9866
+ /** `COP` payments carry a different shape: narrow on `method === 'COP'` and read them as {@link CopPaymentWebhookData}. */
9867
+ method: 'C2P' | 'VPOS' | 'PAGO_MOVIL' | 'DEBITO_INMEDIATO' | 'COP';
9153
9868
  usdAmount: number;
9154
9869
  vesAmount: number;
9155
9870
  bcvRate: number;
@@ -9181,6 +9896,37 @@ interface PaymentWebhookData {
9181
9896
  metadata: Record<string, string>;
9182
9897
  };
9183
9898
  }
9899
+ /**
9900
+ * `payment.*` data for a Colombian peso payment (`method: "COP"`). Amounts are whole pesos.
9901
+ * `amountUsd` and `copRate` are present only for hosted-checkout payments.
9902
+ */
9903
+ interface CopPaymentWebhookData {
9904
+ id: string;
9905
+ paymentId: string;
9906
+ method: 'COP';
9907
+ currency: 'COP';
9908
+ status: 'pending' | 'completed' | 'failed' | 'canceled' | 'refunded';
9909
+ channel: 'breb' | 'nequi' | 'daviplata';
9910
+ amountCop: number;
9911
+ feeCop?: number;
9912
+ amountUsd?: string;
9913
+ copRate?: string;
9914
+ reference?: string;
9915
+ externalRef?: string;
9916
+ metadata: Record<string, string>;
9917
+ failureCode?: 'expired' | 'rejected' | 'processor_error' | 'processor_unknown';
9918
+ expiresAt?: string;
9919
+ createdAt: string;
9920
+ completedAt?: string;
9921
+ tenantName: string;
9922
+ livemode: boolean;
9923
+ /** Present when the payment came from a checkout session. */
9924
+ checkoutSession?: {
9925
+ id: string;
9926
+ reference: string | null;
9927
+ metadata: Record<string, string>;
9928
+ };
9929
+ }
9184
9930
  type PaymentEventName = Extract<WebhookEventName, `payment.${string}`>;
9185
9931
  /** A verified webhook delivery, discriminated by `event`. */
9186
9932
  type WebhookEvent = {
@@ -9238,6 +9984,8 @@ declare class VexPay {
9238
9984
  readonly crypto: Crypto;
9239
9985
  /** Convert available VES to USDT (enabled per account). */
9240
9986
  readonly conversions: Conversions;
9987
+ /** Colombian pesos: Bre-B, Nequi and Daviplata payments and the COP balance. */
9988
+ readonly cop: Cop;
9241
9989
  readonly products: Products;
9242
9990
  readonly paymentLinks: PaymentLinks;
9243
9991
  readonly tenantPayoutAccount: TenantPayoutAccount;
@@ -9295,6 +10043,6 @@ declare class VexPayTimeoutError extends VexPayConnectionError {
9295
10043
  declare class VexPaySignatureVerificationError extends VexPayError {
9296
10044
  }
9297
10045
 
9298
- declare const VERSION = "0.4.0";
10046
+ declare const VERSION = "0.6.0";
9299
10047
 
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 };
10048
+ export { type CopPaymentWebhookData, 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 };