@andco/protocol 0.0.9 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api-errors.d.ts +25 -12
- package/dist/api-errors.d.ts.map +1 -1
- package/dist/api-errors.js +25 -12
- package/dist/authorization.js +1 -1
- package/dist/errors.d.ts +70 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +97 -0
- package/dist/intent-input.d.ts +58 -41
- package/dist/intent-input.d.ts.map +1 -1
- package/dist/intent-input.js +38 -14
- package/dist/intent-status.d.ts +6 -1
- package/dist/intent-status.d.ts.map +1 -1
- package/dist/intent-status.js +6 -1
- package/dist/miniapp-icon.js +2 -2
- package/dist/native-intent.d.ts +18 -18
- package/dist/native-intent.d.ts.map +1 -1
- package/dist/native-intent.js +37 -7
- package/dist/rar/catalog.d.ts +11 -0
- package/dist/rar/catalog.d.ts.map +1 -1
- package/dist/rar/catalog.js +11 -0
- package/dist/transport/financial-events.d.ts +6 -3
- package/dist/transport/financial-events.d.ts.map +1 -1
- package/dist/transport/generated/oauth-api.d.ts +163 -41
- package/dist/transport/generated/oauth-api.d.ts.map +1 -1
- package/dist/transport/intents.d.ts +4 -2
- package/dist/transport/intents.d.ts.map +1 -1
- package/dist/transport/intents.js +24 -24
- package/dist/transport/rest.d.ts +12 -2
- package/dist/transport/rest.d.ts.map +1 -1
- package/dist/webhooks.d.ts +9 -4
- package/dist/webhooks.d.ts.map +1 -1
- package/dist/webhooks.js +17 -16
- package/package.json +2 -2
|
@@ -33,7 +33,10 @@ export interface paths {
|
|
|
33
33
|
path?: never;
|
|
34
34
|
cookie?: never;
|
|
35
35
|
};
|
|
36
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* Get the active Grant carried by the bearer token
|
|
38
|
+
* @description `subject` is the credential's principal: the Profile, or the application when an Organization consented. `holder` is whose resources the Grant reaches, the Profile or the Organization, so a Resource Server learns which Company authorized without reading it out of the details.
|
|
39
|
+
*/
|
|
37
40
|
get: operations["getGrantAuthorization"];
|
|
38
41
|
put?: never;
|
|
39
42
|
post?: never;
|
|
@@ -63,6 +66,26 @@ export interface paths {
|
|
|
63
66
|
patch?: never;
|
|
64
67
|
trace?: never;
|
|
65
68
|
};
|
|
69
|
+
"/catalog/banks": {
|
|
70
|
+
parameters: {
|
|
71
|
+
query?: never;
|
|
72
|
+
header?: never;
|
|
73
|
+
path?: never;
|
|
74
|
+
cookie?: never;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* List the banks a transfer can be sent to
|
|
78
|
+
* @description The `bank_id` values that a `bank_transfer` destination of type `external` accepts, each with the bank's name, so an integrator never guesses a slug. The list and the check a transfer goes through are the same function: an `id` here is a `bank_id` the transfer resolves to that bank, and a `bank_id` that resolves to none fails with `unsupported_bank` when the transfer is executed. Granted by a `bank_transfer` authorization detail with `create`. The bank's catalog is read on behalf of the subject, through the web session of one of the accounts that detail reaches, so a subject without any answers `409 interaction_required` like any other read of the bank. It is one bounded list, answered whole as a single page: `pageInfo.hasNextPage` is false, no edge carries a cursor and the pagination parameters do not apply. Returns edges and camelCase pageInfo.
|
|
79
|
+
*/
|
|
80
|
+
get: operations["getBankCatalog"];
|
|
81
|
+
put?: never;
|
|
82
|
+
post?: never;
|
|
83
|
+
delete?: never;
|
|
84
|
+
options?: never;
|
|
85
|
+
head?: never;
|
|
86
|
+
patch?: never;
|
|
87
|
+
trace?: never;
|
|
88
|
+
};
|
|
66
89
|
"/userinfo": {
|
|
67
90
|
parameters: {
|
|
68
91
|
query?: never;
|
|
@@ -290,7 +313,7 @@ export interface paths {
|
|
|
290
313
|
put?: never;
|
|
291
314
|
/**
|
|
292
315
|
* Create an intent under the exact OAuth Grant
|
|
293
|
-
* @description The same creation has two representations, and the content type picks between them. An `application/json` body is an Intent born waiting for an Approval. An `application/jwt` body is one Signed Instruction, sent as a compact JWS whose verified payload is `SignedTransferIntentClaims`, `SignedAccountOpeningIntentClaims` or `SignedAccountClosureIntentClaims`, and every value the operation uses comes from those claims and none from the envelope carrying them. A signed Intent is born approved when the signing client's Grant holds the family's `approve` action (`bank_transfer` or `bank_account`); otherwise it waits, like a proposal, for the person on the hosted screen or for `POST /intents/{intent_id}/approve` by a Grant that holds it. Opening and closing an account fail synchronously with `403 account_key_out_of_grant` when the account_key is outside the Grant's `accounts` patterns and with `409 account_key_taken` when the account_key names an account of the subject (always for a closed one; otherwise unless `upsert`). The new account's number arrives in the `account_opening.succeeded` event as `account: { id, accountKey, number, name }`.
|
|
316
|
+
* @description The same creation has two representations, and the content type picks between them. An `application/json` body is an Intent born waiting for an Approval. An `application/jwt` body is one Signed Instruction, sent as a compact JWS whose verified payload is `SignedTransferIntentClaims`, `SignedAccountOpeningIntentClaims` or `SignedAccountClosureIntentClaims`, and every value the operation uses comes from those claims and none from the envelope carrying them. A signed Intent is born approved when the signing client's Grant holds the family's `approve` action (`bank_transfer` or `bank_account`); otherwise it waits, like a proposal, for the person on the hosted screen or for `POST /intents/{intent_id}/approve` by a Grant that holds it. Opening and closing an account fail synchronously with `403 account_key_out_of_grant` when the account_key is outside the Grant's `accounts` patterns and with `409 account_key_taken` when the account_key names an account of the subject (always for a closed one; otherwise unless `upsert`). The new account's number arrives in the `account_opening.succeeded` event as `account: { id, accountKey, number, name }`. Once the request is valid and authorized (a malformed body is still `400 invalid_request` and a Grant without the permission still `403 insufficient_authorization`), an opening and a transfer between two accounts of the same holder work where the bank serves them: the answer is `201` with the Intent `requires_action` and its `authorization_url`, or, for a Signed Instruction whose signer also holds the family's `approve`, the Intent as it is after its release. Where the deployment's bank does not serve one, the same request answers `501 not_implemented` with `code: account_opening_not_implemented` or `code: own_account_transfer_not_implemented`; a closure always answers `501 not_implemented` with `code: account_closure_not_implemented`. Nothing is created in those cases. A subject without a bank connection to a company cannot open an account: `422 bank_connection_unavailable` with the `intent_id`. A released Signed Instruction answers the refusals of `POST /intents/{intent_id}/approve`.
|
|
294
317
|
*/
|
|
295
318
|
post: operations["createIntent"];
|
|
296
319
|
delete?: never;
|
|
@@ -348,7 +371,7 @@ export interface paths {
|
|
|
348
371
|
};
|
|
349
372
|
/**
|
|
350
373
|
* List one account's transactions
|
|
351
|
-
* @description Answers the transactions the account's statement presentation reads, so an integrator sees exactly what a person would see, newest first, one page at a time: feed `pageInfo.endCursor` back as `?after=` while `pageInfo.hasNextPage`. Granted by a `bank_transaction` authorization detail with `read` whose `accounts` reach this account. The page is read from the bank on behalf of the subject, and the bank's read model walks forward only: `pageInfo.endCursor` is the bank's own cursor for the next page, handed over untouched, and `after` accepts nothing else (`invalid_cursor` otherwise). There is no cursor per transaction, no backward walk and no offset: `before`, `last`, `offset` and `limit` answer `invalid_request`. Returns edges and camelCase pageInfo.
|
|
374
|
+
* @description Answers the transactions the account's statement presentation reads, so an integrator sees exactly what a person would see, newest first, one page at a time: feed `pageInfo.endCursor` back as `?after=` while `pageInfo.hasNextPage`. Granted by a `bank_transaction` authorization detail with `read` whose `accounts` reach this account. The account is named by its identifier or by its Account Key, whichever the integrator knows: a segment shaped like a UUID is an identifier, any other is an Account Key of the Grant's subject. The permission is the same for both and the key is resolved on this request: an account the Grant does not reach, by identifier or by key, and a key that names no account of the subject answer `404`, as if it did not exist, whether or not the account exists. The page is read from the bank on behalf of the subject, and the bank's read model walks forward only: `pageInfo.endCursor` is the bank's own cursor for the next page, handed over untouched, and `after` accepts nothing else (`invalid_cursor` otherwise). There is no cursor per transaction, no backward walk and no offset: `before`, `last`, `offset` and `limit` answer `invalid_request`. Returns edges and camelCase pageInfo.
|
|
352
375
|
*/
|
|
353
376
|
get: operations["listAccountTransactions"];
|
|
354
377
|
put?: never;
|
|
@@ -433,7 +456,11 @@ export interface paths {
|
|
|
433
456
|
put?: never;
|
|
434
457
|
/**
|
|
435
458
|
* Approve an Intent with a Grant holding the family's approve action
|
|
436
|
-
* @description Approval by a credential, without a person: the Grant behind the token must hold `approve` on the family that releases this Intent type (`bank_transfer` for a transfer) for the same subject, and within that detail's `transactions.maximum`. Above it the call answers `422 amount_out_of_grant` and the Intent stays pending for another approver. A transfer
|
|
459
|
+
* @description Approval by a credential, without a person: the Grant behind the token must hold `approve` on the family that releases this Intent type (`bank_transfer` for a transfer) for the same subject, and within that detail's `transactions.maximum`. Above it the call answers `422 amount_out_of_grant` and the Intent stays pending for another approver. A transfer only a person can release answers `409 interaction_required` with `authorization_url` and `reason`, before any approval is recorded and before the bank is called: `bank_verification_required` for a transfer that leaves its holder's own accounts (to another bank or to another Andco customer), which the bank moves only after that person confirms it with their web PIN and a code the bank sends to their phone; and `source_account_required` when the person still picks the source. Accepted is not moved: wait for `transfer.succeeded` or `transfer.failed`.
|
|
460
|
+
*
|
|
461
|
+
* Two kinds of Intent are released with nobody present. Opening an additional account by Account Key needs `bank_account` `approve`; the answer is the Intent, and the account number never comes back in it: it arrives in the `account_opening.succeeded` event. A transfer between two accounts of the same holder needs `bank_transfer` `approve`; the bank asks no fraud engine and no challenge because the money does not leave the holder, and the answer is the Intent `succeeded`, or `processing.confirmed` (which for this rail begins at release, while for a transfer that leaves its holder it begins when the bank accepts it) when the bank has not answered for good yet, in which case nothing else is needed from the caller: the server asks the bank again under the same key on a bounded schedule and the outcome arrives as `transfer.succeeded` or `transfer.failed`. "Same holder" is decided by the bank: two accounts of one Organization (or of one person's business) qualify, while an account of a person and an account of a Company they represent do not, and that transfer is an ordinary one that leaves its holder.
|
|
462
|
+
*
|
|
463
|
+
* Refusals of such a release: `409 interaction_required` with `intent_id`, `reason` and `interaction_url`, where `reason` is `bank_connection_pin_required`, `bank_connection_reconnect_required` or `bank_representative_replacement_required`; the bank asks no challenge, but the web session that acts for the holder needs its person back (or the Organization must connect another bank representative), nothing was opened, frozen or moved, the Intent is untouched and the same request succeeds once the person has acted at `interaction_url`. Also `409 bank_account_quota_exceeded` (with `detail`, the sentence naming the ceiling), `409 account_key_taken` (with `detail`), `409 intent_expired`, `409 invalid_intent_state` and `403 insufficient_authorization`. `422` with `intent_id` and `error` one of `bank_connection_unavailable` (the subject has no bank connection to a company), `bank_authorization_denied` (the bank does not let that person open accounts for that company), `bank_holder_without_account`, `bank_account_limit_reached`, `bank_refused`, `insufficient_funds`, `bank_rejected` or `bank_review_required`; the Intent is `failed` with the same detail (see `IntentStatus`). `503 temporarily_unavailable` means the bank could not be asked: asking again for the same Intent is safe and answers the same result, because the Intent's id is the bank's idempotency key. Where the bank does not serve the capability, `501 not_implemented` with `account_opening_not_implemented` or `own_account_transfer_not_implemented` and the `intent_id`; the Intent stays as it was. Safe to retry.
|
|
437
464
|
*/
|
|
438
465
|
post: operations["approveIntent"];
|
|
439
466
|
delete?: never;
|
|
@@ -538,11 +565,25 @@ export interface components {
|
|
|
538
565
|
/** @description The path parameter that is not well formed, on `invalid_identifier`. */
|
|
539
566
|
parameter?: string;
|
|
540
567
|
code?: string;
|
|
568
|
+
/**
|
|
569
|
+
* Format: uuid
|
|
570
|
+
* @description The Intent a refusal of its release is about, on `interaction_required`, `422` answers that fail it and `501 not_implemented` at approval.
|
|
571
|
+
*/
|
|
572
|
+
intent_id?: string;
|
|
573
|
+
/** @description The sentence naming the ceiling on `bank_account_quota_exceeded`, or why the Account Key is taken on `account_key_taken`. */
|
|
574
|
+
detail?: string;
|
|
541
575
|
/**
|
|
542
576
|
* Format: uri
|
|
543
|
-
* @description Where in Platform the person does what `code` names, on `interaction_required` for a bank connection.
|
|
577
|
+
* @description Where in Platform the person does what `code` names, on `interaction_required` for a bank connection, including the release of an Intent.
|
|
544
578
|
*/
|
|
545
579
|
interaction_url?: string;
|
|
580
|
+
/**
|
|
581
|
+
* Format: uri
|
|
582
|
+
* @description Where the person completes the Intent, on `interaction_required` for an Intent.
|
|
583
|
+
*/
|
|
584
|
+
authorization_url?: string;
|
|
585
|
+
/** @description Why only a person can go on, on `interaction_required` for an Intent: `bank_verification_required` (the bank asks them to confirm the transfer with their web PIN and an SMS code) or `source_account_required` (they still pick the source account). On the release of an Intent that moves with nobody present it is `bank_connection_pin_required`, `bank_connection_reconnect_required` or `bank_representative_replacement_required`. On `invalid_signed_instruction` and `invalid_request` it says what did not verify. */
|
|
586
|
+
reason?: string;
|
|
546
587
|
message?: string;
|
|
547
588
|
};
|
|
548
589
|
/** @description The verified `kid`, algorithm and claims of a Signed Instruction that verified against the presenting OAuth Client's registered keys. `claims` is the decoded JWT payload as signed -- this operation checks only `exp` and `jti` structurally and otherwise passes every claim through untouched, so it never narrows to one Intent family's claim schema. */
|
|
@@ -578,11 +619,26 @@ export interface components {
|
|
|
578
619
|
clientId: string;
|
|
579
620
|
/** Format: uuid */
|
|
580
621
|
grantId: string;
|
|
622
|
+
holder: components["schemas"]["GrantHolder"];
|
|
581
623
|
/** Format: uri */
|
|
582
624
|
resource: string;
|
|
583
625
|
scopes: string[];
|
|
584
626
|
subject: components["schemas"]["GrantSubject"];
|
|
585
627
|
};
|
|
628
|
+
/** @description Whose resources the Grant reaches: the Profile, or the Organization (Company) the person consented for. It is the only place this response names an Organization outside `authorizationDetails`, because for an Organization the `subject` is the application. It carries the identifier and no identity data; the RUT and the legal name are read from the identities of the Organization. */
|
|
629
|
+
GrantHolder: components["schemas"]["ProfileGrantHolder"] | components["schemas"]["OrganizationGrantHolder"];
|
|
630
|
+
ProfileGrantHolder: {
|
|
631
|
+
/** @constant */
|
|
632
|
+
type: "profile";
|
|
633
|
+
/** Format: uuid */
|
|
634
|
+
identifier: string;
|
|
635
|
+
};
|
|
636
|
+
OrganizationGrantHolder: {
|
|
637
|
+
/** @constant */
|
|
638
|
+
type: "organization";
|
|
639
|
+
/** @description The Organization's identifier, the same value `authorizationDetails[].subject.identifier` carries: a positive decimal integer, as a string. */
|
|
640
|
+
identifier: string;
|
|
641
|
+
};
|
|
586
642
|
GrantActor: {
|
|
587
643
|
/** @constant */
|
|
588
644
|
type: "profile";
|
|
@@ -706,6 +762,21 @@ export interface components {
|
|
|
706
762
|
/** Format: uuid */
|
|
707
763
|
id: string;
|
|
708
764
|
};
|
|
765
|
+
/** @description The whole list of banks as one page. `pageInfo.hasNextPage` is false and `endCursor` null; an edge's `cursor` is null because the list has no positions to resume from. */
|
|
766
|
+
BankCatalogPage: {
|
|
767
|
+
edges: {
|
|
768
|
+
/** @description Always null. */
|
|
769
|
+
cursor: string | null;
|
|
770
|
+
node: components["schemas"]["BankCatalogEntry"];
|
|
771
|
+
}[];
|
|
772
|
+
pageInfo: components["schemas"]["PageInfo"];
|
|
773
|
+
};
|
|
774
|
+
BankCatalogEntry: {
|
|
775
|
+
/** @description The `bank_id` of a destination of type `external`. */
|
|
776
|
+
id: string;
|
|
777
|
+
/** @description The bank's name as the bank lists it. */
|
|
778
|
+
name: string;
|
|
779
|
+
};
|
|
709
780
|
/** @description A standard connection. Edge cursors remain present on nonempty terminal pages. Reads are live; offset positions can shift under concurrent changes. */
|
|
710
781
|
PermissionCatalogPage: {
|
|
711
782
|
edges: {
|
|
@@ -747,7 +818,7 @@ export interface components {
|
|
|
747
818
|
type: string | null;
|
|
748
819
|
/** @description Null while the balance projection does not know the account yet. */
|
|
749
820
|
currency: string | null;
|
|
750
|
-
/** @description The ledger balance the bank maintains for the account, as a decimal string, never a number. It is what the account holds after its last movement; funds the bank has on hold are not subtracted from it. Null while the balance projection does not know the account yet, for example right after it is opened
|
|
821
|
+
/** @description The ledger balance the bank maintains for the account, as a decimal string, never a number. It is what the account holds after its last movement; funds the bank has on hold are not subtracted from it. Null while the balance projection does not know the account yet, for example right after it is opened, and null when the Grant lacks `read_balance`; a listing never fails for it and never makes up a zero. */
|
|
751
822
|
balance: string | null;
|
|
752
823
|
};
|
|
753
824
|
/** @description A standard connection. Edge cursors remain present on nonempty terminal pages. Reads are live; offset positions can shift under concurrent changes. */
|
|
@@ -791,7 +862,7 @@ export interface components {
|
|
|
791
862
|
};
|
|
792
863
|
/** @description The monetary scalar, defined once. It travels as a string because CLP has no minor unit and an exact peso amount does not survive a JSON number. Every envelope carries it as `value`: what a request or a Signed Instruction asks for, what an Intent was asked for, and what a transfer actually moved (`settled.value`). */
|
|
793
864
|
MonetaryValue: string;
|
|
794
|
-
/** @description The Account Key its holder chose for one of its own accounts: unique per holder and immutable. It is resolved on every operation rather than once, so it travels in the body
|
|
865
|
+
/** @description The Account Key its holder chose for one of its own accounts: unique per holder and immutable. It is resolved on every operation rather than once, so it travels in the body of a request that creates something. A read may name it in a path segment where the operation says so, as `GET /accounts/{bank_account_id}/transactions` does, and resolves it on that request all the same. */
|
|
795
866
|
AccountKey: string;
|
|
796
867
|
/** @description One Andco account of the Grant's subject, named by its Account Key. */
|
|
797
868
|
IntentAccountKey: {
|
|
@@ -855,16 +926,13 @@ export interface components {
|
|
|
855
926
|
/** @description Defaults to false when omitted. */
|
|
856
927
|
editable?: boolean;
|
|
857
928
|
};
|
|
858
|
-
/** @description The amount a transfer proposes. `editable`
|
|
929
|
+
/** @description The amount a transfer proposes. `editable: true` lets the person who confirms set the amount on Andco's confirmation screen, and `value` is the initial proposal shown there; the amount must fall within the Grant's `transactions.minimum` and `transactions.maximum` and not exceed the available balance. Without `editable` (or with `false`) the amount is locked. What moved is `settled`. */
|
|
859
930
|
TransferAmountProposal: {
|
|
860
931
|
/** @constant */
|
|
861
932
|
currency: "CLP";
|
|
862
933
|
value: components["schemas"]["MonetaryValue"];
|
|
863
|
-
/**
|
|
864
|
-
|
|
865
|
-
* @constant
|
|
866
|
-
*/
|
|
867
|
-
editable?: false;
|
|
934
|
+
/** @description Defaults to false when omitted. */
|
|
935
|
+
editable?: boolean;
|
|
868
936
|
};
|
|
869
937
|
/** @description The amount a Signed Instruction orders: the same `{ currency, value }` as a request, with nothing left for a person to change. */
|
|
870
938
|
SignedAmount: {
|
|
@@ -872,12 +940,15 @@ export interface components {
|
|
|
872
940
|
currency: "CLP";
|
|
873
941
|
value: components["schemas"]["MonetaryValue"];
|
|
874
942
|
};
|
|
875
|
-
/** @description The amount a transfer orders, as it is answered
|
|
943
|
+
/** @description The amount a transfer orders, as it is answered. `value` is the request's proposal and never changes; `confirmed` is the amount the person confirmed, null until they confirm, and it is what moves. It is never proof that money moved; read `settled` for that. */
|
|
876
944
|
TransferAmount: {
|
|
877
945
|
/** @constant */
|
|
878
946
|
currency: "CLP";
|
|
947
|
+
/** @description Immutable amount from the creation request. */
|
|
879
948
|
value: components["schemas"]["MonetaryValue"];
|
|
880
949
|
editable: boolean;
|
|
950
|
+
/** @description The amount the person confirmed, null until then; it is what moves. For a transfer that is not editable it is `value`, set when the person confirms. Always within the Grant's `transactions.minimum` and `transactions.maximum`, when it has them. */
|
|
951
|
+
confirmed: string | null;
|
|
881
952
|
};
|
|
882
953
|
/** @description The money a transfer actually moved and when it settled. Present only once the transfer `succeeded`; null before, and null for ever when it fails, is rejected, cancelled or expires. */
|
|
883
954
|
TransferSettlement: {
|
|
@@ -938,7 +1009,7 @@ export interface components {
|
|
|
938
1009
|
reason: string;
|
|
939
1010
|
};
|
|
940
1011
|
DepositIntentCreate: ({
|
|
941
|
-
/** @description Positive fixed duration, anchored once when the operation is first created. */
|
|
1012
|
+
/** @description Positive fixed duration, anchored once when the operation is first created. Exactly one expiration field is required: `@andco/bank-sdk` fills no default for a Deposit. */
|
|
942
1013
|
expires_in?: string;
|
|
943
1014
|
/**
|
|
944
1015
|
* Format: date-time
|
|
@@ -1064,15 +1135,15 @@ export interface components {
|
|
|
1064
1135
|
/** Format: uri */
|
|
1065
1136
|
authorization_url: string;
|
|
1066
1137
|
};
|
|
1067
|
-
/** @description The `application/json` half of creating a transfer: an Intent born waiting for an Approval. A null `source` is the confirmation screen, where a person picks the account the money leaves from among the Grant's sources; the
|
|
1138
|
+
/** @description The `application/json` half of creating a transfer: an Intent born waiting for an Approval. A null `source` is the confirmation screen, where a person picks the account the money leaves from among the Grant's sources; the destination is always locked there (`editable: true` is an `invalid_request`), and the amount is too unless `amount.editable` is true, in which case the person sets it. The `application/jwt` half is `SignedTransferIntentClaims`, and the two are separate schemas rather than one with optional fields on purpose: when signed and unsigned members share an object, something eventually reads the wrong ones. */
|
|
1068
1139
|
TransferIntentCreate: {
|
|
1069
|
-
/** @description Positive fixed duration, anchored once when the operation is first created. */
|
|
1140
|
+
/** @description Positive fixed duration, anchored once when the operation is first created. The API itself requires exactly one expiration field, and `@andco/bank-sdk` sends `30 minutes` when a create call names neither. */
|
|
1070
1141
|
expires_in?: string;
|
|
1071
1142
|
/**
|
|
1072
1143
|
* Format: date-time
|
|
1073
|
-
* @description Absolute deadline with an explicit timezone. Exactly one expiration field is required
|
|
1144
|
+
* @description Absolute deadline with an explicit timezone. `null`: the Intent never expires. Exactly one expiration field is required.
|
|
1074
1145
|
*/
|
|
1075
|
-
expires_at?: string;
|
|
1146
|
+
expires_at?: string | null;
|
|
1076
1147
|
/** @constant */
|
|
1077
1148
|
type: "transfer";
|
|
1078
1149
|
/** @description The Andco account the money leaves. Null leaves that choice to a person on a screen. */
|
|
@@ -1084,7 +1155,7 @@ export interface components {
|
|
|
1084
1155
|
[key: string]: unknown;
|
|
1085
1156
|
};
|
|
1086
1157
|
} & (unknown | unknown);
|
|
1087
|
-
/** @description Authoritative Project-facing state of a transfer. `source` and `destination` answer in the same matcher vocabulary as the request. `amount` is
|
|
1158
|
+
/** @description Authoritative Project-facing state of a transfer. `source` and `destination` answer in the same matcher vocabulary as the request. `amount.value` is the proposal of the request, `amount.confirmed` the amount the person confirmed (null until then; it is what moves) and `settled` what it moved: reconciliation reads `settled`, which stays null until the money moved. `transfer.confirmed` and the events after it report the confirmed amount. */
|
|
1088
1159
|
TransferIntent: {
|
|
1089
1160
|
/** Format: uuid */
|
|
1090
1161
|
id: string;
|
|
@@ -1112,14 +1183,22 @@ export interface components {
|
|
|
1112
1183
|
};
|
|
1113
1184
|
/** Format: date-time */
|
|
1114
1185
|
server_time: string;
|
|
1115
|
-
/** @description Remaining actionable lifetime at server_time; zero for finite terminal Intents. */
|
|
1116
|
-
expires_in_seconds: number;
|
|
1117
|
-
/**
|
|
1118
|
-
|
|
1186
|
+
/** @description Remaining actionable lifetime at server_time; zero for finite terminal Intents, `null` when the Intent never expires. */
|
|
1187
|
+
expires_in_seconds: number | null;
|
|
1188
|
+
/**
|
|
1189
|
+
* Format: date-time
|
|
1190
|
+
* @description The deadline to approve and execute the Intent. `null`: the Intent never expires.
|
|
1191
|
+
*/
|
|
1192
|
+
expires_at: string | null;
|
|
1119
1193
|
/** Format: date-time */
|
|
1120
1194
|
created_at: string;
|
|
1121
1195
|
/** Format: uri */
|
|
1122
1196
|
authorization_url: string;
|
|
1197
|
+
/**
|
|
1198
|
+
* @description Present on every read of the Intent (GET, list, creation answers and signed-instruction answers) while it is `requires_action` and only a person can release it; absent when a credential may release it, and absent once the Intent is no longer `requires_action`. The same two words `409 interaction_required` gives as `reason` when a credential tries `POST /intents/{intent_id}/approve`. `bank_verification_required`: the transfer leaves its holder's own accounts and the bank asks the person to confirm it at `authorization_url` with their web PIN and an SMS code; the Intent becomes `processing.confirmed` only when the bank accepts it. `source_account_required`: the person still picks the account the money leaves from.
|
|
1199
|
+
* @enum {string}
|
|
1200
|
+
*/
|
|
1201
|
+
interaction_reason?: "bank_verification_required" | "source_account_required";
|
|
1123
1202
|
};
|
|
1124
1203
|
/** @description The `application/json` half of opening a Cuenta Vista: an Intent born waiting for an Approval. `/accounts` has no `POST` because everything with banking consequence happens through an Intent, and an opening carries no amount, no source and no destination -- only the name the account will answer to. Opening is asynchronous: the answer is the Intent and its status, and the Número de Cuenta arrives on the account's event stream. */
|
|
1125
1204
|
AccountOpeningIntentCreate: {
|
|
@@ -1133,9 +1212,13 @@ export interface components {
|
|
|
1133
1212
|
* @default false
|
|
1134
1213
|
*/
|
|
1135
1214
|
upsert: boolean;
|
|
1215
|
+
/** @description The API itself requires exactly one expiration field, and `@andco/bank-sdk` sends `30 minutes` when a create call names neither. */
|
|
1136
1216
|
expires_in?: string;
|
|
1137
|
-
/**
|
|
1138
|
-
|
|
1217
|
+
/**
|
|
1218
|
+
* Format: date-time
|
|
1219
|
+
* @description Absolute deadline with an explicit timezone. `null`: the Intent never expires.
|
|
1220
|
+
*/
|
|
1221
|
+
expires_at?: string | null;
|
|
1139
1222
|
note?: components["schemas"]["IntentNote"];
|
|
1140
1223
|
metadata?: {
|
|
1141
1224
|
[key: string]: unknown;
|
|
@@ -1157,9 +1240,13 @@ export interface components {
|
|
|
1157
1240
|
name?: string;
|
|
1158
1241
|
/** @default false */
|
|
1159
1242
|
upsert: boolean;
|
|
1243
|
+
/** @description The API itself requires exactly one expiration field, and `@andco/bank-sdk` sends `30 minutes` when a create call names neither. */
|
|
1160
1244
|
expires_in?: string;
|
|
1161
|
-
/**
|
|
1162
|
-
|
|
1245
|
+
/**
|
|
1246
|
+
* Format: date-time
|
|
1247
|
+
* @description Absolute deadline with an explicit timezone. `null`: the Intent never expires.
|
|
1248
|
+
*/
|
|
1249
|
+
expires_at?: string | null;
|
|
1163
1250
|
metadata?: {
|
|
1164
1251
|
[key: string]: unknown;
|
|
1165
1252
|
};
|
|
@@ -1188,10 +1275,13 @@ export interface components {
|
|
|
1188
1275
|
};
|
|
1189
1276
|
/** Format: date-time */
|
|
1190
1277
|
server_time: string;
|
|
1191
|
-
/** @description Remaining actionable lifetime at server_time; zero for finite terminal Intents. */
|
|
1192
|
-
expires_in_seconds: number;
|
|
1193
|
-
/**
|
|
1194
|
-
|
|
1278
|
+
/** @description Remaining actionable lifetime at server_time; zero for finite terminal Intents, `null` when the Intent never expires. */
|
|
1279
|
+
expires_in_seconds: number | null;
|
|
1280
|
+
/**
|
|
1281
|
+
* Format: date-time
|
|
1282
|
+
* @description The deadline to approve and execute the Intent. `null`: the Intent never expires.
|
|
1283
|
+
*/
|
|
1284
|
+
expires_at: string | null;
|
|
1195
1285
|
/** Format: date-time */
|
|
1196
1286
|
created_at: string;
|
|
1197
1287
|
/** Format: uri */
|
|
@@ -1278,9 +1368,13 @@ export interface components {
|
|
|
1278
1368
|
source: components["schemas"]["IntentAccount"];
|
|
1279
1369
|
destination: components["schemas"]["TransferDestination"];
|
|
1280
1370
|
amount: components["schemas"]["SignedAmount"];
|
|
1371
|
+
/** @description The API itself requires exactly one expiration field, and `@andco/bank-sdk` sends `30 minutes` when a create call names neither. */
|
|
1281
1372
|
expires_in?: string;
|
|
1282
|
-
/**
|
|
1283
|
-
|
|
1373
|
+
/**
|
|
1374
|
+
* Format: date-time
|
|
1375
|
+
* @description Absolute deadline with an explicit timezone. `null`: the Intent never expires.
|
|
1376
|
+
*/
|
|
1377
|
+
expires_at?: string | null;
|
|
1284
1378
|
/** @description A plain bank reference; a Signed Instruction proposes nothing. */
|
|
1285
1379
|
note?: string;
|
|
1286
1380
|
metadata?: {
|
|
@@ -1288,12 +1382,14 @@ export interface components {
|
|
|
1288
1382
|
};
|
|
1289
1383
|
} & (unknown | unknown);
|
|
1290
1384
|
/**
|
|
1291
|
-
* @description `<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `processing`, `succeeded`, `failed`, `cancelled`, `rejected` or `expired`, and it is what tells whether the Intent can still change: `requires_action` and `processing` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread.
|
|
1385
|
+
* @description `<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `processing`, `succeeded`, `failed`, `cancelled`, `rejected` or `expired`, and it is what tells whether the Intent can still change: `requires_action` and `processing` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread. In TypeScript, `INTENT_STATUS_BASE` and `IS_INTENT_TERMINAL_STATUS` from `@andco/protocol` do exactly that; an exhaustive `switch` over the enum below stops being exhaustive the first time a detail is added.
|
|
1386
|
+
*
|
|
1387
|
+
* Where an Intent stands. `failed` says why, and whether money moved. A transfer that leaves its holder's own accounts (to another bank or to another Andco customer) is `requires_action` from creation for as long as a person still owes the bank a proof, and every read of it carries `interaction_reason: bank_verification_required`; pressing Confirm, typing the web PIN or typing the SMS code does not change its status. It becomes `processing.confirmed`, and `transfer.confirmed` is published once, when the bank accepts the transfer; from then on nobody has to do anything and the outcome arrives as `succeeded` or `failed.bank_rejected`. A challenge the person abandons, lets run out or exhausts with wrong answers leaves the Intent `requires_action` (the person confirms again and gets a new code) until its own expiry, `expired`. A transfer between two accounts of the same holder has no challenge: it is `processing.confirmed` from its release, while the server asks the bank again under the same key. In both, `processing.confirmed` means that the bank holds the command and nobody has to do anything. `processing.settling`, `processing.reversing` and `processing.reconciling` are not emitted. While the bank has been asked and its answer is not yet known (normally one request) the Intent still reads `requires_action`, does not read `expired` even if its deadline passes, and `cancel` and `reject` answer `409 invalid_intent_state`. Transfers: `failed.fraud_rejected` (the bank's fraud engine refused it before accepting, straight from `requires_action`), `failed.bank_refused` (the bank or its ledger refused the request, before accepting it when the transfer leaves its holder; for a transfer between own accounts, for example, the destination is not an active account of the same holder), `failed.bank_rejected` (the bank accepted it and the receiving bank, or the ledger, rejected it; the debit is undone by the bank), `failed.bank_review_required` (a transfer between own accounts the bank stopped half way or gave no usable answer for a day: money may have left the source account without reaching the destination, the bank must review it, and it is never retried under a new Intent) and `failed.own_account_transfer_not_implemented` (the bank does not serve transfers between own accounts). In `failed.fraud_rejected`, `failed.bank_refused` and `failed.own_account_transfer_not_implemented` no money moved; in `failed.bank_rejected` nothing stays moved. Account openings: `failed.bank_authorization_denied` (the bank does not let that person open accounts for that company), `failed.bank_holder_without_account`, `failed.bank_account_limit_reached`, `failed.bank_connection_unavailable` (no bank connection to a company), `failed.account_opening_not_implemented` (the bank does not serve openings), `failed.bank_core_unavailable`, `failed.bank_account_save_failed`, `failed.bank_account_quota_exceeded` (the holder already has as many accounts as allowed) and `failed.account_key_taken`. An opening that failed opened no account in any of them. Closures, which are not served today: `failed.bank_account_not_found` and `failed.bank_account_balance_not_zero`.
|
|
1292
1388
|
*
|
|
1293
|
-
* `failed.<code>` names the reason. The list holds every code Andco
|
|
1389
|
+
* `failed.<code>` names the reason. The list holds every code Andco records, and it may grow: a `failed.` value outside this list is a failure like any other.
|
|
1294
1390
|
* @enum {string}
|
|
1295
1391
|
*/
|
|
1296
|
-
IntentStatus: "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "succeeded" | "failed" | "failed.insufficient_funds" | "failed.
|
|
1392
|
+
IntentStatus: "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "succeeded" | "failed" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled" | "cancelled.grant_revoked" | "cancelled.grant_expired" | "rejected" | "expired";
|
|
1297
1393
|
Organization: {
|
|
1298
1394
|
id: string;
|
|
1299
1395
|
name: string;
|
|
@@ -1341,7 +1437,7 @@ export interface components {
|
|
|
1341
1437
|
"application/json": components["schemas"]["ApiError"];
|
|
1342
1438
|
};
|
|
1343
1439
|
};
|
|
1344
|
-
/** @description The idempotency key was already used with a different request */
|
|
1440
|
+
/** @description The idempotency key was already used with a different request (`idempotency_conflict`), or the Intent cannot go on. On the release of an Intent: `interaction_required` (see `BankConnectionInteractionRequired`, with `intent_id` and `reason`), `bank_account_quota_exceeded` and `account_key_taken` (both with `detail`, a sentence a person can read), `intent_expired` and `invalid_intent_state`. */
|
|
1345
1441
|
Conflict: {
|
|
1346
1442
|
headers: {
|
|
1347
1443
|
[name: string]: unknown;
|
|
@@ -1350,7 +1446,7 @@ export interface components {
|
|
|
1350
1446
|
"application/json": components["schemas"]["ApiError"];
|
|
1351
1447
|
};
|
|
1352
1448
|
};
|
|
1353
|
-
/** @description The request is valid but exceeds the effective amount limits */
|
|
1449
|
+
/** @description The request is valid but cannot go on. It exceeds the effective amount limits (`amount_out_of_grant`), or the bank answered the release of an Intent, and then `intent_id` names the Intent, which is `failed` with the same word as its detail: `bank_connection_unavailable` (the subject has no bank connection to a company; nothing was asked of the bank), `bank_authorization_denied`, `bank_holder_without_account`, `bank_account_limit_reached`, `insufficient_funds`, `bank_refused`, `bank_rejected` (the ledger refused an entry and nothing stays moved) and `bank_review_required` (the bank stopped half way or gave no usable answer for a day: money may have left the source account without reaching the destination and the bank must review it; never retry it under a new Intent). */
|
|
1354
1450
|
UnprocessableEntity: {
|
|
1355
1451
|
headers: {
|
|
1356
1452
|
[name: string]: unknown;
|
|
@@ -1359,7 +1455,7 @@ export interface components {
|
|
|
1359
1455
|
"application/json": components["schemas"]["ApiError"];
|
|
1360
1456
|
};
|
|
1361
1457
|
};
|
|
1362
|
-
/** @description
|
|
1458
|
+
/** @description `not_implemented`: the requested case is unavailable, and `code` says which. On Intent creation (after the request is validated and authorized, except a closure, which is answered whatever the Grant holds) and on approval: `account_closure_not_implemented` (closing an account, postponed with no date), `account_opening_not_implemented` (opening an additional account by Account Key) and `own_account_transfer_not_implemented` (a transfer between two accounts of the same holder, that is, whose destination is an Account Key or an Andco account of the Grant's subject). The last two work where the bank serves them; the bank ships each behind a switch that is off by default and turned on per environment, so a deployment whose bank does not serve one answers this with the same code. At creation nothing is created; at approval the answer carries the `intent_id` and the Intent stays as it was. */
|
|
1363
1459
|
NotImplemented: {
|
|
1364
1460
|
headers: {
|
|
1365
1461
|
[name: string]: unknown;
|
|
@@ -1386,7 +1482,7 @@ export interface components {
|
|
|
1386
1482
|
"application/json": components["schemas"]["ApiError"];
|
|
1387
1483
|
};
|
|
1388
1484
|
};
|
|
1389
|
-
/** @description `interaction_required`: the subject's connection with the bank needs the person back before the bank can answer for them. `code` says what the person has to do: `bank_connection_pin_required` (type the web PIN) or `bank_connection_reconnect_required` (connect the account again), and `interaction_url` is where they do it in Platform. Nothing is wrong with the Grant: the same request succeeds afterwards. Retrying before then answers the same. */
|
|
1485
|
+
/** @description `interaction_required`: the subject's connection with the bank needs the person back before the bank can answer for them. `code` says what the person has to do: `bank_connection_pin_required` (type the web PIN) or `bank_connection_reconnect_required` (connect the account again) or `bank_representative_replacement_required` (the Organization connects another bank representative), and `interaction_url` is where they do it in Platform. On the release of an Intent (`POST /intents/{intent_id}/approve` or a Signed Instruction) the answer carries `intent_id` and `reason` (with the value `code` has on a read) and no `code`: the bank asks no challenge for these operations, but the web session that acts for the holder needs its person back. Nothing was opened, frozen or moved and the Intent is untouched. Nothing is wrong with the Grant: the same request succeeds afterwards. Retrying before then answers the same. */
|
|
1390
1486
|
BankConnectionInteractionRequired: {
|
|
1391
1487
|
headers: {
|
|
1392
1488
|
[name: string]: unknown;
|
|
@@ -1536,6 +1632,31 @@ export interface operations {
|
|
|
1536
1632
|
503: components["responses"]["TemporarilyUnavailable"];
|
|
1537
1633
|
};
|
|
1538
1634
|
};
|
|
1635
|
+
getBankCatalog: {
|
|
1636
|
+
parameters: {
|
|
1637
|
+
query?: never;
|
|
1638
|
+
header?: never;
|
|
1639
|
+
path?: never;
|
|
1640
|
+
cookie?: never;
|
|
1641
|
+
};
|
|
1642
|
+
requestBody?: never;
|
|
1643
|
+
responses: {
|
|
1644
|
+
/** @description The banks a transfer can be sent to, ordered as the bank lists them */
|
|
1645
|
+
200: {
|
|
1646
|
+
headers: {
|
|
1647
|
+
[name: string]: unknown;
|
|
1648
|
+
};
|
|
1649
|
+
content: {
|
|
1650
|
+
"application/json": components["schemas"]["BankCatalogPage"];
|
|
1651
|
+
};
|
|
1652
|
+
};
|
|
1653
|
+
401: components["responses"]["InvalidToken"];
|
|
1654
|
+
403: components["responses"]["Forbidden"];
|
|
1655
|
+
404: components["responses"]["UnsupportedVersion"];
|
|
1656
|
+
409: components["responses"]["BankConnectionInteractionRequired"];
|
|
1657
|
+
503: components["responses"]["TemporarilyUnavailable"];
|
|
1658
|
+
};
|
|
1659
|
+
};
|
|
1539
1660
|
getUserInfo: {
|
|
1540
1661
|
parameters: {
|
|
1541
1662
|
query?: never;
|
|
@@ -2112,6 +2233,7 @@ export interface operations {
|
|
|
2112
2233
|
};
|
|
2113
2234
|
header?: never;
|
|
2114
2235
|
path: {
|
|
2236
|
+
/** @description The account's identifier (a UUID) or its Account Key. */
|
|
2115
2237
|
bank_account_id: string;
|
|
2116
2238
|
};
|
|
2117
2239
|
cookie?: never;
|