squarefi-bff-api-module 1.36.28 → 1.36.30

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.
@@ -830,7 +830,8 @@ export interface paths {
830
830
  postcode?: string;
831
831
  street1?: string;
832
832
  street2?: string;
833
- state_id?: number;
833
+ /** @description Required when the selected country has states; countries without states may omit it */
834
+ state_id?: number | null;
834
835
  };
835
836
  };
836
837
  /** @description Required for crypto types (CRYPTO_EXTERNAL, CRYPTO_INTERNAL) */
@@ -3870,13 +3871,14 @@ export interface paths {
3870
3871
  put?: never;
3871
3872
  /**
3872
3873
  * Exchange
3873
- * @description Exchange between currencies within the wallet bound to the API key.
3874
+ * @description Crypto-to-crypto exchange within the wallet bound to the API key.
3874
3875
  *
3875
- * **Crypto-to-crypto** exchanges complete instantly (status `COMPLETE`).
3876
- * **Fiat-to-crypto** and **crypto-to-fiat** exchanges create a `PENDING` order
3877
- * and trigger an asynchronous Rail workflow.
3876
+ * Two-phase, like the banking withdrawals: the order is created in status
3877
+ * `NEW` with the source funds blocked. Call `POST /api/orders/{order_id}/approve`
3878
+ * to execute the swap (the order lands in `COMPLETE` synchronously), or
3879
+ * `POST /api/orders/{order_id}/cancel` to release the blocked funds.
3878
3880
  *
3879
- * Requires an active virtual account for the fiat currency when fiat is involved.
3881
+ * Fiat legs are not supported only crypto-to-crypto pairs are accepted.
3880
3882
  *
3881
3883
  */
3882
3884
  post: {
@@ -3892,7 +3894,7 @@ export interface paths {
3892
3894
  };
3893
3895
  };
3894
3896
  responses: {
3895
- /** @description Exchange order created */
3897
+ /** @description Exchange order created (status NEW, funds blocked — approve to execute) */
3896
3898
  200: {
3897
3899
  headers: {
3898
3900
  [name: string]: unknown;
@@ -4219,6 +4221,8 @@ export interface paths {
4219
4221
  /**
4220
4222
  * Approve order
4221
4223
  * @description Transitions the order from NEW to PROCESSING and triggers the order execution pipeline.
4224
+ * Exchange orders (EXCHANGE_OMNI) and internal transfers (TRANSFER_INTERNAL /
4225
+ * OMNIBUS_INTERNAL_TRANSFER) settle synchronously and land in COMPLETE.
4222
4226
  * Only orders with status NEW can be approved.
4223
4227
  *
4224
4228
  */
@@ -4366,7 +4370,12 @@ export interface paths {
4366
4370
  put?: never;
4367
4371
  /**
4368
4372
  * Internal
4369
- * @description Transfers funds between wallets within the platform.
4373
+ * @description Transfers funds between wallets within the platform. Two-phase: the
4374
+ * order is created in `NEW` status with the sender's funds blocked;
4375
+ * call `POST /api/orders/{id}/approve` to execute the transfer — it
4376
+ * settles synchronously (receiver credited, order `COMPLETE`). A `NEW`
4377
+ * order can be canceled via `POST /api/orders/{id}/cancel` to refund
4378
+ * the blocked funds.
4370
4379
  * Wallet ID is automatically resolved from the API key — do **not** pass `wallet_id`.
4371
4380
  *
4372
4381
  * `request_id` is used for idempotency: re-posting the same `request_id`
@@ -4406,7 +4415,7 @@ export interface paths {
4406
4415
  };
4407
4416
  };
4408
4417
  responses: {
4409
- /** @description Transfer created */
4418
+ /** @description Transfer created in NEW status (funds blocked, awaiting approve) */
4410
4419
  200: {
4411
4420
  headers: {
4412
4421
  [name: string]: unknown;
@@ -4478,6 +4487,12 @@ export interface paths {
4478
4487
  * address (or another internal wallet) via a previously-created counterparty
4479
4488
  * destination.
4480
4489
  *
4490
+ * Two-phase: the order is created in `NEW` status with funds blocked;
4491
+ * `POST /api/orders/{id}/approve` dispatches the on-chain send. If the
4492
+ * destination address belongs to a wallet in the same tenant, the order is
4493
+ * created as `OMNIBUS_INTERNAL_TRANSFER` (no on-chain transaction) — still
4494
+ * `NEW` at create, settled synchronously to `COMPLETE` at approve.
4495
+ *
4481
4496
  * **Prerequisites:**
4482
4497
  * - A counterparty destination of type `CRYPTO_EXTERNAL` or `CRYPTO_INTERNAL`
4483
4498
  * created via `POST /api/counterparty/destinations`.
@@ -7430,6 +7445,12 @@ export interface components {
7430
7445
  * @example 7c8d4a2b-1e3f-4d59-9b6a-2c0e5f7d8a90
7431
7446
  */
7432
7447
  to_currency_id: string;
7448
+ /**
7449
+ * Format: uuid
7450
+ * @description Idempotency key (UUID v4 recommended).
7451
+ * @example 550e8400-e29b-41d4-a716-446655440000
7452
+ */
7453
+ request_id: string;
7433
7454
  };
7434
7455
  /** @description Virtual bank account */
7435
7456
  VirtualAccount: {
@@ -891,21 +891,90 @@ export interface paths {
891
891
  };
892
892
  requestBody?: never;
893
893
  responses: {
894
- /** @description Bank data resolved successfully */
894
+ /** @description Bank data resolved. `data` is null ONLY when the bank-data lookup subsystem is
895
+ * disabled on the environment; with lookups enabled a failed resolution is
896
+ * reported as 400, never as a null `data`.
897
+ * */
895
898
  200: {
896
899
  headers: {
897
900
  [name: string]: unknown;
898
901
  };
899
- content?: never;
902
+ content: {
903
+ "application/json": {
904
+ /** @example true */
905
+ success: boolean;
906
+ data: components["schemas"]["BankData"] | null;
907
+ };
908
+ };
900
909
  };
901
- /** @description Missing/unsupported code */
910
+ /** @description Bad request — one of:
911
+ * - `VALIDATION_ERROR` — query parameter `code` is missing/empty, or longer than 64 characters
912
+ * - `UNSUPPORTED_BANK_CODE` — `code` does not match any supported format (IBAN, SWIFT/BIC, US RTN)
913
+ * - `BANK_DATA_LOOKUP_FAILED` — the code is well-formed but could not be resolved
914
+ * (unknown code or a transient lookup failure); always reported as this single
915
+ * 400, never as 404/502
916
+ * - `EXTERNAL_SERVICE_ERROR` — the bank-data lookup is temporarily unavailable
917
+ *
918
+ * The body also carries a top-level `correlationId` (added by the error handler to
919
+ * every 4xx/5xx it formats).
920
+ * */
902
921
  400: {
903
922
  headers: {
904
923
  [name: string]: unknown;
905
924
  };
906
- content?: never;
925
+ content: {
926
+ "application/json": components["schemas"]["ErrorResponse"];
927
+ };
907
928
  };
908
929
  401: components["responses"]["UnauthorizedError"];
930
+ /** @description Per-user bank-data lookup rate limit exceeded (stricter than the general frontend
931
+ * rate limit). The body is sent directly by the rate-limit middleware, bypassing
932
+ * the group error handler, so it carries no `correlationId` and no `details` field.
933
+ *
934
+ * The platform-wide per-user and per-IP limiters can also answer 429 on this
935
+ * endpoint — same envelope, code and headers, but with the generic message
936
+ * "Too many requests. Please try again later.".
937
+ * */
938
+ 429: {
939
+ headers: {
940
+ /** @description Maximum number of lookups allowed in the current window */
941
+ "X-RateLimit-Limit"?: string;
942
+ /** @description Lookups remaining in the current window */
943
+ "X-RateLimit-Remaining"?: string;
944
+ /** @description Unix timestamp (ms) at which the current window resets */
945
+ "X-RateLimit-Reset"?: string;
946
+ [name: string]: unknown;
947
+ };
948
+ content: {
949
+ /** @example {
950
+ * "success": false,
951
+ * "error": {
952
+ * "code": "RATE_LIMIT_EXCEEDED",
953
+ * "message": "Too many bank data lookups. Please slow down."
954
+ * }
955
+ * } */
956
+ "application/json": components["schemas"]["ErrorResponse"];
957
+ };
958
+ };
959
+ /** @description Unexpected internal error, handled by the catch-all error handler; the body
960
+ * carries a `correlationId`.
961
+ * */
962
+ 500: {
963
+ headers: {
964
+ [name: string]: unknown;
965
+ };
966
+ content: {
967
+ /** @example {
968
+ * "success": false,
969
+ * "error": {
970
+ * "code": "INTERNAL_ERROR",
971
+ * "message": "Internal server error"
972
+ * },
973
+ * "correlationId": "3f7f2f9a-8f0e-4a3b-9a3d-2f1c9d6a1b2c"
974
+ * } */
975
+ "application/json": components["schemas"]["ErrorResponse"];
976
+ };
977
+ };
909
978
  };
910
979
  };
911
980
  put?: never;
@@ -1425,11 +1494,11 @@ export interface paths {
1425
1494
  * Check internal-transfer availability for a destination
1426
1495
  * @description Read-only check (writes nothing). Resolves the destination's payment
1427
1496
  * details to an on-platform wallet within the tenant and reports whether an
1428
- * instant internal transfer is available.
1497
+ * internal (off-chain) transfer is available.
1429
1498
  *
1430
1499
  * A `true` answer means the caller can create an INTERNAL destination to
1431
1500
  * `target_wallet_id` and transfer to it. Any recipient that cannot receive
1432
- * an instant internal transfer is uniformly reported as `available:false`
1501
+ * an internal transfer is uniformly reported as `available:false`
1433
1502
  * with `target_wallet_id:null` — the check does not disclose the reason.
1434
1503
  *
1435
1504
  * Detects crypto (address), INTERNAL (stored target wallet) and banking
@@ -4582,6 +4651,269 @@ export interface paths {
4582
4651
  patch?: never;
4583
4652
  trace?: never;
4584
4653
  };
4654
+ "/frontend/kyc_verification/{wallet_id}/init": {
4655
+ parameters: {
4656
+ query?: never;
4657
+ header?: never;
4658
+ path?: never;
4659
+ cookie?: never;
4660
+ };
4661
+ get?: never;
4662
+ put?: never;
4663
+ /**
4664
+ * Initialize KYC verification for a wallet
4665
+ * @description Starts a provider-agnostic KYC data-collection flow for the wallet via
4666
+ * the Auth API. The KYC provider (Persona, Sumsub, …) is resolved
4667
+ * internally per tenant — the caller does not choose it. Returns the
4668
+ * provider verification id plus an optional short-lived SDK token the
4669
+ * client uses to launch the verification. The caller's Bearer token is
4670
+ * forwarded to the Auth API.
4671
+ *
4672
+ * Provider-agnostic replacement for the deprecated
4673
+ * `GET /frontend/kyc_persona/{wallet_id}/init`.
4674
+ *
4675
+ * **Authentication**: Bearer token with x-tenant-id header required
4676
+ *
4677
+ * **Access Control**: Any user with access to the wallet (scoped card-users excluded)
4678
+ *
4679
+ */
4680
+ post: {
4681
+ parameters: {
4682
+ query?: never;
4683
+ header?: never;
4684
+ path: {
4685
+ /** @description Wallet UUID */
4686
+ wallet_id: string;
4687
+ };
4688
+ cookie?: never;
4689
+ };
4690
+ requestBody: {
4691
+ content: {
4692
+ "application/json": {
4693
+ /**
4694
+ * @description KYC entity type
4695
+ * @enum {string}
4696
+ */
4697
+ type: "individual" | "business";
4698
+ };
4699
+ };
4700
+ };
4701
+ responses: {
4702
+ /** @description KYC verification initialized */
4703
+ 200: {
4704
+ headers: {
4705
+ [name: string]: unknown;
4706
+ };
4707
+ content: {
4708
+ "application/json": {
4709
+ /** @example true */
4710
+ success: boolean;
4711
+ data: {
4712
+ /**
4713
+ * Format: uuid
4714
+ * @description Echo of the wallet from the path
4715
+ */
4716
+ wallet_id: string;
4717
+ /**
4718
+ * @description Provider that handled the flow (e.g. persona, sumsub)
4719
+ * @example persona
4720
+ */
4721
+ provider_type: string;
4722
+ /**
4723
+ * @description Provider verification id — Persona: inquiryId, Sumsub: applicantId
4724
+ * @example inq_ABDNxhp9ZzD3yehivCbMVvmjwh5g5r
4725
+ */
4726
+ verification_id: string;
4727
+ /** @description Short-lived SDK/session token when the provider mints one — otherwise null */
4728
+ verification_token?: string | null;
4729
+ };
4730
+ };
4731
+ };
4732
+ };
4733
+ /** @description Validation error (`type` missing or not in [individual, business]) */
4734
+ 400: {
4735
+ headers: {
4736
+ [name: string]: unknown;
4737
+ };
4738
+ content: {
4739
+ "application/json": components["schemas"]["ErrorResponse"];
4740
+ };
4741
+ };
4742
+ /** @description Missing or invalid Bearer token */
4743
+ 401: {
4744
+ headers: {
4745
+ [name: string]: unknown;
4746
+ };
4747
+ content: {
4748
+ "application/json": components["schemas"]["ErrorResponse"];
4749
+ };
4750
+ };
4751
+ /** @description Caller has no access to this wallet */
4752
+ 403: {
4753
+ headers: {
4754
+ [name: string]: unknown;
4755
+ };
4756
+ content: {
4757
+ "application/json": components["schemas"]["ErrorResponse"];
4758
+ };
4759
+ };
4760
+ /** @description Wallet not found upstream */
4761
+ 404: {
4762
+ headers: {
4763
+ [name: string]: unknown;
4764
+ };
4765
+ content: {
4766
+ "application/json": components["schemas"]["ErrorResponse"];
4767
+ };
4768
+ };
4769
+ /** @description Auth API unavailable, timed out, or returned a malformed payload */
4770
+ 502: {
4771
+ headers: {
4772
+ [name: string]: unknown;
4773
+ };
4774
+ content: {
4775
+ "application/json": components["schemas"]["ErrorResponse"];
4776
+ };
4777
+ };
4778
+ };
4779
+ };
4780
+ delete?: never;
4781
+ options?: never;
4782
+ head?: never;
4783
+ patch?: never;
4784
+ trace?: never;
4785
+ };
4786
+ "/frontend/kyc_verification/{wallet_id}/resume": {
4787
+ parameters: {
4788
+ query?: never;
4789
+ header?: never;
4790
+ path?: never;
4791
+ cookie?: never;
4792
+ };
4793
+ get?: never;
4794
+ put?: never;
4795
+ /**
4796
+ * Resume KYC verification for a wallet
4797
+ * @description Resumes an existing provider-agnostic KYC data-collection flow for the
4798
+ * wallet via the Auth API. The provider is resolved internally per tenant.
4799
+ * `verification_ref` is the provider reference returned by init (Persona:
4800
+ * `inquiry_id`, Sumsub: `applicant_id`). The caller's Bearer token is
4801
+ * forwarded to the Auth API.
4802
+ *
4803
+ * Provider-agnostic replacement for the deprecated
4804
+ * `GET /frontend/kyc_persona/{wallet_id}/resume`.
4805
+ *
4806
+ * **Authentication**: Bearer token with x-tenant-id header required
4807
+ *
4808
+ * **Access Control**: Any user with access to the wallet (scoped card-users excluded)
4809
+ *
4810
+ */
4811
+ post: {
4812
+ parameters: {
4813
+ query?: never;
4814
+ header?: never;
4815
+ path: {
4816
+ /** @description Wallet UUID */
4817
+ wallet_id: string;
4818
+ };
4819
+ cookie?: never;
4820
+ };
4821
+ requestBody: {
4822
+ content: {
4823
+ "application/json": {
4824
+ /**
4825
+ * @description Provider verification reference (Persona: inquiry_id, Sumsub: applicant_id)
4826
+ * @example inq_ABDNxhp9ZzD3yehivCbMVvmjwh5g5r
4827
+ */
4828
+ verification_ref: string;
4829
+ };
4830
+ };
4831
+ };
4832
+ responses: {
4833
+ /** @description KYC verification resumed */
4834
+ 200: {
4835
+ headers: {
4836
+ [name: string]: unknown;
4837
+ };
4838
+ content: {
4839
+ "application/json": {
4840
+ /** @example true */
4841
+ success: boolean;
4842
+ data: {
4843
+ /**
4844
+ * Format: uuid
4845
+ * @description Echo of the wallet from the path
4846
+ */
4847
+ wallet_id: string;
4848
+ /**
4849
+ * @description Provider that handled the flow (e.g. persona, sumsub)
4850
+ * @example persona
4851
+ */
4852
+ provider_type: string;
4853
+ /**
4854
+ * @description Provider verification id — Persona: inquiryId, Sumsub: applicantId
4855
+ * @example inq_ABDNxhp9ZzD3yehivCbMVvmjwh5g5r
4856
+ */
4857
+ verification_id: string;
4858
+ /** @description Short-lived SDK/session token when the provider mints one — otherwise null */
4859
+ verification_token?: string | null;
4860
+ };
4861
+ };
4862
+ };
4863
+ };
4864
+ /** @description Validation error (`verification_ref` missing or empty) */
4865
+ 400: {
4866
+ headers: {
4867
+ [name: string]: unknown;
4868
+ };
4869
+ content: {
4870
+ "application/json": components["schemas"]["ErrorResponse"];
4871
+ };
4872
+ };
4873
+ /** @description Missing or invalid Bearer token */
4874
+ 401: {
4875
+ headers: {
4876
+ [name: string]: unknown;
4877
+ };
4878
+ content: {
4879
+ "application/json": components["schemas"]["ErrorResponse"];
4880
+ };
4881
+ };
4882
+ /** @description Caller has no access to this wallet */
4883
+ 403: {
4884
+ headers: {
4885
+ [name: string]: unknown;
4886
+ };
4887
+ content: {
4888
+ "application/json": components["schemas"]["ErrorResponse"];
4889
+ };
4890
+ };
4891
+ /** @description No such verification to resume upstream */
4892
+ 404: {
4893
+ headers: {
4894
+ [name: string]: unknown;
4895
+ };
4896
+ content: {
4897
+ "application/json": components["schemas"]["ErrorResponse"];
4898
+ };
4899
+ };
4900
+ /** @description Auth API unavailable, timed out, or returned a malformed payload */
4901
+ 502: {
4902
+ headers: {
4903
+ [name: string]: unknown;
4904
+ };
4905
+ content: {
4906
+ "application/json": components["schemas"]["ErrorResponse"];
4907
+ };
4908
+ };
4909
+ };
4910
+ };
4911
+ delete?: never;
4912
+ options?: never;
4913
+ head?: never;
4914
+ patch?: never;
4915
+ trace?: never;
4916
+ };
4585
4917
  "/frontend/orders/deposit/ach": {
4586
4918
  parameters: {
4587
4919
  query?: never;
@@ -4830,13 +5162,17 @@ export interface paths {
4830
5162
  put?: never;
4831
5163
  /**
4832
5164
  * Exchange
4833
- * @description Exchange between currencies within a wallet.
5165
+ * @description Currency exchange within a wallet — a pure ledger swap for any enabled
5166
+ * currency pair (crypto and fiat alike). Pair availability is governed by
5167
+ * the exchange calculation config: a disabled pair is rejected at create.
4834
5168
  *
4835
- * **Crypto-to-crypto** exchanges complete instantly (status `COMPLETE`).
4836
- * **Fiat-to-crypto** and **crypto-to-fiat** exchanges create a `PENDING` order
4837
- * and trigger an asynchronous Rail workflow.
5169
+ * Two-phase, like the banking withdrawals: the order is created in status
5170
+ * `NEW` without touching the balance. Call `POST /frontend/orders/{order_id}/approve`
5171
+ * (OTP-gated, keyed on the order id) to check the balance, debit the
5172
+ * source funds and execute the swap — the order lands in `COMPLETE`
5173
+ * synchronously — or `POST /frontend/orders/{order_id}/cancel` to
5174
+ * discard the order.
4838
5175
  *
4839
- * Requires an active virtual account for the fiat currency when fiat is involved.
4840
5176
  * Caller must be `admin` of the wallet.
4841
5177
  *
4842
5178
  */
@@ -4853,7 +5189,7 @@ export interface paths {
4853
5189
  };
4854
5190
  };
4855
5191
  responses: {
4856
- /** @description Exchange order created */
5192
+ /** @description Exchange order created (status NEW — approve to debit and execute) */
4857
5193
  200: {
4858
5194
  headers: {
4859
5195
  [name: string]: unknown;
@@ -4921,7 +5257,12 @@ export interface paths {
4921
5257
  put?: never;
4922
5258
  /**
4923
5259
  * Internal
4924
- * @description Transfers funds between two wallets within the platform.
5260
+ * @description Transfers funds between two wallets within the platform. Two-phase:
5261
+ * the order is created in `NEW` status without touching the balance;
5262
+ * `POST /frontend/orders/{id}/approve` (OTP-gated, keyed on the order
5263
+ * id) checks the balance, debits the sender and executes the transfer
5264
+ * synchronously — receiver credited, order `COMPLETE`. A `NEW` order
5265
+ * can simply be canceled (no funds are held).
4925
5266
  * Caller must be `admin` of the source wallet.
4926
5267
  *
4927
5268
  */
@@ -4948,15 +5289,13 @@ export interface paths {
4948
5289
  */
4949
5290
  counterparty_destination_id: string;
4950
5291
  amount: number;
4951
- /** @description Idempotency key (UUID) */
4952
- request_id: string;
4953
5292
  /** @description Optional supporting documents persisted with the order. */
4954
5293
  documents?: components["schemas"]["OrderDocumentInput"][];
4955
5294
  };
4956
5295
  };
4957
5296
  };
4958
5297
  responses: {
4959
- /** @description Transfer created */
5298
+ /** @description Transfer created in NEW status (awaiting approve; no funds held) */
4960
5299
  200: {
4961
5300
  headers: {
4962
5301
  [name: string]: unknown;
@@ -5024,10 +5363,14 @@ export interface paths {
5024
5363
  put?: never;
5025
5364
  /**
5026
5365
  * Crypto
5027
- * @description Sends crypto from an omnibus wallet to an external address.
5028
- * If the destination address belongs to a wallet in the same tenant,
5029
- * the order is created as `OMNIBUS_INTERNAL_TRANSFER` with instant completion
5030
- * (no on-chain transaction).
5366
+ * @description Sends crypto from an omnibus wallet to an external address. Two-phase:
5367
+ * the order is created in `NEW` status without touching the balance;
5368
+ * `POST /frontend/orders/{id}/approve` (OTP-gated, keyed on the order
5369
+ * id) checks the balance, debits the funds and dispatches the on-chain
5370
+ * send. If the destination address belongs to a wallet in the same
5371
+ * tenant, the order is created as `OMNIBUS_INTERNAL_TRANSFER` (no
5372
+ * on-chain transaction) — still `NEW` at create, debited + settled
5373
+ * synchronously to `COMPLETE` at approve.
5031
5374
  *
5032
5375
  */
5033
5376
  post: {
@@ -5697,7 +6040,14 @@ export interface paths {
5697
6040
  put?: never;
5698
6041
  /**
5699
6042
  * Approve an order
5700
- * @description Moves a NEW order to PROCESSING, triggering its workflow. Validates the order's request_id via OTP.
6043
+ * @description Moves a NEW order to PROCESSING: checks the balance, debits the funds
6044
+ * (transaction written as `complete`) and triggers its workflow.
6045
+ * Exchange orders (EXCHANGE_OMNI) and internal transfers
6046
+ * (TRANSFER_INTERNAL / OMNIBUS_INTERNAL_TRANSFER) settle synchronously
6047
+ * and land in COMPLETE. An insufficient balance fails the order
6048
+ * (FAILED). OTP verification is mandatory and keyed on the order id
6049
+ * (request the OTP for the order being approved).
6050
+ *
5701
6051
  */
5702
6052
  post: {
5703
6053
  parameters: {
@@ -5758,7 +6108,7 @@ export interface paths {
5758
6108
  put?: never;
5759
6109
  /**
5760
6110
  * Cancel an order
5761
- * @description Cancels a NEW/FAILED order, cancels its workflow run, and refunds the blocked funds.
6111
+ * @description Cancels a NEW/FAILED order, cancels its workflow run, and refunds the debited funds (if the order was ever approved).
5762
6112
  */
5763
6113
  post: {
5764
6114
  parameters: {
@@ -5779,7 +6129,7 @@ export interface paths {
5779
6129
  };
5780
6130
  };
5781
6131
  responses: {
5782
- /** @description Order canceled and funds refunded */
6132
+ /** @description Order canceled (debited funds refunded when applicable) */
5783
6133
  200: {
5784
6134
  headers: {
5785
6135
  [name: string]: unknown;
@@ -8080,6 +8430,16 @@ export interface paths {
8080
8430
  * @example true
8081
8431
  */
8082
8432
  empty_name?: boolean;
8433
+ /**
8434
+ * Format: uuid
8435
+ * @description Optional KYC entity to link (entity-first KYC model). Must be
8436
+ * an entity of the current user (`GET /kyc/entities`); its type
8437
+ * must be enabled for the tenant. The link is set once at
8438
+ * creation and is immutable. Omitted → wallet is created
8439
+ * without a linked entity (legacy behaviour).
8440
+ *
8441
+ */
8442
+ kyc_entity_id?: string;
8083
8443
  };
8084
8444
  };
8085
8445
  };
@@ -8128,14 +8488,14 @@ export interface paths {
8128
8488
  };
8129
8489
  };
8130
8490
  };
8131
- /** @description Bad request - invalid type */
8491
+ /** @description Bad request invalid name, or `kyc_entity_id` is malformed / not an entity of the current user / belongs to another tenant */
8132
8492
  400: {
8133
8493
  headers: {
8134
8494
  [name: string]: unknown;
8135
8495
  };
8136
8496
  content?: never;
8137
8497
  };
8138
- /** @description Forbidden - no permission to create wallets */
8498
+ /** @description Forbidden no permission to create wallets, or the entity type is not enabled for the tenant */
8139
8499
  403: {
8140
8500
  headers: {
8141
8501
  [name: string]: unknown;
@@ -8869,7 +9229,7 @@ export interface paths {
8869
9229
  *
8870
9230
  * **Access Control**: User must own the wallet
8871
9231
  *
8872
- * **Note**: The system will automatically use the appropriate provider (Utila or Processing) based on tenant configuration.
9232
+ * **Note**: New addresses are always provisioned via Utila. The legacy Processing (Accepta) provider was decommissioned; existing `processing` addresses remain readable.
8873
9233
  *
8874
9234
  */
8875
9235
  post: {
@@ -9859,6 +10219,8 @@ export interface paths {
9859
10219
  * - Cannot invite yourself
9860
10220
  * - Cannot invite a current owner of this wallet
9861
10221
  * - Cannot invite a user who is already a member (active or deactivated)
10222
+ * - When the tenant has KYC enabled, the wallet's entity must be `APPROVED`;
10223
+ * otherwise the invite is rejected with 403 `KYC_REQUIREMENTS_NOT_MET`
9862
10224
  *
9863
10225
  * **Authentication**: Bearer token with x-tenant-id header required
9864
10226
  *
@@ -9912,7 +10274,7 @@ export interface paths {
9912
10274
  };
9913
10275
  content?: never;
9914
10276
  };
9915
- /** @description Access denied (insufficient wallet role) */
10277
+ /** @description Access denied (insufficient wallet role) or KYC not approved for the wallet entity */
9916
10278
  403: {
9917
10279
  headers: {
9918
10280
  [name: string]: unknown;
@@ -10218,6 +10580,12 @@ export interface components {
10218
10580
  memo?: string | null;
10219
10581
  /** Format: uuid */
10220
10582
  currency_id?: string;
10583
+ /**
10584
+ * @description Hosting classification of the address. Defaults to unknown.
10585
+ * @default unknown
10586
+ * @enum {string}
10587
+ */
10588
+ wallet_custody_type: "custodial" | "selfhosted" | "unknown";
10221
10589
  currency: components["schemas"]["CounterpartyCurrencyRef"];
10222
10590
  /** Format: date-time */
10223
10591
  created_at: string;
@@ -10261,6 +10629,60 @@ export interface components {
10261
10629
  */
10262
10630
  target_wallet_id: string | null;
10263
10631
  };
10632
+ /** @description Bank postal address resolved from the bank identifier. Intentionally mirrors the CounterpartyBankingAddress shape so the payload can prefill a counterparty form as-is. */
10633
+ BankDataAddress: {
10634
+ /** @description Resolved `countries.id` of the bank’s country; null when it could not be resolved */
10635
+ country_id: number | null;
10636
+ /** @description Always null today (reserved for future enrichment) */
10637
+ state_id: number | null;
10638
+ city: string | null;
10639
+ postcode: string | null;
10640
+ /** @description Bank street address line */
10641
+ street1: string | null;
10642
+ /** @description Always null today (reserved) */
10643
+ street2: string | null;
10644
+ /** @description Always null today (reserved) */
10645
+ description: string | null;
10646
+ };
10647
+ /**
10648
+ * @description Normalised bank data resolved from a bank identifier. Which identifier fields are populated depends on the looked-up code type: IBAN → `iban` + `swift_bic` (plus `account_number`/`sort_code` for GB IBANs), SWIFT/BIC → `swift_bic`, US RTN → `routing_number`; identifier fields not applicable to the code type are null. `bank_name` and `address` are populated for every code type whenever they are available.
10649
+ * @example {
10650
+ * "account_number": "31926819",
10651
+ * "bank_name": "NATIONAL WESTMINSTER BANK PLC",
10652
+ * "note": null,
10653
+ * "routing_number": null,
10654
+ * "swift_bic": "NWBKGB2LXXX",
10655
+ * "iban": "GB29NWBK60161331926819",
10656
+ * "sort_code": "601613",
10657
+ * "address": {
10658
+ * "country_id": 230,
10659
+ * "state_id": null,
10660
+ * "city": "London",
10661
+ * "postcode": null,
10662
+ * "street1": null,
10663
+ * "street2": null,
10664
+ * "description": null
10665
+ * }
10666
+ * }
10667
+ */
10668
+ BankData: {
10669
+ /** @description Populated only for GB IBANs (22 chars): the embedded 8-digit account number (IBAN positions 14-22); null otherwise */
10670
+ account_number: string | null;
10671
+ /** @description Registered bank name; null when unavailable */
10672
+ bank_name: string | null;
10673
+ /** @description Always null today (reserved) */
10674
+ note: string | null;
10675
+ /** @description Populated only when the looked-up code is a US routing number (echoes the RTN); null otherwise */
10676
+ routing_number: string | null;
10677
+ /** @description SWIFT/BIC (ISO 9362); populated for SWIFT lookups and for IBAN lookups when the IBAN resolves to a BIC */
10678
+ swift_bic: string | null;
10679
+ /** @description Populated only for IBAN lookups (the normalised IBAN itself) */
10680
+ iban: string | null;
10681
+ /** @description Populated only for GB IBANs: the embedded 6-digit sort code (IBAN positions 8-14); null otherwise */
10682
+ sort_code: string | null;
10683
+ /** @description Bank postal address (always present) */
10684
+ address: components["schemas"]["BankDataAddress"];
10685
+ };
10264
10686
  /** @description Bank / rail account coordinates for a sub-account. Rail-dependent — some rails return only a subset of these. */
10265
10687
  BankAccountDetails: {
10266
10688
  swift?: string;
@@ -10721,7 +11143,7 @@ export interface components {
10721
11143
  };
10722
11144
  /** @description Public order metadata fields */
10723
11145
  OrderMeta: {
10724
- /** @description Idempotency key passed at creation time */
11146
+ /** @description Legacy idempotency key null on orders created by the current flow */
10725
11147
  request_id?: string | null;
10726
11148
  note?: string | null;
10727
11149
  reference?: string | null;
@@ -10791,8 +11213,6 @@ export interface components {
10791
11213
  counterparty_destination_id: string;
10792
11214
  /** Format: uuid */
10793
11215
  wallet_account_id?: string;
10794
- /** @description Idempotency key (UUID) */
10795
- request_id: string;
10796
11216
  reference?: string;
10797
11217
  note?: string;
10798
11218
  /** @description Optional supporting documents persisted with the order. */
@@ -10813,8 +11233,6 @@ export interface components {
10813
11233
  virtual_account_id: string;
10814
11234
  /** Format: uuid */
10815
11235
  counterparty_destination_id: string;
10816
- /** @description Idempotency key (UUID) */
10817
- request_id: string;
10818
11236
  reference?: string;
10819
11237
  note?: string;
10820
11238
  /** @description Optional supporting documents persisted with the order. */
@@ -364,7 +364,7 @@ export interface paths {
364
364
  put?: never;
365
365
  /**
366
366
  * Create a new wallet address
367
- * @description Create a new blockchain address for a wallet with Utila or Processing integration
367
+ * @description Create a new blockchain address for a wallet with Utila integration
368
368
  */
369
369
  post: {
370
370
  parameters: {
@@ -8977,6 +8977,108 @@ export interface components {
8977
8977
  */
8978
8978
  has_more?: boolean;
8979
8979
  };
8980
+ /** @description Profile information of the payment sender */
8981
+ L2FOriginatorProfile: {
8982
+ /**
8983
+ * @description Name of the sender
8984
+ * @example FS AI, A SERIES OF FINSIGHT SPECI
8985
+ */
8986
+ name?: string;
8987
+ /** @description Sender's address information */
8988
+ address?: {
8989
+ address_line1?: string | null;
8990
+ city?: string | null;
8991
+ state?: string | null;
8992
+ postal_code?: string | null;
8993
+ country?: string | null;
8994
+ };
8995
+ };
8996
+ /** @description Bank account information of the sender */
8997
+ L2FOriginatorAccountInfo: {
8998
+ /**
8999
+ * @description Bank account number
9000
+ * @example 202504243736
9001
+ */
9002
+ account_number?: string;
9003
+ /**
9004
+ * @description Routing number (for US payments)
9005
+ * @example 91311229
9006
+ */
9007
+ routing_number?: string | null;
9008
+ /** @description SWIFT BIC code (for international transfers) */
9009
+ swift_bic?: string | null;
9010
+ /** @description Name of the bank/institution */
9011
+ institution_name?: string | null;
9012
+ };
9013
+ /**
9014
+ * @description Standardized originator (sender) information for L2F ONRAMP orders.
9015
+ * Available for order types: L2F_ACH_ONRAMP, L2F_WIRE_ONRAMP, L2F_SEPA_ONRAMP, L2F_SWIFT_ONRAMP.
9016
+ * This field appears in order.meta.originator
9017
+ *
9018
+ * @example {
9019
+ * "profile": {
9020
+ * "name": "FS AI, A SERIES OF FINSIGHT SPECI",
9021
+ * "address": {
9022
+ * "address_line1": "",
9023
+ * "city": "",
9024
+ * "state": "",
9025
+ * "postal_code": "",
9026
+ * "country": ""
9027
+ * }
9028
+ * },
9029
+ * "account_information": {
9030
+ * "account_number": "202504243736",
9031
+ * "routing_number": "91311229",
9032
+ * "swift_bic": "",
9033
+ * "institution_name": ""
9034
+ * },
9035
+ * "reference": "20251016MMQFMP2U004005",
9036
+ * "memo": "bfgkp5w"
9037
+ * }
9038
+ */
9039
+ L2FOriginator: {
9040
+ profile?: components["schemas"]["L2FOriginatorProfile"];
9041
+ account_information?: components["schemas"]["L2FOriginatorAccountInfo"];
9042
+ /**
9043
+ * @description Payment reference number (rail_reference from Railio)
9044
+ * @example 20251016MMQFMP2U004005
9045
+ */
9046
+ reference?: string | null;
9047
+ /**
9048
+ * @description Payment memo/note (rail_originator_memo from Railio)
9049
+ * @example bfgkp5w
9050
+ */
9051
+ memo?: string | null;
9052
+ } | null;
9053
+ /**
9054
+ * @description Optional array of document objects to attach to the order.
9055
+ * Documents should be uploaded to a storage service beforehand and only URLs should be provided.
9056
+ * Maximum 50 documents per order.
9057
+ *
9058
+ * @example [
9059
+ * {
9060
+ * "url": "https://storage.example.com/documents/invoice-001.pdf",
9061
+ * "description": "Invoice for payment #001"
9062
+ * },
9063
+ * {
9064
+ * "url": "https://storage.example.com/documents/contract-signed.pdf",
9065
+ * "description": "Signed contract"
9066
+ * }
9067
+ * ]
9068
+ */
9069
+ OrderDocuments: {
9070
+ /**
9071
+ * Format: uri
9072
+ * @description URL of the uploaded document
9073
+ * @example https://storage.example.com/documents/invoice-123.pdf
9074
+ */
9075
+ url: string;
9076
+ /**
9077
+ * @description Optional description of the document
9078
+ * @example Invoice for payment #12345
9079
+ */
9080
+ description?: string | null;
9081
+ }[];
8980
9082
  VirtualAccount: {
8981
9083
  /**
8982
9084
  * Format: uuid
@@ -9261,8 +9363,6 @@ export interface components {
9261
9363
  CardUpdateRequest: unknown;
9262
9364
  IssuingProgram: unknown;
9263
9365
  IssuingTransactionList: unknown;
9264
- L2FOriginator: unknown;
9265
- OrderDocuments: unknown;
9266
9366
  };
9267
9367
  responses: never;
9268
9368
  parameters: never;
@@ -615,7 +615,8 @@ export interface paths {
615
615
  postcode?: string;
616
616
  street1?: string;
617
617
  street2?: string;
618
- state_id?: number;
618
+ /** @description Required when the selected country has states; countries without states may omit it */
619
+ state_id?: number | null;
619
620
  };
620
621
  };
621
622
  crypto_data?: {
@@ -2517,13 +2518,14 @@ export interface paths {
2517
2518
  put?: never;
2518
2519
  /**
2519
2520
  * Exchange
2520
- * @description Exchange between currencies within a wallet.
2521
+ * @description Crypto-to-crypto exchange within a wallet.
2521
2522
  *
2522
- * **Crypto-to-crypto** exchanges complete instantly (status `COMPLETE`).
2523
- * **Fiat-to-crypto** and **crypto-to-fiat** exchanges create a `PENDING` order
2524
- * and trigger an asynchronous Rail workflow.
2523
+ * Two-phase, like the banking withdrawals: the order is created in status
2524
+ * `NEW` with the source funds blocked. Call `POST /admin/orders/{order_id}/approve`
2525
+ * to execute the swap (the order lands in `COMPLETE` synchronously), or
2526
+ * `POST /admin/orders/{order_id}/cancel` to release the blocked funds.
2525
2527
  *
2526
- * Requires an active virtual account for the fiat currency when fiat is involved.
2528
+ * Fiat legs are not supported only crypto-to-crypto pairs are accepted.
2527
2529
  *
2528
2530
  */
2529
2531
  post: {
@@ -2542,7 +2544,7 @@ export interface paths {
2542
2544
  };
2543
2545
  };
2544
2546
  responses: {
2545
- /** @description Exchange order created */
2547
+ /** @description Exchange order created (status NEW, funds blocked — approve to execute) */
2546
2548
  200: {
2547
2549
  headers: {
2548
2550
  [name: string]: unknown;
@@ -2608,7 +2610,15 @@ export interface paths {
2608
2610
  };
2609
2611
  get?: never;
2610
2612
  put?: never;
2611
- /** Internal */
2613
+ /**
2614
+ * Internal
2615
+ * @description Transfers funds between two wallets within the platform. Two-phase:
2616
+ * the order is created in `NEW` status with the sender's funds blocked;
2617
+ * `POST /admin/orders/{id}/approve` executes the transfer synchronously —
2618
+ * receiver credited, order `COMPLETE`. A `NEW` order can be canceled to
2619
+ * refund the blocked funds.
2620
+ *
2621
+ */
2612
2622
  post: {
2613
2623
  parameters: {
2614
2624
  query?: never;
@@ -2636,7 +2646,7 @@ export interface paths {
2636
2646
  };
2637
2647
  };
2638
2648
  responses: {
2639
- /** @description Transfer created */
2649
+ /** @description Transfer created in NEW status (funds blocked, awaiting approve) */
2640
2650
  200: {
2641
2651
  headers: {
2642
2652
  [name: string]: unknown;
@@ -2693,7 +2703,16 @@ export interface paths {
2693
2703
  };
2694
2704
  get?: never;
2695
2705
  put?: never;
2696
- /** Crypto */
2706
+ /**
2707
+ * Crypto
2708
+ * @description Sends crypto from the wallet's omnibus balance via a counterparty
2709
+ * destination. Two-phase: created `NEW` with funds blocked;
2710
+ * `POST /admin/orders/{id}/approve` dispatches the on-chain send. A
2711
+ * destination address internal to the tenant downgrades the order to
2712
+ * `OMNIBUS_INTERNAL_TRANSFER` — still `NEW` at create, settled
2713
+ * synchronously to `COMPLETE` at approve.
2714
+ *
2715
+ */
2697
2716
  post: {
2698
2717
  parameters: {
2699
2718
  query?: never;
@@ -3538,6 +3557,8 @@ export interface paths {
3538
3557
  /**
3539
3558
  * Approve order
3540
3559
  * @description Transitions the order from NEW to PROCESSING and triggers the order execution pipeline.
3560
+ * Exchange orders (EXCHANGE_OMNI) and internal transfers (TRANSFER_INTERNAL /
3561
+ * OMNIBUS_INTERNAL_TRANSFER) settle synchronously and land in COMPLETE.
3541
3562
  * Only orders with status NEW can be approved.
3542
3563
  *
3543
3564
  */
@@ -8176,6 +8197,11 @@ export interface components {
8176
8197
  * @description Destination currency UUID
8177
8198
  */
8178
8199
  to_currency_id: string;
8200
+ /**
8201
+ * Format: uuid
8202
+ * @description Idempotency key (UUID v4 recommended)
8203
+ */
8204
+ request_id: string;
8179
8205
  };
8180
8206
  TenantOrder: {
8181
8207
  /** Format: uuid */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "squarefi-bff-api-module",
3
- "version": "1.36.28",
3
+ "version": "1.36.30",
4
4
  "description": "Squarefi BFF API client module",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",