squarefi-bff-api-module 1.36.32 → 1.36.33

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.
@@ -1 +1,4 @@
1
- export declare const bankData: {};
1
+ import { API } from './types/types';
2
+ export declare const bankData: {
3
+ getByCode: (params: API.BankData.GetByCode.Request) => Promise<API.BankData.GetByCode.Response>;
4
+ };
@@ -1,8 +1,6 @@
1
+ import { apiClientV1Frontend } from '../utils/apiClientFactory';
1
2
  export const bankData = {
2
- // getBankDataByAccountNumber: ( // TBD on backend
3
- // params: API.BankData.GetBankDataByAccountNumber.Request,
4
- // ): Promise<API.BankData.GetBankDataByAccountNumber.Response> =>
5
- // apiClientV2.getRequest<API.BankData.GetBankDataByAccountNumber.Response>(`/bank-data`, {
6
- // params,
7
- // }),
3
+ getByCode: (params) => apiClientV1Frontend.getRequest('/frontend/bank-data', {
4
+ params,
5
+ }),
8
6
  };
@@ -7352,7 +7352,24 @@ export interface components {
7352
7352
  amount_to?: number | null;
7353
7353
  order_type?: string;
7354
7354
  /** @enum {string} */
7355
- status?: "NEW" | "EXPECTED" | "PROCESSING" | "COMPLETE" | "FAILED" | "CANCELED" | "REFUNDED";
7355
+ status?: "NEW" | "PENDING" | "EXPECTED" | "PROCESSING" | "COMPLETE" | "FAILED" | "CANCELED" | "REFUNDED";
7356
+ /**
7357
+ * @description Compliance (transaction monitoring) state. Orthogonal to `status`: a `held` order is still PENDING and nothing has been credited — it resolves to COMPLETE or FAILED once the review finishes. `null` means the order was never subject to a compliance hold.
7358
+ * @enum {string|null}
7359
+ */
7360
+ compliance_state?: "held" | "released" | "rejected" | null;
7361
+ /** @description Why the order is (or was) held. */
7362
+ compliance_reason?: string | null;
7363
+ /**
7364
+ * Format: date-time
7365
+ * @description When the hold started.
7366
+ */
7367
+ compliance_held_at?: string | null;
7368
+ /**
7369
+ * Format: date-time
7370
+ * @description When the hold was released or rejected.
7371
+ */
7372
+ compliance_resolved_at?: string | null;
7356
7373
  /** Format: uuid */
7357
7374
  sub_account_id?: string | null;
7358
7375
  info?: string | null;
@@ -872,9 +872,21 @@ export interface paths {
872
872
  cookie?: never;
873
873
  };
874
874
  /**
875
- * Look up bank data by code
876
- * @description Resolves a bank identifier (IBAN, SWIFT/BIC, or US RTN) into normalised
877
- * bank/address data suitable for prefilling a counterparty form.
875
+ * Look up bank data by payment method and code
876
+ * @description Resolves a bank identifier into the bank name and registered address for
877
+ * prefilling counterparty bank details. `method` fixes the expected code
878
+ * format:
879
+ *
880
+ * | `method` | code |
881
+ * | --- | --- |
882
+ * | `ach`, `fedwire` | US routing number (ABA/RTN) |
883
+ * | `swift`, `sepa` | SWIFT/BIC |
884
+ * | `fps`, `chaps` | UK sort code (always resolves to an empty list today) |
885
+ *
886
+ * Matching is by full code — prefix search is not supported, so `data`
887
+ * carries at most one element today. A well-formed code that matches no
888
+ * bank is `200` with an empty `data`, not a 404. Banks that do not accept
889
+ * the selected method also resolve to an empty `data`.
878
890
  *
879
891
  * **Authentication**: Bearer token + x-tenant-id header
880
892
  *
@@ -882,8 +894,13 @@ export interface paths {
882
894
  get: {
883
895
  parameters: {
884
896
  query: {
885
- /** @description IBAN, SWIFT/BIC, or US routing number (optionally "routing:account") */
897
+ /** @description Full bank code in the format implied by `method`. For `ach`/`fedwire`
898
+ * the legacy `routing:account` form is tolerated — the account part is
899
+ * ignored.
900
+ * */
886
901
  code: string;
902
+ /** @description Payment method the bank details are collected for */
903
+ method: "ach" | "fedwire" | "swift" | "sepa" | "fps" | "chaps";
887
904
  };
888
905
  header?: never;
889
906
  path?: never;
@@ -891,9 +908,9 @@ export interface paths {
891
908
  };
892
909
  requestBody?: never;
893
910
  responses: {
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`.
911
+ /** @description Matched banks (at most one today). An empty `data` means the code is
912
+ * well-formed but no bank was found for the requested method — clients
913
+ * fall back to manual entry.
897
914
  * */
898
915
  200: {
899
916
  headers: {
@@ -903,20 +920,24 @@ export interface paths {
903
920
  "application/json": {
904
921
  /** @example true */
905
922
  success: boolean;
906
- data: components["schemas"]["BankData"] | null;
923
+ data: components["schemas"]["BankDataItem"][];
924
+ /**
925
+ * @description Convenience length of `data`
926
+ * @example 1
927
+ */
928
+ count?: number;
907
929
  };
908
930
  };
909
931
  };
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
932
+ /** @description Bad request — only for malformed input:
933
+ * - `VALIDATION_ERROR` — `code` is missing/empty or longer than 64
934
+ * characters, or `method` is missing/not one of the allowed values
935
+ * - `UNSUPPORTED_BANK_CODE` — `code` does not match the format required
936
+ * by `method` (e.g. a SWIFT/BIC passed with `method=ach`)
917
937
  *
918
- * The body also carries a top-level `correlationId` (added by the error handler to
919
- * every 4xx/5xx it formats).
938
+ * A resolvable-but-unknown code is NOT a 400 it answers `200` with an
939
+ * empty `data`. The body also carries a top-level `correlationId`
940
+ * (added by the error handler to every 4xx/5xx it formats).
920
941
  * */
921
942
  400: {
922
943
  headers: {
@@ -975,6 +996,25 @@ export interface paths {
975
996
  "application/json": components["schemas"]["ErrorResponse"];
976
997
  };
977
998
  };
999
+ /** @description Bank data lookup is temporarily unavailable — safe to retry later.
1000
+ * The body carries a `correlationId`.
1001
+ * */
1002
+ 503: {
1003
+ headers: {
1004
+ [name: string]: unknown;
1005
+ };
1006
+ content: {
1007
+ /** @example {
1008
+ * "success": false,
1009
+ * "error": {
1010
+ * "code": "BANK_DATA_LOOKUP_FAILED",
1011
+ * "message": "Bank data lookup failed"
1012
+ * },
1013
+ * "correlationId": "3f7f2f9a-8f0e-4a3b-9a3d-2f1c9d6a1b2c"
1014
+ * } */
1015
+ "application/json": components["schemas"]["ErrorResponse"];
1016
+ };
1017
+ };
978
1018
  };
979
1019
  };
980
1020
  put?: never;
@@ -5050,7 +5090,56 @@ export interface paths {
5050
5090
  };
5051
5091
  };
5052
5092
  };
5053
- put?: never;
5093
+ /**
5094
+ * Edit a mass payout draft
5095
+ * @description Draft-only. `items` fully replaces the recipient list; `virtual_account_id: null` clears the source VA.
5096
+ */
5097
+ put: {
5098
+ parameters: {
5099
+ query?: never;
5100
+ header?: never;
5101
+ path: {
5102
+ /** @description Source wallet the batches belong to */
5103
+ wallet_id: components["parameters"]["MassPayoutWalletId"];
5104
+ id: components["parameters"]["MassPayoutId"];
5105
+ };
5106
+ cookie?: never;
5107
+ };
5108
+ requestBody: {
5109
+ content: {
5110
+ "application/json": {
5111
+ name?: string;
5112
+ /** Format: uuid */
5113
+ virtual_account_id?: string | null;
5114
+ items?: components["schemas"]["MassPayoutItemInput"][];
5115
+ };
5116
+ };
5117
+ };
5118
+ responses: {
5119
+ /** @description Updated draft */
5120
+ 200: {
5121
+ headers: {
5122
+ [name: string]: unknown;
5123
+ };
5124
+ content: {
5125
+ "application/json": {
5126
+ /** @example true */
5127
+ success?: boolean;
5128
+ data?: components["schemas"]["MassPayout"];
5129
+ };
5130
+ };
5131
+ };
5132
+ /** @description Batch is not editable anymore (already submitted) */
5133
+ 409: {
5134
+ headers: {
5135
+ [name: string]: unknown;
5136
+ };
5137
+ content: {
5138
+ "application/json": components["schemas"]["ErrorResponse"];
5139
+ };
5140
+ };
5141
+ };
5142
+ };
5054
5143
  post?: never;
5055
5144
  delete?: never;
5056
5145
  options?: never;
@@ -10748,11 +10837,11 @@ export interface components {
10748
10837
  */
10749
10838
  target_wallet_id: string | null;
10750
10839
  };
10751
- /** @description Bank postal address resolved from the bank identifier. Intentionally mirrors the CounterpartyBankingAddress shape so the payload can prefill a counterparty form as-is. */
10840
+ /** @description Registered bank address. `country_id`/`state_id` reference the `countries`/`states` dictionaries served by this API, so the payload can prefill a counterparty form as-is. */
10752
10841
  BankDataAddress: {
10753
10842
  /** @description Resolved `countries.id` of the bank’s country; null when it could not be resolved */
10754
10843
  country_id: number | null;
10755
- /** @description Always null today (reserved for future enrichment) */
10844
+ /** @description Resolved `states.id`; populated for US banks when available, null otherwise */
10756
10845
  state_id: number | null;
10757
10846
  city: string | null;
10758
10847
  postcode: string | null;
@@ -10760,46 +10849,28 @@ export interface components {
10760
10849
  street1: string | null;
10761
10850
  /** @description Always null today (reserved) */
10762
10851
  street2: string | null;
10763
- /** @description Always null today (reserved) */
10764
- description: string | null;
10765
10852
  };
10766
10853
  /**
10767
- * @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.
10854
+ * @description A bank matched by the looked-up code. The list holds at most one element today (full-code match; prefix search is not supported).
10768
10855
  * @example {
10769
- * "account_number": "31926819",
10770
- * "bank_name": "NATIONAL WESTMINSTER BANK PLC",
10771
- * "note": null,
10772
- * "routing_number": null,
10773
- * "swift_bic": "NWBKGB2LXXX",
10774
- * "iban": "GB29NWBK60161331926819",
10775
- * "sort_code": "601613",
10856
+ * "bank_name": "JPMORGAN CHASE BANK, NA",
10857
+ * "code": "021000021",
10776
10858
  * "address": {
10777
- * "country_id": 230,
10778
- * "state_id": null,
10779
- * "city": "London",
10859
+ * "country_id": 233,
10860
+ * "state_id": 1452,
10861
+ * "city": "NEW YORK",
10780
10862
  * "postcode": null,
10781
10863
  * "street1": null,
10782
- * "street2": null,
10783
- * "description": null
10864
+ * "street2": null
10784
10865
  * }
10785
10866
  * }
10786
10867
  */
10787
- BankData: {
10788
- /** @description Populated only for GB IBANs (22 chars): the embedded 8-digit account number (IBAN positions 14-22); null otherwise */
10789
- account_number: string | null;
10868
+ BankDataItem: {
10790
10869
  /** @description Registered bank name; null when unavailable */
10791
10870
  bank_name: string | null;
10792
- /** @description Always null today (reserved) */
10793
- note: string | null;
10794
- /** @description Populated only when the looked-up code is a US routing number (echoes the RTN); null otherwise */
10795
- routing_number: string | null;
10796
- /** @description SWIFT/BIC (ISO 9362); populated for SWIFT lookups and for IBAN lookups when the IBAN resolves to a BIC */
10797
- swift_bic: string | null;
10798
- /** @description Populated only for IBAN lookups (the normalised IBAN itself) */
10799
- iban: string | null;
10800
- /** @description Populated only for GB IBANs: the embedded 6-digit sort code (IBAN positions 8-14); null otherwise */
10801
- sort_code: string | null;
10802
- /** @description Bank postal address (always present) */
10871
+ /** @description Normalised code the bank was matched by (echoes the query `code`) */
10872
+ code: string;
10873
+ /** @description Registered bank address (always present) */
10803
10874
  address: components["schemas"]["BankDataAddress"];
10804
10875
  };
10805
10876
  /** @description Bank / rail account coordinates for a sub-account. Rail-dependent — some rails return only a subset of these. */
@@ -11285,7 +11356,24 @@ export interface components {
11285
11356
  amount_to?: number | null;
11286
11357
  order_type?: string;
11287
11358
  /** @enum {string} */
11288
- status?: "NEW" | "EXPECTED" | "PROCESSING" | "COMPLETE" | "FAILED" | "CANCELED" | "REFUNDED";
11359
+ status?: "NEW" | "PENDING" | "EXPECTED" | "PROCESSING" | "COMPLETE" | "FAILED" | "CANCELED" | "REFUNDED";
11360
+ /**
11361
+ * @description Compliance (transaction monitoring) state. Orthogonal to `status`: a `held` order is still PENDING and nothing has been credited — it resolves to COMPLETE or FAILED once the review finishes. `null` means the order was never subject to a compliance hold.
11362
+ * @enum {string|null}
11363
+ */
11364
+ compliance_state?: "held" | "released" | "rejected" | null;
11365
+ /** @description Why the order is (or was) held. */
11366
+ compliance_reason?: string | null;
11367
+ /**
11368
+ * Format: date-time
11369
+ * @description When the hold started.
11370
+ */
11371
+ compliance_held_at?: string | null;
11372
+ /**
11373
+ * Format: date-time
11374
+ * @description When the hold was released or rejected.
11375
+ */
11376
+ compliance_resolved_at?: string | null;
11289
11377
  /** Format: uuid */
11290
11378
  sub_account_id?: string | null;
11291
11379
  info?: string | null;
@@ -81,6 +81,12 @@ export declare namespace API {
81
81
  };
82
82
  }
83
83
  }
84
+ namespace BankData {
85
+ namespace GetByCode {
86
+ type Request = pathsV1Frontend['/frontend/bank-data']['get']['parameters']['query'];
87
+ type Response = pathsV1Frontend['/frontend/bank-data']['get']['responses'][200]['content']['application/json'];
88
+ }
89
+ }
84
90
  namespace Cards {
85
91
  namespace Config {
86
92
  type IssuingProgramOrderType = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "squarefi-bff-api-module",
3
- "version": "1.36.32",
3
+ "version": "1.36.33",
4
4
  "description": "Squarefi BFF API client module",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",