@andco/protocol 0.0.15 → 0.1.0-ti.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/dist/authorization-preparation.d.ts +1 -1
  2. package/dist/errors.d.ts +1 -1
  3. package/dist/errors.js +1 -1
  4. package/dist/intent-input.d.ts +67 -54
  5. package/dist/intent-input.d.ts.map +1 -1
  6. package/dist/intent-input.js +39 -23
  7. package/dist/intent-status.d.ts +5 -6
  8. package/dist/intent-status.d.ts.map +1 -1
  9. package/dist/intent-status.js +12 -7
  10. package/dist/miniapp-manifest.d.ts +2 -2
  11. package/dist/miniapp-manifest.js +1 -1
  12. package/dist/native-intent.d.ts +12 -12
  13. package/dist/native-intent.d.ts.map +1 -1
  14. package/dist/native-intent.js +7 -4
  15. package/dist/rar/account-matchers.d.ts +10 -10
  16. package/dist/rar/account-matchers.js +2 -2
  17. package/dist/rar/bank.d.ts +295 -23
  18. package/dist/rar/bank.d.ts.map +1 -1
  19. package/dist/rar/bank.js +54 -16
  20. package/dist/rar/catalog.d.ts +134 -9
  21. package/dist/rar/catalog.d.ts.map +1 -1
  22. package/dist/rar/catalog.js +6 -6
  23. package/dist/rar/json-schemas.generated.d.ts.map +1 -1
  24. package/dist/rar/json-schemas.generated.js +375 -7
  25. package/dist/rar/money.d.ts +1 -1
  26. package/dist/rar/money.js +1 -1
  27. package/dist/rar/subject-data.d.ts +1 -1
  28. package/dist/rar/subject-data.js +1 -1
  29. package/dist/rest/accounts.d.ts +69 -47
  30. package/dist/rest/accounts.d.ts.map +1 -1
  31. package/dist/rest/accounts.js +32 -22
  32. package/dist/rest/catalog.d.ts +3 -3
  33. package/dist/rest/catalog.js +2 -2
  34. package/dist/rest/contract.d.ts +581 -316
  35. package/dist/rest/contract.d.ts.map +1 -1
  36. package/dist/rest/contract.js +10 -6
  37. package/dist/rest/events.js +1 -1
  38. package/dist/rest/identity.d.ts +22 -22
  39. package/dist/rest/identity.d.ts.map +1 -1
  40. package/dist/rest/identity.js +4 -4
  41. package/dist/rest/intents.d.ts +301 -142
  42. package/dist/rest/intents.d.ts.map +1 -1
  43. package/dist/rest/intents.js +67 -53
  44. package/dist/rest/signatures.d.ts +19 -5
  45. package/dist/rest/signatures.d.ts.map +1 -1
  46. package/dist/rest/signatures.js +47 -5
  47. package/dist/rest/transfers.d.ts +738 -362
  48. package/dist/rest/transfers.d.ts.map +1 -1
  49. package/dist/rest/transfers.js +71 -44
  50. package/dist/signing.d.ts +6 -2
  51. package/dist/signing.d.ts.map +1 -1
  52. package/dist/signing.js +2 -1
  53. package/dist/transfer.d.ts +101 -65
  54. package/dist/transfer.d.ts.map +1 -1
  55. package/dist/transfer.js +69 -43
  56. package/dist/transport/financial-events.d.ts +65 -14
  57. package/dist/transport/financial-events.d.ts.map +1 -1
  58. package/dist/transport/financial-events.js +34 -0
  59. package/dist/transport/generated/oauth-api.d.ts +384 -110
  60. package/dist/transport/generated/oauth-api.d.ts.map +1 -1
  61. package/dist/transport/intents.d.ts +6 -6
  62. package/dist/transport/intents.d.ts.map +1 -1
  63. package/dist/transport/rest.d.ts +9 -8
  64. package/dist/transport/rest.d.ts.map +1 -1
  65. package/dist/transport/rest.js +1 -1
  66. package/package.json +1 -1
@@ -110,11 +110,11 @@ export interface paths {
110
110
  put?: never;
111
111
  /**
112
112
  * Approve an Intent with a Grant holding the family's approve action
113
- * @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 AndPass and a code the bank sends to their phone, and also for a transfer created with `receiver: null` that nobody has completed yet; and `source_account_required` when the person still picks the source. Accepted is not moved: wait for `transfer.succeeded` or `transfer.failed`.
113
+ * @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 AndPass and a code the bank sends to their phone, and also for a transfer created with `receiver: null` that nobody has completed yet; and `source_account_required` when the person still picks the source. The approval ends the Intent: the answer is the Intent `approved`, and an approved transfer Intent names its Transfer in `transfer_id`. Approved is not moved: read the Transfer, or wait for `transfer.succeeded` or `transfer.failed`.
114
114
  *
115
- * 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.
115
+ * 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 `approved`, with its outcome in `account_opening_status`, 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 proof because the money does not leave the holder, and the answer is the Intent `approved` with its `transfer_id`. The Transfer it names is released at once: it reads `succeeded`, or `processing` 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.
116
116
  *
117
- * 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 account 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 `used` and `quota`), `409 account_key_taken` (with `reason`), `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.
117
+ * 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 proof, but the web session that acts for the holder needs its person back (or the Organization must connect another account 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 `used` and `quota`), `409 account_key_taken` (with `reason`), `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 stays `approved`, and the Transfer it names, or the opening, reads `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 bank is asked under the same 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.
118
118
  */
119
119
  post: operations["approveIntent"];
120
120
  delete?: never;
@@ -134,7 +134,7 @@ export interface paths {
134
134
  put?: never;
135
135
  /**
136
136
  * Withdraw an Intent the calling client created
137
- * @description A Cancellation is the creator withdrawing its own request: only the client and Grant that created the Intent may cancel it. An approver declining it uses `reject`, and the audit keeps the two apart. Records why: an Intent that vanished without a reason is an unexplained gap. Answers `409 intent_expired` when the Intent's deadline to be approved and executed has already passed.
137
+ * @description A Cancellation is the creator withdrawing its own request: only the client and Grant that created the Intent may cancel it. An approver declining it uses `reject`, and the audit keeps the two apart. The `reason` is optional: when given it has 1 to 280 characters, and it is recorded with the Cancellation. Answers `409 intent_expired` when the Intent's deadline to be approved and executed has already passed.
138
138
  */
139
139
  post: operations["cancelIntent"];
140
140
  delete?: never;
@@ -154,7 +154,7 @@ export interface paths {
154
154
  put?: never;
155
155
  /**
156
156
  * Close this application's no-target deposit collection with an explicit close Grant action
157
- * @description Idempotent. Preserves existing terminal outcomes. Does not move funds, cancel commands AndCo already accepted, or grant account transaction access.
157
+ * @description Idempotent. Preserves existing terminal outcomes. Does not move funds, cancel commands AndCo already accepted, or grant account movement access.
158
158
  */
159
159
  post: operations["closeDeposit"];
160
160
  delete?: never;
@@ -174,7 +174,7 @@ export interface paths {
174
174
  put?: never;
175
175
  /**
176
176
  * Create an intent under the exact OAuth Grant
177
- * @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 `SignedAccountOpeningIntentClaims` or `SignedAccountClosureIntentClaims`, and every value the operation uses comes from those claims and none from the envelope carrying them. A string body sent as anything but `application/jwt` answers `415 unsupported_media_type`. A Signed Instruction that does not verify answers `400 invalid_signed_instruction` with its `reason`, and one whose `exp` passed `401 expired_signed_instruction`. A signed transfer is not an Intent: it is uploaded to `POST /transfers` as a `SignedTransferEnvelope` (ADR 0093), and transfer claims signed here are refused. A signed Intent is born approved when the signing client's Grant holds the family's `approve` action (`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`.
177
+ * @description The same creation has three 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 `SignedAccountOpeningIntentClaims` or `SignedAccountClosureIntentClaims`, and every value the operation uses comes from those claims and none from the envelope carrying them. An `application/jose+json` body is a signed transfer with `approved: false`: a `SignedTransferEnvelope`, a JWS in the General JSON Serialization, whose payload is `SignedTransferClaims`. It creates a transfer Intent that waits for a decision and answers a TransferIntent with `transfer_id` null. It is verified as `POST /transfers` verifies a signed transfer, with the same rules for the `jti` (a UUID in lowercase, and the only idempotency-key), `exp`, the keys, the `sender` and the `receiver`; the `unusable_key` reason means that the key is registered, but AndCo could not load it to check this signature, so its person registers a new key and revokes this one, then you sign again. A repeat of the same envelope answers the same Intent, and another body under the same `jti` answers `409 idempotency_conflict`. A signed transfer with `approved: true` answers `400 approved_use_transfers` and nothing is recorded: its signature is the approval, so send it to `POST /transfers`. A signed account opening or closure with `approved: true` stays accepted here and is born approved. A string body sent as anything but `application/jwt` answers `415 unsupported_media_type`. A Signed Instruction that does not verify answers `400 invalid_signed_instruction` with its `reason`, and one whose `exp` passed `401 expired_signed_instruction`. A signed account Intent is born approved when the signing client's Grant holds the family's `approve` action (`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 account Intent whose signer also holds the family's `approve`, the Intent born `approved`. 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 signed account Intent born approved answers the refusals of `POST /intents/{intent_id}/approve`.
178
178
  */
179
179
  post: operations["createIntent"];
180
180
  delete?: never;
@@ -191,22 +191,24 @@ export interface paths {
191
191
  cookie?: never;
192
192
  };
193
193
  /**
194
- * List the Transfers uploaded under the same exact OAuth Grant
195
- * @description For now it only finds one Transfer by the `jti` of the Signed Instruction that uploaded it, and `jti` is required (`400 invalid_request` when it is missing or is not a UUID); a listing without it can come later in the same shape. The answer is a collection of zero or one Transfer, with the reach of `GET /transfers/{transfer_id}`: only a Transfer uploaded under the same OAuth Grant and the same client, never another's. For any other `jti`, or one that another Grant or client uploaded, the collection is empty, so no answer tells them apart. It finds a Transfer whose `exp` has passed, which is its purpose: after a lost answer to `POST /transfers`, read by `jti` before signing again.
194
+ * Find a Transfer by the jti of its signed instruction
195
+ * @description It finds one Transfer by the `jti` of the signed transfer with `approved: true` that submitted it, and `jti` is required (`400 invalid_request` when it is missing or is not a UUID in lowercase). The answer is a collection of zero or one Transfer, with the reach of `GET /transfers/{transfer_id}`. A `jti` belongs to the client and the Grant's subject, across the client's Grants: a `jti` that another client or another subject used finds nothing, and so does the `jti` of a signed Intent, which stays on the Intent. The collection is empty in those cases, so no answer tells them apart. It finds a Transfer whose `exp` has passed, which is its purpose: after a lost answer to `POST /transfers`, read by `jti` before signing again. To list the Transfers of an account, use `GET /accounts/{bank_account_id}/transfers`.
196
196
  */
197
197
  get: operations["listTransfers"];
198
198
  put?: never;
199
199
  /**
200
- * Upload a signed transfer
201
- * @description Uploads one Transfer as a Signed Instruction (ADR 0093, ADR 0092): a `SignedTransferEnvelope`, a JWS in the General JSON Serialization sent as `application/jose+json`, whose payload is `SignedTransferClaims`. Every value the operation uses comes from the verified claims; the envelope is kept unchanged, because the same object travels to the core. Any other `Content-Type` answers `415 unsupported_media_type`, and an `Idempotency-Key` header `400 idempotency_key_not_allowed`: the `jti` is the idempotency key.
200
+ * Submit a signed transfer
201
+ * @description Submits one Transfer as a Signed Instruction: a `SignedTransferEnvelope`, a JWS in the General JSON Serialization sent as `application/jose+json`, whose payload is `SignedTransferClaims`. Every value the operation uses comes from the verified claims; the envelope is kept unchanged. Any other `Content-Type` answers `415 unsupported_media_type`, and an `Idempotency-Key` header `400 idempotency_key_not_allowed`: the `jti` is the idempotency-key.
202
202
  *
203
- * Before anything is stored: the token's Grant must hold `bank_transfer` `create` (`403 insufficient_authorization`). The envelope must have its shape and at least one signature, each with a protected header of `typ` `transfer.v1+jwt` (`400 invalid_signed_instruction` with `reason` `malformed_assertion` and its `issues`, or `missing_signature`). Every signature must verify, each with a key registered under a Project of the holder, the Grant's subject: `unknown_key` (a `kid` that is no key of the holder's Projects, a key of another holder included), `revoked_key`, `expired_key`, `disallowed_algorithm` or `invalid_signature`. The claims must be `SignedTransferClaims` (`invalid_claims` with `issues`) and `iss` the presenting client (`wrong_issuer`); an `exp` that passed answers `401 expired_signed_instruction`, and the `exp` of a new `jti` less than 15 minutes after the upload `400 invalid_signed_instruction` with `reason` `expiration_too_soon` (nothing is stored), so sign with an `exp` at least 15 minutes ahead (`bank-sdk` signs 30 minutes ahead). The floor applies only to a new `jti`: the same instruction sent again (same `jti`, same content) is never refused for it, however little of its `exp` is left, and answers or releases the same Transfer as before. That is how a stored Transfer is released after `409 interaction_required` or `503 temporarily_unavailable`. A client that lost the answer can also read the Transfer with `GET /transfers?jti=`, which finds it even after its `exp`. The `sender` must be an AndCo account of the holder that the Grant's `sources` cover (`422 invalid_source`, found by its `account_number`) and must match it (`422 sender_mismatch`; `422 transfer_sender_identity_unavailable` while AndCo knows no RUT for the holder). The Grant's `destinations` must cover the `receiver` (`422 invalid_destination`) and its limits the amount (`422 amount_out_of_grant`). `approved: true` needs `bank_transfer` `approve` within its maximum: `403 insufficient_authorization` otherwise, never a transfer that waits silently.
203
+ * The signature is the approval: the claims must have `approved: true`, and the Transfer exists as soon as it is submitted, with no decision to wait for. A signed transfer with `approved: false` answers `400 approval_required_use_intents` and nothing is stored: send it to `POST /intents`, which creates an Intent that waits for a decision.
204
+ *
205
+ * Before anything is stored: the token's Grant must hold `bank_transfer` `create` (`403 insufficient_authorization`). The envelope must have its shape and at least one signature, each with a protected header of `typ` `transfer.v1+jwt` (`400 invalid_signed_instruction` with `reason` `malformed_assertion` and its `issues`, or `missing_signature`). Every signature must verify, each with a key registered under a Project of the holder, the Grant's subject: `unknown_key` (a `kid` that is no key of the holder's Projects, a key of another holder included), `revoked_key`, `expired_key`, `unusable_key`, `disallowed_algorithm` or `invalid_signature`. `unusable_key` means that the key is registered, but AndCo could not load it to check this signature: its person registers a new key and revokes this one, then you sign again. The claims must be `SignedTransferClaims` (`invalid_claims` with `issues`; the `jti` must be a UUID in lowercase) and `iss` the presenting client (`wrong_issuer`); an `exp` that passed answers `401 expired_signed_instruction`, and the `exp` of a new `jti` less than 15 minutes after the submission `400 invalid_signed_instruction` with `reason` `expiration_too_soon` (nothing is stored), so sign with an `exp` at least 15 minutes ahead (`bank-sdk` signs 30 minutes ahead). The floor applies only to a new `jti`: the same instruction sent again (same `jti`, same content) is never refused for it, however little of its `exp` is left, and answers or releases the same Transfer as before. That is how a stored Transfer is released after `409 interaction_required` or `503 temporarily_unavailable`. A client that lost the answer can also read the Transfer with `GET /transfers?jti=`, which finds it even after its `exp`. The `sender` must be an AndCo account of the holder that the Grant's `sources` cover (`422 invalid_source`, found by its `account_number`) and must match it (`422 sender_mismatch`; `422 transfer_sender_identity_unavailable` while AndCo knows no RUT for the holder). The Grant's `destinations` must cover the `receiver` (`422 invalid_destination`) and its limits the amount (`422 amount_out_of_grant`). The signed transfer needs `bank_transfer` `approve` within its maximum: `403 insufficient_authorization` otherwise, never a transfer that waits silently.
204
206
  *
205
207
  * The same `jti` with the same claims answers the same Transfer and never moves money twice; the same `jti` with any other content, `exp` included, answers `409 idempotency_conflict`. To sign again with a new `exp`, use a new `jti`.
206
208
  *
207
- * Where AndCo's core verifies signatures, every key must also be registered in the core, for any signed transfer (`unsynced_key`).
209
+ * A key that AndCo does not accept yet for signed transfers answers `unsynced_key`.
208
210
  *
209
- * A transfer between two accounts of the same holder works where AndCo serves that rail (otherwise `501 not_implemented` with `code: own_account_transfer_not_implemented`): an approved one is released at once with nobody present and answers `processing.confirmed` or `succeeded`, or the release's refusals of `POST /intents/{intent_id}/approve` (`409 interaction_required` with `bank_connection_*` when the web session that acts for the holder needs its person; sending the same instruction again once they acted releases it). A transfer that leaves its holder answers `501 not_implemented` with `code: signed_outgoing_transfer_not_implemented` where AndCo does not verify signatures, and nothing is created; where it does, an approved one is sent to the core at once with nobody present: no web AndPass and no SMS code, because the core verifies the signature itself. The fraud engine still evaluates it. It answers `processing.confirmed` (or `succeeded`) once the core accepts it, `failed.fraud_rejected` when the engine refuses it, `failed.bank_challenge_required` when the engine asks for a challenge (nobody answers it: send the same transfer as an Intent a person confirms), and `failed.<code>` when the core refuses the signature (`unknown_key`, `revoked_key`, `invalid_signature`, `expired_signed_instruction`, `sender_mismatch`) or the request (`bank_refused`). On either rail, a key that signed it and is revoked or expired when the Transfer executes fails it with `failed.revoked_key` or `failed.expired_key`, even if the key was valid at upload, and nothing is sent; so does a key the core no longer holds, with `failed.unknown_key`, for one that leaves its holder. While the core's answer is not known it stays `requires_action`: read it later, or send the same envelope again, which never moves money twice. `503 temporarily_unavailable` means it was stored and not sent, because the sender account already had two fraud evaluations in the last minute (the `message` says until when): send the same envelope again after that. `409 interaction_required` with `bank_connection_*` means the web session that acts for the holder needs its person, and nothing was created. An unapproved Transfer waits, `requires_action`, for `POST /intents/{intent_id}/approve` with its `id`, or for a member of an Organization who may approve its transfers, and is sent the same way once approved.
211
+ * A transfer between two accounts of the same holder works where AndCo serves that rail (otherwise `501 not_implemented` with `code: own_account_transfer_not_implemented`): it is released at once with nobody present and answers `processing` or `succeeded`, or the release's refusals of `POST /intents/{intent_id}/approve` (`409 interaction_required` with `bank_connection_*` when the web session that acts for the holder needs its person; sending the same instruction again once they acted releases it). A transfer that leaves its holder answers `501 not_implemented` with `code: signed_outgoing_transfer_not_implemented` while AndCo does not serve that rail, and nothing is created; otherwise it is sent at once with nobody present: no web AndPass and no SMS code, because the signature itself authorizes it. It is still screened. It answers `processing` once AndCo accepts it, and later `succeeded`; it answers `failed` with its `status_detail` when the screening refuses it (`fraud_rejected`), when the signature is refused (`unknown_key`, `revoked_key`, `invalid_signature`, `expired_signed_instruction`, `sender_mismatch`) or when the bank refuses the request (`bank_refused`). A signature that needs a proof only a person can give fails too: send the same transfer as an Intent that a person confirms. On either rail, a key that signed it and is revoked or expired when the Transfer executes fails it with `expired_key` or `revoked_key`, even if the key was valid at submission, and nothing is sent; so does a key AndCo no longer holds, with `unknown_key`, for one that leaves its holder. While no final answer is known it reads `processing`: read it later with `GET /transfers/{transfer_id}`, or send the same envelope again, which never moves money twice. `503 temporarily_unavailable` means it was stored and not sent, because the sender account already had two transfer evaluations in the last minute (the `message` says until when): send the same envelope again after that. `409 interaction_required` with `bank_connection_*` means the web session that acts for the holder needs its person, and nothing was created.
210
212
  */
211
213
  post: operations["createTransfer"];
212
214
  delete?: never;
@@ -224,7 +226,7 @@ export interface paths {
224
226
  };
225
227
  /**
226
228
  * List the banks a transfer can be sent to
227
- * @description The banks of Core's catalog, each with its four-digit code and its name: the `bank_code` values a Receptor (a `bank_transfer` destination of type `external`) names, so an integrator never guesses one. `@andco/protocol` also exports the known codes as `CHILEAN_BANK_CODES`, which no validation reads; a code Core does not know 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.
229
+ * @description The banks a transfer can be sent to, each with its four-digit code and its name: the `bank_code` values a Receptor (a `bank_transfer` destination of type `external`) names, so an integrator never guesses one. `@andco/protocol` also exports the known codes as `CHILEAN_BANK_CODES`, which no validation reads; a code the catalog does not know fails with `unsupported_bank` when the transfer is executed. Granted by a `bank_transfer` authorization detail with `create`. It is read on behalf of the subject through one of the accounts that detail reaches, so a subject without any answers `409 interaction_required`. 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.
228
230
  */
229
231
  get: operations["getBankCatalog"];
230
232
  put?: never;
@@ -299,7 +301,10 @@ export interface paths {
299
301
  path?: never;
300
302
  cookie?: never;
301
303
  };
302
- /** Read one Transfer uploaded under the same exact OAuth Grant */
304
+ /**
305
+ * Read one Transfer
306
+ * @description A client reads the Transfers that it created for the same subject, under any of its active Grants that holds `bank_transfer` `create`, `approve` or `reject`. A Grant with `bank_transfer` `read` also reads the Transfers of any origin whose sender account it covers. Any other Transfer answers `404`, as if it did not exist.
307
+ */
303
308
  get: operations["getTransfer"];
304
309
  put?: never;
305
310
  post?: never;
@@ -346,7 +351,7 @@ export interface paths {
346
351
  patch?: never;
347
352
  trace?: never;
348
353
  };
349
- "/accounts/{bank_account_id}/transactions": {
354
+ "/accounts/{bank_account_id}/movements": {
350
355
  parameters: {
351
356
  query?: never;
352
357
  header?: never;
@@ -354,10 +359,30 @@ export interface paths {
354
359
  cookie?: never;
355
360
  };
356
361
  /**
357
- * List one account's transactions
358
- * @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 AndCo on behalf of the subject, and its read model walks forward only: `pageInfo.endCursor` is AndCo'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.
362
+ * List one account's Movements
363
+ * @description Answers the Movements 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_movement` 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 AndCo on behalf of the subject, and its read model walks forward only: `pageInfo.endCursor` is AndCo's own cursor for the next page, handed over untouched, and `after` accepts nothing else (`invalid_cursor` otherwise). There is no cursor per Movement, no backward walk and no offset: `before`, `last`, `offset` and `limit` answer `invalid_request`. Returns edges and camelCase pageInfo.
359
364
  */
360
- get: operations["listAccountTransactions"];
365
+ get: operations["listAccountMovements"];
366
+ put?: never;
367
+ post?: never;
368
+ delete?: never;
369
+ options?: never;
370
+ head?: never;
371
+ patch?: never;
372
+ trace?: never;
373
+ };
374
+ "/accounts/{bank_account_id}/transfers": {
375
+ parameters: {
376
+ query?: never;
377
+ header?: never;
378
+ path?: never;
379
+ cookie?: never;
380
+ };
381
+ /**
382
+ * List the Transfers that leave one account
383
+ * @description The Transfers whose sender is this account, newest first, one page at a time: feed `pageInfo.endCursor` back as `?after=` while `pageInfo.hasNextPage`. 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. 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. With a `bank_transfer` `read` detail whose `accounts` reach the account, the page holds every Transfer that leaves it, in any status (failed and cancelled included) and of any origin: another Project, the AndCo web app or the issuer's own channels. Without `read`, the page holds only the Transfers that this client created for the same subject, under any of its active Grants that holds `bank_transfer` `create`, `approve` or `reject`, in any status. The route never answers `403` for a narrower Grant: it answers a smaller page, which can be empty. It holds no Intent and no draft: the Intents stay under `/intents`. Money that arrives in the account is not a Transfer of it: it shows as a credit Movement. Each edge has its own cursor, which stays stable when new Transfers arrive. `before`, `last`, `offset` and `limit` answer `invalid_request`.
384
+ */
385
+ get: operations["listAccountTransfers"];
361
386
  put?: never;
362
387
  post?: never;
363
388
  delete?: never;
@@ -454,7 +479,7 @@ export interface paths {
454
479
  cookie?: never;
455
480
  };
456
481
  /**
457
- * Replay account facts with account transaction read permission
482
+ * Replay account facts with account movement read permission
458
483
  * @description Returns edges and camelCase pageInfo. Cursor and offset argument families cannot be mixed.
459
484
  */
460
485
  get: operations["readAccountEvents"];
@@ -517,7 +542,7 @@ export interface paths {
517
542
  put?: never;
518
543
  /**
519
544
  * Reject an Intent with a Grant holding the family's reject action
520
- * @description An approver declining an Intent, recorded as a Rejection and kept apart from a Cancellation (the creator withdrawing it). The Grant behind the token must hold `reject` on the family that releases this Intent type for the same subject; no maximum applies to a rejection. Answers `409 intent_expired` when the Intent's deadline has passed.
545
+ * @description An approver declining an Intent, recorded as a Rejection and kept apart from a Cancellation (the creator withdrawing it). The Grant behind the token must hold `reject` on the family that releases this Intent type for the same subject; no maximum applies to a rejection. The `reason` is optional: when given it has 1 to 280 characters, and it is recorded with the Rejection. Answers `409 intent_expired` when the Intent's deadline has passed.
521
546
  */
522
547
  post: operations["rejectIntent"];
523
548
  delete?: never;
@@ -569,6 +594,10 @@ export interface components {
569
594
  /** @constant */
570
595
  type: "account_closure";
571
596
  status: components["schemas"]["IntentStatus"];
597
+ /** @description The outcome of the account closure once the Intent is `approved`: `processing` from the approval until AndCo answers, then `succeeded` or `failed`. Null while the Intent has no decision, and for ever when it ends rejected, cancelled or expired. The Intent stays `approved` in every case: a refusal does not revive it, and a new try is a new Intent. */
598
+ account_closure_status: ("processing" | "succeeded" | "failed") | null;
599
+ /** @description Why the closure failed, null when it did not: `bank_account_not_found` and `bank_account_balance_not_zero`. The vocabulary is open: a word added later appears here as it is, so decide on the status. */
600
+ account_closure_status_detail: string | null;
572
601
  /** @description Whether a Signed Instruction created this Intent rather than a plain request. */
573
602
  signed: boolean;
574
603
  account: components["schemas"]["IntentAccount"];
@@ -603,7 +632,7 @@ export interface components {
603
632
  expires_in?: never;
604
633
  expires_at: string;
605
634
  };
606
- /** @description Authoritative Project-facing state of an account opening. It carries no amount and no fee: an opening moves no money. Opening is asynchronous, so `account.bank_account_id` is absent until the core assigns the Número de Cuenta, which arrives on the account's own event stream rather than in this response. */
635
+ /** @description Authoritative Project-facing state of an account opening. It carries no amount and no fee: an opening moves no money. Opening is asynchronous, so `account.bank_account_id` is absent until AndCo assigns the Número de Cuenta, which arrives on the account's own event stream rather than in this response. */
607
636
  AccountOpeningIntent: {
608
637
  /** Format: uuid */
609
638
  id: string;
@@ -626,6 +655,10 @@ export interface components {
626
655
  /** @constant */
627
656
  type: "account_opening";
628
657
  status: components["schemas"]["IntentStatus"];
658
+ /** @description The outcome of the account opening once the Intent is `approved`: `processing` from the approval until AndCo answers, then `succeeded` or `failed`. Null while the Intent has no decision, and for ever when it ends rejected, cancelled or expired. The Intent stays `approved` in every case: a refusal does not revive it, and a new try is a new Intent. */
659
+ account_opening_status: ("processing" | "succeeded" | "failed") | null;
660
+ /** @description Why the opening failed, null when it did not: `bank_authorization_denied`, `bank_holder_without_account`, `bank_account_limit_reached`, `account_opening_not_implemented`, `bank_core_unavailable`, `bank_account_save_failed`, `bank_connection_unavailable`, `bank_account_quota_exceeded` and `account_key_taken`. The vocabulary is open: a word added later appears here as it is, so decide on the status. */
661
+ account_opening_status_detail: string | null;
629
662
  /** @description Whether a Signed Instruction created this Intent rather than a plain request. */
630
663
  signed: boolean;
631
664
  account: {
@@ -747,11 +780,11 @@ export interface components {
747
780
  type: string | null;
748
781
  /** @description Null while the balance projection does not know the account yet. */
749
782
  currency: string | null;
750
- /** @description The ledger balance AndCo maintains for the account, as a decimal string, never a number. It is what the account holds after its last movement; funds 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. */
783
+ /** @description The balance AndCo maintains for the account, as a decimal string, never a number. It is what the account holds after its last movement; funds on hold are not subtracted from it. Null while AndCo does not know the account's balance 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
784
  balance: string | null;
752
785
  };
753
786
  BankCatalogEntry: {
754
- /** @description The bank's four-digit code in Core's catalog: the `bank_code` of a Receptor. */
787
+ /** @description The bank's four-digit code: the `bank_code` of a Receptor. */
755
788
  id: string;
756
789
  /** @description The bank's name as the bank lists it. */
757
790
  name: string;
@@ -764,32 +797,42 @@ export interface components {
764
797
  }[];
765
798
  pageInfo: components["schemas"]["PageInfo"];
766
799
  };
767
- BankTransaction: {
800
+ Movement: {
801
+ /** @constant */
802
+ object: "movement";
768
803
  /** Format: uuid */
769
804
  id: string;
770
- transactionId: string | null;
805
+ /** @description The ledger id of the transaction that posted this Movement, or null when AndCo has none. A Transfer that succeeded carries the same id of its debit. */
806
+ transaction_id: string | null;
771
807
  description: string;
772
- /** @description Issued by AndCo and republished exactly as AndCo sent it, with none of the digit-count bound of an AndCo-defined amount. What tells an inflow from an outflow is `movement_type`, not a sign: AndCo sends the amount as a positive figure. */
773
- amount: string;
808
+ /** @description A positive integer in whole pesos (CLP). What tells an inflow from an outflow is `movement_type`, not a sign. */
809
+ amount: number;
810
+ /**
811
+ * @description The currency of the account: a permission never assumes it, so the node names it.
812
+ * @constant
813
+ */
814
+ currency: "CLP";
774
815
  /**
775
- * @description The kind of movement, under AndCo's own field name and in its own words. `deposit` and `interest` bring money into this account and raise its balance; `withdrawal` takes money out and lowers it. `amount` is always positive, so `movement_type` is what tells an inflow from an outflow.
816
+ * @description The kind of Movement, in AndCo's own words. `deposit` and `interest` bring money into this account and raise its balance; `withdrawal` takes money out and lowers it. `amount` is always positive, so `movement_type` is what tells an inflow from an outflow.
776
817
  * @enum {string}
777
818
  */
778
819
  movement_type: "deposit" | "interest" | "withdrawal";
779
- origin: string | null;
820
+ movement_origin: string | null;
780
821
  /** Format: date-time */
781
- date: string;
782
- /** @description Same provenance as `amount`: issued by AndCo and republished exactly, never normalized. Real balances do go negative, so the sign is not narrowed away. */
783
- runningBalance: string | null;
784
- paymentType: string | null;
822
+ movement_date: string;
823
+ /** @description The balance after this Movement, an integer in whole pesos, or null when AndCo did not send one: it is never made up. Real balances do go negative, so the sign is not narrowed away. */
824
+ running_balance: number | null;
825
+ payment_type: string | null;
785
826
  reversed: boolean;
786
827
  note: string | null;
828
+ /** @description The id of the Transfer that this debit belongs to, only when the Grant may read that Transfer: one this client created for the same subject, or any Transfer of an account that a `bank_transfer` `read` detail covers. Always present. A null never means that no Transfer exists: it means no Transfer that this Grant may read, and it is also null for a credit, for a Movement without a `transaction_id` and for one that AndCo has posted before AndCo recorded the Transfer, which fills on a later read. */
829
+ transfer_id: string | null;
787
830
  };
788
- /** @description A connection read live from AndCo, which issues one cursor per page and walks forward only. `pageInfo.endCursor` is that cursor and is null on the last page; `pageInfo.startCursor` is always null and `pageInfo.hasPreviousPage` always false. An edge's `cursor` is null: AndCo names no position inside a page, so a walk resumes from the end of a page, never from one transaction. */
789
- BankTransactionPage: {
831
+ /** @description A connection read live from AndCo, which issues one cursor per page and walks forward only. `pageInfo.endCursor` is that cursor and is null on the last page; `pageInfo.startCursor` is always null and `pageInfo.hasPreviousPage` always false. An edge's `cursor` is null: AndCo names no position inside a page, so a walk resumes from the end of a page, never from one Movement. */
832
+ MovementPage: {
790
833
  edges: {
791
834
  cursor: string | null;
792
- node: components["schemas"]["BankTransaction"];
835
+ node: components["schemas"]["Movement"];
793
836
  }[];
794
837
  pageInfo: components["schemas"]["PageInfo"];
795
838
  };
@@ -840,7 +883,7 @@ export interface components {
840
883
  * @description `<base>[.<detail>]`. Read the base, what precedes the first dot, to know whether the Deposit can still change: `requires_action` can, every other base is final. A Grant that ends cancels its waiting Deposits with a detail.
841
884
  * @enum {string}
842
885
  */
843
- status: "requires_action" | "completed" | "closed" | "expired" | "cancelled" | "cancelled.grant_revoked" | "cancelled.grant_expired" | "failed";
886
+ status: "requires_action" | "completed" | "closed" | "expired" | "cancelled" | "cancelled.grant_revoked" | "cancelled.grant_expired";
844
887
  attribution_version: number;
845
888
  closure: {
846
889
  /** Format: date-time */
@@ -985,10 +1028,10 @@ export interface components {
985
1028
  /** @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. */
986
1029
  GrantHolder: components["schemas"]["ProfileGrantHolder"] | components["schemas"]["OrganizationGrantHolder"];
987
1030
  GrantSubject: components["schemas"]["ProfileGrantSubject"] | components["schemas"]["ApplicationGrantSubject"];
988
- /** @description What AndCo Core checked about the identity's document. It belongs to the document (country, kind and number), so correcting the number voids it and correcting the names does not. It does not expire; the reader decides how old a validation it accepts. */
1031
+ /** @description What AndCo checked about the identity's document. It belongs to the document (country, kind and number), so correcting the number voids it and correcting the names does not. It does not expire; the reader decides how old a validation it accepts. */
989
1032
  IdentityValidation: {
990
1033
  /**
991
- * @description Who validated the identity. `andco_core` is AndCo Core, on its hosted page.
1034
+ * @description Who validated the identity. `andco_core` is AndCo's own check, on its hosted page.
992
1035
  * @enum {string}
993
1036
  */
994
1037
  validated_by: "andco_core";
@@ -998,23 +1041,23 @@ export interface components {
998
1041
  evidence: ("document" | "liveness" | "face_comparison")[];
999
1042
  /**
1000
1043
  * Format: uuid
1001
- * @description AndCo Core's identifier of the validation. Keep it as the reference to the validation.
1044
+ * @description AndCo's identifier of the validation. Keep it as the reference to the validation.
1002
1045
  */
1003
1046
  verification_id: string;
1004
1047
  };
1005
1048
  Intent: components["schemas"]["DepositIntent"] | components["schemas"]["TransferIntent"] | components["schemas"]["AccountOpeningIntent"] | components["schemas"]["AccountClosureIntent"];
1006
1049
  /** @description One AndCo account of the Grant's subject, in the account matcher vocabulary: by Account Key (`{ type: "account_key", accountKey }`) or by identifier (`{ type: "account", id }`). It is where a transfer's money leaves from, where a deposit lands and the account a closure closes. An AccountKey is answered back as an AccountKey: it resolves to an account at execution. */
1007
1050
  IntentAccount: components["schemas"]["IntentAccountKey"] | components["schemas"]["IntentAccountId"];
1008
- /** @description A Receptor at a Chilean bank, in Core's vocabulary (`receiver` without the amount): the four-digit `bank_code` (Andco is `0739`), the `account_type` code (`"10"` savings, `"20"` checking, `"40"` debit), the `account_number`, and the holder's `name` and RUT. `country` and `national_kind_id` are always declared. It carries every field a `bank_transfer` `external` matcher can fix, so the Grant's destinations are asked about exactly this account. */
1051
+ /** @description A Receptor at a Chilean bank, in the transfer vocabulary of the API (`receiver` without the amount): the four-digit `bank_code` (AndCo is `0739`), the `account_type` code (`"10"` savings, `"20"` checking, `"40"` debit), the `account_number`, and the holder's `name` and RUT. `country` and `national_kind_id` are always declared. It carries every field a `bank_transfer` `external` matcher can fix, so the Grant's destinations are asked about exactly this account. */
1009
1052
  IntentAccountExternal: {
1010
1053
  /** @constant */
1011
1054
  type: "external";
1012
1055
  /** @constant */
1013
1056
  country: "CL";
1014
- /** @description The bank's four-digit code in Core's catalog. Andco is `0739`. */
1057
+ /** @description The bank's four-digit code, as `GET /catalogs/banks` lists it. AndCo is `0739`. */
1015
1058
  bank_code: string;
1016
1059
  /**
1017
- * @description Core's account type code: `"10"` savings, `"20"` checking, `"40"` debit (cuenta vista).
1060
+ * @description The account type code: `"10"` savings, `"20"` checking, `"40"` debit (cuenta vista).
1018
1061
  * @enum {string}
1019
1062
  */
1020
1063
  account_type: "10" | "20" | "40";
@@ -1051,7 +1094,7 @@ export interface components {
1051
1094
  editable?: boolean;
1052
1095
  };
1053
1096
  IntentCancellation: {
1054
- reason: string;
1097
+ reason?: string;
1055
1098
  };
1056
1099
  /** @description The comment a request asks for. `editable: true` lets the person who confirms change it; each operation freezes its own final note at confirmation. */
1057
1100
  IntentNote: {
@@ -1064,17 +1107,17 @@ export interface components {
1064
1107
  editable?: boolean;
1065
1108
  };
1066
1109
  IntentRejection: {
1067
- reason: string;
1110
+ reason?: string;
1068
1111
  };
1069
1112
  /**
1070
- * @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.
1113
+ * @description `<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `approved`, `rejected`, `cancelled`, `expired`, and, for a deposit only, `completed` and `closed`. It tells whether the Intent can still change: `requires_action` 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.
1071
1114
  *
1072
- * 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 AndPass or typing the SMS code does not change its status. It becomes `processing.confirmed`, and `transfer.confirmed` is published once, when AndCo 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 AndCo 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 AndCo 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). A signed Transfer that leaves its holder (`POST /transfers`, ADR 0092) is never confirmed by a person: it also fails with `failed.bank_challenge_required` (the bank's fraud engine asked for a challenge nobody answers for a signature; send the same transfer as an Intent a person confirms) or with the core's refusal of its signature, in the words the upload uses: `failed.unknown_key` (the core holds no such key), `failed.revoked_key`, `failed.invalid_signature`, `failed.expired_signed_instruction` (its `exp` passed before the core executed it) and `failed.sender_mismatch`. A signed Transfer on either rail also fails, before anything is sent, when a key that signed it is no longer usable as it executes, even if it was at upload: `failed.revoked_key`, `failed.expired_key`, or `failed.unknown_key` (no Project of the holder has it any more, or, for one that leaves its holder, the core no longer holds it). In `failed.fraud_rejected`, `failed.bank_refused`, `failed.own_account_transfer_not_implemented`, `failed.bank_challenge_required`, `failed.expired_key` and the core's refusals of a signature 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`.
1115
+ * An Intent is the request for a decision, and it ends at that decision. `requires_action`: nobody has decided yet. `approved`: a person or a credential approved it; that is the end of the Intent, and the operation it asked for goes on elsewhere. `rejected`: an approver declined it. `cancelled`: the Project that created it withdrew it, or its Grant ended (`cancelled.grant_revoked`, `cancelled.grant_expired`), or a data migration of AndCo cancelled it (`cancelled.migration`, a transfer Intent that was already past its approval in a development or staging environment: no Transfer exists for it). `expired`: nobody decided before its deadline. A deposit has no approval: it ends `completed` when it collected its amount, or `closed`.
1073
1116
  *
1074
- * `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.
1117
+ * The outcome of an approved Intent is not here. An approved transfer Intent names its Transfer in `transfer_id`, and the Transfer carries `status` and `status_detail` (`processing`, `succeeded`, `failed`, `cancelled`). An approved account opening or closure carries its outcome beside `approved`, in `account_opening_status` or `account_closure_status` (`processing`, `succeeded` or `failed`) with the detail that says why.
1075
1118
  * @enum {string}
1076
1119
  */
1077
- 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_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "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";
1120
+ IntentStatus: "requires_action" | "approved" | "rejected" | "cancelled" | "cancelled.grant_revoked" | "cancelled.grant_expired" | "cancelled.migration" | "expired" | "completed" | "closed";
1078
1121
  Organization: {
1079
1122
  id: string;
1080
1123
  name: string;
@@ -1311,7 +1354,7 @@ export interface components {
1311
1354
  [key: string]: unknown;
1312
1355
  };
1313
1356
  };
1314
- /** @description The claims of a signed transfer (`typ` `transfer.v1+jwt`): Core's `POST /api/transfer` body (with its optional `metadata`) plus `iss`, `aud`, `jti`, `exp` and `approved`. Strict: an unknown claim, country or document is refused, nothing names an Account Key or an Andco account id, and the only deadline is `exp`. */
1357
+ /** @description The claims of a signed transfer (`typ` `transfer.v1+jwt`): `sender`, `receiver` and `comment` (with an optional `metadata`) plus `iss`, `aud`, `jti`, `exp` and `approved`. Strict: an unknown claim, country or document is refused, nothing names an Account Key or an AndCo account id, and the only deadline is `exp`. */
1315
1358
  SignedTransferClaims: {
1316
1359
  /** @description The signing Project's `client_id`. */
1317
1360
  iss: string;
@@ -1319,12 +1362,12 @@ export interface components {
1319
1362
  aud: "https://api.andco.com";
1320
1363
  /**
1321
1364
  * Format: uuid
1322
- * @description Names the Transfer: Core's `Idempotency-Key`. The same `jti` with other content is a conflict.
1365
+ * @description A UUID in lowercase. It names the Transfer: it is its idempotency-key. The same `jti` with other content is a conflict.
1323
1366
  */
1324
1367
  jti: string;
1325
- /** @description Unix seconds after which the core refuses to execute the transfer. */
1368
+ /** @description Unix seconds after which the transfer is refused. */
1326
1369
  exp: number;
1327
- /** @description `true` orders the transfer sent to the core as soon as it is uploaded, which needs `bank_transfer` `approve` in the Grant. */
1370
+ /** @description `true` orders the transfer sent as soon as it is submitted, which needs `bank_transfer` `approve` in the Grant. */
1328
1371
  approved: boolean;
1329
1372
  sender: components["schemas"]["TransferSender"];
1330
1373
  receiver: components["schemas"]["TransferReceiver"];
@@ -1339,7 +1382,7 @@ export interface components {
1339
1382
  SignedTransferEnvelope: {
1340
1383
  /** @description The base64url of the JSON claims (`SignedTransferClaims`). */
1341
1384
  payload: string;
1342
- /** @description At least one signature over the same payload; the core verifies every one. */
1385
+ /** @description At least one signature over the same payload; every one is verified. */
1343
1386
  signatures: {
1344
1387
  /** @description The base64url of the JSON protected header (`SignedTransferHeader`). */
1345
1388
  protected: string;
@@ -1364,7 +1407,7 @@ export interface components {
1364
1407
  /** @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. */
1365
1408
  confirmed: number | null;
1366
1409
  };
1367
- /** @description A Transfer uploaded as a Signed Instruction (ADR 0093), in Core's vocabulary: `sender`, `receiver` (with the amount, an integer in the minor unit of the currency) and `comment` exactly as signed. `status` is where it stands; `core_status` the core's own word, for the record. */
1410
+ /** @description A Transfer, with one shape for every origin. `sender` and `receiver` have the same fields, and `amount` and `currency` sit on the Transfer. It has no `approved` and no deadline: the decision belongs to the Intent. */
1368
1411
  Transfer: {
1369
1412
  /** @constant */
1370
1413
  object: "transfer";
@@ -1373,36 +1416,81 @@ export interface components {
1373
1416
  * @description The Transfer's own id: what `GET /transfers/{transfer_id}` reads.
1374
1417
  */
1375
1418
  id: string;
1419
+ status: components["schemas"]["TransferStatus"];
1420
+ /** @description The word that says why, null when the status has none: `bank_refused` for a `failed` Transfer the bank refused for sure, `expired` for a `cancelled` one whose deadline passed, `grant_revoked` or `grant_expired` for one whose Grant ended. The vocabulary is open: a detail added later appears here as it is, so decide on `status`. */
1421
+ status_detail: string | null;
1376
1422
  /**
1377
- * Format: uuid
1378
- * @description The `jti` of the Signed Instruction that uploaded it. Sending the same instruction again answers this same Transfer.
1379
- */
1380
- jti: string;
1381
- /**
1382
- * @description Where the Transfer stands, in the words an Intent uses (`IntentStatus`): decide on the base, never on the whole value. A signed transfer that is not approved is `requires_action` until a Grant with `bank_transfer` `approve` or a person approves it. A transfer between two accounts of the same holder is `processing.confirmed` from its release until AndCo answers for good, then `succeeded` or `failed.<code>`.
1423
+ * @description Who made it: `oauth`, a Project through the API; `platform`, a person in the AndCo web app; `emisor`, a person in the issuer's own channels, for example its mobile app.
1383
1424
  * @enum {string}
1384
1425
  */
1385
- status: "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_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "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";
1386
- /** @description The core bancario's own word for its transfer (`requested`, `confirmed`, `rejected_insufficient_funds`, …), for the record. Null while AndCo has not read one. Never branch on it: a word the core adds later appears here as it is, and `status` is what to decide on. */
1387
- core_status: string | null;
1388
- /** @description The signed `approved`: whether the instruction ordered the transfer sent as soon as it was uploaded. */
1389
- approved: boolean;
1390
- sender: components["schemas"]["TransferSender"];
1391
- receiver: components["schemas"]["TransferReceiver"];
1392
- /** @description The signed comment, when there is one. */
1393
- comment?: string;
1426
+ origin: "oauth" | "platform" | "emisor";
1427
+ /** @description An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647. */
1428
+ amount: number;
1429
+ /** @constant */
1430
+ currency: "CLP";
1431
+ /** @description The Remitente: the account the money leaves and its holder. */
1432
+ sender: {
1433
+ /** @description The country of the account, for example `CL`. */
1434
+ country: string;
1435
+ /** @description The bank's four-digit code, as `GET /catalogs/banks` lists it. AndCo is `0739`. */
1436
+ bank_code: string;
1437
+ /**
1438
+ * @description The account type code: `"10"` savings, `"20"` checking, `"40"` debit (cuenta vista).
1439
+ * @enum {string}
1440
+ */
1441
+ account_type: "10" | "20" | "40";
1442
+ /** @description The account number, as its bank writes it. */
1443
+ account_number: string;
1444
+ /** @description The holder's name, or null when it is not known. */
1445
+ name: string | null;
1446
+ /** @description The kind of the holder's document, for example `RUT`, or null when it is not known. */
1447
+ national_kind_id: string | null;
1448
+ /** @description The holder's document number, or null when it is not known. */
1449
+ national_id: string | null;
1450
+ };
1451
+ /** @description The Receptor: the account the money lands on and its holder. */
1452
+ receiver: {
1453
+ /** @description The country of the account, for example `CL`. */
1454
+ country: string;
1455
+ /** @description The bank's four-digit code, as `GET /catalogs/banks` lists it. AndCo is `0739`. */
1456
+ bank_code: string;
1457
+ /**
1458
+ * @description The account type code: `"10"` savings, `"20"` checking, `"40"` debit (cuenta vista).
1459
+ * @enum {string}
1460
+ */
1461
+ account_type: "10" | "20" | "40";
1462
+ /** @description The account number, as its bank writes it. */
1463
+ account_number: string;
1464
+ /** @description The holder's name, or null when it is not known. */
1465
+ name: string | null;
1466
+ /** @description The kind of the holder's document, for example `RUT`, or null when it is not known. */
1467
+ national_kind_id: string | null;
1468
+ /** @description The holder's document number, or null when it is not known. */
1469
+ national_id: string | null;
1470
+ };
1471
+ /** @description The Nota de operación, at most 60 bytes of UTF-8, or null when there is none. */
1472
+ comment: string | null;
1473
+ /** @description The Intent this Transfer came from. Null for origin `emisor` (no request came first) and for a signed transfer with `approved: true` (its signature approved it, so there was no request). */
1474
+ intent_id: string | null;
1475
+ /** @description The `jti` of the signed transfer with `approved: true` that submitted it, a UUID in lowercase. Null for any other Transfer: the `jti` of a signed Intent stays on the Intent. `GET /transfers?jti=` finds only a Transfer that has one. */
1476
+ jti: string | null;
1477
+ /** @description The ledger id of the debit once the Transfer succeeded, else null. A Movement carries the same id. */
1478
+ transaction_id: string | null;
1394
1479
  /**
1395
1480
  * Format: date-time
1396
- * @description When the Transfer was uploaded.
1481
+ * @description When the Transfer came to exist.
1397
1482
  */
1398
1483
  created_at: string;
1399
- /**
1400
- * Format: date-time
1401
- * @description The Transfer's deadline: the signature's `exp`. A transfer still waiting for its approval at this instant expires.
1402
- */
1403
- expires_at: string;
1404
1484
  };
1405
- /** @description A connection of Transfers uploaded under the same exact OAuth Grant. `GET /transfers?jti=` answers zero edges or one, and an edge's `cursor` is null: AndCo names no position inside it. A listing without `jti` can arrive later in this same shape, so read `edges` and never assume one. */
1485
+ /** @description A connection of Transfers, newest first, walked forward with `after` and `first`. Each edge has its own opaque `cursor`, which encodes the order key (creation time and id), so a walk never skips or repeats a Transfer when new ones arrive. `pageInfo.endCursor` is the cursor of the last edge, and `hasNextPage` is false when no Transfer follows, also on a page of exactly `first` items. */
1486
+ TransferListPage: {
1487
+ edges: {
1488
+ cursor: string;
1489
+ node: components["schemas"]["Transfer"];
1490
+ }[];
1491
+ pageInfo: components["schemas"]["PageInfo"];
1492
+ };
1493
+ /** @description A connection of the Transfers that `GET /transfers?jti=` found: zero edges or one, and an edge's `cursor` is null, because AndCo names no position inside it. The list of an account has its own page, `TransferListPage`, with a cursor on each edge. */
1406
1494
  TransferPage: {
1407
1495
  edges: {
1408
1496
  cursor: string | null;
@@ -1410,11 +1498,36 @@ export interface components {
1410
1498
  }[];
1411
1499
  pageInfo: components["schemas"]["PageInfo"];
1412
1500
  };
1413
- /** @description The amount a transfer proposes: `value` is an integer in the minor unit of the currency (CLP: whole pesos), at most 2147483647 (int4, as Core stores it). `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 balance. Without `editable` (or with `false`) the amount is locked. What moved is `settled`. */
1501
+ /** @description One side of a Transfer: the account and its holder, with the same seven fields for the Remitente and the Receptor. The amount is on the Transfer. */
1502
+ TransferParty: {
1503
+ /** @description The country of the account, for example `CL`. */
1504
+ country: string;
1505
+ /** @description The bank's four-digit code, as `GET /catalogs/banks` lists it. AndCo is `0739`. */
1506
+ bank_code: string;
1507
+ /**
1508
+ * @description The account type code: `"10"` savings, `"20"` checking, `"40"` debit (cuenta vista).
1509
+ * @enum {string}
1510
+ */
1511
+ account_type: "10" | "20" | "40";
1512
+ /** @description The account number, as its bank writes it. */
1513
+ account_number: string;
1514
+ /** @description The holder's name, or null when it is not known. */
1515
+ name: string | null;
1516
+ /** @description The kind of the holder's document, for example `RUT`, or null when it is not known. */
1517
+ national_kind_id: string | null;
1518
+ /** @description The holder's document number, or null when it is not known. */
1519
+ national_id: string | null;
1520
+ };
1521
+ /**
1522
+ * @description Where the Transfer stands: `requires_action` while the person still owes the bank a step, `processing` while the bank holds it and has not answered for good, then `succeeded`, `failed` or `cancelled`, which are final. `status_detail` says why. There is no `rejected` Transfer: a rejection ends an Intent, and a rejected Intent has no Transfer.
1523
+ * @enum {string}
1524
+ */
1525
+ TransferStatus: "requires_action" | "processing" | "succeeded" | "failed" | "cancelled";
1526
+ /** @description The amount a transfer proposes: `value` is an integer in the minor unit of the currency (CLP: whole pesos), at most 2147483647. `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 balance. Without `editable` (or with `false`) the amount is locked. What moved is `settled`. */
1414
1527
  TransferAmountProposal: {
1415
1528
  /** @constant */
1416
1529
  currency: "CLP";
1417
- /** @description An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647, because Core stores it as int4. A larger one is refused with `max_value`. */
1530
+ /** @description An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647. A larger one is refused with `max_value`. */
1418
1531
  value: number;
1419
1532
  /**
1420
1533
  * @description Defaults to false when omitted.
@@ -1422,7 +1535,7 @@ export interface components {
1422
1535
  */
1423
1536
  editable?: boolean;
1424
1537
  };
1425
- /** @description The comment a transfer asks for, as Core's `comment`: at most 60 bytes of UTF-8 (`comment_too_long`). `editable: true` lets the person who confirms change it; the comment freezes at confirmation. */
1538
+ /** @description The comment a transfer asks for: at most 60 bytes of UTF-8 (`comment_too_long`). `editable: true` lets the person who confirms change it; the comment freezes at confirmation. */
1426
1539
  TransferCommentProposal: {
1427
1540
  /** @description Trimmed comment. An empty one is allowed. */
1428
1541
  value: string;
@@ -1432,7 +1545,7 @@ export interface components {
1432
1545
  */
1433
1546
  editable?: boolean;
1434
1547
  };
1435
- /** @description Authoritative Project-facing state of a transfer, in Core's vocabulary (ADR 0093). `sender` and `receiver` answer in the same matcher vocabulary as the request, and `comment` is the request's comment. `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. */
1548
+ /** @description Authoritative Project-facing state of a transfer request, in the transfer vocabulary of the API. The Intent is the request for a decision and ends at it: once it is `approved` it names its Transfer in `transfer_id`, and the money is followed on the Transfer. `sender` and `receiver` answer in the same matcher vocabulary as the request, and `comment` is the request's comment. `amount.value` is the proposal of the request and `amount.confirmed` the amount the person confirmed (null until then; it is what moves). `transfer.confirmed` and the events after it report the confirmed amount. */
1436
1549
  TransferIntent: {
1437
1550
  /** Format: uuid */
1438
1551
  id: string;
@@ -1454,6 +1567,8 @@ export interface components {
1454
1567
  /** @constant */
1455
1568
  type: "transfer";
1456
1569
  status: components["schemas"]["IntentStatus"];
1570
+ /** @description The id of the Transfer that exists after the Intent is approved: read it with `GET /transfers/{transfer_id}`. Null while the Intent waits, and for ever when it ends rejected, cancelled or expired, because no Transfer exists then. */
1571
+ transfer_id: string | null;
1457
1572
  /** @description Whether a Signed Instruction created this Intent rather than a plain request. */
1458
1573
  signed: boolean;
1459
1574
  /** @description The Remitente. Null while the person has yet to pick where the money leaves from. An AccountKey is answered back as an AccountKey, because it stays unresolved until execution. */
@@ -1470,12 +1585,12 @@ export interface components {
1470
1585
  amount: "0";
1471
1586
  };
1472
1587
  /**
1473
- * @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 AndCo asks the person to authorize it at `authorization_url` with their web AndPass and an SMS code; the Intent becomes `processing.confirmed` only when AndCo accepts it. A transfer created with `receiver: null` reads this way until the person completes it, because what she writes there always leaves her accounts. `source_account_required`: the person still picks the account the money leaves from.
1588
+ * @description Present on every read of the Intent while it is `requires_action` and only a person can complete it; absent once the Intent is no longer `requires_action`. `source_account_required`: the person still picks the account the money leaves from. A step that the bank asks after the approval, for example a verification with the web AndPass and an SMS code, belongs to the Transfer and is not an Intent reason.
1474
1589
  * @enum {string}
1475
1590
  */
1476
- interaction_reason?: "bank_verification_required" | "source_account_required";
1591
+ interaction_reason?: "source_account_required";
1477
1592
  };
1478
- /** @description The `application/json` half of creating a transfer: an Intent born waiting for an Approval, in Core's vocabulary (ADR 0093): `sender`, `receiver`, an integer `amount.value` and a `comment` of at most 60 bytes. A null `sender` is the confirmation screen, where a person picks the account the money leaves from among the Grant's sources, and a null `receiver` is the screen too: the person completes where the money goes (the bank, the type and number of the account, and its holder's RUT and name), and the server checks what she wrote against the Grant's `destinations` when she confirms, refusing one outside them with `invalid_destination`. Both default to null when omitted. A Receptor the request names is locked on the screen (`editable: true` is an `invalid_request`), and the amount is too unless `amount.editable` is true, in which case the person sets it. A Receptor at a bank is named in Core's vocabulary (`IntentAccountExternal`). A signed transfer is not an Intent: it is uploaded to `POST /transfers` as a `SignedTransferEnvelope`. */
1593
+ /** @description The `application/json` half of creating a transfer: an Intent born waiting for an Approval, in the transfer vocabulary of the API: `sender`, `receiver`, an integer `amount.value` and a `comment` of at most 60 bytes. A null `sender` is the confirmation screen, where a person picks the account the money leaves from among the Grant's sources, and a null `receiver` is the screen too: the person completes where the money goes (the bank, the type and number of the account, and its holder's RUT and name), and the server checks what she wrote against the Grant's `destinations` when she confirms, refusing one outside them with `invalid_destination`. Both default to null when omitted. A Receptor the request names is locked on the screen (`editable: true` is an `invalid_request`), and the amount is too unless `amount.editable` is true, in which case the person sets it. A Receptor at a bank is named in the transfer vocabulary of the API (`IntentAccountExternal`). A signed transfer is not an Intent: it is submitted to `POST /transfers` as a `SignedTransferEnvelope`. */
1479
1594
  TransferIntentCreate: {
1480
1595
  /** @default {} */
1481
1596
  metadata?: {
@@ -1519,7 +1634,7 @@ export interface components {
1519
1634
  expires_in?: never;
1520
1635
  expires_at: string | null;
1521
1636
  };
1522
- /** @description The Receptor of a transfer, in the `bank_transfer` matcher vocabulary: an AndCo account by AccountKey or identifier, or a Receptor at a Chilean bank in Core's vocabulary. */
1637
+ /** @description The Receptor of a transfer, in the `bank_transfer` matcher vocabulary: an AndCo account by AccountKey or identifier, or a Receptor at a Chilean bank in the transfer vocabulary of the API. */
1523
1638
  TransferIntentReceiver: components["schemas"]["IntentAccountKey"] | components["schemas"]["IntentAccountId"] | components["schemas"]["IntentAccountExternal"];
1524
1639
  /** @description The Receptor of a transfer when it is named, in the request and in the answered Intent alike. A named Receptor is always locked on the confirmation screen: `editable` only admits `false`, and `editable: true` fails at creation with `invalid_request`. To let the person choose where the money goes, the request says `receiver: null` instead (`TransferIntentCreate`). Defaults to false in a request; an answered Intent always states it, including a Receptor the person completed on the screen, which is locked once she confirms. */
1525
1640
  TransferIntentReceiverProposal: {
@@ -1546,10 +1661,10 @@ export interface components {
1546
1661
  type: "external";
1547
1662
  /** @constant */
1548
1663
  country: "CL";
1549
- /** @description The bank's four-digit code in Core's catalog. Andco is `0739`. */
1664
+ /** @description The bank's four-digit code, as `GET /catalogs/banks` lists it. AndCo is `0739`. */
1550
1665
  bank_code: string;
1551
1666
  /**
1552
- * @description Core's account type code: `"10"` savings, `"20"` checking, `"40"` debit (cuenta vista).
1667
+ * @description The account type code: `"10"` savings, `"20"` checking, `"40"` debit (cuenta vista).
1553
1668
  * @enum {string}
1554
1669
  */
1555
1670
  account_type: "10" | "20" | "40";
@@ -1566,60 +1681,60 @@ export interface components {
1566
1681
  */
1567
1682
  editable?: false;
1568
1683
  };
1569
- /** @description The Receptor, as Core's `receiver`: the account the money lands on, its holder, and the amount, an integer in the minor unit of the currency. `country` and `national_kind_id` are always declared. */
1684
+ /** @description The Receptor: the account the money lands on, its holder, and the amount, an integer in the minor unit of the currency. `country` and `national_kind_id` are always declared. */
1570
1685
  TransferReceiver: {
1571
1686
  /** @constant */
1572
1687
  country: "CL";
1573
- /** @description The bank's four-digit code in Core's catalog. Andco is `0739`. */
1688
+ /** @description The bank's four-digit code, as `GET /catalogs/banks` lists it. AndCo is `0739`. */
1574
1689
  bank_code: string;
1575
1690
  /**
1576
- * @description Core's account type code: `"10"` savings, `"20"` checking, `"40"` debit (cuenta vista).
1691
+ * @description The account type code: `"10"` savings, `"20"` checking, `"40"` debit (cuenta vista).
1577
1692
  * @enum {string}
1578
1693
  */
1579
1694
  account_type: "10" | "20" | "40";
1580
1695
  /** @description The account number, as its bank writes it. */
1581
1696
  account_number: string;
1582
- /** @description The holder's name. Core stores it as it arrives and never compares it. */
1697
+ /** @description The holder's name, kept as it arrives and never compared. */
1583
1698
  name: string;
1584
1699
  /** @constant */
1585
1700
  national_kind_id: "RUT";
1586
- /** @description The holder's RUT. Core compares it as a normalized RUT. */
1701
+ /** @description The holder's RUT, compared as a normalized RUT. */
1587
1702
  national_id: string;
1588
- /** @description An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647, because Core stores it as int4. A larger one is refused with `max_value`. */
1703
+ /** @description An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647. A larger one is refused with `max_value`. */
1589
1704
  amount: number;
1590
1705
  /** @constant */
1591
1706
  currency: "CLP";
1592
1707
  /**
1593
1708
  * Format: email
1594
- * @description Where Core notifies the Receptor.
1709
+ * @description Where the Receptor is notified.
1595
1710
  */
1596
1711
  email?: string;
1597
1712
  };
1598
- /** @description The Remitente, as Core's `sender`: the account the money leaves and its holder. `country` and `national_kind_id` are always declared. Core checks the country, the bank (`0739`), the account's own type and the holder's RUT; it stores `name` as it arrives. */
1713
+ /** @description The Remitente: the account the money leaves and its holder. `country` and `national_kind_id` are always declared. The country, the bank (`0739`), the account's own type and the holder's RUT are checked; `name` is kept as it arrives. */
1599
1714
  TransferSender: {
1600
1715
  /** @constant */
1601
1716
  country: "CL";
1602
- /** @description The bank's four-digit code in Core's catalog. Andco is `0739`. */
1717
+ /** @description The bank's four-digit code, as `GET /catalogs/banks` lists it. AndCo is `0739`. */
1603
1718
  bank_code: string;
1604
1719
  /**
1605
- * @description Core's account type code: `"10"` savings, `"20"` checking, `"40"` debit (cuenta vista).
1720
+ * @description The account type code: `"10"` savings, `"20"` checking, `"40"` debit (cuenta vista).
1606
1721
  * @enum {string}
1607
1722
  */
1608
1723
  account_type: "10" | "20" | "40";
1609
1724
  /** @description The account number, as its bank writes it. */
1610
1725
  account_number: string;
1611
- /** @description The holder's name. Core stores it as it arrives and never compares it. */
1726
+ /** @description The holder's name, kept as it arrives and never compared. */
1612
1727
  name: string;
1613
1728
  /** @constant */
1614
1729
  national_kind_id: "RUT";
1615
- /** @description The holder's RUT. Core compares it as a normalized RUT. */
1730
+ /** @description The holder's RUT, compared as a normalized RUT. */
1616
1731
  national_id: string;
1617
1732
  };
1618
1733
  /** @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. */
1619
1734
  TransferSettlement: {
1620
1735
  /** @constant */
1621
1736
  currency: "CLP";
1622
- /** @description An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647, because Core stores it as int4. A larger one is refused with `max_value`. */
1737
+ /** @description An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647. A larger one is refused with `max_value`. */
1623
1738
  value: number;
1624
1739
  /** Format: date-time */
1625
1740
  at: string;
@@ -1637,6 +1752,7 @@ export interface components {
1637
1752
  ProfileId: string;
1638
1753
  AddressId: string;
1639
1754
  IntentId: string;
1755
+ BankAccountId: string;
1640
1756
  };
1641
1757
  requestBodies: never;
1642
1758
  headers: never;
@@ -3844,6 +3960,7 @@ export interface operations {
3844
3960
  content: {
3845
3961
  "application/json": components["schemas"]["DepositIntentCreate"] | components["schemas"]["TransferIntentCreate"] | components["schemas"]["AccountOpeningIntentCreate"] | components["schemas"]["AccountClosureIntentCreate"];
3846
3962
  "application/jwt": string;
3963
+ "application/jose+json": components["schemas"]["SignedTransferEnvelope"];
3847
3964
  };
3848
3965
  };
3849
3966
  responses: {
@@ -3856,7 +3973,7 @@ export interface operations {
3856
3973
  "application/json": components["schemas"]["Intent"];
3857
3974
  };
3858
3975
  };
3859
- /** @description `invalid_request`, `idempotency_key_not_allowed`, `invalid_signed_instruction` */
3976
+ /** @description `invalid_request`, `idempotency_key_not_allowed`, `approved_use_transfers`, `invalid_signed_instruction` */
3860
3977
  400: {
3861
3978
  headers: {
3862
3979
  [name: string]: unknown;
@@ -3884,6 +4001,13 @@ export interface operations {
3884
4001
  message?: string;
3885
4002
  /** @description When present, an English sentence suggesting to the developer what to do about the error. Never branch on it and never show it to a person. */
3886
4003
  hint?: string;
4004
+ } | {
4005
+ /** @constant */
4006
+ error: "approved_use_transfers";
4007
+ /** @description An English sentence for the developer reading a log. Never branch on it and never show it to a person. */
4008
+ message?: string;
4009
+ /** @description When present, an English sentence suggesting to the developer what to do about the error. Never branch on it and never show it to a person. */
4010
+ hint?: string;
3887
4011
  } | {
3888
4012
  /** @constant */
3889
4013
  error: "invalid_signed_instruction";
@@ -4392,7 +4516,7 @@ export interface operations {
4392
4516
  };
4393
4517
  requestBody?: never;
4394
4518
  responses: {
4395
- /** @description The Transfers found: zero or one, as the Project that uploaded them reads them */
4519
+ /** @description The Transfers found: zero or one */
4396
4520
  200: {
4397
4521
  headers: {
4398
4522
  [name: string]: unknown;
@@ -4520,7 +4644,7 @@ export interface operations {
4520
4644
  };
4521
4645
  };
4522
4646
  responses: {
4523
- /** @description The Transfer uploaded, or the same one from a repeated instruction */
4647
+ /** @description The Transfer submitted, or the same one from a repeated instruction */
4524
4648
  201: {
4525
4649
  headers: {
4526
4650
  [name: string]: unknown;
@@ -4529,7 +4653,7 @@ export interface operations {
4529
4653
  "application/json": components["schemas"]["Transfer"];
4530
4654
  };
4531
4655
  };
4532
- /** @description `invalid_request`, `idempotency_key_not_allowed`, `invalid_signed_instruction` */
4656
+ /** @description `invalid_request`, `idempotency_key_not_allowed`, `approval_required_use_intents`, `invalid_signed_instruction` */
4533
4657
  400: {
4534
4658
  headers: {
4535
4659
  [name: string]: unknown;
@@ -4557,6 +4681,13 @@ export interface operations {
4557
4681
  message?: string;
4558
4682
  /** @description When present, an English sentence suggesting to the developer what to do about the error. Never branch on it and never show it to a person. */
4559
4683
  hint?: string;
4684
+ } | {
4685
+ /** @constant */
4686
+ error: "approval_required_use_intents";
4687
+ /** @description An English sentence for the developer reading a log. Never branch on it and never show it to a person. */
4688
+ message?: string;
4689
+ /** @description When present, an English sentence suggesting to the developer what to do about the error. Never branch on it and never show it to a person. */
4690
+ hint?: string;
4560
4691
  } | {
4561
4692
  /** @constant */
4562
4693
  error: "invalid_signed_instruction";
@@ -5380,7 +5511,7 @@ export interface operations {
5380
5511
  };
5381
5512
  requestBody?: never;
5382
5513
  responses: {
5383
- /** @description The Transfer, as the Project that uploaded it reads it */
5514
+ /** @description The Transfer */
5384
5515
  200: {
5385
5516
  headers: {
5386
5517
  [name: string]: unknown;
@@ -5781,7 +5912,7 @@ export interface operations {
5781
5912
  };
5782
5913
  };
5783
5914
  };
5784
- listAccountTransactions: {
5915
+ listAccountMovements: {
5785
5916
  parameters: {
5786
5917
  query?: {
5787
5918
  after?: components["parameters"]["After"];
@@ -5789,19 +5920,19 @@ export interface operations {
5789
5920
  };
5790
5921
  header?: never;
5791
5922
  path: {
5792
- bank_account_id: string;
5923
+ bank_account_id: components["parameters"]["BankAccountId"];
5793
5924
  };
5794
5925
  cookie?: never;
5795
5926
  };
5796
5927
  requestBody?: never;
5797
5928
  responses: {
5798
- /** @description Authorized cursor page of account transactions, newest first */
5929
+ /** @description Authorized cursor page of account Movements, newest first */
5799
5930
  200: {
5800
5931
  headers: {
5801
5932
  [name: string]: unknown;
5802
5933
  };
5803
5934
  content: {
5804
- "application/json": components["schemas"]["BankTransactionPage"];
5935
+ "application/json": components["schemas"]["MovementPage"];
5805
5936
  };
5806
5937
  };
5807
5938
  /** @description `invalid_request`, `invalid_identifier`, `invalid_cursor` */
@@ -5970,6 +6101,149 @@ export interface operations {
5970
6101
  };
5971
6102
  };
5972
6103
  };
6104
+ listAccountTransfers: {
6105
+ parameters: {
6106
+ query?: {
6107
+ after?: components["parameters"]["After"];
6108
+ first?: components["parameters"]["First"];
6109
+ };
6110
+ header?: never;
6111
+ path: {
6112
+ bank_account_id: components["parameters"]["BankAccountId"];
6113
+ };
6114
+ cookie?: never;
6115
+ };
6116
+ requestBody?: never;
6117
+ responses: {
6118
+ /** @description A page of Transfers, newest first */
6119
+ 200: {
6120
+ headers: {
6121
+ [name: string]: unknown;
6122
+ };
6123
+ content: {
6124
+ "application/json": components["schemas"]["TransferListPage"];
6125
+ };
6126
+ };
6127
+ /** @description `invalid_request`, `invalid_cursor` */
6128
+ 400: {
6129
+ headers: {
6130
+ [name: string]: unknown;
6131
+ };
6132
+ content: {
6133
+ "application/json": {
6134
+ /** @constant */
6135
+ error: "invalid_request";
6136
+ issues: {
6137
+ /** @description What failed, as a stable code: a schema check such as `max_length`, `regex` or `uuid`, or the code of a rule such as `note_too_long`. Map it to your own words. */
6138
+ type: string;
6139
+ /** @description Where it failed, as the keys from the root of the part of the request it belongs to; empty for the part as a whole. */
6140
+ path: string[];
6141
+ /** @description What the check required, when it has a value: the maximum of `max_length`, for instance. */
6142
+ requirement?: unknown;
6143
+ }[];
6144
+ /** @description An English sentence for the developer reading a log. Never branch on it and never show it to a person. */
6145
+ message?: string;
6146
+ /** @description When present, an English sentence suggesting to the developer what to do about the error. Never branch on it and never show it to a person. */
6147
+ hint?: string;
6148
+ } | {
6149
+ /** @constant */
6150
+ error: "invalid_cursor";
6151
+ /** @description An English sentence for the developer reading a log. Never branch on it and never show it to a person. */
6152
+ message?: string;
6153
+ /** @description When present, an English sentence suggesting to the developer what to do about the error. Never branch on it and never show it to a person. */
6154
+ hint?: string;
6155
+ };
6156
+ };
6157
+ };
6158
+ /** @description `invalid_token` */
6159
+ 401: {
6160
+ headers: {
6161
+ [name: string]: unknown;
6162
+ };
6163
+ content: {
6164
+ "application/json": {
6165
+ /** @constant */
6166
+ error: "invalid_token";
6167
+ /** @description An English sentence for the developer reading a log. Never branch on it and never show it to a person. */
6168
+ message?: string;
6169
+ /** @description When present, an English sentence suggesting to the developer what to do about the error. Never branch on it and never show it to a person. */
6170
+ hint?: string;
6171
+ };
6172
+ };
6173
+ };
6174
+ /** @description `invalid_origin` */
6175
+ 403: {
6176
+ headers: {
6177
+ [name: string]: unknown;
6178
+ };
6179
+ content: {
6180
+ "application/json": {
6181
+ /** @constant */
6182
+ error: "invalid_origin";
6183
+ /** @description An English sentence for the developer reading a log. Never branch on it and never show it to a person. */
6184
+ message?: string;
6185
+ /** @description When present, an English sentence suggesting to the developer what to do about the error. Never branch on it and never show it to a person. */
6186
+ hint?: string;
6187
+ };
6188
+ };
6189
+ };
6190
+ /** @description `not_found`, `unsupported_version` */
6191
+ 404: {
6192
+ headers: {
6193
+ [name: string]: unknown;
6194
+ };
6195
+ content: {
6196
+ "application/json": {
6197
+ /** @constant */
6198
+ error: "not_found";
6199
+ /** @description An English sentence for the developer reading a log. Never branch on it and never show it to a person. */
6200
+ message?: string;
6201
+ /** @description When present, an English sentence suggesting to the developer what to do about the error. Never branch on it and never show it to a person. */
6202
+ hint?: string;
6203
+ } | {
6204
+ /** @constant */
6205
+ error: "unsupported_version";
6206
+ /** @description An English sentence for the developer reading a log. Never branch on it and never show it to a person. */
6207
+ message?: string;
6208
+ /** @description When present, an English sentence suggesting to the developer what to do about the error. Never branch on it and never show it to a person. */
6209
+ hint?: string;
6210
+ };
6211
+ };
6212
+ };
6213
+ /** @description `server_error` */
6214
+ 500: {
6215
+ headers: {
6216
+ [name: string]: unknown;
6217
+ };
6218
+ content: {
6219
+ "application/json": {
6220
+ /** @constant */
6221
+ error: "server_error";
6222
+ /** @description An English sentence for the developer reading a log. Never branch on it and never show it to a person. */
6223
+ message?: string;
6224
+ /** @description When present, an English sentence suggesting to the developer what to do about the error. Never branch on it and never show it to a person. */
6225
+ hint?: string;
6226
+ };
6227
+ };
6228
+ };
6229
+ /** @description `temporarily_unavailable` */
6230
+ 503: {
6231
+ headers: {
6232
+ [name: string]: unknown;
6233
+ };
6234
+ content: {
6235
+ "application/json": {
6236
+ /** @constant */
6237
+ error: "temporarily_unavailable";
6238
+ /** @description An English sentence for the developer reading a log. Never branch on it and never show it to a person. */
6239
+ message?: string;
6240
+ /** @description When present, an English sentence suggesting to the developer what to do about the error. Never branch on it and never show it to a person. */
6241
+ hint?: string;
6242
+ };
6243
+ };
6244
+ };
6245
+ };
6246
+ };
5973
6247
  listOrganizationIdentities: {
5974
6248
  parameters: {
5975
6249
  query?: {