@timbro/invoices 0.10.3 → 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.
Files changed (60) hide show
  1. package/README.md +58 -2
  2. package/dist/admin.d.ts +2 -3
  3. package/dist/admin.d.ts.map +1 -1
  4. package/dist/generated/hosted/index.d.ts +3 -3
  5. package/dist/generated/hosted/index.d.ts.map +1 -1
  6. package/dist/generated/hosted/index.js +2 -2
  7. package/dist/generated/hosted/sdk.gen.d.ts +19 -1
  8. package/dist/generated/hosted/sdk.gen.d.ts.map +1 -1
  9. package/dist/generated/hosted/sdk.gen.js +225 -1
  10. package/dist/generated/hosted/types.gen.d.ts +583 -5
  11. package/dist/generated/hosted/types.gen.d.ts.map +1 -1
  12. package/dist/generated/hosted/zod-response.gen.d.ts +6678 -208
  13. package/dist/generated/hosted/zod-response.gen.d.ts.map +1 -1
  14. package/dist/generated/hosted/zod-response.gen.js +694 -207
  15. package/dist/generated/hosted/zod.gen.d.ts +1661 -14
  16. package/dist/generated/hosted/zod.gen.d.ts.map +1 -1
  17. package/dist/generated/hosted/zod.gen.js +772 -222
  18. package/dist/generated/index.d.ts +3 -3
  19. package/dist/generated/index.d.ts.map +1 -1
  20. package/dist/generated/index.js +2 -2
  21. package/dist/generated/invoice-api-contract.d.ts +186 -2
  22. package/dist/generated/invoice-api-contract.d.ts.map +1 -1
  23. package/dist/generated/invoice-api-contract.js +211 -1
  24. package/dist/generated/sdk.gen.d.ts +5 -5
  25. package/dist/generated/sdk.gen.d.ts.map +1 -1
  26. package/dist/generated/sdk.gen.js +93 -93
  27. package/dist/generated/types.gen.d.ts +288 -139
  28. package/dist/generated/types.gen.d.ts.map +1 -1
  29. package/dist/generated/zod-response.gen.d.ts +2304 -2548
  30. package/dist/generated/zod-response.gen.d.ts.map +1 -1
  31. package/dist/generated/zod-response.gen.js +179 -109
  32. package/dist/generated/zod.gen.d.ts +1252 -2188
  33. package/dist/generated/zod.gen.d.ts.map +1 -1
  34. package/dist/generated/zod.gen.js +215 -115
  35. package/dist/hosted-tenant.d.ts +9 -0
  36. package/dist/hosted-tenant.d.ts.map +1 -1
  37. package/dist/hosted-tenant.js +7 -0
  38. package/dist/index.d.ts +1 -1
  39. package/dist/index.d.ts.map +1 -1
  40. package/dist/invoice-hosted-controls.d.ts +22 -3
  41. package/dist/invoice-hosted-controls.d.ts.map +1 -1
  42. package/dist/invoice-hosted-controls.js +48 -12
  43. package/dist/invoice.d.ts +5 -0
  44. package/dist/invoice.d.ts.map +1 -1
  45. package/dist/invoice.js +1 -0
  46. package/dist/issuance-readiness.d.ts +9 -0
  47. package/dist/issuance-readiness.d.ts.map +1 -0
  48. package/dist/issuance-readiness.js +19 -0
  49. package/dist/timbro-client.d.ts +6 -8
  50. package/dist/timbro-client.d.ts.map +1 -1
  51. package/dist/timbro-client.js +3 -5
  52. package/dist/webhook-event.d.ts +392 -0
  53. package/dist/webhook-event.d.ts.map +1 -1
  54. package/package.json +3 -3
  55. package/dist/certificate-custody-readiness.d.ts +0 -6
  56. package/dist/certificate-custody-readiness.d.ts.map +0 -1
  57. package/dist/certificate-custody-readiness.js +0 -13
  58. package/dist/fiscal-numbering-readiness.d.ts +0 -6
  59. package/dist/fiscal-numbering-readiness.d.ts.map +0 -1
  60. package/dist/fiscal-numbering-readiness.js +0 -13
@@ -63,6 +63,70 @@ export const zMerchantBusinessSigningCertificate = z.union([
63
63
  notAfter: z.iso.datetime(),
64
64
  }),
65
65
  ]);
66
+ /**
67
+ * NumberingRange
68
+ *
69
+ * The range Timbro assigns the next fiscal number of this type from.
70
+ */
71
+ export const zNumberingRange = z.strictObject({
72
+ remaining: z.int().gte(1).lte(9999999999),
73
+ expiresOn: z.iso.date().nullable(),
74
+ });
75
+ /**
76
+ * DocumentTypeIssuanceReadiness
77
+ *
78
+ * Whether Timbro can issue one e-CF type now, as Timbro reports it.
79
+ */
80
+ export const zDocumentTypeIssuanceReadiness = z.union([
81
+ z.strictObject({
82
+ type: z.union([
83
+ z.literal("E31"),
84
+ z.literal("E32"),
85
+ z.literal("E33"),
86
+ z.literal("E34"),
87
+ z.literal("E41"),
88
+ z.literal("E43"),
89
+ z.literal("E44"),
90
+ z.literal("E45"),
91
+ z.literal("E46"),
92
+ z.literal("E47"),
93
+ ]),
94
+ status: z.literal("ready"),
95
+ numbering: zNumberingRange,
96
+ }),
97
+ z.strictObject({
98
+ type: z.union([
99
+ z.literal("E31"),
100
+ z.literal("E32"),
101
+ z.literal("E33"),
102
+ z.literal("E34"),
103
+ z.literal("E41"),
104
+ z.literal("E43"),
105
+ z.literal("E44"),
106
+ z.literal("E45"),
107
+ z.literal("E46"),
108
+ z.literal("E47"),
109
+ ]),
110
+ status: z.literal("actionRequired"),
111
+ reasons: z
112
+ .array(z.union([
113
+ z.literal("legal_issuer_profile_incomplete"),
114
+ z.literal("signing_certificate_missing"),
115
+ z.literal("signing_certificate_expired"),
116
+ z.literal("signing_certificate_not_yet_valid"),
117
+ z.literal("authorization_missing"),
118
+ z.literal("authorization_not_active"),
119
+ z.literal("authorization_not_verified"),
120
+ z.literal("authorization_not_observed"),
121
+ z.literal("range_exhausted"),
122
+ z.literal("authorization_expiration_invalid"),
123
+ z.literal("authorization_expired"),
124
+ z.literal("authorization_range_overlap"),
125
+ ]))
126
+ .min(1),
127
+ numbering: zNumberingRange.nullable(),
128
+ }),
129
+ ]);
66
130
  /**
67
131
  * MerchantBusinessFiscalSetupAvailable
68
132
  */
@@ -142,6 +206,7 @@ export const zMerchantBusinessFiscalSetupAvailable = z.strictObject({
142
206
  ]),
143
207
  }),
144
208
  ]),
209
+ documentTypes: z.array(zDocumentTypeIssuanceReadiness).nullable(),
145
210
  });
146
211
  /**
147
212
  * MerchantBusinessFiscalSetup
@@ -160,6 +225,7 @@ export const zMerchantBusinessLiveFiscalSetupAvailable = z.strictObject({
160
225
  binding: zMerchantBusinessFiscalBinding,
161
226
  legalIssuer: zMerchantBusinessLegalIssuer,
162
227
  signingCertificate: zMerchantBusinessSigningCertificate,
228
+ documentTypes: z.array(zDocumentTypeIssuanceReadiness).nullable(),
163
229
  });
164
230
  /**
165
231
  * MerchantBusinessLiveFiscalSetup
@@ -177,6 +243,20 @@ export const zMerchantBusinessLiveFiscalSetup = z.union([
177
243
  */
178
244
  export const zProblem = z.strictObject({
179
245
  code: z.enum([
246
+ "authorization_not_found",
247
+ "authorization_checkout_reference_invalid",
248
+ "authorization_reference_conflict",
249
+ "authorization_capture_conflict",
250
+ "authorization_capture_exceeds_hold",
251
+ "authorization_not_capturable",
252
+ "authorization_not_cancelable",
253
+ "authorization_not_editable",
254
+ "authorization_submission_invalid",
255
+ "authorization_authentication_pending",
256
+ "authorization_credentials_unavailable",
257
+ "authorization_dispatch_refused",
258
+ "authorization_hold_evidence_missing",
259
+ "provider_qualification_required",
180
260
  "merchant_authentication_unavailable",
181
261
  "platform_test_profile_unavailable",
182
262
  "merchant_fiscal_binding_unavailable",
@@ -217,6 +297,10 @@ export const zProblem = z.strictObject({
217
297
  "merchant_business_not_member",
218
298
  "merchant_business_revision_conflict",
219
299
  "merchant_business_capabilities_required",
300
+ "merchant_business_certification_path_unavailable",
301
+ "merchant_business_certification_requirements_unmet",
302
+ "merchant_business_certification_revision_conflict",
303
+ "merchant_business_certification_evidence_not_found",
220
304
  "merchant_fiscal_setup_incomplete",
221
305
  "merchant_payment_setup_assessment_incomplete",
222
306
  "merchant_certificate_conflict",
@@ -295,15 +379,12 @@ export const zProblem = z.strictObject({
295
379
  "api_key_retired",
296
380
  "payment_method_already_in_progress",
297
381
  "payment_not_payable",
298
- "refund_not_allowed",
299
- "refund_already_exists",
300
382
  "payment_awaiting_verification",
301
383
  "payment_attempt_invalid",
302
384
  "payment_attempt_mismatch",
303
385
  "payment_attempt_stale",
304
386
  "payment_method_mismatch",
305
387
  "provider_response_invalid",
306
- "decline_not_retryable",
307
388
  "checkout_window_closed",
308
389
  "payment_not_editable",
309
390
  "payment_cancel_not_allowed",
@@ -353,9 +434,6 @@ export const zProblem = z.strictObject({
353
434
  "payment_description_required",
354
435
  "sale_amount_invalid",
355
436
  "credential_storage_unavailable",
356
- "refund_credentials_unavailable",
357
- "refund_provider_unavailable",
358
- "refund_provider_reference_unavailable",
359
437
  "provider_not_eligible",
360
438
  "no_eligible_provider",
361
439
  "currency_not_supported_by_provider",
@@ -382,6 +460,9 @@ export const zProblem = z.strictObject({
382
460
  "refund_tip_amount_invalid",
383
461
  "refund_tip_allocation_unknown",
384
462
  "refund_amount_invalid",
463
+ "refund_tax_amount_invalid",
464
+ "refund_tax_amount_required",
465
+ "refund_tax_allocation_unknown",
385
466
  "refund_currency_mismatch",
386
467
  "payer_fiscal_profile_invalid",
387
468
  "rate_limit_exceeded",
@@ -537,6 +618,92 @@ export const zProblem = z.strictObject({
537
618
  title: z.string(),
538
619
  type: z.enum(["about:blank"]),
539
620
  });
621
+ /**
622
+ * MerchantBusinessCertificationRequirement
623
+ */
624
+ export const zMerchantBusinessCertificationRequirement = z.strictObject({
625
+ code: z.union([
626
+ z.literal("invoices_not_requested"),
627
+ z.literal("fiscal_details_incomplete"),
628
+ z.literal("certification_binding_required"),
629
+ z.literal("certification_certificate_required"),
630
+ z.literal("provider_eligibility_unverified"),
631
+ z.literal("certification_receiver_urls_pending"),
632
+ z.literal("certification_test_set_processing_unavailable"),
633
+ ]),
634
+ owner: z.union([
635
+ z.literal("merchant"),
636
+ z.literal("dgii"),
637
+ z.literal("timbro"),
638
+ z.literal("operator"),
639
+ ]),
640
+ blocks: z
641
+ .array(z.union([z.literal("start"), z.literal("step_1"), z.literal("step_2"), z.literal("step_7")]))
642
+ .max(4),
643
+ field: z.string().optional(),
644
+ });
645
+ /**
646
+ * MerchantBusinessCertificationEvidence
647
+ *
648
+ * A business-reported DGII outcome. It remains unverified until an authorized evidence review confirms it.
649
+ */
650
+ export const zMerchantBusinessCertificationEvidence = z.strictObject({
651
+ id: z.string().refine((text) => Array.from(text).length >= 1),
652
+ outcome: z.union([
653
+ z.literal("submitted"),
654
+ z.literal("approved"),
655
+ z.literal("rejected"),
656
+ z.literal("needs_correction"),
657
+ ]),
658
+ verification: z.union([
659
+ z.literal("user_reported"),
660
+ z.literal("operator_verified"),
661
+ z.literal("operator_rejected"),
662
+ ]),
663
+ reference: z
664
+ .string()
665
+ .refine((text) => Array.from(text).length <= 255)
666
+ .nullable(),
667
+ createdAt: z.iso.datetime(),
668
+ reviewedAt: z.iso.datetime().optional(),
669
+ reviewReference: z
670
+ .string()
671
+ .refine((text) => Array.from(text).length <= 512)
672
+ .optional(),
673
+ });
674
+ /**
675
+ * MerchantBusinessCertificationStep
676
+ */
677
+ export const zMerchantBusinessCertificationStep = z.strictObject({
678
+ number: z.union([
679
+ z.literal(1),
680
+ z.literal(2),
681
+ z.literal(3),
682
+ z.literal(4),
683
+ z.literal(5),
684
+ z.literal(6),
685
+ z.literal(7),
686
+ z.literal(8),
687
+ z.literal(9),
688
+ z.literal(10),
689
+ z.literal(11),
690
+ z.literal(12),
691
+ z.literal(13),
692
+ z.literal(14),
693
+ z.literal(15),
694
+ ]),
695
+ code: z.string().refine((text) => Array.from(text).length >= 1),
696
+ title: z.string().refine((text) => Array.from(text).length >= 1),
697
+ actor: z.union([z.literal("merchant"), z.literal("dgii"), z.literal("timbro")]),
698
+ status: z.union([
699
+ z.literal("blocked"),
700
+ z.literal("action_required"),
701
+ z.literal("awaiting_dgii"),
702
+ z.literal("reported"),
703
+ z.literal("verified"),
704
+ ]),
705
+ evidence: z.array(zMerchantBusinessCertificationEvidence),
706
+ });
540
707
  /**
541
708
  * MerchantBusiness
542
709
  *
@@ -1161,6 +1328,313 @@ export const zUpdateBusinessResponse = z.strictObject({
1161
1328
  })),
1162
1329
  onboardingUrl: z.url(),
1163
1330
  });
1331
+ /**
1332
+ * MerchantBusinessCertification
1333
+ *
1334
+ * Durable certification preparation and user-reported DGII progress for the authenticated business.
1335
+ */
1336
+ export const zRetrieveMerchantBusinessCertificationResponse = z.union([
1337
+ z.strictObject({
1338
+ object: z.literal("merchant_business_certification"),
1339
+ status: z.literal("not_started"),
1340
+ requirements: z.array(zMerchantBusinessCertificationRequirement),
1341
+ availablePaths: z
1342
+ .array(z.union([z.literal("own_software"), z.literal("external_software")]))
1343
+ .min(1),
1344
+ recommendedPath: z.union([z.literal("own_software"), z.literal("external_software")]),
1345
+ actions: z.array(z.literal("start")).max(1),
1346
+ }),
1347
+ z.strictObject({
1348
+ object: z.literal("merchant_business_certification"),
1349
+ id: z.string().regex(/^cert_[a-z0-9]{24,}$/),
1350
+ revision: z.int().gte(1),
1351
+ status: z.literal("in_progress"),
1352
+ path: z.union([z.literal("own_software"), z.literal("external_software")]),
1353
+ software: z.strictObject({
1354
+ name: z
1355
+ .string()
1356
+ .refine((text) => Array.from(text).length >= 1)
1357
+ .refine((text) => Array.from(text).length <= 128),
1358
+ version: z
1359
+ .string()
1360
+ .refine((text) => Array.from(text).length >= 1)
1361
+ .refine((text) => Array.from(text).length <= 64),
1362
+ }),
1363
+ phase: z.union([
1364
+ z.literal("preparation"),
1365
+ z.literal("application"),
1366
+ z.literal("tests"),
1367
+ z.literal("authorization"),
1368
+ ]),
1369
+ serviceUrls: z
1370
+ .strictObject({
1371
+ reception: z.url(),
1372
+ commercialApproval: z.url(),
1373
+ })
1374
+ .nullable(),
1375
+ requirements: z.array(zMerchantBusinessCertificationRequirement),
1376
+ actions: z.array(z.union([z.literal("report_evidence"), z.literal("import_certificate")])),
1377
+ steps: z.tuple([
1378
+ zMerchantBusinessCertificationStep,
1379
+ zMerchantBusinessCertificationStep,
1380
+ zMerchantBusinessCertificationStep,
1381
+ zMerchantBusinessCertificationStep,
1382
+ zMerchantBusinessCertificationStep,
1383
+ zMerchantBusinessCertificationStep,
1384
+ zMerchantBusinessCertificationStep,
1385
+ zMerchantBusinessCertificationStep,
1386
+ zMerchantBusinessCertificationStep,
1387
+ zMerchantBusinessCertificationStep,
1388
+ zMerchantBusinessCertificationStep,
1389
+ zMerchantBusinessCertificationStep,
1390
+ zMerchantBusinessCertificationStep,
1391
+ zMerchantBusinessCertificationStep,
1392
+ zMerchantBusinessCertificationStep,
1393
+ ]),
1394
+ }),
1395
+ ]);
1396
+ /**
1397
+ * MerchantBusinessCertificationStartRequest
1398
+ */
1399
+ export const zStartMerchantBusinessCertificationBody = z.strictObject({
1400
+ path: z.union([z.literal("own_software"), z.literal("external_software")]),
1401
+ });
1402
+ export const zStartMerchantBusinessCertificationHeaders = z.object({
1403
+ "idempotency-key": z
1404
+ .string()
1405
+ .refine((text) => Array.from(text).length >= 1)
1406
+ .refine((text) => Array.from(text).length <= 255)
1407
+ .regex(/^[\x20-\x7e]+$/),
1408
+ });
1409
+ export const zStartMerchantBusinessCertificationResponse = z.union([
1410
+ z.union([
1411
+ z.strictObject({
1412
+ object: z.literal("merchant_business_certification"),
1413
+ status: z.literal("not_started"),
1414
+ requirements: z.array(zMerchantBusinessCertificationRequirement),
1415
+ availablePaths: z
1416
+ .array(z.union([z.literal("own_software"), z.literal("external_software")]))
1417
+ .min(1),
1418
+ recommendedPath: z.union([z.literal("own_software"), z.literal("external_software")]),
1419
+ actions: z.array(z.literal("start")).max(1),
1420
+ }),
1421
+ z.strictObject({
1422
+ object: z.literal("merchant_business_certification"),
1423
+ id: z.string().regex(/^cert_[a-z0-9]{24,}$/),
1424
+ revision: z.int().gte(1),
1425
+ status: z.literal("in_progress"),
1426
+ path: z.union([z.literal("own_software"), z.literal("external_software")]),
1427
+ software: z.strictObject({
1428
+ name: z
1429
+ .string()
1430
+ .refine((text) => Array.from(text).length >= 1)
1431
+ .refine((text) => Array.from(text).length <= 128),
1432
+ version: z
1433
+ .string()
1434
+ .refine((text) => Array.from(text).length >= 1)
1435
+ .refine((text) => Array.from(text).length <= 64),
1436
+ }),
1437
+ phase: z.union([
1438
+ z.literal("preparation"),
1439
+ z.literal("application"),
1440
+ z.literal("tests"),
1441
+ z.literal("authorization"),
1442
+ ]),
1443
+ serviceUrls: z
1444
+ .strictObject({
1445
+ reception: z.url(),
1446
+ commercialApproval: z.url(),
1447
+ })
1448
+ .nullable(),
1449
+ requirements: z.array(zMerchantBusinessCertificationRequirement),
1450
+ actions: z.array(z.union([z.literal("report_evidence"), z.literal("import_certificate")])),
1451
+ steps: z.tuple([
1452
+ zMerchantBusinessCertificationStep,
1453
+ zMerchantBusinessCertificationStep,
1454
+ zMerchantBusinessCertificationStep,
1455
+ zMerchantBusinessCertificationStep,
1456
+ zMerchantBusinessCertificationStep,
1457
+ zMerchantBusinessCertificationStep,
1458
+ zMerchantBusinessCertificationStep,
1459
+ zMerchantBusinessCertificationStep,
1460
+ zMerchantBusinessCertificationStep,
1461
+ zMerchantBusinessCertificationStep,
1462
+ zMerchantBusinessCertificationStep,
1463
+ zMerchantBusinessCertificationStep,
1464
+ zMerchantBusinessCertificationStep,
1465
+ zMerchantBusinessCertificationStep,
1466
+ zMerchantBusinessCertificationStep,
1467
+ ]),
1468
+ }),
1469
+ ]),
1470
+ z.union([
1471
+ z.strictObject({
1472
+ object: z.literal("merchant_business_certification"),
1473
+ status: z.literal("not_started"),
1474
+ requirements: z.array(zMerchantBusinessCertificationRequirement),
1475
+ availablePaths: z
1476
+ .array(z.union([z.literal("own_software"), z.literal("external_software")]))
1477
+ .min(1),
1478
+ recommendedPath: z.union([z.literal("own_software"), z.literal("external_software")]),
1479
+ actions: z.array(z.literal("start")).max(1),
1480
+ }),
1481
+ z.strictObject({
1482
+ object: z.literal("merchant_business_certification"),
1483
+ id: z.string().regex(/^cert_[a-z0-9]{24,}$/),
1484
+ revision: z.int().gte(1),
1485
+ status: z.literal("in_progress"),
1486
+ path: z.union([z.literal("own_software"), z.literal("external_software")]),
1487
+ software: z.strictObject({
1488
+ name: z
1489
+ .string()
1490
+ .refine((text) => Array.from(text).length >= 1)
1491
+ .refine((text) => Array.from(text).length <= 128),
1492
+ version: z
1493
+ .string()
1494
+ .refine((text) => Array.from(text).length >= 1)
1495
+ .refine((text) => Array.from(text).length <= 64),
1496
+ }),
1497
+ phase: z.union([
1498
+ z.literal("preparation"),
1499
+ z.literal("application"),
1500
+ z.literal("tests"),
1501
+ z.literal("authorization"),
1502
+ ]),
1503
+ serviceUrls: z
1504
+ .strictObject({
1505
+ reception: z.url(),
1506
+ commercialApproval: z.url(),
1507
+ })
1508
+ .nullable(),
1509
+ requirements: z.array(zMerchantBusinessCertificationRequirement),
1510
+ actions: z.array(z.union([z.literal("report_evidence"), z.literal("import_certificate")])),
1511
+ steps: z.tuple([
1512
+ zMerchantBusinessCertificationStep,
1513
+ zMerchantBusinessCertificationStep,
1514
+ zMerchantBusinessCertificationStep,
1515
+ zMerchantBusinessCertificationStep,
1516
+ zMerchantBusinessCertificationStep,
1517
+ zMerchantBusinessCertificationStep,
1518
+ zMerchantBusinessCertificationStep,
1519
+ zMerchantBusinessCertificationStep,
1520
+ zMerchantBusinessCertificationStep,
1521
+ zMerchantBusinessCertificationStep,
1522
+ zMerchantBusinessCertificationStep,
1523
+ zMerchantBusinessCertificationStep,
1524
+ zMerchantBusinessCertificationStep,
1525
+ zMerchantBusinessCertificationStep,
1526
+ zMerchantBusinessCertificationStep,
1527
+ ]),
1528
+ }),
1529
+ ]),
1530
+ ]);
1531
+ /**
1532
+ * MerchantBusinessCertificationEvidenceRequest
1533
+ */
1534
+ export const zSubmitMerchantBusinessCertificationEvidenceBody = z.strictObject({
1535
+ expectedRevision: z.int().gte(1),
1536
+ step: z.union([
1537
+ z.literal(1),
1538
+ z.literal(2),
1539
+ z.literal(3),
1540
+ z.literal(4),
1541
+ z.literal(5),
1542
+ z.literal(6),
1543
+ z.literal(7),
1544
+ z.literal(8),
1545
+ z.literal(9),
1546
+ z.literal(10),
1547
+ z.literal(11),
1548
+ z.literal(12),
1549
+ z.literal(13),
1550
+ z.literal(14),
1551
+ z.literal(15),
1552
+ ]),
1553
+ outcome: z.union([
1554
+ z.literal("submitted"),
1555
+ z.literal("approved"),
1556
+ z.literal("rejected"),
1557
+ z.literal("needs_correction"),
1558
+ ]),
1559
+ reference: z
1560
+ .string()
1561
+ .refine((text) => Array.from(text).length >= 1)
1562
+ .refine((text) => Array.from(text).length <= 255)
1563
+ .regex(/^[^\p{C}]*$/u)
1564
+ .optional(),
1565
+ });
1566
+ export const zSubmitMerchantBusinessCertificationEvidenceHeaders = z.object({
1567
+ "idempotency-key": z
1568
+ .string()
1569
+ .refine((text) => Array.from(text).length >= 1)
1570
+ .refine((text) => Array.from(text).length <= 255)
1571
+ .regex(/^[\x20-\x7e]+$/),
1572
+ });
1573
+ /**
1574
+ * MerchantBusinessCertification
1575
+ *
1576
+ * Durable certification preparation and user-reported DGII progress for the authenticated business.
1577
+ */
1578
+ export const zSubmitMerchantBusinessCertificationEvidenceResponse = z.union([
1579
+ z.strictObject({
1580
+ object: z.literal("merchant_business_certification"),
1581
+ status: z.literal("not_started"),
1582
+ requirements: z.array(zMerchantBusinessCertificationRequirement),
1583
+ availablePaths: z
1584
+ .array(z.union([z.literal("own_software"), z.literal("external_software")]))
1585
+ .min(1),
1586
+ recommendedPath: z.union([z.literal("own_software"), z.literal("external_software")]),
1587
+ actions: z.array(z.literal("start")).max(1),
1588
+ }),
1589
+ z.strictObject({
1590
+ object: z.literal("merchant_business_certification"),
1591
+ id: z.string().regex(/^cert_[a-z0-9]{24,}$/),
1592
+ revision: z.int().gte(1),
1593
+ status: z.literal("in_progress"),
1594
+ path: z.union([z.literal("own_software"), z.literal("external_software")]),
1595
+ software: z.strictObject({
1596
+ name: z
1597
+ .string()
1598
+ .refine((text) => Array.from(text).length >= 1)
1599
+ .refine((text) => Array.from(text).length <= 128),
1600
+ version: z
1601
+ .string()
1602
+ .refine((text) => Array.from(text).length >= 1)
1603
+ .refine((text) => Array.from(text).length <= 64),
1604
+ }),
1605
+ phase: z.union([
1606
+ z.literal("preparation"),
1607
+ z.literal("application"),
1608
+ z.literal("tests"),
1609
+ z.literal("authorization"),
1610
+ ]),
1611
+ serviceUrls: z
1612
+ .strictObject({
1613
+ reception: z.url(),
1614
+ commercialApproval: z.url(),
1615
+ })
1616
+ .nullable(),
1617
+ requirements: z.array(zMerchantBusinessCertificationRequirement),
1618
+ actions: z.array(z.union([z.literal("report_evidence"), z.literal("import_certificate")])),
1619
+ steps: z.tuple([
1620
+ zMerchantBusinessCertificationStep,
1621
+ zMerchantBusinessCertificationStep,
1622
+ zMerchantBusinessCertificationStep,
1623
+ zMerchantBusinessCertificationStep,
1624
+ zMerchantBusinessCertificationStep,
1625
+ zMerchantBusinessCertificationStep,
1626
+ zMerchantBusinessCertificationStep,
1627
+ zMerchantBusinessCertificationStep,
1628
+ zMerchantBusinessCertificationStep,
1629
+ zMerchantBusinessCertificationStep,
1630
+ zMerchantBusinessCertificationStep,
1631
+ zMerchantBusinessCertificationStep,
1632
+ zMerchantBusinessCertificationStep,
1633
+ zMerchantBusinessCertificationStep,
1634
+ zMerchantBusinessCertificationStep,
1635
+ ]),
1636
+ }),
1637
+ ]);
1164
1638
  /**
1165
1639
  * MerchantBusinessConfigureInvoicingRequest
1166
1640
  */
@@ -1186,108 +1660,93 @@ export const zConfigureInvoicingResponse = z.strictObject({
1186
1660
  /**
1187
1661
  * MerchantBusinessSigningCertificateRequest
1188
1662
  */
1189
- export const zImportSigningCertificateBody = z.strictObject({
1190
- mode: z.union([z.literal("test"), z.literal("live")]),
1191
- certificateP12Base64: z
1192
- .string()
1193
- .refine((text) => Array.from(text).length >= 24)
1194
- .refine((text) => Array.from(text).length <= 200000),
1195
- password: z
1196
- .string()
1197
- .refine((text) => Array.from(text).length >= 1)
1198
- .refine((text) => Array.from(text).length <= 256),
1199
- });
1663
+ export const zImportSigningCertificateBody = z.union([
1664
+ z.strictObject({
1665
+ mode: z.union([z.literal("test"), z.literal("live")]),
1666
+ certificateP12Base64: z
1667
+ .string()
1668
+ .refine((text) => Array.from(text).length >= 24)
1669
+ .refine((text) => Array.from(text).length <= 200000),
1670
+ password: z
1671
+ .string()
1672
+ .refine((text) => Array.from(text).length >= 1)
1673
+ .refine((text) => Array.from(text).length <= 256),
1674
+ }),
1675
+ z.strictObject({
1676
+ purpose: z.literal("certification"),
1677
+ certificateP12Base64: z
1678
+ .string()
1679
+ .refine((text) => Array.from(text).length >= 24)
1680
+ .refine((text) => Array.from(text).length <= 200000),
1681
+ password: z
1682
+ .string()
1683
+ .refine((text) => Array.from(text).length >= 1)
1684
+ .refine((text) => Array.from(text).length <= 256),
1685
+ }),
1686
+ ]);
1200
1687
  /**
1201
- * MerchantBusiness
1202
- *
1203
- * The business the credential selects, its capabilities, and the requirements that remain.
1688
+ * Default Response
1204
1689
  */
1205
- export const zImportSigningCertificateResponse = z.strictObject({
1206
- object: z.literal("merchant_business"),
1207
- id: z.string().regex(/^mbiz_[0-9a-hjkmnp-tv-z]{24,}$/),
1208
- rnc: z.string().regex(/^[0-9]{9}$/),
1209
- legalName: z.string().refine((text) => Array.from(text).length >= 1),
1210
- revision: z.int().gte(0),
1211
- capabilities: z.strictObject({
1212
- payments: z.strictObject({
1213
- requested: z.boolean(),
1214
- test: z.strictObject({
1215
- status: z.union([
1216
- z.literal("active"),
1217
- z.literal("pending"),
1218
- z.literal("inactive"),
1219
- z.literal("unavailable"),
1220
- ]),
1221
- }),
1222
- live: z.strictObject({
1223
- status: z.union([
1224
- z.literal("active"),
1225
- z.literal("pending"),
1226
- z.literal("inactive"),
1227
- z.literal("unavailable"),
1228
- ]),
1229
- }),
1230
- }),
1231
- invoices: z.strictObject({
1232
- requested: z.boolean(),
1233
- test: z.strictObject({
1234
- status: z.union([
1235
- z.literal("active"),
1236
- z.literal("pending"),
1237
- z.literal("inactive"),
1238
- z.literal("unavailable"),
1239
- ]),
1690
+ export const zImportSigningCertificateResponse = z.union([
1691
+ z.strictObject({
1692
+ object: z.literal("merchant_business"),
1693
+ id: z.string().regex(/^mbiz_[0-9a-hjkmnp-tv-z]{24,}$/),
1694
+ rnc: z.string().regex(/^[0-9]{9}$/),
1695
+ legalName: z.string().refine((text) => Array.from(text).length >= 1),
1696
+ revision: z.int().gte(0),
1697
+ capabilities: z.strictObject({
1698
+ payments: z.strictObject({
1699
+ requested: z.boolean(),
1700
+ test: z.strictObject({
1701
+ status: z.union([
1702
+ z.literal("active"),
1703
+ z.literal("pending"),
1704
+ z.literal("inactive"),
1705
+ z.literal("unavailable"),
1706
+ ]),
1707
+ }),
1708
+ live: z.strictObject({
1709
+ status: z.union([
1710
+ z.literal("active"),
1711
+ z.literal("pending"),
1712
+ z.literal("inactive"),
1713
+ z.literal("unavailable"),
1714
+ ]),
1715
+ }),
1240
1716
  }),
1241
- live: z.strictObject({
1242
- status: z.union([
1243
- z.literal("active"),
1244
- z.literal("pending"),
1245
- z.literal("inactive"),
1246
- z.literal("unavailable"),
1247
- ]),
1717
+ invoices: z.strictObject({
1718
+ requested: z.boolean(),
1719
+ test: z.strictObject({
1720
+ status: z.union([
1721
+ z.literal("active"),
1722
+ z.literal("pending"),
1723
+ z.literal("inactive"),
1724
+ z.literal("unavailable"),
1725
+ ]),
1726
+ }),
1727
+ live: z.strictObject({
1728
+ status: z.union([
1729
+ z.literal("active"),
1730
+ z.literal("pending"),
1731
+ z.literal("inactive"),
1732
+ z.literal("unavailable"),
1733
+ ]),
1734
+ }),
1248
1735
  }),
1249
1736
  }),
1250
- }),
1251
- fiscalDetails: z.strictObject({
1252
- commercialName: z.string().nullable(),
1253
- address: z.string().nullable(),
1254
- location: z
1255
- .strictObject({
1256
- placeId: z
1257
- .string()
1258
- .regex(/^place_[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/),
1259
- catalogReleaseId: z.string().regex(/^dr_[A-Za-z0-9._-]+$/),
1260
- municipalityCode: z
1261
- .string()
1262
- .regex(/^[0-9]{6}$/)
1263
- .nullable(),
1264
- name: z
1265
- .string()
1266
- .refine((text) => Array.from(text).length >= 1)
1267
- .refine((text) => Array.from(text).length <= 160),
1268
- kind: z.union([
1269
- z.literal("country"),
1270
- z.literal("region"),
1271
- z.literal("national_district"),
1272
- z.literal("province"),
1273
- z.literal("municipality"),
1274
- z.literal("municipal_district"),
1275
- z.literal("urban_zone"),
1276
- z.literal("section"),
1277
- z.literal("barrio"),
1278
- z.literal("paraje"),
1279
- z.literal("subbarrio"),
1280
- ]),
1281
- qualityStatus: z.union([
1282
- z.literal("verified"),
1283
- z.literal("provisional"),
1284
- z.literal("conflicted"),
1285
- ]),
1286
- ancestors: z
1287
- .array(z.strictObject({
1737
+ fiscalDetails: z.strictObject({
1738
+ commercialName: z.string().nullable(),
1739
+ address: z.string().nullable(),
1740
+ location: z
1741
+ .strictObject({
1288
1742
  placeId: z
1289
1743
  .string()
1290
1744
  .regex(/^place_[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/),
1745
+ catalogReleaseId: z.string().regex(/^dr_[A-Za-z0-9._-]+$/),
1746
+ municipalityCode: z
1747
+ .string()
1748
+ .regex(/^[0-9]{6}$/)
1749
+ .nullable(),
1291
1750
  name: z
1292
1751
  .string()
1293
1752
  .refine((text) => Array.from(text).length >= 1)
@@ -1310,140 +1769,228 @@ export const zImportSigningCertificateResponse = z.strictObject({
1310
1769
  z.literal("provisional"),
1311
1770
  z.literal("conflicted"),
1312
1771
  ]),
1313
- }))
1314
- .max(32),
1315
- })
1316
- .nullable(),
1317
- phone: z.string().nullable(),
1318
- email: z.string().nullable(),
1319
- defaultIncomeType: z.string().nullable(),
1320
- }),
1321
- paymentsProfile: z
1322
- .strictObject({
1323
- displayName: z
1324
- .string()
1325
- .refine((text) => Array.from(text).length >= 1)
1326
- .refine((text) => Array.from(text).length <= 80)
1327
- .regex(/\S/),
1328
- statementDescriptor: z
1329
- .string()
1330
- .refine((text) => Array.from(text).length >= 1)
1331
- .refine((text) => Array.from(text).length <= 22)
1332
- .regex(/\S/),
1333
- permanentAddress: z.strictObject({
1334
- line1: z
1335
- .string()
1336
- .refine((text) => Array.from(text).length >= 1)
1337
- .refine((text) => Array.from(text).length <= 160)
1338
- .regex(/\S/),
1339
- line2: z
1340
- .string()
1341
- .refine((text) => Array.from(text).length >= 1)
1342
- .refine((text) => Array.from(text).length <= 160)
1343
- .regex(/\S/)
1344
- .optional(),
1345
- city: z
1772
+ ancestors: z
1773
+ .array(z.strictObject({
1774
+ placeId: z
1775
+ .string()
1776
+ .regex(/^place_[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/),
1777
+ name: z
1778
+ .string()
1779
+ .refine((text) => Array.from(text).length >= 1)
1780
+ .refine((text) => Array.from(text).length <= 160),
1781
+ kind: z.union([
1782
+ z.literal("country"),
1783
+ z.literal("region"),
1784
+ z.literal("national_district"),
1785
+ z.literal("province"),
1786
+ z.literal("municipality"),
1787
+ z.literal("municipal_district"),
1788
+ z.literal("urban_zone"),
1789
+ z.literal("section"),
1790
+ z.literal("barrio"),
1791
+ z.literal("paraje"),
1792
+ z.literal("subbarrio"),
1793
+ ]),
1794
+ qualityStatus: z.union([
1795
+ z.literal("verified"),
1796
+ z.literal("provisional"),
1797
+ z.literal("conflicted"),
1798
+ ]),
1799
+ }))
1800
+ .max(32),
1801
+ })
1802
+ .nullable(),
1803
+ phone: z.string().nullable(),
1804
+ email: z.string().nullable(),
1805
+ defaultIncomeType: z.string().nullable(),
1806
+ }),
1807
+ paymentsProfile: z
1808
+ .strictObject({
1809
+ displayName: z
1346
1810
  .string()
1347
1811
  .refine((text) => Array.from(text).length >= 1)
1348
1812
  .refine((text) => Array.from(text).length <= 80)
1349
1813
  .regex(/\S/),
1350
- province: z
1351
- .string()
1352
- .refine((text) => Array.from(text).length >= 1)
1353
- .refine((text) => Array.from(text).length <= 80)
1354
- .regex(/\S/)
1355
- .optional(),
1356
- postalCode: z
1814
+ statementDescriptor: z
1357
1815
  .string()
1358
1816
  .refine((text) => Array.from(text).length >= 1)
1359
- .refine((text) => Array.from(text).length <= 20)
1360
- .regex(/\S/)
1361
- .optional(),
1362
- countryCode: z.string().regex(/^[A-Z]{2}$/),
1363
- }),
1364
- supportEmail: z.email().refine((text) => Array.from(text).length <= 254),
1365
- supportPhone: z.string().regex(/^\+[1-9][0-9]{7,14}$/),
1366
- deliveryPolicy: z.union([
1367
- z.strictObject({
1368
- kind: z.literal("not_offered"),
1369
- }),
1370
- z.strictObject({
1371
- kind: z.literal("merchant_managed"),
1372
- summary: z
1817
+ .refine((text) => Array.from(text).length <= 22)
1818
+ .regex(/\S/),
1819
+ permanentAddress: z.strictObject({
1820
+ line1: z
1373
1821
  .string()
1374
1822
  .refine((text) => Array.from(text).length >= 1)
1375
1823
  .refine((text) => Array.from(text).length <= 160)
1376
1824
  .regex(/\S/),
1377
- url: z
1378
- .url()
1379
- .refine((text) => Array.from(text).length <= 2048)
1380
- .regex(/^https?:\/\//)
1825
+ line2: z
1826
+ .string()
1827
+ .refine((text) => Array.from(text).length >= 1)
1828
+ .refine((text) => Array.from(text).length <= 160)
1829
+ .regex(/\S/)
1381
1830
  .optional(),
1831
+ city: z
1832
+ .string()
1833
+ .refine((text) => Array.from(text).length >= 1)
1834
+ .refine((text) => Array.from(text).length <= 80)
1835
+ .regex(/\S/),
1836
+ province: z
1837
+ .string()
1838
+ .refine((text) => Array.from(text).length >= 1)
1839
+ .refine((text) => Array.from(text).length <= 80)
1840
+ .regex(/\S/)
1841
+ .optional(),
1842
+ postalCode: z
1843
+ .string()
1844
+ .refine((text) => Array.from(text).length >= 1)
1845
+ .refine((text) => Array.from(text).length <= 20)
1846
+ .regex(/\S/)
1847
+ .optional(),
1848
+ countryCode: z.string().regex(/^[A-Z]{2}$/),
1382
1849
  }),
1383
- ]),
1384
- })
1385
- .nullable(),
1386
- invoicing: z.strictObject({
1387
- test: zMerchantBusinessFiscalSetup,
1388
- live: zMerchantBusinessLiveFiscalSetup,
1850
+ supportEmail: z.email().refine((text) => Array.from(text).length <= 254),
1851
+ supportPhone: z.string().regex(/^\+[1-9][0-9]{7,14}$/),
1852
+ deliveryPolicy: z.union([
1853
+ z.strictObject({
1854
+ kind: z.literal("not_offered"),
1855
+ }),
1856
+ z.strictObject({
1857
+ kind: z.literal("merchant_managed"),
1858
+ summary: z
1859
+ .string()
1860
+ .refine((text) => Array.from(text).length >= 1)
1861
+ .refine((text) => Array.from(text).length <= 160)
1862
+ .regex(/\S/),
1863
+ url: z
1864
+ .url()
1865
+ .refine((text) => Array.from(text).length <= 2048)
1866
+ .regex(/^https?:\/\//)
1867
+ .optional(),
1868
+ }),
1869
+ ]),
1870
+ })
1871
+ .nullable(),
1872
+ invoicing: z.strictObject({
1873
+ test: zMerchantBusinessFiscalSetup,
1874
+ live: zMerchantBusinessLiveFiscalSetup,
1875
+ }),
1876
+ requirements: z.array(z.strictObject({
1877
+ code: z.union([
1878
+ z.literal("capabilities_required"),
1879
+ z.literal("commercial_name_required"),
1880
+ z.literal("address_required"),
1881
+ z.literal("location_required"),
1882
+ z.literal("phone_required"),
1883
+ z.literal("default_income_type_required"),
1884
+ z.literal("contact_email_verification_required"),
1885
+ z.literal("fiscal_details_rejected"),
1886
+ z.literal("taxpayer_registration_required"),
1887
+ z.literal("signing_certificate_required"),
1888
+ z.literal("signing_certificate_expiring"),
1889
+ z.literal("test_fiscal_document_rejected"),
1890
+ z.literal("test_fiscal_document_pending"),
1891
+ z.literal("test_fiscal_document_send_pending"),
1892
+ z.literal("fiscal_binding_pending"),
1893
+ z.literal("legal_issuer_sync_pending"),
1894
+ z.literal("fiscal_setup_unavailable"),
1895
+ z.literal("fiscal_binding_conflict"),
1896
+ z.literal("fiscal_issuer_rejected"),
1897
+ z.literal("test_fiscal_document_operator_required"),
1898
+ z.literal("payments_profile_required"),
1899
+ z.literal("test_payments_unavailable"),
1900
+ z.literal("merchant_account_required"),
1901
+ z.literal("merchant_account_disabled"),
1902
+ z.literal("active_credential_required"),
1903
+ z.literal("credential_material_invalid"),
1904
+ z.literal("test_live_mode_mismatch"),
1905
+ z.literal("callback_configuration_failed"),
1906
+ z.literal("callback_configuration_required"),
1907
+ z.literal("connectivity_check_failed"),
1908
+ z.literal("connectivity_check_required"),
1909
+ z.literal("provider_qualification_failed"),
1910
+ z.literal("provider_qualification_required"),
1911
+ z.literal("provider_adapter_unavailable"),
1912
+ ]),
1913
+ owner: z.union([
1914
+ z.literal("merchant"),
1915
+ z.literal("dgii"),
1916
+ z.literal("timbro"),
1917
+ z.literal("provider"),
1918
+ z.literal("operator"),
1919
+ ]),
1920
+ blocks: z.array(z.union([z.literal("payments"), z.literal("invoices")])).max(2),
1921
+ mode: z.union([z.literal("test"), z.literal("live")]).optional(),
1922
+ field: z.string().optional(),
1923
+ errors: z
1924
+ .array(z.strictObject({
1925
+ code: z.string(),
1926
+ message: z.string(),
1927
+ }))
1928
+ .min(1)
1929
+ .optional(),
1930
+ })),
1931
+ onboardingUrl: z.url(),
1389
1932
  }),
1390
- requirements: z.array(z.strictObject({
1391
- code: z.union([
1392
- z.literal("capabilities_required"),
1393
- z.literal("commercial_name_required"),
1394
- z.literal("address_required"),
1395
- z.literal("location_required"),
1396
- z.literal("phone_required"),
1397
- z.literal("default_income_type_required"),
1398
- z.literal("contact_email_verification_required"),
1399
- z.literal("fiscal_details_rejected"),
1400
- z.literal("taxpayer_registration_required"),
1401
- z.literal("signing_certificate_required"),
1402
- z.literal("signing_certificate_expiring"),
1403
- z.literal("test_fiscal_document_rejected"),
1404
- z.literal("test_fiscal_document_pending"),
1405
- z.literal("test_fiscal_document_send_pending"),
1406
- z.literal("fiscal_binding_pending"),
1407
- z.literal("legal_issuer_sync_pending"),
1408
- z.literal("fiscal_setup_unavailable"),
1409
- z.literal("fiscal_binding_conflict"),
1410
- z.literal("fiscal_issuer_rejected"),
1411
- z.literal("test_fiscal_document_operator_required"),
1412
- z.literal("payments_profile_required"),
1413
- z.literal("test_payments_unavailable"),
1414
- z.literal("merchant_account_required"),
1415
- z.literal("merchant_account_disabled"),
1416
- z.literal("active_credential_required"),
1417
- z.literal("credential_material_invalid"),
1418
- z.literal("test_live_mode_mismatch"),
1419
- z.literal("callback_configuration_failed"),
1420
- z.literal("callback_configuration_required"),
1421
- z.literal("connectivity_check_failed"),
1422
- z.literal("connectivity_check_required"),
1423
- z.literal("provider_qualification_failed"),
1424
- z.literal("provider_qualification_required"),
1425
- z.literal("provider_adapter_unavailable"),
1426
- ]),
1427
- owner: z.union([
1428
- z.literal("merchant"),
1429
- z.literal("dgii"),
1430
- z.literal("timbro"),
1431
- z.literal("provider"),
1432
- z.literal("operator"),
1433
- ]),
1434
- blocks: z.array(z.union([z.literal("payments"), z.literal("invoices")])).max(2),
1435
- mode: z.union([z.literal("test"), z.literal("live")]).optional(),
1436
- field: z.string().optional(),
1437
- errors: z
1438
- .array(z.strictObject({
1439
- code: z.string(),
1440
- message: z.string(),
1441
- }))
1442
- .min(1)
1443
- .optional(),
1444
- })),
1445
- onboardingUrl: z.url(),
1446
- });
1933
+ z.union([
1934
+ z.strictObject({
1935
+ object: z.literal("merchant_business_certification"),
1936
+ status: z.literal("not_started"),
1937
+ requirements: z.array(zMerchantBusinessCertificationRequirement),
1938
+ availablePaths: z
1939
+ .array(z.union([z.literal("own_software"), z.literal("external_software")]))
1940
+ .min(1),
1941
+ recommendedPath: z.union([z.literal("own_software"), z.literal("external_software")]),
1942
+ actions: z.array(z.literal("start")).max(1),
1943
+ }),
1944
+ z.strictObject({
1945
+ object: z.literal("merchant_business_certification"),
1946
+ id: z.string().regex(/^cert_[a-z0-9]{24,}$/),
1947
+ revision: z.int().gte(1),
1948
+ status: z.literal("in_progress"),
1949
+ path: z.union([z.literal("own_software"), z.literal("external_software")]),
1950
+ software: z.strictObject({
1951
+ name: z
1952
+ .string()
1953
+ .refine((text) => Array.from(text).length >= 1)
1954
+ .refine((text) => Array.from(text).length <= 128),
1955
+ version: z
1956
+ .string()
1957
+ .refine((text) => Array.from(text).length >= 1)
1958
+ .refine((text) => Array.from(text).length <= 64),
1959
+ }),
1960
+ phase: z.union([
1961
+ z.literal("preparation"),
1962
+ z.literal("application"),
1963
+ z.literal("tests"),
1964
+ z.literal("authorization"),
1965
+ ]),
1966
+ serviceUrls: z
1967
+ .strictObject({
1968
+ reception: z.url(),
1969
+ commercialApproval: z.url(),
1970
+ })
1971
+ .nullable(),
1972
+ requirements: z.array(zMerchantBusinessCertificationRequirement),
1973
+ actions: z.array(z.union([z.literal("report_evidence"), z.literal("import_certificate")])),
1974
+ steps: z.tuple([
1975
+ zMerchantBusinessCertificationStep,
1976
+ zMerchantBusinessCertificationStep,
1977
+ zMerchantBusinessCertificationStep,
1978
+ zMerchantBusinessCertificationStep,
1979
+ zMerchantBusinessCertificationStep,
1980
+ zMerchantBusinessCertificationStep,
1981
+ zMerchantBusinessCertificationStep,
1982
+ zMerchantBusinessCertificationStep,
1983
+ zMerchantBusinessCertificationStep,
1984
+ zMerchantBusinessCertificationStep,
1985
+ zMerchantBusinessCertificationStep,
1986
+ zMerchantBusinessCertificationStep,
1987
+ zMerchantBusinessCertificationStep,
1988
+ zMerchantBusinessCertificationStep,
1989
+ zMerchantBusinessCertificationStep,
1990
+ ]),
1991
+ }),
1992
+ ]),
1993
+ ]);
1447
1994
  /**
1448
1995
  * MerchantBusinessTestFiscalDocumentRequest
1449
1996
  */
@@ -2017,6 +2564,7 @@ export const zCreateWebhookEndpointBody = z.strictObject({
2017
2564
  enabledEvents: z
2018
2565
  .array(z.union([
2019
2566
  z.literal("payment.succeeded"),
2567
+ z.literal("payment.declined"),
2020
2568
  z.literal("payment.canceled"),
2021
2569
  z.literal("payment.expired"),
2022
2570
  z.literal("payment.operator_required"),
@@ -2028,9 +2576,11 @@ export const zCreateWebhookEndpointBody = z.strictObject({
2028
2576
  z.literal("invoice.rejected"),
2029
2577
  z.literal("invoice.operatorRequired"),
2030
2578
  z.literal("invoice.ready"),
2579
+ z.literal("invoice.deliverySent"),
2580
+ z.literal("invoice.deliveryFailed"),
2031
2581
  ]))
2032
2582
  .min(1)
2033
- .max(12),
2583
+ .max(15),
2034
2584
  });
2035
2585
  export const zCreateWebhookEndpointHeaders = z.object({
2036
2586
  "idempotency-key": z