@codespar/sdk 0.16.2 → 0.16.4

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.
@@ -16147,7 +16147,7 @@ export interface paths {
16147
16147
  };
16148
16148
  };
16149
16149
  };
16150
- /** @description `no_celcoin_account`: the consumer has no active Pix funding source, so there is no account to list. `pix_key_provider_refused`: the provider adjudicated and said no; `details.provider_code` names its business code, and retrying the same input cannot succeed. */
16150
+ /** @description `no_provider_account`: the consumer has no active Pix funding source, so there is no account to list. `pix_key_provider_refused`: the provider adjudicated and said no; `details.provider_code` names its business code, and retrying the same input cannot succeed. */
16151
16151
  422: {
16152
16152
  headers: {
16153
16153
  [name: string]: unknown;
@@ -16156,7 +16156,7 @@ export interface paths {
16156
16156
  "application/json": {
16157
16157
  error: {
16158
16158
  /** @enum {string} */
16159
- code: "no_celcoin_account" | "pix_key_provider_refused";
16159
+ code: "no_provider_account" | "pix_key_provider_refused";
16160
16160
  message: string;
16161
16161
  details?: {
16162
16162
  [key: string]: unknown;
@@ -16307,7 +16307,7 @@ export interface paths {
16307
16307
  };
16308
16308
  };
16309
16309
  };
16310
- /** @description `no_celcoin_account`: the consumer has no active pix-celcoin funding source in this organization — or is not this organization's consumer at all; nothing reached the provider. `pix_key_provider_refused`: the provider adjudicated and refused, with `details.provider_status` and `details.provider_code` (null when the body named no code); repeating the same input will not pass. */
16310
+ /** @description `no_provider_account`: the consumer has no active pix-celcoin funding source in this organization — or is not this organization's consumer at all; nothing reached the provider. `pix_key_provider_refused`: the provider adjudicated and refused, with `details.provider_status` and `details.provider_code` (null when the body named no code); repeating the same input will not pass. */
16311
16311
  422: {
16312
16312
  headers: {
16313
16313
  [name: string]: unknown;
@@ -16316,7 +16316,7 @@ export interface paths {
16316
16316
  "application/json": {
16317
16317
  error: {
16318
16318
  /** @enum {string} */
16319
- code: "no_celcoin_account" | "pix_key_provider_refused";
16319
+ code: "no_provider_account" | "pix_key_provider_refused";
16320
16320
  message: string;
16321
16321
  details?: {
16322
16322
  [key: string]: unknown;
@@ -16463,7 +16463,7 @@ export interface paths {
16463
16463
  };
16464
16464
  };
16465
16465
  };
16466
- /** @description `no_celcoin_account`: the consumer has no active Pix funding source. `pix_key_provider_refused`: the provider adjudicated and refused; retrying the same input cannot succeed. `details.provider_code` carries its business code. */
16466
+ /** @description `no_provider_account`: the consumer has no active Pix funding source. `pix_key_provider_refused`: the provider adjudicated and refused; retrying the same input cannot succeed. `details.provider_code` carries its business code. */
16467
16467
  422: {
16468
16468
  headers: {
16469
16469
  [name: string]: unknown;
@@ -16472,7 +16472,7 @@ export interface paths {
16472
16472
  "application/json": {
16473
16473
  error: {
16474
16474
  /** @enum {string} */
16475
- code: "no_celcoin_account" | "pix_key_provider_refused";
16475
+ code: "no_provider_account" | "pix_key_provider_refused";
16476
16476
  message: string;
16477
16477
  details?: {
16478
16478
  [key: string]: unknown;
@@ -17633,7 +17633,7 @@ export interface paths {
17633
17633
  "application/json": {
17634
17634
  error: {
17635
17635
  /** @enum {string} */
17636
- code: "no_celcoin_account" | "sandbox_funding_failed";
17636
+ code: "no_provider_account" | "sandbox_funding_failed";
17637
17637
  message: string;
17638
17638
  details?: {
17639
17639
  [key: string]: unknown;
@@ -17758,7 +17758,7 @@ export interface paths {
17758
17758
  "application/json": {
17759
17759
  error: {
17760
17760
  /** @enum {string} */
17761
- code: "no_celcoin_account" | "sandbox_funding_failed";
17761
+ code: "no_provider_account" | "sandbox_funding_failed";
17762
17762
  message: string;
17763
17763
  details?: {
17764
17764
  [key: string]: unknown;
@@ -18332,7 +18332,7 @@ export interface paths {
18332
18332
  *
18333
18333
  * A SEND SUPERSEDES THE LIVE ONE for the same contact: the previous verification is closed and only the new code counts. If that happens while this send is in flight, the 201 comes back with `expires_at` already in the past, and that is deliberate — two live codes would double the guessing budget.
18334
18334
  *
18335
- * A `consumerId` the calling organization does not hold answers 422 `no_celcoin_account`, the same answer as an own consumer that has not finished onboarding. The route does not separate the two, so it cannot be used to probe for ids.
18335
+ * A `consumerId` the calling organization does not hold answers 422 `no_provider_account`, the same answer as an own consumer that has not finished onboarding. The route does not separate the two, so it cannot be used to probe for ids.
18336
18336
  */
18337
18337
  post: {
18338
18338
  parameters: {
@@ -18405,7 +18405,7 @@ export interface paths {
18405
18405
  };
18406
18406
  };
18407
18407
  };
18408
- /** @description `no_celcoin_account`: the consumer has no active pix-celcoin funding source in this organization — or is not this organization's consumer at all. `otp_sender_refused`: the sender refused to deliver to this number and repeating will not change that; `details.provider` names which sender said so. Nothing was sent, and no attempt was consumed, in either case. */
18408
+ /** @description `no_provider_account`: the consumer has no active pix-celcoin funding source in this organization — or is not this organization's consumer at all. `otp_sender_refused`: the sender refused to deliver to this number and repeating will not change that; `details.provider` names which sender said so. Nothing was sent, and no attempt was consumed, in either case. */
18409
18409
  422: {
18410
18410
  headers: {
18411
18411
  [name: string]: unknown;
@@ -18414,7 +18414,7 @@ export interface paths {
18414
18414
  "application/json": {
18415
18415
  error: {
18416
18416
  /** @enum {string} */
18417
- code: "no_celcoin_account" | "otp_sender_refused";
18417
+ code: "no_provider_account" | "otp_sender_refused";
18418
18418
  message: string;
18419
18419
  details?: {
18420
18420
  [key: string]: unknown;
@@ -18837,7 +18837,7 @@ export interface paths {
18837
18837
  };
18838
18838
  };
18839
18839
  };
18840
- /** @description `no_celcoin_account`: the consumer has no active pix-celcoin funding source in this organization — or is not this organization's consumer at all. `dda_document_not_owned` ALSO answers 422, and only for one cause: the account has no verified document on file at all, so no document can be shown to be theirs. Sending a different document will not help; finish onboarding and retry. */
18840
+ /** @description `no_provider_account`: the consumer has no active pix-celcoin funding source in this organization — or is not this organization's consumer at all. `dda_document_not_owned` ALSO answers 422, and only for one cause: the account has no verified document on file at all, so no document can be shown to be theirs. Sending a different document will not help; finish onboarding and retry. */
18841
18841
  422: {
18842
18842
  headers: {
18843
18843
  [name: string]: unknown;
@@ -18846,7 +18846,7 @@ export interface paths {
18846
18846
  "application/json": {
18847
18847
  error: {
18848
18848
  /** @enum {string} */
18849
- code: "no_celcoin_account" | "dda_document_not_owned";
18849
+ code: "no_provider_account" | "dda_document_not_owned";
18850
18850
  message: string;
18851
18851
  details?: {
18852
18852
  [key: string]: unknown;
@@ -25647,7 +25647,7 @@ export interface paths {
25647
25647
  put?: never;
25648
25648
  /**
25649
25649
  * Create a payable from a partner's record or a person's form
25650
- * @description A payable is an obligation to pay somebody. This endpoint takes one as structured data: `attribution.channel` is `structured` for a partner system's record and `manual` for a form a person filled in. Both go through the same schema and the same deterministic checks, so the same payable sent through either channel ends in the same status with the same validation. `upload` is refused, because this endpoint takes no file yet.
25650
+ * @description A payable is an obligation to pay somebody. This endpoint takes one as structured data: `attribution.channel` is `structured` for a partner system's record and `manual` for a form a person filled in. Both go through the same schema and the same deterministic checks, so the same payable sent through either channel ends in the same status with the same validation. A file (PDF or image) goes to `POST /v1/payables/documents`, which reads the payable out of it and enters the same pipeline; a `multipart/form-data` body sent HERE answers 415 `payable_document_endpoint`, and a JSON body claiming `attribution.channel: "upload"` is refused.
25651
25651
  *
25652
25652
  * Every field carries its provenance in `from`. Amounts are integer centavos (`*_minor`). `rail_quote` is refused by name: the amount and the payee of a payment come from the rail, never from a request. `attribution.credential_id` is set to the API key the request authenticated with; a different value is refused.
25653
25653
  *
@@ -25698,6 +25698,8 @@ export interface paths {
25698
25698
  evidence?: {
25699
25699
  page: number;
25700
25700
  excerpt: string;
25701
+ /** @enum {string} */
25702
+ verification?: "verified" | "moved" | "unverifiable";
25701
25703
  };
25702
25704
  confidence?: number;
25703
25705
  };
@@ -25708,6 +25710,8 @@ export interface paths {
25708
25710
  evidence?: {
25709
25711
  page: number;
25710
25712
  excerpt: string;
25713
+ /** @enum {string} */
25714
+ verification?: "verified" | "moved" | "unverifiable";
25711
25715
  };
25712
25716
  confidence?: number;
25713
25717
  };
@@ -25720,6 +25724,8 @@ export interface paths {
25720
25724
  evidence?: {
25721
25725
  page: number;
25722
25726
  excerpt: string;
25727
+ /** @enum {string} */
25728
+ verification?: "verified" | "moved" | "unverifiable";
25723
25729
  };
25724
25730
  confidence?: number;
25725
25731
  };
@@ -25730,6 +25736,8 @@ export interface paths {
25730
25736
  evidence?: {
25731
25737
  page: number;
25732
25738
  excerpt: string;
25739
+ /** @enum {string} */
25740
+ verification?: "verified" | "moved" | "unverifiable";
25733
25741
  };
25734
25742
  confidence?: number;
25735
25743
  };
@@ -25741,6 +25749,8 @@ export interface paths {
25741
25749
  evidence?: {
25742
25750
  page: number;
25743
25751
  excerpt: string;
25752
+ /** @enum {string} */
25753
+ verification?: "verified" | "moved" | "unverifiable";
25744
25754
  };
25745
25755
  confidence?: number;
25746
25756
  };
@@ -25751,6 +25761,8 @@ export interface paths {
25751
25761
  evidence?: {
25752
25762
  page: number;
25753
25763
  excerpt: string;
25764
+ /** @enum {string} */
25765
+ verification?: "verified" | "moved" | "unverifiable";
25754
25766
  };
25755
25767
  confidence?: number;
25756
25768
  };
@@ -25761,6 +25773,8 @@ export interface paths {
25761
25773
  evidence?: {
25762
25774
  page: number;
25763
25775
  excerpt: string;
25776
+ /** @enum {string} */
25777
+ verification?: "verified" | "moved" | "unverifiable";
25764
25778
  };
25765
25779
  confidence?: number;
25766
25780
  };
@@ -25771,6 +25785,8 @@ export interface paths {
25771
25785
  evidence?: {
25772
25786
  page: number;
25773
25787
  excerpt: string;
25788
+ /** @enum {string} */
25789
+ verification?: "verified" | "moved" | "unverifiable";
25774
25790
  };
25775
25791
  confidence?: number;
25776
25792
  };
@@ -25782,6 +25798,8 @@ export interface paths {
25782
25798
  evidence?: {
25783
25799
  page: number;
25784
25800
  excerpt: string;
25801
+ /** @enum {string} */
25802
+ verification?: "verified" | "moved" | "unverifiable";
25785
25803
  };
25786
25804
  confidence?: number;
25787
25805
  };
@@ -25792,6 +25810,8 @@ export interface paths {
25792
25810
  evidence?: {
25793
25811
  page: number;
25794
25812
  excerpt: string;
25813
+ /** @enum {string} */
25814
+ verification?: "verified" | "moved" | "unverifiable";
25795
25815
  };
25796
25816
  confidence?: number;
25797
25817
  };
@@ -25802,6 +25822,8 @@ export interface paths {
25802
25822
  evidence?: {
25803
25823
  page: number;
25804
25824
  excerpt: string;
25825
+ /** @enum {string} */
25826
+ verification?: "verified" | "moved" | "unverifiable";
25805
25827
  };
25806
25828
  confidence?: number;
25807
25829
  };
@@ -25812,6 +25834,8 @@ export interface paths {
25812
25834
  evidence?: {
25813
25835
  page: number;
25814
25836
  excerpt: string;
25837
+ /** @enum {string} */
25838
+ verification?: "verified" | "moved" | "unverifiable";
25815
25839
  };
25816
25840
  confidence?: number;
25817
25841
  };
@@ -25824,6 +25848,8 @@ export interface paths {
25824
25848
  evidence?: {
25825
25849
  page: number;
25826
25850
  excerpt: string;
25851
+ /** @enum {string} */
25852
+ verification?: "verified" | "moved" | "unverifiable";
25827
25853
  };
25828
25854
  confidence?: number;
25829
25855
  };
@@ -25834,6 +25860,8 @@ export interface paths {
25834
25860
  evidence?: {
25835
25861
  page: number;
25836
25862
  excerpt: string;
25863
+ /** @enum {string} */
25864
+ verification?: "verified" | "moved" | "unverifiable";
25837
25865
  };
25838
25866
  confidence?: number;
25839
25867
  };
@@ -25844,6 +25872,8 @@ export interface paths {
25844
25872
  evidence?: {
25845
25873
  page: number;
25846
25874
  excerpt: string;
25875
+ /** @enum {string} */
25876
+ verification?: "verified" | "moved" | "unverifiable";
25847
25877
  };
25848
25878
  confidence?: number;
25849
25879
  };
@@ -25854,6 +25884,8 @@ export interface paths {
25854
25884
  evidence?: {
25855
25885
  page: number;
25856
25886
  excerpt: string;
25887
+ /** @enum {string} */
25888
+ verification?: "verified" | "moved" | "unverifiable";
25857
25889
  };
25858
25890
  confidence?: number;
25859
25891
  };
@@ -25864,6 +25896,8 @@ export interface paths {
25864
25896
  evidence?: {
25865
25897
  page: number;
25866
25898
  excerpt: string;
25899
+ /** @enum {string} */
25900
+ verification?: "verified" | "moved" | "unverifiable";
25867
25901
  };
25868
25902
  confidence?: number;
25869
25903
  };
@@ -25874,6 +25908,8 @@ export interface paths {
25874
25908
  evidence?: {
25875
25909
  page: number;
25876
25910
  excerpt: string;
25911
+ /** @enum {string} */
25912
+ verification?: "verified" | "moved" | "unverifiable";
25877
25913
  };
25878
25914
  confidence?: number;
25879
25915
  };
@@ -25884,6 +25920,8 @@ export interface paths {
25884
25920
  evidence?: {
25885
25921
  page: number;
25886
25922
  excerpt: string;
25923
+ /** @enum {string} */
25924
+ verification?: "verified" | "moved" | "unverifiable";
25887
25925
  };
25888
25926
  confidence?: number;
25889
25927
  };
@@ -25894,6 +25932,8 @@ export interface paths {
25894
25932
  evidence?: {
25895
25933
  page: number;
25896
25934
  excerpt: string;
25935
+ /** @enum {string} */
25936
+ verification?: "verified" | "moved" | "unverifiable";
25897
25937
  };
25898
25938
  confidence?: number;
25899
25939
  };
@@ -25904,6 +25944,8 @@ export interface paths {
25904
25944
  evidence?: {
25905
25945
  page: number;
25906
25946
  excerpt: string;
25947
+ /** @enum {string} */
25948
+ verification?: "verified" | "moved" | "unverifiable";
25907
25949
  };
25908
25950
  confidence?: number;
25909
25951
  };
@@ -25914,6 +25956,8 @@ export interface paths {
25914
25956
  evidence?: {
25915
25957
  page: number;
25916
25958
  excerpt: string;
25959
+ /** @enum {string} */
25960
+ verification?: "verified" | "moved" | "unverifiable";
25917
25961
  };
25918
25962
  confidence?: number;
25919
25963
  };
@@ -25962,6 +26006,8 @@ export interface paths {
25962
26006
  evidence?: {
25963
26007
  page: number;
25964
26008
  excerpt: string;
26009
+ /** @enum {string} */
26010
+ verification?: "verified" | "moved" | "unverifiable";
25965
26011
  };
25966
26012
  confidence?: number;
25967
26013
  };
@@ -25972,6 +26018,8 @@ export interface paths {
25972
26018
  evidence?: {
25973
26019
  page: number;
25974
26020
  excerpt: string;
26021
+ /** @enum {string} */
26022
+ verification?: "verified" | "moved" | "unverifiable";
25975
26023
  };
25976
26024
  confidence?: number;
25977
26025
  };
@@ -25984,6 +26032,8 @@ export interface paths {
25984
26032
  evidence?: {
25985
26033
  page: number;
25986
26034
  excerpt: string;
26035
+ /** @enum {string} */
26036
+ verification?: "verified" | "moved" | "unverifiable";
25987
26037
  };
25988
26038
  confidence?: number;
25989
26039
  };
@@ -25994,6 +26044,8 @@ export interface paths {
25994
26044
  evidence?: {
25995
26045
  page: number;
25996
26046
  excerpt: string;
26047
+ /** @enum {string} */
26048
+ verification?: "verified" | "moved" | "unverifiable";
25997
26049
  };
25998
26050
  confidence?: number;
25999
26051
  };
@@ -26005,6 +26057,8 @@ export interface paths {
26005
26057
  evidence?: {
26006
26058
  page: number;
26007
26059
  excerpt: string;
26060
+ /** @enum {string} */
26061
+ verification?: "verified" | "moved" | "unverifiable";
26008
26062
  };
26009
26063
  confidence?: number;
26010
26064
  };
@@ -26015,6 +26069,8 @@ export interface paths {
26015
26069
  evidence?: {
26016
26070
  page: number;
26017
26071
  excerpt: string;
26072
+ /** @enum {string} */
26073
+ verification?: "verified" | "moved" | "unverifiable";
26018
26074
  };
26019
26075
  confidence?: number;
26020
26076
  };
@@ -26025,6 +26081,8 @@ export interface paths {
26025
26081
  evidence?: {
26026
26082
  page: number;
26027
26083
  excerpt: string;
26084
+ /** @enum {string} */
26085
+ verification?: "verified" | "moved" | "unverifiable";
26028
26086
  };
26029
26087
  confidence?: number;
26030
26088
  };
@@ -26035,6 +26093,8 @@ export interface paths {
26035
26093
  evidence?: {
26036
26094
  page: number;
26037
26095
  excerpt: string;
26096
+ /** @enum {string} */
26097
+ verification?: "verified" | "moved" | "unverifiable";
26038
26098
  };
26039
26099
  confidence?: number;
26040
26100
  };
@@ -26046,6 +26106,8 @@ export interface paths {
26046
26106
  evidence?: {
26047
26107
  page: number;
26048
26108
  excerpt: string;
26109
+ /** @enum {string} */
26110
+ verification?: "verified" | "moved" | "unverifiable";
26049
26111
  };
26050
26112
  confidence?: number;
26051
26113
  };
@@ -26056,6 +26118,8 @@ export interface paths {
26056
26118
  evidence?: {
26057
26119
  page: number;
26058
26120
  excerpt: string;
26121
+ /** @enum {string} */
26122
+ verification?: "verified" | "moved" | "unverifiable";
26059
26123
  };
26060
26124
  confidence?: number;
26061
26125
  };
@@ -26066,6 +26130,8 @@ export interface paths {
26066
26130
  evidence?: {
26067
26131
  page: number;
26068
26132
  excerpt: string;
26133
+ /** @enum {string} */
26134
+ verification?: "verified" | "moved" | "unverifiable";
26069
26135
  };
26070
26136
  confidence?: number;
26071
26137
  };
@@ -26076,6 +26142,8 @@ export interface paths {
26076
26142
  evidence?: {
26077
26143
  page: number;
26078
26144
  excerpt: string;
26145
+ /** @enum {string} */
26146
+ verification?: "verified" | "moved" | "unverifiable";
26079
26147
  };
26080
26148
  confidence?: number;
26081
26149
  };
@@ -26088,6 +26156,8 @@ export interface paths {
26088
26156
  evidence?: {
26089
26157
  page: number;
26090
26158
  excerpt: string;
26159
+ /** @enum {string} */
26160
+ verification?: "verified" | "moved" | "unverifiable";
26091
26161
  };
26092
26162
  confidence?: number;
26093
26163
  };
@@ -26098,6 +26168,8 @@ export interface paths {
26098
26168
  evidence?: {
26099
26169
  page: number;
26100
26170
  excerpt: string;
26171
+ /** @enum {string} */
26172
+ verification?: "verified" | "moved" | "unverifiable";
26101
26173
  };
26102
26174
  confidence?: number;
26103
26175
  };
@@ -26108,6 +26180,8 @@ export interface paths {
26108
26180
  evidence?: {
26109
26181
  page: number;
26110
26182
  excerpt: string;
26183
+ /** @enum {string} */
26184
+ verification?: "verified" | "moved" | "unverifiable";
26111
26185
  };
26112
26186
  confidence?: number;
26113
26187
  };
@@ -26118,6 +26192,8 @@ export interface paths {
26118
26192
  evidence?: {
26119
26193
  page: number;
26120
26194
  excerpt: string;
26195
+ /** @enum {string} */
26196
+ verification?: "verified" | "moved" | "unverifiable";
26121
26197
  };
26122
26198
  confidence?: number;
26123
26199
  };
@@ -26128,6 +26204,8 @@ export interface paths {
26128
26204
  evidence?: {
26129
26205
  page: number;
26130
26206
  excerpt: string;
26207
+ /** @enum {string} */
26208
+ verification?: "verified" | "moved" | "unverifiable";
26131
26209
  };
26132
26210
  confidence?: number;
26133
26211
  };
@@ -26138,6 +26216,8 @@ export interface paths {
26138
26216
  evidence?: {
26139
26217
  page: number;
26140
26218
  excerpt: string;
26219
+ /** @enum {string} */
26220
+ verification?: "verified" | "moved" | "unverifiable";
26141
26221
  };
26142
26222
  confidence?: number;
26143
26223
  };
@@ -26148,6 +26228,8 @@ export interface paths {
26148
26228
  evidence?: {
26149
26229
  page: number;
26150
26230
  excerpt: string;
26231
+ /** @enum {string} */
26232
+ verification?: "verified" | "moved" | "unverifiable";
26151
26233
  };
26152
26234
  confidence?: number;
26153
26235
  };
@@ -26158,6 +26240,8 @@ export interface paths {
26158
26240
  evidence?: {
26159
26241
  page: number;
26160
26242
  excerpt: string;
26243
+ /** @enum {string} */
26244
+ verification?: "verified" | "moved" | "unverifiable";
26161
26245
  };
26162
26246
  confidence?: number;
26163
26247
  };
@@ -26168,6 +26252,8 @@ export interface paths {
26168
26252
  evidence?: {
26169
26253
  page: number;
26170
26254
  excerpt: string;
26255
+ /** @enum {string} */
26256
+ verification?: "verified" | "moved" | "unverifiable";
26171
26257
  };
26172
26258
  confidence?: number;
26173
26259
  };
@@ -26178,6 +26264,8 @@ export interface paths {
26178
26264
  evidence?: {
26179
26265
  page: number;
26180
26266
  excerpt: string;
26267
+ /** @enum {string} */
26268
+ verification?: "verified" | "moved" | "unverifiable";
26181
26269
  };
26182
26270
  confidence?: number;
26183
26271
  };
@@ -26317,13 +26405,78 @@ export interface paths {
26317
26405
  }[];
26318
26406
  /** @description Checks whose failure rejects the payable. */
26319
26407
  rejected_by: string[];
26408
+ /** @description Checks that failed and stopped blocking because a person confirmed the rail's beneficiary (§6). The check still fails; what changed is that somebody took responsibility for it. */
26409
+ confirmed_by: string[];
26320
26410
  /** @description Required, implemented checks that did not answer and may be retried. */
26321
26411
  awaiting: string[];
26322
26412
  /** @description Checks that did not run and do not block READY in this release. */
26323
26413
  not_covered: string[];
26324
- /** @description §9 triggers that keep a VALIDATED payable out of READY, such as `new_supplier`. */
26414
+ /** @description §9 triggers that keep a VALIDATED payable out of READY, such as `new_supplier`. The evidence trigger names the field and the gap: `critical_field_without_evidence:<field>:<missing|unverified|unverifiable|moved>`. */
26325
26415
  review_triggers: string[];
26416
+ /** @description Resolutions a person recorded in a completed review (§9). Absent until one is. */
26417
+ resolutions?: {
26418
+ /** @description The §7 check this resolution answers. */
26419
+ code: string;
26420
+ /**
26421
+ * @description What the person did about it.
26422
+ * @enum {string}
26423
+ */
26424
+ resolution: "human_correction" | "reject" | "confirm_rail_beneficiary";
26425
+ /** @description ISO 8601 instant of the review. */
26426
+ at: string;
26427
+ /** @description The user who reviewed. */
26428
+ by: string;
26429
+ /**
26430
+ * @description How that identity was established.
26431
+ * @enum {string}
26432
+ */
26433
+ by_source: "verified_user_token" | "header_asserted";
26434
+ /** @description Field paths a correction changed. Paths only, never values. */
26435
+ fields?: string[];
26436
+ /** @description The rail's payee, masked, as the person confirmed it. */
26437
+ confirmed_beneficiary_document?: string;
26438
+ }[];
26326
26439
  };
26440
+ /** @description What paying it did (ent#1587); null until a payment was attempted. */
26441
+ payment: {
26442
+ /** @enum {string} */
26443
+ state: "awaiting_approval" | "dispatching" | "executed" | "uncertain" | "released";
26444
+ /** @description The pending approval that holds this payment, while a person decides. */
26445
+ approval_id?: string;
26446
+ /**
26447
+ * @description What the provider was asked to settle. `sandbox_fixture` only in a test project: the boleto is settled against Celcoin's sandbox fixture, not the document's line (spec v0.4 §18), and `document_amount_minor` keeps what the document's own line quoted.
26448
+ * @enum {string}
26449
+ */
26450
+ settled_against?: "document_line" | "sandbox_fixture";
26451
+ document_amount_minor?: number;
26452
+ mandate_id: string;
26453
+ /** @description Derived from the payable id, the quote and the try; never the cycle's default. */
26454
+ attempt_id: string;
26455
+ /** @description How many claims this payable has taken. Each is its own attempt. */
26456
+ tries: number;
26457
+ /** @description The rail's TRUE amount at the quote the attempt id was derived from. */
26458
+ amount_minor: number;
26459
+ /** @description SHA-256 of the quote the attempt was derived from. Never the quote. */
26460
+ quote_hash: string;
26461
+ claimed_at: string;
26462
+ /** @description The credential that asked. The key id, never the key; null on service auth. */
26463
+ key_id: string | null;
26464
+ via: string;
26465
+ executed_at?: string;
26466
+ receipt_id?: string | null;
26467
+ transaction_id?: string;
26468
+ end_to_end_id?: string | null;
26469
+ money_moved?: boolean;
26470
+ /** @description The lifecycle code the dispatch ended in when its outcome is unknown. */
26471
+ uncertain_code?: string;
26472
+ hold_entry_id?: string | null;
26473
+ /** @description The last refusal that provably moved no money, kept on release back to READY. */
26474
+ last_refusal?: {
26475
+ code: string;
26476
+ attempt_id: string;
26477
+ at: string;
26478
+ };
26479
+ } | null;
26327
26480
  /** @description ISO 8601 instant the payable was created. */
26328
26481
  created_at: string;
26329
26482
  /** @description ISO 8601 instant of the last change to the payable. */
@@ -26360,6 +26513,8 @@ export interface paths {
26360
26513
  evidence?: {
26361
26514
  page: number;
26362
26515
  excerpt: string;
26516
+ /** @enum {string} */
26517
+ verification?: "verified" | "moved" | "unverifiable";
26363
26518
  };
26364
26519
  confidence?: number;
26365
26520
  };
@@ -26370,6 +26525,8 @@ export interface paths {
26370
26525
  evidence?: {
26371
26526
  page: number;
26372
26527
  excerpt: string;
26528
+ /** @enum {string} */
26529
+ verification?: "verified" | "moved" | "unverifiable";
26373
26530
  };
26374
26531
  confidence?: number;
26375
26532
  };
@@ -26382,6 +26539,8 @@ export interface paths {
26382
26539
  evidence?: {
26383
26540
  page: number;
26384
26541
  excerpt: string;
26542
+ /** @enum {string} */
26543
+ verification?: "verified" | "moved" | "unverifiable";
26385
26544
  };
26386
26545
  confidence?: number;
26387
26546
  };
@@ -26392,6 +26551,8 @@ export interface paths {
26392
26551
  evidence?: {
26393
26552
  page: number;
26394
26553
  excerpt: string;
26554
+ /** @enum {string} */
26555
+ verification?: "verified" | "moved" | "unverifiable";
26395
26556
  };
26396
26557
  confidence?: number;
26397
26558
  };
@@ -26403,6 +26564,8 @@ export interface paths {
26403
26564
  evidence?: {
26404
26565
  page: number;
26405
26566
  excerpt: string;
26567
+ /** @enum {string} */
26568
+ verification?: "verified" | "moved" | "unverifiable";
26406
26569
  };
26407
26570
  confidence?: number;
26408
26571
  };
@@ -26413,6 +26576,8 @@ export interface paths {
26413
26576
  evidence?: {
26414
26577
  page: number;
26415
26578
  excerpt: string;
26579
+ /** @enum {string} */
26580
+ verification?: "verified" | "moved" | "unverifiable";
26416
26581
  };
26417
26582
  confidence?: number;
26418
26583
  };
@@ -26423,6 +26588,8 @@ export interface paths {
26423
26588
  evidence?: {
26424
26589
  page: number;
26425
26590
  excerpt: string;
26591
+ /** @enum {string} */
26592
+ verification?: "verified" | "moved" | "unverifiable";
26426
26593
  };
26427
26594
  confidence?: number;
26428
26595
  };
@@ -26433,6 +26600,8 @@ export interface paths {
26433
26600
  evidence?: {
26434
26601
  page: number;
26435
26602
  excerpt: string;
26603
+ /** @enum {string} */
26604
+ verification?: "verified" | "moved" | "unverifiable";
26436
26605
  };
26437
26606
  confidence?: number;
26438
26607
  };
@@ -26444,6 +26613,8 @@ export interface paths {
26444
26613
  evidence?: {
26445
26614
  page: number;
26446
26615
  excerpt: string;
26616
+ /** @enum {string} */
26617
+ verification?: "verified" | "moved" | "unverifiable";
26447
26618
  };
26448
26619
  confidence?: number;
26449
26620
  };
@@ -26454,6 +26625,8 @@ export interface paths {
26454
26625
  evidence?: {
26455
26626
  page: number;
26456
26627
  excerpt: string;
26628
+ /** @enum {string} */
26629
+ verification?: "verified" | "moved" | "unverifiable";
26457
26630
  };
26458
26631
  confidence?: number;
26459
26632
  };
@@ -26464,6 +26637,8 @@ export interface paths {
26464
26637
  evidence?: {
26465
26638
  page: number;
26466
26639
  excerpt: string;
26640
+ /** @enum {string} */
26641
+ verification?: "verified" | "moved" | "unverifiable";
26467
26642
  };
26468
26643
  confidence?: number;
26469
26644
  };
@@ -26474,6 +26649,8 @@ export interface paths {
26474
26649
  evidence?: {
26475
26650
  page: number;
26476
26651
  excerpt: string;
26652
+ /** @enum {string} */
26653
+ verification?: "verified" | "moved" | "unverifiable";
26477
26654
  };
26478
26655
  confidence?: number;
26479
26656
  };
@@ -26486,6 +26663,8 @@ export interface paths {
26486
26663
  evidence?: {
26487
26664
  page: number;
26488
26665
  excerpt: string;
26666
+ /** @enum {string} */
26667
+ verification?: "verified" | "moved" | "unverifiable";
26489
26668
  };
26490
26669
  confidence?: number;
26491
26670
  };
@@ -26496,6 +26675,8 @@ export interface paths {
26496
26675
  evidence?: {
26497
26676
  page: number;
26498
26677
  excerpt: string;
26678
+ /** @enum {string} */
26679
+ verification?: "verified" | "moved" | "unverifiable";
26499
26680
  };
26500
26681
  confidence?: number;
26501
26682
  };
@@ -26506,6 +26687,8 @@ export interface paths {
26506
26687
  evidence?: {
26507
26688
  page: number;
26508
26689
  excerpt: string;
26690
+ /** @enum {string} */
26691
+ verification?: "verified" | "moved" | "unverifiable";
26509
26692
  };
26510
26693
  confidence?: number;
26511
26694
  };
@@ -26516,6 +26699,8 @@ export interface paths {
26516
26699
  evidence?: {
26517
26700
  page: number;
26518
26701
  excerpt: string;
26702
+ /** @enum {string} */
26703
+ verification?: "verified" | "moved" | "unverifiable";
26519
26704
  };
26520
26705
  confidence?: number;
26521
26706
  };
@@ -26526,6 +26711,8 @@ export interface paths {
26526
26711
  evidence?: {
26527
26712
  page: number;
26528
26713
  excerpt: string;
26714
+ /** @enum {string} */
26715
+ verification?: "verified" | "moved" | "unverifiable";
26529
26716
  };
26530
26717
  confidence?: number;
26531
26718
  };
@@ -26536,6 +26723,8 @@ export interface paths {
26536
26723
  evidence?: {
26537
26724
  page: number;
26538
26725
  excerpt: string;
26726
+ /** @enum {string} */
26727
+ verification?: "verified" | "moved" | "unverifiable";
26539
26728
  };
26540
26729
  confidence?: number;
26541
26730
  };
@@ -26546,6 +26735,8 @@ export interface paths {
26546
26735
  evidence?: {
26547
26736
  page: number;
26548
26737
  excerpt: string;
26738
+ /** @enum {string} */
26739
+ verification?: "verified" | "moved" | "unverifiable";
26549
26740
  };
26550
26741
  confidence?: number;
26551
26742
  };
@@ -26556,6 +26747,8 @@ export interface paths {
26556
26747
  evidence?: {
26557
26748
  page: number;
26558
26749
  excerpt: string;
26750
+ /** @enum {string} */
26751
+ verification?: "verified" | "moved" | "unverifiable";
26559
26752
  };
26560
26753
  confidence?: number;
26561
26754
  };
@@ -26566,6 +26759,8 @@ export interface paths {
26566
26759
  evidence?: {
26567
26760
  page: number;
26568
26761
  excerpt: string;
26762
+ /** @enum {string} */
26763
+ verification?: "verified" | "moved" | "unverifiable";
26569
26764
  };
26570
26765
  confidence?: number;
26571
26766
  };
@@ -26576,6 +26771,8 @@ export interface paths {
26576
26771
  evidence?: {
26577
26772
  page: number;
26578
26773
  excerpt: string;
26774
+ /** @enum {string} */
26775
+ verification?: "verified" | "moved" | "unverifiable";
26579
26776
  };
26580
26777
  confidence?: number;
26581
26778
  };
@@ -26715,13 +26912,78 @@ export interface paths {
26715
26912
  }[];
26716
26913
  /** @description Checks whose failure rejects the payable. */
26717
26914
  rejected_by: string[];
26915
+ /** @description Checks that failed and stopped blocking because a person confirmed the rail's beneficiary (§6). The check still fails; what changed is that somebody took responsibility for it. */
26916
+ confirmed_by: string[];
26718
26917
  /** @description Required, implemented checks that did not answer and may be retried. */
26719
26918
  awaiting: string[];
26720
26919
  /** @description Checks that did not run and do not block READY in this release. */
26721
26920
  not_covered: string[];
26722
- /** @description §9 triggers that keep a VALIDATED payable out of READY, such as `new_supplier`. */
26921
+ /** @description §9 triggers that keep a VALIDATED payable out of READY, such as `new_supplier`. The evidence trigger names the field and the gap: `critical_field_without_evidence:<field>:<missing|unverified|unverifiable|moved>`. */
26723
26922
  review_triggers: string[];
26923
+ /** @description Resolutions a person recorded in a completed review (§9). Absent until one is. */
26924
+ resolutions?: {
26925
+ /** @description The §7 check this resolution answers. */
26926
+ code: string;
26927
+ /**
26928
+ * @description What the person did about it.
26929
+ * @enum {string}
26930
+ */
26931
+ resolution: "human_correction" | "reject" | "confirm_rail_beneficiary";
26932
+ /** @description ISO 8601 instant of the review. */
26933
+ at: string;
26934
+ /** @description The user who reviewed. */
26935
+ by: string;
26936
+ /**
26937
+ * @description How that identity was established.
26938
+ * @enum {string}
26939
+ */
26940
+ by_source: "verified_user_token" | "header_asserted";
26941
+ /** @description Field paths a correction changed. Paths only, never values. */
26942
+ fields?: string[];
26943
+ /** @description The rail's payee, masked, as the person confirmed it. */
26944
+ confirmed_beneficiary_document?: string;
26945
+ }[];
26724
26946
  };
26947
+ /** @description What paying it did (ent#1587); null until a payment was attempted. */
26948
+ payment: {
26949
+ /** @enum {string} */
26950
+ state: "awaiting_approval" | "dispatching" | "executed" | "uncertain" | "released";
26951
+ /** @description The pending approval that holds this payment, while a person decides. */
26952
+ approval_id?: string;
26953
+ /**
26954
+ * @description What the provider was asked to settle. `sandbox_fixture` only in a test project: the boleto is settled against Celcoin's sandbox fixture, not the document's line (spec v0.4 §18), and `document_amount_minor` keeps what the document's own line quoted.
26955
+ * @enum {string}
26956
+ */
26957
+ settled_against?: "document_line" | "sandbox_fixture";
26958
+ document_amount_minor?: number;
26959
+ mandate_id: string;
26960
+ /** @description Derived from the payable id, the quote and the try; never the cycle's default. */
26961
+ attempt_id: string;
26962
+ /** @description How many claims this payable has taken. Each is its own attempt. */
26963
+ tries: number;
26964
+ /** @description The rail's TRUE amount at the quote the attempt id was derived from. */
26965
+ amount_minor: number;
26966
+ /** @description SHA-256 of the quote the attempt was derived from. Never the quote. */
26967
+ quote_hash: string;
26968
+ claimed_at: string;
26969
+ /** @description The credential that asked. The key id, never the key; null on service auth. */
26970
+ key_id: string | null;
26971
+ via: string;
26972
+ executed_at?: string;
26973
+ receipt_id?: string | null;
26974
+ transaction_id?: string;
26975
+ end_to_end_id?: string | null;
26976
+ money_moved?: boolean;
26977
+ /** @description The lifecycle code the dispatch ended in when its outcome is unknown. */
26978
+ uncertain_code?: string;
26979
+ hold_entry_id?: string | null;
26980
+ /** @description The last refusal that provably moved no money, kept on release back to READY. */
26981
+ last_refusal?: {
26982
+ code: string;
26983
+ attempt_id: string;
26984
+ at: string;
26985
+ };
26986
+ } | null;
26725
26987
  /** @description ISO 8601 instant the payable was created. */
26726
26988
  created_at: string;
26727
26989
  /** @description ISO 8601 instant of the last change to the payable. */
@@ -26771,7 +27033,27 @@ export interface paths {
26771
27033
  };
26772
27034
  };
26773
27035
  };
26774
- /** @description `payable_carrier_malformed`: a carrier failed its own check digits, so the payable is `REJECTED` and was not stored; `details.carriers` names the carrier and the failure. `payable_no_duplicate_key`: the payable carries no duplicity axis. `payable_channel_unsupported`: `upload` was sent. `payable_attribution_mismatch`: `attribution.credential_id` names another API key. */
27036
+ /** @description A `multipart/form-data` body was sent to the JSON endpoint. Send the file to `POST /v1/payables/documents` (`details.endpoint`). */
27037
+ 415: {
27038
+ headers: {
27039
+ [name: string]: unknown;
27040
+ };
27041
+ content: {
27042
+ "application/json": {
27043
+ error: {
27044
+ /** @enum {string} */
27045
+ code: "payable_document_endpoint";
27046
+ message: string;
27047
+ details?: {
27048
+ [key: string]: unknown;
27049
+ };
27050
+ };
27051
+ /** @description Echoes the `X-Request-Id` header when the request carried one. */
27052
+ request_id: string | null;
27053
+ };
27054
+ };
27055
+ };
27056
+ /** @description `payable_carrier_malformed`: a carrier failed its own check digits, so the payable is `REJECTED` and was not stored; `details.carriers` names the carrier and the failure. `payable_no_duplicate_key`: the payable carries no duplicity axis. `payable_channel_unsupported`: a JSON body claimed `upload`. `payable_attribution_mismatch`: `attribution.credential_id` names another API key. */
26775
27057
  422: {
26776
27058
  headers: {
26777
27059
  [name: string]: unknown;
@@ -26819,36 +27101,56 @@ export interface paths {
26819
27101
  patch?: never;
26820
27102
  trace?: never;
26821
27103
  };
26822
- "/v1/payables/{payableId}": {
27104
+ "/v1/payables/documents": {
26823
27105
  parameters: {
26824
27106
  query?: never;
26825
27107
  header?: never;
26826
27108
  path?: never;
26827
27109
  cookie?: never;
26828
27110
  };
27111
+ get?: never;
27112
+ put?: never;
26829
27113
  /**
26830
- * Read a payable
26831
- * @description The payable, its `status`, the outcome of every check in `validation`, and why it has that status in `review`. Reading never re-runs a check or changes the status. **The amount and the payee come from the rail, never from what was sent.** `amount_matches_rail`, `beneficiary_document_matches_supplier` and `due_date_state` run against a consult of the boleto on the payable, and they block `READY` whether or not they answered. A consult that could not be made — no connected payment provider, a provider that did not answer — leaves them `indisponivel` and the payable `NEEDS_REVIEW`, named under `review.review_by`. `pix_key_owner_matches_supplier` is not consulted in this release and blocks a payable carrying a Pix BR Code with cause `required_not_implemented`. `VALIDATING` is never returned: nothing re-runs a validation yet, so a check with no answer goes to a person rather than waiting.
27114
+ * Create a payable from an uploaded document (PDF or image)
27115
+ * @description The file goes in the multipart field `document` (PDF, PNG, JPEG or WEBP by its bytes; the declared type is not consulted), an optional text field `actor` names the person who uploaded it, and the payable is READ from the document: `attribution.channel` is `upload`, every field carries `from: "modelo"`, a page and a literal excerpt, and `extraction` names the model and its token counts. From there it enters the same pipeline as `POST /v1/payables` — the same schema, the same deterministic checks, the same duplicate axes, the same statuses — and answers the same 200/201 shape. A JSON body sent here answers 415 `payable_document_required`.
27116
+ *
27117
+ * **Upload (multipart).** The door is behind a deployment switch: while it is off every upload answers 503 `payable_extraction_disabled` and nothing is read or stored. The file is checked before any reader sees it — real type by magic bytes (415 `payable_document_type_unsupported`; HEIC is detected and named but not accepted), at most 10 MB (413 `payable_document_too_large`), at most 10 pages (422 `payable_document_too_many_pages`), no JavaScript, embedded files, forms or launch actions (422 `payable_document_active_content`; refused, not stripped, so the hash on the payable is the hash of the bytes sent), and it must open (422 `payable_document_unreadable`, `details.reason` `encrypted` or `malformed`). The SHA-256 of the file is `document_hash`, computed before anything else: a file an open or paid payable of this project already holds answers 409 `payable_duplicate` on the `document_hash` axis without being read again. The original file is NOT kept; re-extraction is re-upload.
27118
+ *
27119
+ * The reader's citations are checked against the PDF's text layer (§7): each field's `evidence.verification` is `verified`, `moved` (the excerpt is on another page) or `unverifiable` (an image, or a PDF with no text layer — a scan). `moved` and `unverifiable` on a critical field open the `critical_field_without_evidence` review trigger; an excerpt that is in NO page of a critical field refuses the whole document, 422 `payable_evidence_fabricated`, and nothing is stored. A reader that did not find enough for the schema answers 422 `payable_extraction_incomplete` naming the missing paths. A reader that did not answer after a bounded retry answers 502 `payable_extraction_unavailable` (retriable, nothing stored; the original is not kept, so there is no failed row to resume); a reader that declined the document answers 422 `payable_extraction_refused`. Nothing of the document's content reaches a log, an audit event or an error body: the trail carries the hash, the model, the token counts and the verdict counts.
27120
+ *
27121
+ * **The amount and the payee come from the rail, never from what was sent.** `amount_matches_rail`, `beneficiary_document_matches_supplier` and `due_date_state` run against a consult of the boleto on the payable, and they block `READY` whether or not they answered. A consult that could not be made — no connected payment provider, a provider that did not answer — leaves them `indisponivel` and the payable `NEEDS_REVIEW`, named under `review.review_by`. `pix_key_owner_matches_supplier` is not consulted in this release and blocks a payable carrying a Pix BR Code with cause `required_not_implemented`. `VALIDATING` is never returned: nothing re-runs a validation yet, so a check with no answer goes to a person rather than waiting.
26832
27122
  *
26833
27123
  * **Status.** Two fields answer two questions. `review.validation_status` is what the checks alone say: `REJECTED` (a check that rejects failed), `NEEDS_REVIEW` (a check failed, or a required check has no answer it can have), `VALIDATING` (a required, implemented check did not answer and will be retried) or `VALIDATED` (every required check passed). `status` is what the payable may do: `READY` only from `VALIDATED` with no review trigger open, and `NEEDS_REVIEW` when a trigger is open. The trigger this API evaluates is `new_supplier`: this project has no executed payable for the supplier's document, or the payable names no supplier document. It is evaluated per project, never across projects.
26834
27124
  *
26835
27125
  * **Why things are in review.** `review.review_by` lists each check that sends the payable to a person and its `cause`: `check_failed`, `retries_exhausted` or `required_not_implemented`. `review.review_triggers` lists the open triggers. `review.not_covered` lists checks that did not run and do not block `READY` in this release (`supplier_registry`, `bank_details_changed`).
26836
27126
  *
26837
- * A payable of another project, of another organization and an id that is not a payable id all answer the same 404.
27127
+ * **Idempotency.** Send an `Idempotency-Key` header to make a retry safe. The same key with the same file answers 200 with `idempotent_replay: true`; the same key with a different file answers 409 `idempotency_key_conflict`. Both are checked before the reader runs, so a retry never spends a model call.
26838
27128
  *
26839
- * Scope: `payables:read`.
27129
+ * Scope: `payables:write`.
26840
27130
  */
26841
- get: {
27131
+ post: {
26842
27132
  parameters: {
26843
27133
  query?: never;
26844
- header?: never;
26845
- path: {
26846
- /** @description `pbl_` followed by 16 characters. */
26847
- payableId: string;
27134
+ header?: {
27135
+ /** @description Makes the call repeatable. Reuse it verbatim on every retry of the same file. */
27136
+ "Idempotency-Key"?: string;
26848
27137
  };
27138
+ path?: never;
26849
27139
  cookie?: never;
26850
27140
  };
26851
- requestBody?: never;
27141
+ requestBody?: {
27142
+ content: {
27143
+ "multipart/form-data": {
27144
+ /**
27145
+ * Format: binary
27146
+ * @description The PDF, PNG, JPEG or WEBP. At most 10 MB and 10 pages.
27147
+ */
27148
+ document: string;
27149
+ /** @description The person who uploaded it, recorded as `attribution.actor`. */
27150
+ actor?: string;
27151
+ };
27152
+ };
27153
+ };
26852
27154
  responses: {
26853
27155
  /** @description OK */
26854
27156
  200: {
@@ -26877,6 +27179,8 @@ export interface paths {
26877
27179
  evidence?: {
26878
27180
  page: number;
26879
27181
  excerpt: string;
27182
+ /** @enum {string} */
27183
+ verification?: "verified" | "moved" | "unverifiable";
26880
27184
  };
26881
27185
  confidence?: number;
26882
27186
  };
@@ -26887,6 +27191,8 @@ export interface paths {
26887
27191
  evidence?: {
26888
27192
  page: number;
26889
27193
  excerpt: string;
27194
+ /** @enum {string} */
27195
+ verification?: "verified" | "moved" | "unverifiable";
26890
27196
  };
26891
27197
  confidence?: number;
26892
27198
  };
@@ -26899,6 +27205,8 @@ export interface paths {
26899
27205
  evidence?: {
26900
27206
  page: number;
26901
27207
  excerpt: string;
27208
+ /** @enum {string} */
27209
+ verification?: "verified" | "moved" | "unverifiable";
26902
27210
  };
26903
27211
  confidence?: number;
26904
27212
  };
@@ -26909,6 +27217,8 @@ export interface paths {
26909
27217
  evidence?: {
26910
27218
  page: number;
26911
27219
  excerpt: string;
27220
+ /** @enum {string} */
27221
+ verification?: "verified" | "moved" | "unverifiable";
26912
27222
  };
26913
27223
  confidence?: number;
26914
27224
  };
@@ -26920,6 +27230,8 @@ export interface paths {
26920
27230
  evidence?: {
26921
27231
  page: number;
26922
27232
  excerpt: string;
27233
+ /** @enum {string} */
27234
+ verification?: "verified" | "moved" | "unverifiable";
26923
27235
  };
26924
27236
  confidence?: number;
26925
27237
  };
@@ -26930,6 +27242,8 @@ export interface paths {
26930
27242
  evidence?: {
26931
27243
  page: number;
26932
27244
  excerpt: string;
27245
+ /** @enum {string} */
27246
+ verification?: "verified" | "moved" | "unverifiable";
26933
27247
  };
26934
27248
  confidence?: number;
26935
27249
  };
@@ -26940,6 +27254,8 @@ export interface paths {
26940
27254
  evidence?: {
26941
27255
  page: number;
26942
27256
  excerpt: string;
27257
+ /** @enum {string} */
27258
+ verification?: "verified" | "moved" | "unverifiable";
26943
27259
  };
26944
27260
  confidence?: number;
26945
27261
  };
@@ -26950,6 +27266,8 @@ export interface paths {
26950
27266
  evidence?: {
26951
27267
  page: number;
26952
27268
  excerpt: string;
27269
+ /** @enum {string} */
27270
+ verification?: "verified" | "moved" | "unverifiable";
26953
27271
  };
26954
27272
  confidence?: number;
26955
27273
  };
@@ -26961,6 +27279,8 @@ export interface paths {
26961
27279
  evidence?: {
26962
27280
  page: number;
26963
27281
  excerpt: string;
27282
+ /** @enum {string} */
27283
+ verification?: "verified" | "moved" | "unverifiable";
26964
27284
  };
26965
27285
  confidence?: number;
26966
27286
  };
@@ -26971,6 +27291,8 @@ export interface paths {
26971
27291
  evidence?: {
26972
27292
  page: number;
26973
27293
  excerpt: string;
27294
+ /** @enum {string} */
27295
+ verification?: "verified" | "moved" | "unverifiable";
26974
27296
  };
26975
27297
  confidence?: number;
26976
27298
  };
@@ -26981,6 +27303,8 @@ export interface paths {
26981
27303
  evidence?: {
26982
27304
  page: number;
26983
27305
  excerpt: string;
27306
+ /** @enum {string} */
27307
+ verification?: "verified" | "moved" | "unverifiable";
26984
27308
  };
26985
27309
  confidence?: number;
26986
27310
  };
@@ -26991,6 +27315,8 @@ export interface paths {
26991
27315
  evidence?: {
26992
27316
  page: number;
26993
27317
  excerpt: string;
27318
+ /** @enum {string} */
27319
+ verification?: "verified" | "moved" | "unverifiable";
26994
27320
  };
26995
27321
  confidence?: number;
26996
27322
  };
@@ -27003,6 +27329,8 @@ export interface paths {
27003
27329
  evidence?: {
27004
27330
  page: number;
27005
27331
  excerpt: string;
27332
+ /** @enum {string} */
27333
+ verification?: "verified" | "moved" | "unverifiable";
27006
27334
  };
27007
27335
  confidence?: number;
27008
27336
  };
@@ -27013,6 +27341,8 @@ export interface paths {
27013
27341
  evidence?: {
27014
27342
  page: number;
27015
27343
  excerpt: string;
27344
+ /** @enum {string} */
27345
+ verification?: "verified" | "moved" | "unverifiable";
27016
27346
  };
27017
27347
  confidence?: number;
27018
27348
  };
@@ -27023,6 +27353,8 @@ export interface paths {
27023
27353
  evidence?: {
27024
27354
  page: number;
27025
27355
  excerpt: string;
27356
+ /** @enum {string} */
27357
+ verification?: "verified" | "moved" | "unverifiable";
27026
27358
  };
27027
27359
  confidence?: number;
27028
27360
  };
@@ -27033,6 +27365,8 @@ export interface paths {
27033
27365
  evidence?: {
27034
27366
  page: number;
27035
27367
  excerpt: string;
27368
+ /** @enum {string} */
27369
+ verification?: "verified" | "moved" | "unverifiable";
27036
27370
  };
27037
27371
  confidence?: number;
27038
27372
  };
@@ -27043,6 +27377,8 @@ export interface paths {
27043
27377
  evidence?: {
27044
27378
  page: number;
27045
27379
  excerpt: string;
27380
+ /** @enum {string} */
27381
+ verification?: "verified" | "moved" | "unverifiable";
27046
27382
  };
27047
27383
  confidence?: number;
27048
27384
  };
@@ -27053,6 +27389,8 @@ export interface paths {
27053
27389
  evidence?: {
27054
27390
  page: number;
27055
27391
  excerpt: string;
27392
+ /** @enum {string} */
27393
+ verification?: "verified" | "moved" | "unverifiable";
27056
27394
  };
27057
27395
  confidence?: number;
27058
27396
  };
@@ -27063,6 +27401,8 @@ export interface paths {
27063
27401
  evidence?: {
27064
27402
  page: number;
27065
27403
  excerpt: string;
27404
+ /** @enum {string} */
27405
+ verification?: "verified" | "moved" | "unverifiable";
27066
27406
  };
27067
27407
  confidence?: number;
27068
27408
  };
@@ -27073,6 +27413,8 @@ export interface paths {
27073
27413
  evidence?: {
27074
27414
  page: number;
27075
27415
  excerpt: string;
27416
+ /** @enum {string} */
27417
+ verification?: "verified" | "moved" | "unverifiable";
27076
27418
  };
27077
27419
  confidence?: number;
27078
27420
  };
@@ -27083,6 +27425,8 @@ export interface paths {
27083
27425
  evidence?: {
27084
27426
  page: number;
27085
27427
  excerpt: string;
27428
+ /** @enum {string} */
27429
+ verification?: "verified" | "moved" | "unverifiable";
27086
27430
  };
27087
27431
  confidence?: number;
27088
27432
  };
@@ -27093,6 +27437,8 @@ export interface paths {
27093
27437
  evidence?: {
27094
27438
  page: number;
27095
27439
  excerpt: string;
27440
+ /** @enum {string} */
27441
+ verification?: "verified" | "moved" | "unverifiable";
27096
27442
  };
27097
27443
  confidence?: number;
27098
27444
  };
@@ -27232,44 +27578,2705 @@ export interface paths {
27232
27578
  }[];
27233
27579
  /** @description Checks whose failure rejects the payable. */
27234
27580
  rejected_by: string[];
27581
+ /** @description Checks that failed and stopped blocking because a person confirmed the rail's beneficiary (§6). The check still fails; what changed is that somebody took responsibility for it. */
27582
+ confirmed_by: string[];
27235
27583
  /** @description Required, implemented checks that did not answer and may be retried. */
27236
27584
  awaiting: string[];
27237
27585
  /** @description Checks that did not run and do not block READY in this release. */
27238
27586
  not_covered: string[];
27239
- /** @description §9 triggers that keep a VALIDATED payable out of READY, such as `new_supplier`. */
27587
+ /** @description §9 triggers that keep a VALIDATED payable out of READY, such as `new_supplier`. The evidence trigger names the field and the gap: `critical_field_without_evidence:<field>:<missing|unverified|unverifiable|moved>`. */
27240
27588
  review_triggers: string[];
27589
+ /** @description Resolutions a person recorded in a completed review (§9). Absent until one is. */
27590
+ resolutions?: {
27591
+ /** @description The §7 check this resolution answers. */
27592
+ code: string;
27593
+ /**
27594
+ * @description What the person did about it.
27595
+ * @enum {string}
27596
+ */
27597
+ resolution: "human_correction" | "reject" | "confirm_rail_beneficiary";
27598
+ /** @description ISO 8601 instant of the review. */
27599
+ at: string;
27600
+ /** @description The user who reviewed. */
27601
+ by: string;
27602
+ /**
27603
+ * @description How that identity was established.
27604
+ * @enum {string}
27605
+ */
27606
+ by_source: "verified_user_token" | "header_asserted";
27607
+ /** @description Field paths a correction changed. Paths only, never values. */
27608
+ fields?: string[];
27609
+ /** @description The rail's payee, masked, as the person confirmed it. */
27610
+ confirmed_beneficiary_document?: string;
27611
+ }[];
27241
27612
  };
27613
+ /** @description What paying it did (ent#1587); null until a payment was attempted. */
27614
+ payment: {
27615
+ /** @enum {string} */
27616
+ state: "awaiting_approval" | "dispatching" | "executed" | "uncertain" | "released";
27617
+ /** @description The pending approval that holds this payment, while a person decides. */
27618
+ approval_id?: string;
27619
+ /**
27620
+ * @description What the provider was asked to settle. `sandbox_fixture` only in a test project: the boleto is settled against Celcoin's sandbox fixture, not the document's line (spec v0.4 §18), and `document_amount_minor` keeps what the document's own line quoted.
27621
+ * @enum {string}
27622
+ */
27623
+ settled_against?: "document_line" | "sandbox_fixture";
27624
+ document_amount_minor?: number;
27625
+ mandate_id: string;
27626
+ /** @description Derived from the payable id, the quote and the try; never the cycle's default. */
27627
+ attempt_id: string;
27628
+ /** @description How many claims this payable has taken. Each is its own attempt. */
27629
+ tries: number;
27630
+ /** @description The rail's TRUE amount at the quote the attempt id was derived from. */
27631
+ amount_minor: number;
27632
+ /** @description SHA-256 of the quote the attempt was derived from. Never the quote. */
27633
+ quote_hash: string;
27634
+ claimed_at: string;
27635
+ /** @description The credential that asked. The key id, never the key; null on service auth. */
27636
+ key_id: string | null;
27637
+ via: string;
27638
+ executed_at?: string;
27639
+ receipt_id?: string | null;
27640
+ transaction_id?: string;
27641
+ end_to_end_id?: string | null;
27642
+ money_moved?: boolean;
27643
+ /** @description The lifecycle code the dispatch ended in when its outcome is unknown. */
27644
+ uncertain_code?: string;
27645
+ hold_entry_id?: string | null;
27646
+ /** @description The last refusal that provably moved no money, kept on release back to READY. */
27647
+ last_refusal?: {
27648
+ code: string;
27649
+ attempt_id: string;
27650
+ at: string;
27651
+ };
27652
+ } | null;
27242
27653
  /** @description ISO 8601 instant the payable was created. */
27243
27654
  created_at: string;
27244
27655
  /** @description ISO 8601 instant of the last change to the payable. */
27245
27656
  updated_at: string;
27657
+ /** @description True when this answer replays an earlier call made with the same Idempotency-Key. */
27658
+ idempotent_replay: boolean;
27246
27659
  };
27247
27660
  };
27248
27661
  };
27249
- /** @description No payable with this id in this project. */
27250
- 404: {
27662
+ /** @description OK */
27663
+ 201: {
27251
27664
  headers: {
27252
27665
  [name: string]: unknown;
27253
27666
  };
27254
27667
  content: {
27255
27668
  "application/json": {
27256
- error: {
27669
+ /** @enum {string} */
27670
+ schema_version: "payable.v1";
27671
+ /** @enum {string} */
27672
+ doc_type: "invoice" | "danfe_nfe" | "boleto" | "unknown";
27673
+ attribution: {
27257
27674
  /** @enum {string} */
27258
- code: "not_found";
27259
- message: string;
27260
- details?: {
27261
- [key: string]: unknown;
27675
+ channel: "upload" | "structured" | "manual";
27676
+ credential_id?: string;
27677
+ connection_id?: string;
27678
+ actor?: string;
27679
+ };
27680
+ document_hash?: string;
27681
+ supplier: {
27682
+ document?: {
27683
+ value: string;
27684
+ /** @enum {string} */
27685
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
27686
+ evidence?: {
27687
+ page: number;
27688
+ excerpt: string;
27689
+ /** @enum {string} */
27690
+ verification?: "verified" | "moved" | "unverifiable";
27691
+ };
27692
+ confidence?: number;
27693
+ };
27694
+ name: {
27695
+ value: string;
27696
+ /** @enum {string} */
27697
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
27698
+ evidence?: {
27699
+ page: number;
27700
+ excerpt: string;
27701
+ /** @enum {string} */
27702
+ verification?: "verified" | "moved" | "unverifiable";
27703
+ };
27704
+ confidence?: number;
27262
27705
  };
27263
27706
  };
27264
- /** @description Echoes the `X-Request-Id` header when the request carried one. */
27265
- request_id: string | null;
27266
- };
27267
- };
27268
- };
27269
- };
27270
- };
27271
- put?: never;
27272
- post?: never;
27707
+ recipient?: {
27708
+ document?: {
27709
+ value: string;
27710
+ /** @enum {string} */
27711
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
27712
+ evidence?: {
27713
+ page: number;
27714
+ excerpt: string;
27715
+ /** @enum {string} */
27716
+ verification?: "verified" | "moved" | "unverifiable";
27717
+ };
27718
+ confidence?: number;
27719
+ };
27720
+ name: {
27721
+ value: string;
27722
+ /** @enum {string} */
27723
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
27724
+ evidence?: {
27725
+ page: number;
27726
+ excerpt: string;
27727
+ /** @enum {string} */
27728
+ verification?: "verified" | "moved" | "unverifiable";
27729
+ };
27730
+ confidence?: number;
27731
+ };
27732
+ };
27733
+ invoice_number?: {
27734
+ value: string;
27735
+ /** @enum {string} */
27736
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
27737
+ evidence?: {
27738
+ page: number;
27739
+ excerpt: string;
27740
+ /** @enum {string} */
27741
+ verification?: "verified" | "moved" | "unverifiable";
27742
+ };
27743
+ confidence?: number;
27744
+ };
27745
+ serie?: {
27746
+ value: string;
27747
+ /** @enum {string} */
27748
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
27749
+ evidence?: {
27750
+ page: number;
27751
+ excerpt: string;
27752
+ /** @enum {string} */
27753
+ verification?: "verified" | "moved" | "unverifiable";
27754
+ };
27755
+ confidence?: number;
27756
+ };
27757
+ issue_date?: {
27758
+ value: string;
27759
+ /** @enum {string} */
27760
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
27761
+ evidence?: {
27762
+ page: number;
27763
+ excerpt: string;
27764
+ /** @enum {string} */
27765
+ verification?: "verified" | "moved" | "unverifiable";
27766
+ };
27767
+ confidence?: number;
27768
+ };
27769
+ due_date?: {
27770
+ value: string;
27771
+ /** @enum {string} */
27772
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
27773
+ evidence?: {
27774
+ page: number;
27775
+ excerpt: string;
27776
+ /** @enum {string} */
27777
+ verification?: "verified" | "moved" | "unverifiable";
27778
+ };
27779
+ confidence?: number;
27780
+ };
27781
+ items?: {
27782
+ description: {
27783
+ value: string;
27784
+ /** @enum {string} */
27785
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
27786
+ evidence?: {
27787
+ page: number;
27788
+ excerpt: string;
27789
+ /** @enum {string} */
27790
+ verification?: "verified" | "moved" | "unverifiable";
27791
+ };
27792
+ confidence?: number;
27793
+ };
27794
+ quantity: {
27795
+ value: number;
27796
+ /** @enum {string} */
27797
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
27798
+ evidence?: {
27799
+ page: number;
27800
+ excerpt: string;
27801
+ /** @enum {string} */
27802
+ verification?: "verified" | "moved" | "unverifiable";
27803
+ };
27804
+ confidence?: number;
27805
+ };
27806
+ unit_amount_minor: {
27807
+ value: number;
27808
+ /** @enum {string} */
27809
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
27810
+ evidence?: {
27811
+ page: number;
27812
+ excerpt: string;
27813
+ /** @enum {string} */
27814
+ verification?: "verified" | "moved" | "unverifiable";
27815
+ };
27816
+ confidence?: number;
27817
+ };
27818
+ total_amount_minor: {
27819
+ value: number;
27820
+ /** @enum {string} */
27821
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
27822
+ evidence?: {
27823
+ page: number;
27824
+ excerpt: string;
27825
+ /** @enum {string} */
27826
+ verification?: "verified" | "moved" | "unverifiable";
27827
+ };
27828
+ confidence?: number;
27829
+ };
27830
+ }[];
27831
+ totals: {
27832
+ subtotal_minor?: {
27833
+ value: number;
27834
+ /** @enum {string} */
27835
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
27836
+ evidence?: {
27837
+ page: number;
27838
+ excerpt: string;
27839
+ /** @enum {string} */
27840
+ verification?: "verified" | "moved" | "unverifiable";
27841
+ };
27842
+ confidence?: number;
27843
+ };
27844
+ discount_minor?: {
27845
+ value: number;
27846
+ /** @enum {string} */
27847
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
27848
+ evidence?: {
27849
+ page: number;
27850
+ excerpt: string;
27851
+ /** @enum {string} */
27852
+ verification?: "verified" | "moved" | "unverifiable";
27853
+ };
27854
+ confidence?: number;
27855
+ };
27856
+ tax_relief_deducted_minor?: {
27857
+ value: number;
27858
+ /** @enum {string} */
27859
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
27860
+ evidence?: {
27861
+ page: number;
27862
+ excerpt: string;
27863
+ /** @enum {string} */
27864
+ verification?: "verified" | "moved" | "unverifiable";
27865
+ };
27866
+ confidence?: number;
27867
+ };
27868
+ freight_minor?: {
27869
+ value: number;
27870
+ /** @enum {string} */
27871
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
27872
+ evidence?: {
27873
+ page: number;
27874
+ excerpt: string;
27875
+ /** @enum {string} */
27876
+ verification?: "verified" | "moved" | "unverifiable";
27877
+ };
27878
+ confidence?: number;
27879
+ };
27880
+ insurance_minor?: {
27881
+ value: number;
27882
+ /** @enum {string} */
27883
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
27884
+ evidence?: {
27885
+ page: number;
27886
+ excerpt: string;
27887
+ /** @enum {string} */
27888
+ verification?: "verified" | "moved" | "unverifiable";
27889
+ };
27890
+ confidence?: number;
27891
+ };
27892
+ other_charges_minor?: {
27893
+ value: number;
27894
+ /** @enum {string} */
27895
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
27896
+ evidence?: {
27897
+ page: number;
27898
+ excerpt: string;
27899
+ /** @enum {string} */
27900
+ verification?: "verified" | "moved" | "unverifiable";
27901
+ };
27902
+ confidence?: number;
27903
+ };
27904
+ taxes_added_minor?: {
27905
+ value: number;
27906
+ /** @enum {string} */
27907
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
27908
+ evidence?: {
27909
+ page: number;
27910
+ excerpt: string;
27911
+ /** @enum {string} */
27912
+ verification?: "verified" | "moved" | "unverifiable";
27913
+ };
27914
+ confidence?: number;
27915
+ };
27916
+ taxes_included_minor?: {
27917
+ value: number;
27918
+ /** @enum {string} */
27919
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
27920
+ evidence?: {
27921
+ page: number;
27922
+ excerpt: string;
27923
+ /** @enum {string} */
27924
+ verification?: "verified" | "moved" | "unverifiable";
27925
+ };
27926
+ confidence?: number;
27927
+ };
27928
+ grand_total_minor: {
27929
+ value: number;
27930
+ /** @enum {string} */
27931
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
27932
+ evidence?: {
27933
+ page: number;
27934
+ excerpt: string;
27935
+ /** @enum {string} */
27936
+ verification?: "verified" | "moved" | "unverifiable";
27937
+ };
27938
+ confidence?: number;
27939
+ };
27940
+ currency: {
27941
+ value: string;
27942
+ /** @enum {string} */
27943
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
27944
+ evidence?: {
27945
+ page: number;
27946
+ excerpt: string;
27947
+ /** @enum {string} */
27948
+ verification?: "verified" | "moved" | "unverifiable";
27949
+ };
27950
+ confidence?: number;
27951
+ };
27952
+ };
27953
+ carriers?: {
27954
+ boleto?: string;
27955
+ br_code?: string;
27956
+ nfe?: string;
27957
+ };
27958
+ extraction?: {
27959
+ model: string;
27960
+ model_version: string;
27961
+ input_tokens: number;
27962
+ output_tokens: number;
27963
+ reasoning_tokens?: number;
27964
+ };
27965
+ payable_id: string;
27966
+ /** @enum {string} */
27967
+ status: "RECEIVED" | "EXTRACTING" | "EXTRACTED" | "VALIDATING" | "VALIDATED" | "NEEDS_REVIEW" | "READY" | "APPROVED" | "EXECUTED" | "REJECTED" | "FAILED_EXTRACTION" | "EXPIRED";
27968
+ rail_quote?: {
27969
+ beneficiary: {
27970
+ value: string;
27971
+ /** @enum {string} */
27972
+ from: "trilho";
27973
+ };
27974
+ beneficiary_document_masked: {
27975
+ value: string;
27976
+ /** @enum {string} */
27977
+ from: "trilho";
27978
+ };
27979
+ final_beneficiary?: {
27980
+ value: string;
27981
+ /** @enum {string} */
27982
+ from: "trilho";
27983
+ };
27984
+ final_beneficiary_document_masked?: {
27985
+ value: string;
27986
+ /** @enum {string} */
27987
+ from: "trilho";
27988
+ };
27989
+ amount_minor: {
27990
+ value: number;
27991
+ /** @enum {string} */
27992
+ from: "trilho";
27993
+ };
27994
+ discount_minor?: {
27995
+ value: number;
27996
+ /** @enum {string} */
27997
+ from: "trilho";
27998
+ };
27999
+ interest_minor?: {
28000
+ value: number;
28001
+ /** @enum {string} */
28002
+ from: "trilho";
28003
+ };
28004
+ fine_minor?: {
28005
+ value: number;
28006
+ /** @enum {string} */
28007
+ from: "trilho";
28008
+ };
28009
+ due_date?: {
28010
+ value: string;
28011
+ /** @enum {string} */
28012
+ from: "trilho";
28013
+ };
28014
+ /** Format: date-time */
28015
+ quoted_at: string;
28016
+ };
28017
+ validation: {
28018
+ carrier_check_digits?: {
28019
+ /** @enum {string} */
28020
+ outcome: "ok" | "needs_review" | "nao_aplicavel" | "indisponivel";
28021
+ detail?: string;
28022
+ };
28023
+ document_check_digits?: {
28024
+ /** @enum {string} */
28025
+ outcome: "ok" | "needs_review" | "nao_aplicavel" | "indisponivel";
28026
+ detail?: string;
28027
+ };
28028
+ nfe_key_consistency?: {
28029
+ /** @enum {string} */
28030
+ outcome: "ok" | "needs_review" | "nao_aplicavel" | "indisponivel";
28031
+ detail?: string;
28032
+ };
28033
+ arithmetic?: {
28034
+ /** @enum {string} */
28035
+ outcome: "ok" | "needs_review" | "nao_aplicavel" | "indisponivel";
28036
+ detail?: string;
28037
+ };
28038
+ duplicate_document?: {
28039
+ /** @enum {string} */
28040
+ outcome: "ok" | "needs_review" | "nao_aplicavel" | "indisponivel";
28041
+ detail?: string;
28042
+ };
28043
+ amount_matches_rail?: {
28044
+ /** @enum {string} */
28045
+ outcome: "ok" | "needs_review" | "nao_aplicavel" | "indisponivel";
28046
+ detail?: string;
28047
+ };
28048
+ beneficiary_document_matches_supplier?: {
28049
+ /** @enum {string} */
28050
+ outcome: "ok" | "needs_review" | "nao_aplicavel" | "indisponivel";
28051
+ detail?: string;
28052
+ };
28053
+ due_date_state?: {
28054
+ /** @enum {string} */
28055
+ outcome: "ok" | "needs_review" | "nao_aplicavel" | "indisponivel";
28056
+ detail?: string;
28057
+ };
28058
+ pix_key_owner_matches_supplier?: {
28059
+ /** @enum {string} */
28060
+ outcome: "ok" | "needs_review" | "nao_aplicavel" | "indisponivel";
28061
+ detail?: string;
28062
+ };
28063
+ supplier_registry?: {
28064
+ /** @enum {string} */
28065
+ outcome: "ok" | "needs_review" | "nao_aplicavel" | "indisponivel";
28066
+ detail?: string;
28067
+ };
28068
+ bank_details_changed?: {
28069
+ /** @enum {string} */
28070
+ outcome: "ok" | "needs_review" | "nao_aplicavel" | "indisponivel";
28071
+ detail?: string;
28072
+ };
28073
+ };
28074
+ review: {
28075
+ /**
28076
+ * @description What the checks alone say. `status` adds the §9 triggers to it.
28077
+ * @enum {string}
28078
+ */
28079
+ validation_status: "REJECTED" | "NEEDS_REVIEW" | "VALIDATING" | "VALIDATED";
28080
+ /** @description Each check that sends the payable to a person, and why: it failed, it is implemented and did not answer, or it is required and nothing implements it yet. */
28081
+ review_by: {
28082
+ code: string;
28083
+ /** @enum {string} */
28084
+ cause: "check_failed" | "retries_exhausted" | "required_not_implemented";
28085
+ }[];
28086
+ /** @description Checks whose failure rejects the payable. */
28087
+ rejected_by: string[];
28088
+ /** @description Checks that failed and stopped blocking because a person confirmed the rail's beneficiary (§6). The check still fails; what changed is that somebody took responsibility for it. */
28089
+ confirmed_by: string[];
28090
+ /** @description Required, implemented checks that did not answer and may be retried. */
28091
+ awaiting: string[];
28092
+ /** @description Checks that did not run and do not block READY in this release. */
28093
+ not_covered: string[];
28094
+ /** @description §9 triggers that keep a VALIDATED payable out of READY, such as `new_supplier`. The evidence trigger names the field and the gap: `critical_field_without_evidence:<field>:<missing|unverified|unverifiable|moved>`. */
28095
+ review_triggers: string[];
28096
+ /** @description Resolutions a person recorded in a completed review (§9). Absent until one is. */
28097
+ resolutions?: {
28098
+ /** @description The §7 check this resolution answers. */
28099
+ code: string;
28100
+ /**
28101
+ * @description What the person did about it.
28102
+ * @enum {string}
28103
+ */
28104
+ resolution: "human_correction" | "reject" | "confirm_rail_beneficiary";
28105
+ /** @description ISO 8601 instant of the review. */
28106
+ at: string;
28107
+ /** @description The user who reviewed. */
28108
+ by: string;
28109
+ /**
28110
+ * @description How that identity was established.
28111
+ * @enum {string}
28112
+ */
28113
+ by_source: "verified_user_token" | "header_asserted";
28114
+ /** @description Field paths a correction changed. Paths only, never values. */
28115
+ fields?: string[];
28116
+ /** @description The rail's payee, masked, as the person confirmed it. */
28117
+ confirmed_beneficiary_document?: string;
28118
+ }[];
28119
+ };
28120
+ /** @description What paying it did (ent#1587); null until a payment was attempted. */
28121
+ payment: {
28122
+ /** @enum {string} */
28123
+ state: "awaiting_approval" | "dispatching" | "executed" | "uncertain" | "released";
28124
+ /** @description The pending approval that holds this payment, while a person decides. */
28125
+ approval_id?: string;
28126
+ /**
28127
+ * @description What the provider was asked to settle. `sandbox_fixture` only in a test project: the boleto is settled against Celcoin's sandbox fixture, not the document's line (spec v0.4 §18), and `document_amount_minor` keeps what the document's own line quoted.
28128
+ * @enum {string}
28129
+ */
28130
+ settled_against?: "document_line" | "sandbox_fixture";
28131
+ document_amount_minor?: number;
28132
+ mandate_id: string;
28133
+ /** @description Derived from the payable id, the quote and the try; never the cycle's default. */
28134
+ attempt_id: string;
28135
+ /** @description How many claims this payable has taken. Each is its own attempt. */
28136
+ tries: number;
28137
+ /** @description The rail's TRUE amount at the quote the attempt id was derived from. */
28138
+ amount_minor: number;
28139
+ /** @description SHA-256 of the quote the attempt was derived from. Never the quote. */
28140
+ quote_hash: string;
28141
+ claimed_at: string;
28142
+ /** @description The credential that asked. The key id, never the key; null on service auth. */
28143
+ key_id: string | null;
28144
+ via: string;
28145
+ executed_at?: string;
28146
+ receipt_id?: string | null;
28147
+ transaction_id?: string;
28148
+ end_to_end_id?: string | null;
28149
+ money_moved?: boolean;
28150
+ /** @description The lifecycle code the dispatch ended in when its outcome is unknown. */
28151
+ uncertain_code?: string;
28152
+ hold_entry_id?: string | null;
28153
+ /** @description The last refusal that provably moved no money, kept on release back to READY. */
28154
+ last_refusal?: {
28155
+ code: string;
28156
+ attempt_id: string;
28157
+ at: string;
28158
+ };
28159
+ } | null;
28160
+ /** @description ISO 8601 instant the payable was created. */
28161
+ created_at: string;
28162
+ /** @description ISO 8601 instant of the last change to the payable. */
28163
+ updated_at: string;
28164
+ /** @description True when this answer replays an earlier call made with the same Idempotency-Key. */
28165
+ idempotent_replay: boolean;
28166
+ };
28167
+ };
28168
+ };
28169
+ /** @description The multipart field `document` is absent or empty (`payable_document_required`), the `actor` field is out of shape or the multipart body could not be read (`invalid_body`), or the Idempotency-Key header is empty or longer than 255 characters. */
28170
+ 400: {
28171
+ headers: {
28172
+ [name: string]: unknown;
28173
+ };
28174
+ content: {
28175
+ "application/json": {
28176
+ error: {
28177
+ /** @enum {string} */
28178
+ code: "payable_document_required" | "invalid_body" | "invalid_idempotency_key";
28179
+ message: string;
28180
+ details?: {
28181
+ [key: string]: unknown;
28182
+ };
28183
+ };
28184
+ /** @description Echoes the `X-Request-Id` header when the request carried one. */
28185
+ request_id: string | null;
28186
+ };
28187
+ };
28188
+ };
28189
+ /** @description `payable_duplicate`: an open or paid payable of this project already holds this file's `document_hash` (refused before the reader runs; no `details.validation`) or shares a carrier with what was read. `idempotency_key_conflict`: the key was used with a different file. */
28190
+ 409: {
28191
+ headers: {
28192
+ [name: string]: unknown;
28193
+ };
28194
+ content: {
28195
+ "application/json": {
28196
+ error: {
28197
+ /** @enum {string} */
28198
+ code: "payable_duplicate" | "idempotency_key_conflict";
28199
+ message: string;
28200
+ details?: {
28201
+ [key: string]: unknown;
28202
+ };
28203
+ };
28204
+ /** @description Echoes the `X-Request-Id` header when the request carried one. */
28205
+ request_id: string | null;
28206
+ };
28207
+ };
28208
+ };
28209
+ /** @description The uploaded file exceeds 10 MB. Nothing was read or stored. */
28210
+ 413: {
28211
+ headers: {
28212
+ [name: string]: unknown;
28213
+ };
28214
+ content: {
28215
+ "application/json": {
28216
+ error: {
28217
+ /** @enum {string} */
28218
+ code: "payable_document_too_large";
28219
+ message: string;
28220
+ details?: {
28221
+ [key: string]: unknown;
28222
+ };
28223
+ };
28224
+ /** @description Echoes the `X-Request-Id` header when the request carried one. */
28225
+ request_id: string | null;
28226
+ };
28227
+ };
28228
+ };
28229
+ /** @description `payable_document_type_unsupported`: the file is not a PDF, PNG, JPEG or WEBP by its bytes; `details.detected` names what it is when known (`image/heic` is detected and not accepted). `payable_document_required`: the body was not `multipart/form-data` at all. */
28230
+ 415: {
28231
+ headers: {
28232
+ [name: string]: unknown;
28233
+ };
28234
+ content: {
28235
+ "application/json": {
28236
+ error: {
28237
+ /** @enum {string} */
28238
+ code: "payable_document_type_unsupported" | "payable_document_required";
28239
+ message: string;
28240
+ details?: {
28241
+ [key: string]: unknown;
28242
+ };
28243
+ };
28244
+ /** @description Echoes the `X-Request-Id` header when the request carried one. */
28245
+ request_id: string | null;
28246
+ };
28247
+ };
28248
+ };
28249
+ /** @description The PDF has more than 10 pages (`payable_document_too_many_pages`), carries active content (`payable_document_active_content`, `details.found`), or cannot be opened (`payable_document_unreadable`, `details.reason`); the reader cited, for a critical field, a passage in no page (`payable_evidence_fabricated`, `details.fields`); the reader found too little (`payable_extraction_incomplete`, `details.issues`); the reader declined the document (`payable_extraction_refused`); or a carrier it read fails its check digits (`payable_carrier_malformed`). None of these stores anything. */
28250
+ 422: {
28251
+ headers: {
28252
+ [name: string]: unknown;
28253
+ };
28254
+ content: {
28255
+ "application/json": {
28256
+ error: {
28257
+ /** @enum {string} */
28258
+ code: "payable_document_too_many_pages" | "payable_document_active_content" | "payable_document_unreadable" | "payable_evidence_fabricated" | "payable_extraction_incomplete" | "payable_extraction_refused" | "payable_carrier_malformed";
28259
+ message: string;
28260
+ details?: {
28261
+ [key: string]: unknown;
28262
+ };
28263
+ };
28264
+ /** @description Echoes the `X-Request-Id` header when the request carried one. */
28265
+ request_id: string | null;
28266
+ };
28267
+ };
28268
+ };
28269
+ /** @description `payable_extraction_unavailable`: the reader did not answer usably after a bounded retry (`details.attempts`); nothing was stored; retry later with the same Idempotency-Key. `payable_extraction_failed`: the extraction request was refused for a reason on our side; not fixable by retrying. */
28270
+ 502: {
28271
+ headers: {
28272
+ [name: string]: unknown;
28273
+ };
28274
+ content: {
28275
+ "application/json": {
28276
+ error: {
28277
+ /** @enum {string} */
28278
+ code: "payable_extraction_unavailable" | "payable_extraction_failed";
28279
+ message: string;
28280
+ details?: {
28281
+ [key: string]: unknown;
28282
+ };
28283
+ };
28284
+ /** @description Echoes the `X-Request-Id` header when the request carried one. */
28285
+ request_id: string | null;
28286
+ };
28287
+ };
28288
+ };
28289
+ /** @description `payable_extraction_disabled`: the document door is switched off on this deployment; send the payable as JSON (`structured` or `manual`). `payable_extractor_unconfigured`: the door is on with no reader behind it; a deployment fault, not retriable. `vault_unavailable`: the key that protects supplier documents could not be read; retry later with the same Idempotency-Key. */
28290
+ 503: {
28291
+ headers: {
28292
+ [name: string]: unknown;
28293
+ };
28294
+ content: {
28295
+ "application/json": {
28296
+ error: {
28297
+ /** @enum {string} */
28298
+ code: "payable_extraction_disabled" | "payable_extractor_unconfigured" | "vault_unavailable";
28299
+ message: string;
28300
+ details?: {
28301
+ [key: string]: unknown;
28302
+ };
28303
+ };
28304
+ /** @description Echoes the `X-Request-Id` header when the request carried one. */
28305
+ request_id: string | null;
28306
+ };
28307
+ };
28308
+ };
28309
+ };
28310
+ };
28311
+ delete?: never;
28312
+ options?: never;
28313
+ head?: never;
28314
+ patch?: never;
28315
+ trace?: never;
28316
+ };
28317
+ "/v1/payables/{payableId}": {
28318
+ parameters: {
28319
+ query?: never;
28320
+ header?: never;
28321
+ path?: never;
28322
+ cookie?: never;
28323
+ };
28324
+ /**
28325
+ * Read a payable
28326
+ * @description The payable, its `status`, the outcome of every check in `validation`, and why it has that status in `review`. Reading never re-runs a check or changes the status. **The amount and the payee come from the rail, never from what was sent.** `amount_matches_rail`, `beneficiary_document_matches_supplier` and `due_date_state` run against a consult of the boleto on the payable, and they block `READY` whether or not they answered. A consult that could not be made — no connected payment provider, a provider that did not answer — leaves them `indisponivel` and the payable `NEEDS_REVIEW`, named under `review.review_by`. `pix_key_owner_matches_supplier` is not consulted in this release and blocks a payable carrying a Pix BR Code with cause `required_not_implemented`. `VALIDATING` is never returned: nothing re-runs a validation yet, so a check with no answer goes to a person rather than waiting.
28327
+ *
28328
+ * **Status.** Two fields answer two questions. `review.validation_status` is what the checks alone say: `REJECTED` (a check that rejects failed), `NEEDS_REVIEW` (a check failed, or a required check has no answer it can have), `VALIDATING` (a required, implemented check did not answer and will be retried) or `VALIDATED` (every required check passed). `status` is what the payable may do: `READY` only from `VALIDATED` with no review trigger open, and `NEEDS_REVIEW` when a trigger is open. The trigger this API evaluates is `new_supplier`: this project has no executed payable for the supplier's document, or the payable names no supplier document. It is evaluated per project, never across projects.
28329
+ *
28330
+ * **Why things are in review.** `review.review_by` lists each check that sends the payable to a person and its `cause`: `check_failed`, `retries_exhausted` or `required_not_implemented`. `review.review_triggers` lists the open triggers. `review.not_covered` lists checks that did not run and do not block `READY` in this release (`supplier_registry`, `bank_details_changed`).
28331
+ *
28332
+ * A payable of another project, of another organization and an id that is not a payable id all answer the same 404.
28333
+ *
28334
+ * Scope: `payables:read`.
28335
+ */
28336
+ get: {
28337
+ parameters: {
28338
+ query?: never;
28339
+ header?: never;
28340
+ path: {
28341
+ /** @description `pbl_` followed by 16 characters. */
28342
+ payableId: string;
28343
+ };
28344
+ cookie?: never;
28345
+ };
28346
+ requestBody?: never;
28347
+ responses: {
28348
+ /** @description OK */
28349
+ 200: {
28350
+ headers: {
28351
+ [name: string]: unknown;
28352
+ };
28353
+ content: {
28354
+ "application/json": {
28355
+ /** @enum {string} */
28356
+ schema_version: "payable.v1";
28357
+ /** @enum {string} */
28358
+ doc_type: "invoice" | "danfe_nfe" | "boleto" | "unknown";
28359
+ attribution: {
28360
+ /** @enum {string} */
28361
+ channel: "upload" | "structured" | "manual";
28362
+ credential_id?: string;
28363
+ connection_id?: string;
28364
+ actor?: string;
28365
+ };
28366
+ document_hash?: string;
28367
+ supplier: {
28368
+ document?: {
28369
+ value: string;
28370
+ /** @enum {string} */
28371
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
28372
+ evidence?: {
28373
+ page: number;
28374
+ excerpt: string;
28375
+ /** @enum {string} */
28376
+ verification?: "verified" | "moved" | "unverifiable";
28377
+ };
28378
+ confidence?: number;
28379
+ };
28380
+ name: {
28381
+ value: string;
28382
+ /** @enum {string} */
28383
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
28384
+ evidence?: {
28385
+ page: number;
28386
+ excerpt: string;
28387
+ /** @enum {string} */
28388
+ verification?: "verified" | "moved" | "unverifiable";
28389
+ };
28390
+ confidence?: number;
28391
+ };
28392
+ };
28393
+ recipient?: {
28394
+ document?: {
28395
+ value: string;
28396
+ /** @enum {string} */
28397
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
28398
+ evidence?: {
28399
+ page: number;
28400
+ excerpt: string;
28401
+ /** @enum {string} */
28402
+ verification?: "verified" | "moved" | "unverifiable";
28403
+ };
28404
+ confidence?: number;
28405
+ };
28406
+ name: {
28407
+ value: string;
28408
+ /** @enum {string} */
28409
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
28410
+ evidence?: {
28411
+ page: number;
28412
+ excerpt: string;
28413
+ /** @enum {string} */
28414
+ verification?: "verified" | "moved" | "unverifiable";
28415
+ };
28416
+ confidence?: number;
28417
+ };
28418
+ };
28419
+ invoice_number?: {
28420
+ value: string;
28421
+ /** @enum {string} */
28422
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
28423
+ evidence?: {
28424
+ page: number;
28425
+ excerpt: string;
28426
+ /** @enum {string} */
28427
+ verification?: "verified" | "moved" | "unverifiable";
28428
+ };
28429
+ confidence?: number;
28430
+ };
28431
+ serie?: {
28432
+ value: string;
28433
+ /** @enum {string} */
28434
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
28435
+ evidence?: {
28436
+ page: number;
28437
+ excerpt: string;
28438
+ /** @enum {string} */
28439
+ verification?: "verified" | "moved" | "unverifiable";
28440
+ };
28441
+ confidence?: number;
28442
+ };
28443
+ issue_date?: {
28444
+ value: string;
28445
+ /** @enum {string} */
28446
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
28447
+ evidence?: {
28448
+ page: number;
28449
+ excerpt: string;
28450
+ /** @enum {string} */
28451
+ verification?: "verified" | "moved" | "unverifiable";
28452
+ };
28453
+ confidence?: number;
28454
+ };
28455
+ due_date?: {
28456
+ value: string;
28457
+ /** @enum {string} */
28458
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
28459
+ evidence?: {
28460
+ page: number;
28461
+ excerpt: string;
28462
+ /** @enum {string} */
28463
+ verification?: "verified" | "moved" | "unverifiable";
28464
+ };
28465
+ confidence?: number;
28466
+ };
28467
+ items?: {
28468
+ description: {
28469
+ value: string;
28470
+ /** @enum {string} */
28471
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
28472
+ evidence?: {
28473
+ page: number;
28474
+ excerpt: string;
28475
+ /** @enum {string} */
28476
+ verification?: "verified" | "moved" | "unverifiable";
28477
+ };
28478
+ confidence?: number;
28479
+ };
28480
+ quantity: {
28481
+ value: number;
28482
+ /** @enum {string} */
28483
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
28484
+ evidence?: {
28485
+ page: number;
28486
+ excerpt: string;
28487
+ /** @enum {string} */
28488
+ verification?: "verified" | "moved" | "unverifiable";
28489
+ };
28490
+ confidence?: number;
28491
+ };
28492
+ unit_amount_minor: {
28493
+ value: number;
28494
+ /** @enum {string} */
28495
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
28496
+ evidence?: {
28497
+ page: number;
28498
+ excerpt: string;
28499
+ /** @enum {string} */
28500
+ verification?: "verified" | "moved" | "unverifiable";
28501
+ };
28502
+ confidence?: number;
28503
+ };
28504
+ total_amount_minor: {
28505
+ value: number;
28506
+ /** @enum {string} */
28507
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
28508
+ evidence?: {
28509
+ page: number;
28510
+ excerpt: string;
28511
+ /** @enum {string} */
28512
+ verification?: "verified" | "moved" | "unverifiable";
28513
+ };
28514
+ confidence?: number;
28515
+ };
28516
+ }[];
28517
+ totals: {
28518
+ subtotal_minor?: {
28519
+ value: number;
28520
+ /** @enum {string} */
28521
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
28522
+ evidence?: {
28523
+ page: number;
28524
+ excerpt: string;
28525
+ /** @enum {string} */
28526
+ verification?: "verified" | "moved" | "unverifiable";
28527
+ };
28528
+ confidence?: number;
28529
+ };
28530
+ discount_minor?: {
28531
+ value: number;
28532
+ /** @enum {string} */
28533
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
28534
+ evidence?: {
28535
+ page: number;
28536
+ excerpt: string;
28537
+ /** @enum {string} */
28538
+ verification?: "verified" | "moved" | "unverifiable";
28539
+ };
28540
+ confidence?: number;
28541
+ };
28542
+ tax_relief_deducted_minor?: {
28543
+ value: number;
28544
+ /** @enum {string} */
28545
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
28546
+ evidence?: {
28547
+ page: number;
28548
+ excerpt: string;
28549
+ /** @enum {string} */
28550
+ verification?: "verified" | "moved" | "unverifiable";
28551
+ };
28552
+ confidence?: number;
28553
+ };
28554
+ freight_minor?: {
28555
+ value: number;
28556
+ /** @enum {string} */
28557
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
28558
+ evidence?: {
28559
+ page: number;
28560
+ excerpt: string;
28561
+ /** @enum {string} */
28562
+ verification?: "verified" | "moved" | "unverifiable";
28563
+ };
28564
+ confidence?: number;
28565
+ };
28566
+ insurance_minor?: {
28567
+ value: number;
28568
+ /** @enum {string} */
28569
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
28570
+ evidence?: {
28571
+ page: number;
28572
+ excerpt: string;
28573
+ /** @enum {string} */
28574
+ verification?: "verified" | "moved" | "unverifiable";
28575
+ };
28576
+ confidence?: number;
28577
+ };
28578
+ other_charges_minor?: {
28579
+ value: number;
28580
+ /** @enum {string} */
28581
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
28582
+ evidence?: {
28583
+ page: number;
28584
+ excerpt: string;
28585
+ /** @enum {string} */
28586
+ verification?: "verified" | "moved" | "unverifiable";
28587
+ };
28588
+ confidence?: number;
28589
+ };
28590
+ taxes_added_minor?: {
28591
+ value: number;
28592
+ /** @enum {string} */
28593
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
28594
+ evidence?: {
28595
+ page: number;
28596
+ excerpt: string;
28597
+ /** @enum {string} */
28598
+ verification?: "verified" | "moved" | "unverifiable";
28599
+ };
28600
+ confidence?: number;
28601
+ };
28602
+ taxes_included_minor?: {
28603
+ value: number;
28604
+ /** @enum {string} */
28605
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
28606
+ evidence?: {
28607
+ page: number;
28608
+ excerpt: string;
28609
+ /** @enum {string} */
28610
+ verification?: "verified" | "moved" | "unverifiable";
28611
+ };
28612
+ confidence?: number;
28613
+ };
28614
+ grand_total_minor: {
28615
+ value: number;
28616
+ /** @enum {string} */
28617
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
28618
+ evidence?: {
28619
+ page: number;
28620
+ excerpt: string;
28621
+ /** @enum {string} */
28622
+ verification?: "verified" | "moved" | "unverifiable";
28623
+ };
28624
+ confidence?: number;
28625
+ };
28626
+ currency: {
28627
+ value: string;
28628
+ /** @enum {string} */
28629
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
28630
+ evidence?: {
28631
+ page: number;
28632
+ excerpt: string;
28633
+ /** @enum {string} */
28634
+ verification?: "verified" | "moved" | "unverifiable";
28635
+ };
28636
+ confidence?: number;
28637
+ };
28638
+ };
28639
+ carriers?: {
28640
+ boleto?: string;
28641
+ br_code?: string;
28642
+ nfe?: string;
28643
+ };
28644
+ extraction?: {
28645
+ model: string;
28646
+ model_version: string;
28647
+ input_tokens: number;
28648
+ output_tokens: number;
28649
+ reasoning_tokens?: number;
28650
+ };
28651
+ payable_id: string;
28652
+ /** @enum {string} */
28653
+ status: "RECEIVED" | "EXTRACTING" | "EXTRACTED" | "VALIDATING" | "VALIDATED" | "NEEDS_REVIEW" | "READY" | "APPROVED" | "EXECUTED" | "REJECTED" | "FAILED_EXTRACTION" | "EXPIRED";
28654
+ rail_quote?: {
28655
+ beneficiary: {
28656
+ value: string;
28657
+ /** @enum {string} */
28658
+ from: "trilho";
28659
+ };
28660
+ beneficiary_document_masked: {
28661
+ value: string;
28662
+ /** @enum {string} */
28663
+ from: "trilho";
28664
+ };
28665
+ final_beneficiary?: {
28666
+ value: string;
28667
+ /** @enum {string} */
28668
+ from: "trilho";
28669
+ };
28670
+ final_beneficiary_document_masked?: {
28671
+ value: string;
28672
+ /** @enum {string} */
28673
+ from: "trilho";
28674
+ };
28675
+ amount_minor: {
28676
+ value: number;
28677
+ /** @enum {string} */
28678
+ from: "trilho";
28679
+ };
28680
+ discount_minor?: {
28681
+ value: number;
28682
+ /** @enum {string} */
28683
+ from: "trilho";
28684
+ };
28685
+ interest_minor?: {
28686
+ value: number;
28687
+ /** @enum {string} */
28688
+ from: "trilho";
28689
+ };
28690
+ fine_minor?: {
28691
+ value: number;
28692
+ /** @enum {string} */
28693
+ from: "trilho";
28694
+ };
28695
+ due_date?: {
28696
+ value: string;
28697
+ /** @enum {string} */
28698
+ from: "trilho";
28699
+ };
28700
+ /** Format: date-time */
28701
+ quoted_at: string;
28702
+ };
28703
+ validation: {
28704
+ carrier_check_digits?: {
28705
+ /** @enum {string} */
28706
+ outcome: "ok" | "needs_review" | "nao_aplicavel" | "indisponivel";
28707
+ detail?: string;
28708
+ };
28709
+ document_check_digits?: {
28710
+ /** @enum {string} */
28711
+ outcome: "ok" | "needs_review" | "nao_aplicavel" | "indisponivel";
28712
+ detail?: string;
28713
+ };
28714
+ nfe_key_consistency?: {
28715
+ /** @enum {string} */
28716
+ outcome: "ok" | "needs_review" | "nao_aplicavel" | "indisponivel";
28717
+ detail?: string;
28718
+ };
28719
+ arithmetic?: {
28720
+ /** @enum {string} */
28721
+ outcome: "ok" | "needs_review" | "nao_aplicavel" | "indisponivel";
28722
+ detail?: string;
28723
+ };
28724
+ duplicate_document?: {
28725
+ /** @enum {string} */
28726
+ outcome: "ok" | "needs_review" | "nao_aplicavel" | "indisponivel";
28727
+ detail?: string;
28728
+ };
28729
+ amount_matches_rail?: {
28730
+ /** @enum {string} */
28731
+ outcome: "ok" | "needs_review" | "nao_aplicavel" | "indisponivel";
28732
+ detail?: string;
28733
+ };
28734
+ beneficiary_document_matches_supplier?: {
28735
+ /** @enum {string} */
28736
+ outcome: "ok" | "needs_review" | "nao_aplicavel" | "indisponivel";
28737
+ detail?: string;
28738
+ };
28739
+ due_date_state?: {
28740
+ /** @enum {string} */
28741
+ outcome: "ok" | "needs_review" | "nao_aplicavel" | "indisponivel";
28742
+ detail?: string;
28743
+ };
28744
+ pix_key_owner_matches_supplier?: {
28745
+ /** @enum {string} */
28746
+ outcome: "ok" | "needs_review" | "nao_aplicavel" | "indisponivel";
28747
+ detail?: string;
28748
+ };
28749
+ supplier_registry?: {
28750
+ /** @enum {string} */
28751
+ outcome: "ok" | "needs_review" | "nao_aplicavel" | "indisponivel";
28752
+ detail?: string;
28753
+ };
28754
+ bank_details_changed?: {
28755
+ /** @enum {string} */
28756
+ outcome: "ok" | "needs_review" | "nao_aplicavel" | "indisponivel";
28757
+ detail?: string;
28758
+ };
28759
+ };
28760
+ review: {
28761
+ /**
28762
+ * @description What the checks alone say. `status` adds the §9 triggers to it.
28763
+ * @enum {string}
28764
+ */
28765
+ validation_status: "REJECTED" | "NEEDS_REVIEW" | "VALIDATING" | "VALIDATED";
28766
+ /** @description Each check that sends the payable to a person, and why: it failed, it is implemented and did not answer, or it is required and nothing implements it yet. */
28767
+ review_by: {
28768
+ code: string;
28769
+ /** @enum {string} */
28770
+ cause: "check_failed" | "retries_exhausted" | "required_not_implemented";
28771
+ }[];
28772
+ /** @description Checks whose failure rejects the payable. */
28773
+ rejected_by: string[];
28774
+ /** @description Checks that failed and stopped blocking because a person confirmed the rail's beneficiary (§6). The check still fails; what changed is that somebody took responsibility for it. */
28775
+ confirmed_by: string[];
28776
+ /** @description Required, implemented checks that did not answer and may be retried. */
28777
+ awaiting: string[];
28778
+ /** @description Checks that did not run and do not block READY in this release. */
28779
+ not_covered: string[];
28780
+ /** @description §9 triggers that keep a VALIDATED payable out of READY, such as `new_supplier`. The evidence trigger names the field and the gap: `critical_field_without_evidence:<field>:<missing|unverified|unverifiable|moved>`. */
28781
+ review_triggers: string[];
28782
+ /** @description Resolutions a person recorded in a completed review (§9). Absent until one is. */
28783
+ resolutions?: {
28784
+ /** @description The §7 check this resolution answers. */
28785
+ code: string;
28786
+ /**
28787
+ * @description What the person did about it.
28788
+ * @enum {string}
28789
+ */
28790
+ resolution: "human_correction" | "reject" | "confirm_rail_beneficiary";
28791
+ /** @description ISO 8601 instant of the review. */
28792
+ at: string;
28793
+ /** @description The user who reviewed. */
28794
+ by: string;
28795
+ /**
28796
+ * @description How that identity was established.
28797
+ * @enum {string}
28798
+ */
28799
+ by_source: "verified_user_token" | "header_asserted";
28800
+ /** @description Field paths a correction changed. Paths only, never values. */
28801
+ fields?: string[];
28802
+ /** @description The rail's payee, masked, as the person confirmed it. */
28803
+ confirmed_beneficiary_document?: string;
28804
+ }[];
28805
+ };
28806
+ /** @description What paying it did (ent#1587); null until a payment was attempted. */
28807
+ payment: {
28808
+ /** @enum {string} */
28809
+ state: "awaiting_approval" | "dispatching" | "executed" | "uncertain" | "released";
28810
+ /** @description The pending approval that holds this payment, while a person decides. */
28811
+ approval_id?: string;
28812
+ /**
28813
+ * @description What the provider was asked to settle. `sandbox_fixture` only in a test project: the boleto is settled against Celcoin's sandbox fixture, not the document's line (spec v0.4 §18), and `document_amount_minor` keeps what the document's own line quoted.
28814
+ * @enum {string}
28815
+ */
28816
+ settled_against?: "document_line" | "sandbox_fixture";
28817
+ document_amount_minor?: number;
28818
+ mandate_id: string;
28819
+ /** @description Derived from the payable id, the quote and the try; never the cycle's default. */
28820
+ attempt_id: string;
28821
+ /** @description How many claims this payable has taken. Each is its own attempt. */
28822
+ tries: number;
28823
+ /** @description The rail's TRUE amount at the quote the attempt id was derived from. */
28824
+ amount_minor: number;
28825
+ /** @description SHA-256 of the quote the attempt was derived from. Never the quote. */
28826
+ quote_hash: string;
28827
+ claimed_at: string;
28828
+ /** @description The credential that asked. The key id, never the key; null on service auth. */
28829
+ key_id: string | null;
28830
+ via: string;
28831
+ executed_at?: string;
28832
+ receipt_id?: string | null;
28833
+ transaction_id?: string;
28834
+ end_to_end_id?: string | null;
28835
+ money_moved?: boolean;
28836
+ /** @description The lifecycle code the dispatch ended in when its outcome is unknown. */
28837
+ uncertain_code?: string;
28838
+ hold_entry_id?: string | null;
28839
+ /** @description The last refusal that provably moved no money, kept on release back to READY. */
28840
+ last_refusal?: {
28841
+ code: string;
28842
+ attempt_id: string;
28843
+ at: string;
28844
+ };
28845
+ } | null;
28846
+ /** @description ISO 8601 instant the payable was created. */
28847
+ created_at: string;
28848
+ /** @description ISO 8601 instant of the last change to the payable. */
28849
+ updated_at: string;
28850
+ };
28851
+ };
28852
+ };
28853
+ /** @description No payable with this id in this project. */
28854
+ 404: {
28855
+ headers: {
28856
+ [name: string]: unknown;
28857
+ };
28858
+ content: {
28859
+ "application/json": {
28860
+ error: {
28861
+ /** @enum {string} */
28862
+ code: "not_found";
28863
+ message: string;
28864
+ details?: {
28865
+ [key: string]: unknown;
28866
+ };
28867
+ };
28868
+ /** @description Echoes the `X-Request-Id` header when the request carried one. */
28869
+ request_id: string | null;
28870
+ };
28871
+ };
28872
+ };
28873
+ };
28874
+ };
28875
+ put?: never;
28876
+ post?: never;
28877
+ delete?: never;
28878
+ options?: never;
28879
+ head?: never;
28880
+ patch?: never;
28881
+ trace?: never;
28882
+ };
28883
+ "/v1/payables/{payableId}/review": {
28884
+ parameters: {
28885
+ query?: never;
28886
+ header?: never;
28887
+ path?: never;
28888
+ cookie?: never;
28889
+ };
28890
+ get?: never;
28891
+ put?: never;
28892
+ /**
28893
+ * Complete the review of a payable
28894
+ * @description A person records what they decided about a payable that is `NEEDS_REVIEW`, and the payable comes out `READY` or `REJECTED`. There is no third outcome and no partial review: a call that leaves anything blocking is refused and writes nothing, so resolve every item of `review` in one call.
28895
+ *
28896
+ * **Who may review.** A verified human. Forward the reviewer's Clerk session token in `x-codespar-user-token` on a service-auth request; that user must be an `admin` of the organization. A project API key is refused (`bearer_token_cannot_decide`): a key proves which service is calling, never which person confirmed, and the audit event names the person.
28897
+ *
28898
+ * **The ordinary review is an empty one.** `resolutions: []` releases a payable that no check failed and that only a review trigger holds — typically `new_supplier`, a supplier this project has never paid. The person is still recorded as the author.
28899
+ *
28900
+ * **One resolution per failed check.** Each names a `code` that is currently `needs_review` and one of the resolutions that code admits: the two rejecting codes (`carrier_check_digits`, `duplicate_document`) admit none, the three payee codes (`beneficiary_document_matches_supplier`, `pix_key_owner_matches_supplier`, `bank_details_changed`) admit `reject` or `confirm_rail_beneficiary`, and every other code admits `human_correction` or `reject`. A refused resolution lists what its code admits in `details.allowed`. A check that produced no answer (`indisponivel`) has no finding to resolve and is refused (`payable_check_did_not_run`) — a check that never ran is not a check that passed.
28901
+ *
28902
+ * - `human_correction` carries `corrections`, each naming a field and its corrected value. The value is stored with provenance `pessoa`; evidence and confidence of the previous value are dropped. The correction is then RE-CHECKED: the payable is validated again, the rail is consulted again, and the resolution holds only if the check now passes. It is refused otherwise (`payable_correction_did_not_resolve`).
28903
+ * - `confirm_rail_beneficiary` is the only resolution for a payee that differs from the rail's, because editing the extracted field would turn a forged beneficiary into corrected data. It carries `confirmed_beneficiary_document`: the rail's beneficiary, masked. If it is absent or is not who the rail names now, the call is refused with `payable_rail_beneficiary_unconfirmed` and `details.rail_beneficiary_document_masked` tells you who that is — send it back verbatim to confirm.
28904
+ * - `reject` ends the payable, and is sent alone. It is a decision about the payable, not the resolution of a check, so it is accepted whatever state the checks are in — a check that produced no answer included; the code it names only has to be one that admits `reject`.
28905
+ *
28906
+ * **What a correction may touch.** `issue_date`, `due_date`, `recipient.document`, `recipient.name` and the `totals.*` fields, and only when the payable already carries them. Everything that is a duplicity axis (`document_hash`, the carriers, `supplier.document`, `invoice_number`, `serie`) is outside, because it is a canonical column the duplicate check runs on, and `supplier.*` is outside for the payee reason above. A misread carrier or supplier document is re-entered as a new payable, not patched.
28907
+ *
28908
+ * Scope: `payables:write`.
28909
+ */
28910
+ post: {
28911
+ parameters: {
28912
+ query?: never;
28913
+ header?: {
28914
+ /** @description The reviewer's Clerk session token. Required: the review names its author. */
28915
+ "x-codespar-user-token"?: string;
28916
+ };
28917
+ path: {
28918
+ /** @description `pbl_` followed by 16 characters. */
28919
+ payableId: string;
28920
+ };
28921
+ cookie?: never;
28922
+ };
28923
+ requestBody?: {
28924
+ content: {
28925
+ "application/json": {
28926
+ /** @default [] */
28927
+ resolutions?: {
28928
+ /** @enum {string} */
28929
+ code: "carrier_check_digits" | "document_check_digits" | "nfe_key_consistency" | "arithmetic" | "duplicate_document" | "amount_matches_rail" | "beneficiary_document_matches_supplier" | "due_date_state" | "pix_key_owner_matches_supplier" | "supplier_registry" | "bank_details_changed";
28930
+ /** @enum {string} */
28931
+ resolution: "human_correction" | "reject" | "confirm_rail_beneficiary";
28932
+ corrections?: {
28933
+ /** @enum {string} */
28934
+ field: "issue_date" | "due_date" | "recipient.document" | "recipient.name" | "totals.subtotal_minor" | "totals.discount_minor" | "totals.tax_relief_deducted_minor" | "totals.freight_minor" | "totals.insurance_minor" | "totals.other_charges_minor" | "totals.taxes_added_minor" | "totals.taxes_included_minor" | "totals.grand_total_minor" | "totals.currency";
28935
+ value: string | number;
28936
+ }[];
28937
+ confirmed_beneficiary_document?: string;
28938
+ }[];
28939
+ };
28940
+ };
28941
+ };
28942
+ responses: {
28943
+ /** @description OK */
28944
+ 200: {
28945
+ headers: {
28946
+ [name: string]: unknown;
28947
+ };
28948
+ content: {
28949
+ "application/json": {
28950
+ /** @enum {string} */
28951
+ schema_version: "payable.v1";
28952
+ /** @enum {string} */
28953
+ doc_type: "invoice" | "danfe_nfe" | "boleto" | "unknown";
28954
+ attribution: {
28955
+ /** @enum {string} */
28956
+ channel: "upload" | "structured" | "manual";
28957
+ credential_id?: string;
28958
+ connection_id?: string;
28959
+ actor?: string;
28960
+ };
28961
+ document_hash?: string;
28962
+ supplier: {
28963
+ document?: {
28964
+ value: string;
28965
+ /** @enum {string} */
28966
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
28967
+ evidence?: {
28968
+ page: number;
28969
+ excerpt: string;
28970
+ /** @enum {string} */
28971
+ verification?: "verified" | "moved" | "unverifiable";
28972
+ };
28973
+ confidence?: number;
28974
+ };
28975
+ name: {
28976
+ value: string;
28977
+ /** @enum {string} */
28978
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
28979
+ evidence?: {
28980
+ page: number;
28981
+ excerpt: string;
28982
+ /** @enum {string} */
28983
+ verification?: "verified" | "moved" | "unverifiable";
28984
+ };
28985
+ confidence?: number;
28986
+ };
28987
+ };
28988
+ recipient?: {
28989
+ document?: {
28990
+ value: string;
28991
+ /** @enum {string} */
28992
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
28993
+ evidence?: {
28994
+ page: number;
28995
+ excerpt: string;
28996
+ /** @enum {string} */
28997
+ verification?: "verified" | "moved" | "unverifiable";
28998
+ };
28999
+ confidence?: number;
29000
+ };
29001
+ name: {
29002
+ value: string;
29003
+ /** @enum {string} */
29004
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
29005
+ evidence?: {
29006
+ page: number;
29007
+ excerpt: string;
29008
+ /** @enum {string} */
29009
+ verification?: "verified" | "moved" | "unverifiable";
29010
+ };
29011
+ confidence?: number;
29012
+ };
29013
+ };
29014
+ invoice_number?: {
29015
+ value: string;
29016
+ /** @enum {string} */
29017
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
29018
+ evidence?: {
29019
+ page: number;
29020
+ excerpt: string;
29021
+ /** @enum {string} */
29022
+ verification?: "verified" | "moved" | "unverifiable";
29023
+ };
29024
+ confidence?: number;
29025
+ };
29026
+ serie?: {
29027
+ value: string;
29028
+ /** @enum {string} */
29029
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
29030
+ evidence?: {
29031
+ page: number;
29032
+ excerpt: string;
29033
+ /** @enum {string} */
29034
+ verification?: "verified" | "moved" | "unverifiable";
29035
+ };
29036
+ confidence?: number;
29037
+ };
29038
+ issue_date?: {
29039
+ value: string;
29040
+ /** @enum {string} */
29041
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
29042
+ evidence?: {
29043
+ page: number;
29044
+ excerpt: string;
29045
+ /** @enum {string} */
29046
+ verification?: "verified" | "moved" | "unverifiable";
29047
+ };
29048
+ confidence?: number;
29049
+ };
29050
+ due_date?: {
29051
+ value: string;
29052
+ /** @enum {string} */
29053
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
29054
+ evidence?: {
29055
+ page: number;
29056
+ excerpt: string;
29057
+ /** @enum {string} */
29058
+ verification?: "verified" | "moved" | "unverifiable";
29059
+ };
29060
+ confidence?: number;
29061
+ };
29062
+ items?: {
29063
+ description: {
29064
+ value: string;
29065
+ /** @enum {string} */
29066
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
29067
+ evidence?: {
29068
+ page: number;
29069
+ excerpt: string;
29070
+ /** @enum {string} */
29071
+ verification?: "verified" | "moved" | "unverifiable";
29072
+ };
29073
+ confidence?: number;
29074
+ };
29075
+ quantity: {
29076
+ value: number;
29077
+ /** @enum {string} */
29078
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
29079
+ evidence?: {
29080
+ page: number;
29081
+ excerpt: string;
29082
+ /** @enum {string} */
29083
+ verification?: "verified" | "moved" | "unverifiable";
29084
+ };
29085
+ confidence?: number;
29086
+ };
29087
+ unit_amount_minor: {
29088
+ value: number;
29089
+ /** @enum {string} */
29090
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
29091
+ evidence?: {
29092
+ page: number;
29093
+ excerpt: string;
29094
+ /** @enum {string} */
29095
+ verification?: "verified" | "moved" | "unverifiable";
29096
+ };
29097
+ confidence?: number;
29098
+ };
29099
+ total_amount_minor: {
29100
+ value: number;
29101
+ /** @enum {string} */
29102
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
29103
+ evidence?: {
29104
+ page: number;
29105
+ excerpt: string;
29106
+ /** @enum {string} */
29107
+ verification?: "verified" | "moved" | "unverifiable";
29108
+ };
29109
+ confidence?: number;
29110
+ };
29111
+ }[];
29112
+ totals: {
29113
+ subtotal_minor?: {
29114
+ value: number;
29115
+ /** @enum {string} */
29116
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
29117
+ evidence?: {
29118
+ page: number;
29119
+ excerpt: string;
29120
+ /** @enum {string} */
29121
+ verification?: "verified" | "moved" | "unverifiable";
29122
+ };
29123
+ confidence?: number;
29124
+ };
29125
+ discount_minor?: {
29126
+ value: number;
29127
+ /** @enum {string} */
29128
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
29129
+ evidence?: {
29130
+ page: number;
29131
+ excerpt: string;
29132
+ /** @enum {string} */
29133
+ verification?: "verified" | "moved" | "unverifiable";
29134
+ };
29135
+ confidence?: number;
29136
+ };
29137
+ tax_relief_deducted_minor?: {
29138
+ value: number;
29139
+ /** @enum {string} */
29140
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
29141
+ evidence?: {
29142
+ page: number;
29143
+ excerpt: string;
29144
+ /** @enum {string} */
29145
+ verification?: "verified" | "moved" | "unverifiable";
29146
+ };
29147
+ confidence?: number;
29148
+ };
29149
+ freight_minor?: {
29150
+ value: number;
29151
+ /** @enum {string} */
29152
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
29153
+ evidence?: {
29154
+ page: number;
29155
+ excerpt: string;
29156
+ /** @enum {string} */
29157
+ verification?: "verified" | "moved" | "unverifiable";
29158
+ };
29159
+ confidence?: number;
29160
+ };
29161
+ insurance_minor?: {
29162
+ value: number;
29163
+ /** @enum {string} */
29164
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
29165
+ evidence?: {
29166
+ page: number;
29167
+ excerpt: string;
29168
+ /** @enum {string} */
29169
+ verification?: "verified" | "moved" | "unverifiable";
29170
+ };
29171
+ confidence?: number;
29172
+ };
29173
+ other_charges_minor?: {
29174
+ value: number;
29175
+ /** @enum {string} */
29176
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
29177
+ evidence?: {
29178
+ page: number;
29179
+ excerpt: string;
29180
+ /** @enum {string} */
29181
+ verification?: "verified" | "moved" | "unverifiable";
29182
+ };
29183
+ confidence?: number;
29184
+ };
29185
+ taxes_added_minor?: {
29186
+ value: number;
29187
+ /** @enum {string} */
29188
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
29189
+ evidence?: {
29190
+ page: number;
29191
+ excerpt: string;
29192
+ /** @enum {string} */
29193
+ verification?: "verified" | "moved" | "unverifiable";
29194
+ };
29195
+ confidence?: number;
29196
+ };
29197
+ taxes_included_minor?: {
29198
+ value: number;
29199
+ /** @enum {string} */
29200
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
29201
+ evidence?: {
29202
+ page: number;
29203
+ excerpt: string;
29204
+ /** @enum {string} */
29205
+ verification?: "verified" | "moved" | "unverifiable";
29206
+ };
29207
+ confidence?: number;
29208
+ };
29209
+ grand_total_minor: {
29210
+ value: number;
29211
+ /** @enum {string} */
29212
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
29213
+ evidence?: {
29214
+ page: number;
29215
+ excerpt: string;
29216
+ /** @enum {string} */
29217
+ verification?: "verified" | "moved" | "unverifiable";
29218
+ };
29219
+ confidence?: number;
29220
+ };
29221
+ currency: {
29222
+ value: string;
29223
+ /** @enum {string} */
29224
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
29225
+ evidence?: {
29226
+ page: number;
29227
+ excerpt: string;
29228
+ /** @enum {string} */
29229
+ verification?: "verified" | "moved" | "unverifiable";
29230
+ };
29231
+ confidence?: number;
29232
+ };
29233
+ };
29234
+ carriers?: {
29235
+ boleto?: string;
29236
+ br_code?: string;
29237
+ nfe?: string;
29238
+ };
29239
+ extraction?: {
29240
+ model: string;
29241
+ model_version: string;
29242
+ input_tokens: number;
29243
+ output_tokens: number;
29244
+ reasoning_tokens?: number;
29245
+ };
29246
+ payable_id: string;
29247
+ /** @enum {string} */
29248
+ status: "RECEIVED" | "EXTRACTING" | "EXTRACTED" | "VALIDATING" | "VALIDATED" | "NEEDS_REVIEW" | "READY" | "APPROVED" | "EXECUTED" | "REJECTED" | "FAILED_EXTRACTION" | "EXPIRED";
29249
+ rail_quote?: {
29250
+ beneficiary: {
29251
+ value: string;
29252
+ /** @enum {string} */
29253
+ from: "trilho";
29254
+ };
29255
+ beneficiary_document_masked: {
29256
+ value: string;
29257
+ /** @enum {string} */
29258
+ from: "trilho";
29259
+ };
29260
+ final_beneficiary?: {
29261
+ value: string;
29262
+ /** @enum {string} */
29263
+ from: "trilho";
29264
+ };
29265
+ final_beneficiary_document_masked?: {
29266
+ value: string;
29267
+ /** @enum {string} */
29268
+ from: "trilho";
29269
+ };
29270
+ amount_minor: {
29271
+ value: number;
29272
+ /** @enum {string} */
29273
+ from: "trilho";
29274
+ };
29275
+ discount_minor?: {
29276
+ value: number;
29277
+ /** @enum {string} */
29278
+ from: "trilho";
29279
+ };
29280
+ interest_minor?: {
29281
+ value: number;
29282
+ /** @enum {string} */
29283
+ from: "trilho";
29284
+ };
29285
+ fine_minor?: {
29286
+ value: number;
29287
+ /** @enum {string} */
29288
+ from: "trilho";
29289
+ };
29290
+ due_date?: {
29291
+ value: string;
29292
+ /** @enum {string} */
29293
+ from: "trilho";
29294
+ };
29295
+ /** Format: date-time */
29296
+ quoted_at: string;
29297
+ };
29298
+ validation: {
29299
+ carrier_check_digits?: {
29300
+ /** @enum {string} */
29301
+ outcome: "ok" | "needs_review" | "nao_aplicavel" | "indisponivel";
29302
+ detail?: string;
29303
+ };
29304
+ document_check_digits?: {
29305
+ /** @enum {string} */
29306
+ outcome: "ok" | "needs_review" | "nao_aplicavel" | "indisponivel";
29307
+ detail?: string;
29308
+ };
29309
+ nfe_key_consistency?: {
29310
+ /** @enum {string} */
29311
+ outcome: "ok" | "needs_review" | "nao_aplicavel" | "indisponivel";
29312
+ detail?: string;
29313
+ };
29314
+ arithmetic?: {
29315
+ /** @enum {string} */
29316
+ outcome: "ok" | "needs_review" | "nao_aplicavel" | "indisponivel";
29317
+ detail?: string;
29318
+ };
29319
+ duplicate_document?: {
29320
+ /** @enum {string} */
29321
+ outcome: "ok" | "needs_review" | "nao_aplicavel" | "indisponivel";
29322
+ detail?: string;
29323
+ };
29324
+ amount_matches_rail?: {
29325
+ /** @enum {string} */
29326
+ outcome: "ok" | "needs_review" | "nao_aplicavel" | "indisponivel";
29327
+ detail?: string;
29328
+ };
29329
+ beneficiary_document_matches_supplier?: {
29330
+ /** @enum {string} */
29331
+ outcome: "ok" | "needs_review" | "nao_aplicavel" | "indisponivel";
29332
+ detail?: string;
29333
+ };
29334
+ due_date_state?: {
29335
+ /** @enum {string} */
29336
+ outcome: "ok" | "needs_review" | "nao_aplicavel" | "indisponivel";
29337
+ detail?: string;
29338
+ };
29339
+ pix_key_owner_matches_supplier?: {
29340
+ /** @enum {string} */
29341
+ outcome: "ok" | "needs_review" | "nao_aplicavel" | "indisponivel";
29342
+ detail?: string;
29343
+ };
29344
+ supplier_registry?: {
29345
+ /** @enum {string} */
29346
+ outcome: "ok" | "needs_review" | "nao_aplicavel" | "indisponivel";
29347
+ detail?: string;
29348
+ };
29349
+ bank_details_changed?: {
29350
+ /** @enum {string} */
29351
+ outcome: "ok" | "needs_review" | "nao_aplicavel" | "indisponivel";
29352
+ detail?: string;
29353
+ };
29354
+ };
29355
+ review: {
29356
+ /**
29357
+ * @description What the checks alone say. `status` adds the §9 triggers to it.
29358
+ * @enum {string}
29359
+ */
29360
+ validation_status: "REJECTED" | "NEEDS_REVIEW" | "VALIDATING" | "VALIDATED";
29361
+ /** @description Each check that sends the payable to a person, and why: it failed, it is implemented and did not answer, or it is required and nothing implements it yet. */
29362
+ review_by: {
29363
+ code: string;
29364
+ /** @enum {string} */
29365
+ cause: "check_failed" | "retries_exhausted" | "required_not_implemented";
29366
+ }[];
29367
+ /** @description Checks whose failure rejects the payable. */
29368
+ rejected_by: string[];
29369
+ /** @description Checks that failed and stopped blocking because a person confirmed the rail's beneficiary (§6). The check still fails; what changed is that somebody took responsibility for it. */
29370
+ confirmed_by: string[];
29371
+ /** @description Required, implemented checks that did not answer and may be retried. */
29372
+ awaiting: string[];
29373
+ /** @description Checks that did not run and do not block READY in this release. */
29374
+ not_covered: string[];
29375
+ /** @description §9 triggers that keep a VALIDATED payable out of READY, such as `new_supplier`. The evidence trigger names the field and the gap: `critical_field_without_evidence:<field>:<missing|unverified|unverifiable|moved>`. */
29376
+ review_triggers: string[];
29377
+ /** @description Resolutions a person recorded in a completed review (§9). Absent until one is. */
29378
+ resolutions?: {
29379
+ /** @description The §7 check this resolution answers. */
29380
+ code: string;
29381
+ /**
29382
+ * @description What the person did about it.
29383
+ * @enum {string}
29384
+ */
29385
+ resolution: "human_correction" | "reject" | "confirm_rail_beneficiary";
29386
+ /** @description ISO 8601 instant of the review. */
29387
+ at: string;
29388
+ /** @description The user who reviewed. */
29389
+ by: string;
29390
+ /**
29391
+ * @description How that identity was established.
29392
+ * @enum {string}
29393
+ */
29394
+ by_source: "verified_user_token" | "header_asserted";
29395
+ /** @description Field paths a correction changed. Paths only, never values. */
29396
+ fields?: string[];
29397
+ /** @description The rail's payee, masked, as the person confirmed it. */
29398
+ confirmed_beneficiary_document?: string;
29399
+ }[];
29400
+ };
29401
+ /** @description What paying it did (ent#1587); null until a payment was attempted. */
29402
+ payment: {
29403
+ /** @enum {string} */
29404
+ state: "awaiting_approval" | "dispatching" | "executed" | "uncertain" | "released";
29405
+ /** @description The pending approval that holds this payment, while a person decides. */
29406
+ approval_id?: string;
29407
+ /**
29408
+ * @description What the provider was asked to settle. `sandbox_fixture` only in a test project: the boleto is settled against Celcoin's sandbox fixture, not the document's line (spec v0.4 §18), and `document_amount_minor` keeps what the document's own line quoted.
29409
+ * @enum {string}
29410
+ */
29411
+ settled_against?: "document_line" | "sandbox_fixture";
29412
+ document_amount_minor?: number;
29413
+ mandate_id: string;
29414
+ /** @description Derived from the payable id, the quote and the try; never the cycle's default. */
29415
+ attempt_id: string;
29416
+ /** @description How many claims this payable has taken. Each is its own attempt. */
29417
+ tries: number;
29418
+ /** @description The rail's TRUE amount at the quote the attempt id was derived from. */
29419
+ amount_minor: number;
29420
+ /** @description SHA-256 of the quote the attempt was derived from. Never the quote. */
29421
+ quote_hash: string;
29422
+ claimed_at: string;
29423
+ /** @description The credential that asked. The key id, never the key; null on service auth. */
29424
+ key_id: string | null;
29425
+ via: string;
29426
+ executed_at?: string;
29427
+ receipt_id?: string | null;
29428
+ transaction_id?: string;
29429
+ end_to_end_id?: string | null;
29430
+ money_moved?: boolean;
29431
+ /** @description The lifecycle code the dispatch ended in when its outcome is unknown. */
29432
+ uncertain_code?: string;
29433
+ hold_entry_id?: string | null;
29434
+ /** @description The last refusal that provably moved no money, kept on release back to READY. */
29435
+ last_refusal?: {
29436
+ code: string;
29437
+ attempt_id: string;
29438
+ at: string;
29439
+ };
29440
+ } | null;
29441
+ /** @description ISO 8601 instant the payable was created. */
29442
+ created_at: string;
29443
+ /** @description ISO 8601 instant of the last change to the payable. */
29444
+ updated_at: string;
29445
+ };
29446
+ };
29447
+ };
29448
+ /** @description The body did not match the review schema. */
29449
+ 400: {
29450
+ headers: {
29451
+ [name: string]: unknown;
29452
+ };
29453
+ content: {
29454
+ "application/json": {
29455
+ error: {
29456
+ /** @enum {string} */
29457
+ code: "invalid_body";
29458
+ message: string;
29459
+ details?: {
29460
+ [key: string]: unknown;
29461
+ };
29462
+ };
29463
+ /** @description Echoes the `X-Request-Id` header when the request carried one. */
29464
+ request_id: string | null;
29465
+ };
29466
+ };
29467
+ };
29468
+ /** @description The reviewer was not established. `bearer_token_cannot_decide`: a project API key cannot review. `user_token_required`: no token was forwarded. `user_token_invalid`: the token did not verify — mint a fresh one. `user_token_identity_mismatch`: `x-codespar-user` names somebody else. `insufficient_role`: that user is not an admin of the organization. */
29469
+ 403: {
29470
+ headers: {
29471
+ [name: string]: unknown;
29472
+ };
29473
+ content: {
29474
+ "application/json": {
29475
+ error: {
29476
+ /** @enum {string} */
29477
+ code: "bearer_token_cannot_decide" | "user_token_required" | "user_token_invalid" | "user_token_identity_mismatch" | "insufficient_role";
29478
+ message: string;
29479
+ details?: {
29480
+ [key: string]: unknown;
29481
+ };
29482
+ };
29483
+ /** @description Echoes the `X-Request-Id` header when the request carried one. */
29484
+ request_id: string | null;
29485
+ };
29486
+ };
29487
+ };
29488
+ /** @description No payable with this id in this project. */
29489
+ 404: {
29490
+ headers: {
29491
+ [name: string]: unknown;
29492
+ };
29493
+ content: {
29494
+ "application/json": {
29495
+ error: {
29496
+ /** @enum {string} */
29497
+ code: "not_found";
29498
+ message: string;
29499
+ details?: {
29500
+ [key: string]: unknown;
29501
+ };
29502
+ };
29503
+ /** @description Echoes the `X-Request-Id` header when the request carried one. */
29504
+ request_id: string | null;
29505
+ };
29506
+ };
29507
+ };
29508
+ /** @description Nothing was written. `payable_not_reviewable`: the payable is not `NEEDS_REVIEW`. `payable_correction_did_not_resolve`: the corrections were applied and `details.code` still does not pass. `payable_rail_beneficiary_unconfirmed`: the confirmation named nobody, or not who the rail names now; `details.rail_beneficiary_document_masked` names who. `payable_review_incomplete`: something still blocks the payable; `details.review` says what. `payable_review_conflict`: the payable changed while this review was being decided. */
29509
+ 409: {
29510
+ headers: {
29511
+ [name: string]: unknown;
29512
+ };
29513
+ content: {
29514
+ "application/json": {
29515
+ error: {
29516
+ /** @enum {string} */
29517
+ code: "payable_not_reviewable" | "payable_correction_did_not_resolve" | "payable_rail_beneficiary_unconfirmed" | "payable_review_incomplete" | "payable_review_conflict";
29518
+ message: string;
29519
+ details?: {
29520
+ [key: string]: unknown;
29521
+ };
29522
+ };
29523
+ /** @description Echoes the `X-Request-Id` header when the request carried one. */
29524
+ request_id: string | null;
29525
+ };
29526
+ };
29527
+ };
29528
+ /** @description The review itself is malformed. `payable_check_not_in_review`: that check did not fail. `payable_check_did_not_run`: that check produced no answer. `payable_resolution_not_allowed`: that check does not admit that resolution; `details.allowed` lists what it does. `payable_resolution_repeated`: one code, one resolution. `payable_resolution_conflict`: a rejection resolves nothing else. `payable_field_not_correctable`: that field is not corrected in a review, or the payable does not carry it. `payable_correction_invalid`: the corrected payable no longer matches the schema. */
29529
+ 422: {
29530
+ headers: {
29531
+ [name: string]: unknown;
29532
+ };
29533
+ content: {
29534
+ "application/json": {
29535
+ error: {
29536
+ /** @enum {string} */
29537
+ code: "payable_check_not_in_review" | "payable_check_did_not_run" | "payable_resolution_not_allowed" | "payable_resolution_repeated" | "payable_resolution_conflict" | "payable_field_not_correctable" | "payable_correction_invalid";
29538
+ message: string;
29539
+ details?: {
29540
+ [key: string]: unknown;
29541
+ };
29542
+ };
29543
+ /** @description Echoes the `X-Request-Id` header when the request carried one. */
29544
+ request_id: string | null;
29545
+ };
29546
+ };
29547
+ };
29548
+ /** @description `vault_unavailable`: the key that protects supplier documents could not be read. `user_token_verification_unconfigured`: this deployment cannot verify a reviewer's token. Nothing was written either way. */
29549
+ 503: {
29550
+ headers: {
29551
+ [name: string]: unknown;
29552
+ };
29553
+ content: {
29554
+ "application/json": {
29555
+ error: {
29556
+ /** @enum {string} */
29557
+ code: "vault_unavailable" | "user_token_verification_unconfigured";
29558
+ message: string;
29559
+ details?: {
29560
+ [key: string]: unknown;
29561
+ };
29562
+ };
29563
+ /** @description Echoes the `X-Request-Id` header when the request carried one. */
29564
+ request_id: string | null;
29565
+ };
29566
+ };
29567
+ };
29568
+ };
29569
+ };
29570
+ delete?: never;
29571
+ options?: never;
29572
+ head?: never;
29573
+ patch?: never;
29574
+ trace?: never;
29575
+ };
29576
+ "/v1/payables/{payableId}/pay": {
29577
+ parameters: {
29578
+ query?: never;
29579
+ header?: never;
29580
+ path?: never;
29581
+ cookie?: never;
29582
+ };
29583
+ get?: never;
29584
+ put?: never;
29585
+ /**
29586
+ * Pay a payable under a consumer mandate
29587
+ * @description Pays a `READY` payable through the governed consumer-payment cycle — mandate HMAC verification, policy, cap under lock, hold, dispatch with uncertainty classification and a sealed receipt — and moves it to `EXECUTED`. Only a boleto is paid in this wave.
29588
+ *
29589
+ * **The rail is consulted again first.** The stored quote may have aged, so the eleven checks re-run over a fresh consult, with the review's confirmations standing. If that verdict no longer allows paying, nothing is dispatched: the payable goes back to `NEEDS_REVIEW` with the new verdict and the call answers `payable_quote_diverged`. READY is derived from a verdict, never assumed from the row.
29590
+ *
29591
+ * **The attempt id is derived**, from the payable id and the fresh quote (`payment.attempt_id`). The same quote is the same attempt — a retry lands on the same hold, the same provider anchor and the same receipt — and a different quote is a different attempt, which is why the payable leaves READY before money moves.
29592
+ *
29593
+ * **What the outcome does to the payable.** Success: `EXECUTED`, `payment.state = executed`, with `receipt_id`, `transaction_id` and `end_to_end_id`; the response also carries `receipt`. A refusal that provably moved no money (policy, cap, allowlist, funds, `boleto_amount_mismatch`): the payable is `READY` again with `payment.last_refusal`. A dispatch whose outcome is unknown (`psp_dispatch_uncertain`, `psp_attempt_uncertain`, `payable_dispatch_unknown`): the payable stays `APPROVED` with `payment.state = uncertain`, pinned for reconciliation — do not resubmit it, under this payable or another; a later call answers `payable_payment_uncertain`.
29594
+ *
29595
+ * **The receipt carries the document hash.** Its delivery proof is a `merchant_document_ref` of kind `payable` whose reference is `payable:<id>;sha256:<document_hash>` (the hash part only when the payable has one), covered by the receipt's chain: document → mandate → payment → receipt verifies offline.
29596
+ *
29597
+ * **A policy approval holds the payable.** When the durable policy engine routes the spend to a person (403 `policy_denied` with `approval_id`), the payable leaves READY under that approval (`payment.state = awaiting_approval`, `payment.approval_id`); `/pay` answers `payable_payment_pending_approval` until it is decided. The approved execution pays the attempt and records the outcome on the payable; a denied or expired approval is released by the next `/pay`, which asks the gate again.
29598
+ *
29599
+ * **Test projects settle the sandbox fixture.** A boleto in a test project is settled against Celcoin's sandbox fixture, not the document's line (spec §18): `payment.settled_against = sandbox_fixture`, `payment.document_amount_minor` keeps what the document quoted, and the receipt's delivery reference ends in `;settled_against:sandbox_fixture`. Live projects are untouched.
29600
+ *
29601
+ * Scope: `payables:pay`. The mandate must be one of this organization's consumers' and its `merchant_allowlist` must name the boleto's digitable line.
29602
+ */
29603
+ post: {
29604
+ parameters: {
29605
+ query?: never;
29606
+ header?: never;
29607
+ path: {
29608
+ /** @description `pbl_` followed by 16 characters. */
29609
+ payableId: string;
29610
+ };
29611
+ cookie?: never;
29612
+ };
29613
+ requestBody?: {
29614
+ content: {
29615
+ "application/json": {
29616
+ mandate_id: string;
29617
+ };
29618
+ };
29619
+ };
29620
+ responses: {
29621
+ /** @description OK */
29622
+ 200: {
29623
+ headers: {
29624
+ [name: string]: unknown;
29625
+ };
29626
+ content: {
29627
+ "application/json": {
29628
+ /** @enum {string} */
29629
+ schema_version: "payable.v1";
29630
+ /** @enum {string} */
29631
+ doc_type: "invoice" | "danfe_nfe" | "boleto" | "unknown";
29632
+ attribution: {
29633
+ /** @enum {string} */
29634
+ channel: "upload" | "structured" | "manual";
29635
+ credential_id?: string;
29636
+ connection_id?: string;
29637
+ actor?: string;
29638
+ };
29639
+ document_hash?: string;
29640
+ supplier: {
29641
+ document?: {
29642
+ value: string;
29643
+ /** @enum {string} */
29644
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
29645
+ evidence?: {
29646
+ page: number;
29647
+ excerpt: string;
29648
+ /** @enum {string} */
29649
+ verification?: "verified" | "moved" | "unverifiable";
29650
+ };
29651
+ confidence?: number;
29652
+ };
29653
+ name: {
29654
+ value: string;
29655
+ /** @enum {string} */
29656
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
29657
+ evidence?: {
29658
+ page: number;
29659
+ excerpt: string;
29660
+ /** @enum {string} */
29661
+ verification?: "verified" | "moved" | "unverifiable";
29662
+ };
29663
+ confidence?: number;
29664
+ };
29665
+ };
29666
+ recipient?: {
29667
+ document?: {
29668
+ value: string;
29669
+ /** @enum {string} */
29670
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
29671
+ evidence?: {
29672
+ page: number;
29673
+ excerpt: string;
29674
+ /** @enum {string} */
29675
+ verification?: "verified" | "moved" | "unverifiable";
29676
+ };
29677
+ confidence?: number;
29678
+ };
29679
+ name: {
29680
+ value: string;
29681
+ /** @enum {string} */
29682
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
29683
+ evidence?: {
29684
+ page: number;
29685
+ excerpt: string;
29686
+ /** @enum {string} */
29687
+ verification?: "verified" | "moved" | "unverifiable";
29688
+ };
29689
+ confidence?: number;
29690
+ };
29691
+ };
29692
+ invoice_number?: {
29693
+ value: string;
29694
+ /** @enum {string} */
29695
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
29696
+ evidence?: {
29697
+ page: number;
29698
+ excerpt: string;
29699
+ /** @enum {string} */
29700
+ verification?: "verified" | "moved" | "unverifiable";
29701
+ };
29702
+ confidence?: number;
29703
+ };
29704
+ serie?: {
29705
+ value: string;
29706
+ /** @enum {string} */
29707
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
29708
+ evidence?: {
29709
+ page: number;
29710
+ excerpt: string;
29711
+ /** @enum {string} */
29712
+ verification?: "verified" | "moved" | "unverifiable";
29713
+ };
29714
+ confidence?: number;
29715
+ };
29716
+ issue_date?: {
29717
+ value: string;
29718
+ /** @enum {string} */
29719
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
29720
+ evidence?: {
29721
+ page: number;
29722
+ excerpt: string;
29723
+ /** @enum {string} */
29724
+ verification?: "verified" | "moved" | "unverifiable";
29725
+ };
29726
+ confidence?: number;
29727
+ };
29728
+ due_date?: {
29729
+ value: string;
29730
+ /** @enum {string} */
29731
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
29732
+ evidence?: {
29733
+ page: number;
29734
+ excerpt: string;
29735
+ /** @enum {string} */
29736
+ verification?: "verified" | "moved" | "unverifiable";
29737
+ };
29738
+ confidence?: number;
29739
+ };
29740
+ items?: {
29741
+ description: {
29742
+ value: string;
29743
+ /** @enum {string} */
29744
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
29745
+ evidence?: {
29746
+ page: number;
29747
+ excerpt: string;
29748
+ /** @enum {string} */
29749
+ verification?: "verified" | "moved" | "unverifiable";
29750
+ };
29751
+ confidence?: number;
29752
+ };
29753
+ quantity: {
29754
+ value: number;
29755
+ /** @enum {string} */
29756
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
29757
+ evidence?: {
29758
+ page: number;
29759
+ excerpt: string;
29760
+ /** @enum {string} */
29761
+ verification?: "verified" | "moved" | "unverifiable";
29762
+ };
29763
+ confidence?: number;
29764
+ };
29765
+ unit_amount_minor: {
29766
+ value: number;
29767
+ /** @enum {string} */
29768
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
29769
+ evidence?: {
29770
+ page: number;
29771
+ excerpt: string;
29772
+ /** @enum {string} */
29773
+ verification?: "verified" | "moved" | "unverifiable";
29774
+ };
29775
+ confidence?: number;
29776
+ };
29777
+ total_amount_minor: {
29778
+ value: number;
29779
+ /** @enum {string} */
29780
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
29781
+ evidence?: {
29782
+ page: number;
29783
+ excerpt: string;
29784
+ /** @enum {string} */
29785
+ verification?: "verified" | "moved" | "unverifiable";
29786
+ };
29787
+ confidence?: number;
29788
+ };
29789
+ }[];
29790
+ totals: {
29791
+ subtotal_minor?: {
29792
+ value: number;
29793
+ /** @enum {string} */
29794
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
29795
+ evidence?: {
29796
+ page: number;
29797
+ excerpt: string;
29798
+ /** @enum {string} */
29799
+ verification?: "verified" | "moved" | "unverifiable";
29800
+ };
29801
+ confidence?: number;
29802
+ };
29803
+ discount_minor?: {
29804
+ value: number;
29805
+ /** @enum {string} */
29806
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
29807
+ evidence?: {
29808
+ page: number;
29809
+ excerpt: string;
29810
+ /** @enum {string} */
29811
+ verification?: "verified" | "moved" | "unverifiable";
29812
+ };
29813
+ confidence?: number;
29814
+ };
29815
+ tax_relief_deducted_minor?: {
29816
+ value: number;
29817
+ /** @enum {string} */
29818
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
29819
+ evidence?: {
29820
+ page: number;
29821
+ excerpt: string;
29822
+ /** @enum {string} */
29823
+ verification?: "verified" | "moved" | "unverifiable";
29824
+ };
29825
+ confidence?: number;
29826
+ };
29827
+ freight_minor?: {
29828
+ value: number;
29829
+ /** @enum {string} */
29830
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
29831
+ evidence?: {
29832
+ page: number;
29833
+ excerpt: string;
29834
+ /** @enum {string} */
29835
+ verification?: "verified" | "moved" | "unverifiable";
29836
+ };
29837
+ confidence?: number;
29838
+ };
29839
+ insurance_minor?: {
29840
+ value: number;
29841
+ /** @enum {string} */
29842
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
29843
+ evidence?: {
29844
+ page: number;
29845
+ excerpt: string;
29846
+ /** @enum {string} */
29847
+ verification?: "verified" | "moved" | "unverifiable";
29848
+ };
29849
+ confidence?: number;
29850
+ };
29851
+ other_charges_minor?: {
29852
+ value: number;
29853
+ /** @enum {string} */
29854
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
29855
+ evidence?: {
29856
+ page: number;
29857
+ excerpt: string;
29858
+ /** @enum {string} */
29859
+ verification?: "verified" | "moved" | "unverifiable";
29860
+ };
29861
+ confidence?: number;
29862
+ };
29863
+ taxes_added_minor?: {
29864
+ value: number;
29865
+ /** @enum {string} */
29866
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
29867
+ evidence?: {
29868
+ page: number;
29869
+ excerpt: string;
29870
+ /** @enum {string} */
29871
+ verification?: "verified" | "moved" | "unverifiable";
29872
+ };
29873
+ confidence?: number;
29874
+ };
29875
+ taxes_included_minor?: {
29876
+ value: number;
29877
+ /** @enum {string} */
29878
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
29879
+ evidence?: {
29880
+ page: number;
29881
+ excerpt: string;
29882
+ /** @enum {string} */
29883
+ verification?: "verified" | "moved" | "unverifiable";
29884
+ };
29885
+ confidence?: number;
29886
+ };
29887
+ grand_total_minor: {
29888
+ value: number;
29889
+ /** @enum {string} */
29890
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
29891
+ evidence?: {
29892
+ page: number;
29893
+ excerpt: string;
29894
+ /** @enum {string} */
29895
+ verification?: "verified" | "moved" | "unverifiable";
29896
+ };
29897
+ confidence?: number;
29898
+ };
29899
+ currency: {
29900
+ value: string;
29901
+ /** @enum {string} */
29902
+ from: "parser_local" | "trilho" | "modelo" | "parceiro" | "pessoa";
29903
+ evidence?: {
29904
+ page: number;
29905
+ excerpt: string;
29906
+ /** @enum {string} */
29907
+ verification?: "verified" | "moved" | "unverifiable";
29908
+ };
29909
+ confidence?: number;
29910
+ };
29911
+ };
29912
+ carriers?: {
29913
+ boleto?: string;
29914
+ br_code?: string;
29915
+ nfe?: string;
29916
+ };
29917
+ extraction?: {
29918
+ model: string;
29919
+ model_version: string;
29920
+ input_tokens: number;
29921
+ output_tokens: number;
29922
+ reasoning_tokens?: number;
29923
+ };
29924
+ payable_id: string;
29925
+ /** @enum {string} */
29926
+ status: "RECEIVED" | "EXTRACTING" | "EXTRACTED" | "VALIDATING" | "VALIDATED" | "NEEDS_REVIEW" | "READY" | "APPROVED" | "EXECUTED" | "REJECTED" | "FAILED_EXTRACTION" | "EXPIRED";
29927
+ rail_quote?: {
29928
+ beneficiary: {
29929
+ value: string;
29930
+ /** @enum {string} */
29931
+ from: "trilho";
29932
+ };
29933
+ beneficiary_document_masked: {
29934
+ value: string;
29935
+ /** @enum {string} */
29936
+ from: "trilho";
29937
+ };
29938
+ final_beneficiary?: {
29939
+ value: string;
29940
+ /** @enum {string} */
29941
+ from: "trilho";
29942
+ };
29943
+ final_beneficiary_document_masked?: {
29944
+ value: string;
29945
+ /** @enum {string} */
29946
+ from: "trilho";
29947
+ };
29948
+ amount_minor: {
29949
+ value: number;
29950
+ /** @enum {string} */
29951
+ from: "trilho";
29952
+ };
29953
+ discount_minor?: {
29954
+ value: number;
29955
+ /** @enum {string} */
29956
+ from: "trilho";
29957
+ };
29958
+ interest_minor?: {
29959
+ value: number;
29960
+ /** @enum {string} */
29961
+ from: "trilho";
29962
+ };
29963
+ fine_minor?: {
29964
+ value: number;
29965
+ /** @enum {string} */
29966
+ from: "trilho";
29967
+ };
29968
+ due_date?: {
29969
+ value: string;
29970
+ /** @enum {string} */
29971
+ from: "trilho";
29972
+ };
29973
+ /** Format: date-time */
29974
+ quoted_at: string;
29975
+ };
29976
+ validation: {
29977
+ carrier_check_digits?: {
29978
+ /** @enum {string} */
29979
+ outcome: "ok" | "needs_review" | "nao_aplicavel" | "indisponivel";
29980
+ detail?: string;
29981
+ };
29982
+ document_check_digits?: {
29983
+ /** @enum {string} */
29984
+ outcome: "ok" | "needs_review" | "nao_aplicavel" | "indisponivel";
29985
+ detail?: string;
29986
+ };
29987
+ nfe_key_consistency?: {
29988
+ /** @enum {string} */
29989
+ outcome: "ok" | "needs_review" | "nao_aplicavel" | "indisponivel";
29990
+ detail?: string;
29991
+ };
29992
+ arithmetic?: {
29993
+ /** @enum {string} */
29994
+ outcome: "ok" | "needs_review" | "nao_aplicavel" | "indisponivel";
29995
+ detail?: string;
29996
+ };
29997
+ duplicate_document?: {
29998
+ /** @enum {string} */
29999
+ outcome: "ok" | "needs_review" | "nao_aplicavel" | "indisponivel";
30000
+ detail?: string;
30001
+ };
30002
+ amount_matches_rail?: {
30003
+ /** @enum {string} */
30004
+ outcome: "ok" | "needs_review" | "nao_aplicavel" | "indisponivel";
30005
+ detail?: string;
30006
+ };
30007
+ beneficiary_document_matches_supplier?: {
30008
+ /** @enum {string} */
30009
+ outcome: "ok" | "needs_review" | "nao_aplicavel" | "indisponivel";
30010
+ detail?: string;
30011
+ };
30012
+ due_date_state?: {
30013
+ /** @enum {string} */
30014
+ outcome: "ok" | "needs_review" | "nao_aplicavel" | "indisponivel";
30015
+ detail?: string;
30016
+ };
30017
+ pix_key_owner_matches_supplier?: {
30018
+ /** @enum {string} */
30019
+ outcome: "ok" | "needs_review" | "nao_aplicavel" | "indisponivel";
30020
+ detail?: string;
30021
+ };
30022
+ supplier_registry?: {
30023
+ /** @enum {string} */
30024
+ outcome: "ok" | "needs_review" | "nao_aplicavel" | "indisponivel";
30025
+ detail?: string;
30026
+ };
30027
+ bank_details_changed?: {
30028
+ /** @enum {string} */
30029
+ outcome: "ok" | "needs_review" | "nao_aplicavel" | "indisponivel";
30030
+ detail?: string;
30031
+ };
30032
+ };
30033
+ review: {
30034
+ /**
30035
+ * @description What the checks alone say. `status` adds the §9 triggers to it.
30036
+ * @enum {string}
30037
+ */
30038
+ validation_status: "REJECTED" | "NEEDS_REVIEW" | "VALIDATING" | "VALIDATED";
30039
+ /** @description Each check that sends the payable to a person, and why: it failed, it is implemented and did not answer, or it is required and nothing implements it yet. */
30040
+ review_by: {
30041
+ code: string;
30042
+ /** @enum {string} */
30043
+ cause: "check_failed" | "retries_exhausted" | "required_not_implemented";
30044
+ }[];
30045
+ /** @description Checks whose failure rejects the payable. */
30046
+ rejected_by: string[];
30047
+ /** @description Checks that failed and stopped blocking because a person confirmed the rail's beneficiary (§6). The check still fails; what changed is that somebody took responsibility for it. */
30048
+ confirmed_by: string[];
30049
+ /** @description Required, implemented checks that did not answer and may be retried. */
30050
+ awaiting: string[];
30051
+ /** @description Checks that did not run and do not block READY in this release. */
30052
+ not_covered: string[];
30053
+ /** @description §9 triggers that keep a VALIDATED payable out of READY, such as `new_supplier`. The evidence trigger names the field and the gap: `critical_field_without_evidence:<field>:<missing|unverified|unverifiable|moved>`. */
30054
+ review_triggers: string[];
30055
+ /** @description Resolutions a person recorded in a completed review (§9). Absent until one is. */
30056
+ resolutions?: {
30057
+ /** @description The §7 check this resolution answers. */
30058
+ code: string;
30059
+ /**
30060
+ * @description What the person did about it.
30061
+ * @enum {string}
30062
+ */
30063
+ resolution: "human_correction" | "reject" | "confirm_rail_beneficiary";
30064
+ /** @description ISO 8601 instant of the review. */
30065
+ at: string;
30066
+ /** @description The user who reviewed. */
30067
+ by: string;
30068
+ /**
30069
+ * @description How that identity was established.
30070
+ * @enum {string}
30071
+ */
30072
+ by_source: "verified_user_token" | "header_asserted";
30073
+ /** @description Field paths a correction changed. Paths only, never values. */
30074
+ fields?: string[];
30075
+ /** @description The rail's payee, masked, as the person confirmed it. */
30076
+ confirmed_beneficiary_document?: string;
30077
+ }[];
30078
+ };
30079
+ /** @description What paying it did (ent#1587); null until a payment was attempted. */
30080
+ payment: {
30081
+ /** @enum {string} */
30082
+ state: "awaiting_approval" | "dispatching" | "executed" | "uncertain" | "released";
30083
+ /** @description The pending approval that holds this payment, while a person decides. */
30084
+ approval_id?: string;
30085
+ /**
30086
+ * @description What the provider was asked to settle. `sandbox_fixture` only in a test project: the boleto is settled against Celcoin's sandbox fixture, not the document's line (spec v0.4 §18), and `document_amount_minor` keeps what the document's own line quoted.
30087
+ * @enum {string}
30088
+ */
30089
+ settled_against?: "document_line" | "sandbox_fixture";
30090
+ document_amount_minor?: number;
30091
+ mandate_id: string;
30092
+ /** @description Derived from the payable id, the quote and the try; never the cycle's default. */
30093
+ attempt_id: string;
30094
+ /** @description How many claims this payable has taken. Each is its own attempt. */
30095
+ tries: number;
30096
+ /** @description The rail's TRUE amount at the quote the attempt id was derived from. */
30097
+ amount_minor: number;
30098
+ /** @description SHA-256 of the quote the attempt was derived from. Never the quote. */
30099
+ quote_hash: string;
30100
+ claimed_at: string;
30101
+ /** @description The credential that asked. The key id, never the key; null on service auth. */
30102
+ key_id: string | null;
30103
+ via: string;
30104
+ executed_at?: string;
30105
+ receipt_id?: string | null;
30106
+ transaction_id?: string;
30107
+ end_to_end_id?: string | null;
30108
+ money_moved?: boolean;
30109
+ /** @description The lifecycle code the dispatch ended in when its outcome is unknown. */
30110
+ uncertain_code?: string;
30111
+ hold_entry_id?: string | null;
30112
+ /** @description The last refusal that provably moved no money, kept on release back to READY. */
30113
+ last_refusal?: {
30114
+ code: string;
30115
+ attempt_id: string;
30116
+ at: string;
30117
+ };
30118
+ } | null;
30119
+ /** @description ISO 8601 instant the payable was created. */
30120
+ created_at: string;
30121
+ /** @description ISO 8601 instant of the last change to the payable. */
30122
+ updated_at: string;
30123
+ /** @description The sealed Control Record receipt; null when no consumer secret could sign one. */
30124
+ receipt: {
30125
+ id: string;
30126
+ /** @enum {string} */
30127
+ state: "paid" | "exception" | "delivered";
30128
+ chain: string;
30129
+ exceptions: {
30130
+ code: string;
30131
+ detail: string;
30132
+ at: string;
30133
+ }[];
30134
+ } | null;
30135
+ };
30136
+ };
30137
+ };
30138
+ /** @description The body did not match the pay schema. */
30139
+ 400: {
30140
+ headers: {
30141
+ [name: string]: unknown;
30142
+ };
30143
+ content: {
30144
+ "application/json": {
30145
+ error: {
30146
+ /** @enum {string} */
30147
+ code: "invalid_body";
30148
+ message: string;
30149
+ details?: {
30150
+ [key: string]: unknown;
30151
+ };
30152
+ };
30153
+ /** @description Echoes the `X-Request-Id` header when the request carried one. */
30154
+ request_id: string | null;
30155
+ };
30156
+ };
30157
+ };
30158
+ /** @description `policy_denied`: the durable policy engine refused (`reason`, `ruleId`; `approval_id` when it routed the spend to a person — once approved, the same attempt is paid and a later call to this route records it). `payee_not_allowed`: the mandate's allowlist does not name the boleto. */
30159
+ 403: {
30160
+ headers: {
30161
+ [name: string]: unknown;
30162
+ };
30163
+ content: {
30164
+ "application/json": {
30165
+ error: {
30166
+ /** @enum {string} */
30167
+ code: "policy_denied" | "payee_not_allowed";
30168
+ message: string;
30169
+ details?: {
30170
+ [key: string]: unknown;
30171
+ };
30172
+ };
30173
+ /** @description Echoes the `X-Request-Id` header when the request carried one. */
30174
+ request_id: string | null;
30175
+ };
30176
+ };
30177
+ };
30178
+ /** @description `not_found`: no payable with this id in this project. `mandate_not_found`: no consumer mandate with this id in this organization. */
30179
+ 404: {
30180
+ headers: {
30181
+ [name: string]: unknown;
30182
+ };
30183
+ content: {
30184
+ "application/json": {
30185
+ error: {
30186
+ /** @enum {string} */
30187
+ code: "not_found" | "mandate_not_found";
30188
+ message: string;
30189
+ details?: {
30190
+ [key: string]: unknown;
30191
+ };
30192
+ };
30193
+ /** @description Echoes the `X-Request-Id` header when the request carried one. */
30194
+ request_id: string | null;
30195
+ };
30196
+ };
30197
+ };
30198
+ /** @description `payable_not_payable`: not `READY`; `details.status` says what it is. `payable_already_paid`: `EXECUTED`; `details.receipt_id`. `payable_payment_in_flight`: a dispatch is running. `payable_payment_uncertain`: a dispatch outcome is unknown and the payable is pinned — do not resubmit. `payable_payment_pending_approval`: a person is deciding the policy approval (`details.approval_id`). `payable_quote_diverged`: the fresh verdict no longer allows paying; the payable is back in `NEEDS_REVIEW` and `details.review` says why. `payable_payment_conflict`: the row moved while this payment was planned; read it again. `boleto_amount_mismatch`: the provider's true amount moved between the fresh quote and the confirm; nothing paid, the payable is `READY`. */
30199
+ 409: {
30200
+ headers: {
30201
+ [name: string]: unknown;
30202
+ };
30203
+ content: {
30204
+ "application/json": {
30205
+ error: {
30206
+ /** @enum {string} */
30207
+ code: "payable_not_payable" | "payable_already_paid" | "payable_payment_in_flight" | "payable_payment_uncertain" | "payable_payment_pending_approval" | "payable_quote_diverged" | "payable_payment_conflict" | "boleto_amount_mismatch";
30208
+ message: string;
30209
+ details?: {
30210
+ [key: string]: unknown;
30211
+ };
30212
+ };
30213
+ /** @description Echoes the `X-Request-Id` header when the request carried one. */
30214
+ request_id: string | null;
30215
+ };
30216
+ };
30217
+ };
30218
+ /** @description `payable_rail_unsupported`: no boleto carrier to pay by. `insufficient_funds` and the mandate cap codes carry their usual consumer-payment meanings; the payable is `READY` again. */
30219
+ 422: {
30220
+ headers: {
30221
+ [name: string]: unknown;
30222
+ };
30223
+ content: {
30224
+ "application/json": {
30225
+ error: {
30226
+ /** @enum {string} */
30227
+ code: "payable_rail_unsupported" | "insufficient_funds";
30228
+ message: string;
30229
+ details?: {
30230
+ [key: string]: unknown;
30231
+ };
30232
+ };
30233
+ /** @description Echoes the `X-Request-Id` header when the request carried one. */
30234
+ request_id: string | null;
30235
+ };
30236
+ };
30237
+ };
30238
+ /** @description The dispatch did not answer cleanly. `psp_dispatch_uncertain` / `payable_dispatch_unknown`: the outcome is unknown, the payable is `APPROVED` with `payment.state = uncertain` and held for reconciliation — do not resubmit. `psp_dispatch_failed`: the provider refused and nothing moved; the payable is `READY`. `payable_cycle_threw`: the cycle failed before any provider debit; nothing moved, the payable is `READY`, retry. */
30239
+ 502: {
30240
+ headers: {
30241
+ [name: string]: unknown;
30242
+ };
30243
+ content: {
30244
+ "application/json": {
30245
+ error: {
30246
+ /** @enum {string} */
30247
+ code: "psp_dispatch_uncertain" | "payable_dispatch_unknown" | "psp_dispatch_failed" | "payable_cycle_threw";
30248
+ message: string;
30249
+ details?: {
30250
+ [key: string]: unknown;
30251
+ };
30252
+ };
30253
+ /** @description Echoes the `X-Request-Id` header when the request carried one. */
30254
+ request_id: string | null;
30255
+ };
30256
+ };
30257
+ };
30258
+ /** @description `vault_unavailable`: the key that protects supplier documents could not be read. `policy_engine_error`: the policy engine could not evaluate; refused, nothing dispatched. `payable_sandbox_fixture_unavailable`: test project, the sandbox settlement consult did not answer; nothing dispatched, retry. */
30259
+ 503: {
30260
+ headers: {
30261
+ [name: string]: unknown;
30262
+ };
30263
+ content: {
30264
+ "application/json": {
30265
+ error: {
30266
+ /** @enum {string} */
30267
+ code: "vault_unavailable" | "policy_engine_error" | "payable_sandbox_fixture_unavailable";
30268
+ message: string;
30269
+ details?: {
30270
+ [key: string]: unknown;
30271
+ };
30272
+ };
30273
+ /** @description Echoes the `X-Request-Id` header when the request carried one. */
30274
+ request_id: string | null;
30275
+ };
30276
+ };
30277
+ };
30278
+ };
30279
+ };
27273
30280
  delete?: never;
27274
30281
  options?: never;
27275
30282
  head?: never;