squarefi-bff-api-module 1.36.56 → 1.36.58

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Squarefi BFF API SDK
2
2
 
3
- A fully-typed TypeScript / JavaScript SDK for effortless interaction with the Squarefi **Back-For-Front** (BFF) API.
3
+ A fully-typed TypeScript / JavaScript SDK for effortless interaction with the Squarefi **Back-For-Front** (BFF) API
4
4
 
5
5
  ---
6
6
 
@@ -1,6 +1,7 @@
1
1
  import { API } from './types/types';
2
2
  export declare const counterparties: {
3
3
  getAll: ({ wallet_id, ...params }: API.Counterparties.List.Request) => Promise<API.Counterparties.List.Response>;
4
+ getAllWithDestinations: ({ wallet_id, ...params }: API.Counterparties.ListWithDestinations.Request) => Promise<API.Counterparties.ListWithDestinations.Response>;
4
5
  getById: ({ counterparty_account_id, }: API.Counterparties.GetById.Request) => Promise<API.Counterparties.GetById.Response>;
5
6
  create: ({ wallet_id, ...data }: API.Counterparties.Create.Request) => Promise<API.Counterparties.Create.Response>;
6
7
  update: ({ counterparty_account_id, wallet_id: _wallet_id, ...data }: API.Counterparties.Update.Request) => Promise<API.Counterparties.Update.Response>;
@@ -23,6 +23,22 @@ export const counterparties = {
23
23
  const res = await apiClientV1Frontend.getRequest(`/frontend/counterparty/accounts/wallet/${wallet_id}`, { params });
24
24
  return { total: res.pagination?.total ?? res.data.length, data: res.data };
25
25
  },
26
+ // Тот же роут, что getAll, но с include=destinations: бэкенд вкладывает активные реквизиты
27
+ // в строки листинга, и экран узнаёт состав реквизитов всех контрагентов одним запросом вместо
28
+ // одного запроса на контрагента. Флаг проставляется здесь и снаружи не принимается — иначе
29
+ // вызов с ним вернул бы реквизиты в рантайме, а тип листинга остался бы без них.
30
+ // destinations читаем строго, как в getById: подстановка [] на отсутствующий ключ выдала бы
31
+ // «реквизитов нет» для всех контрагентов сразу и скрыла бы бэкенд, не поддержавший флаг.
32
+ getAllWithDestinations: async ({ wallet_id, ...params }) => {
33
+ const res = await apiClientV1Frontend.getRequest(`/frontend/counterparty/accounts/wallet/${wallet_id}`, { params: { ...params, include: 'destinations' } });
34
+ return {
35
+ total: res.pagination?.total ?? res.data.length,
36
+ data: res.data.map(({ destinations, ...account }) => ({
37
+ ...account,
38
+ destinations: destinations.map(mapDestination),
39
+ })),
40
+ };
41
+ },
26
42
  getById: async ({ counterparty_account_id, }) => {
27
43
  const res = await apiClientV1Frontend.getRequest(`/frontend/counterparty/accounts/${counterparty_account_id}`);
28
44
  const { destinations, ...account } = res.data.account;
@@ -6525,6 +6525,15 @@ export interface paths {
6525
6525
  "application/json": components["schemas"]["ApiErrorResponse"];
6526
6526
  };
6527
6527
  };
6528
+ /** @description KYC rail gate failed (KYC-enabled tenants) — `RAIL_NOT_CONFIGURED`, `RAIL_NOT_ENABLED`, `DEPOSITS_DISABLED`, `WALLET_RAIL_NOT_ONBOARDED` or `WALLET_RAIL_NOT_APPROVED`: the program's rail must be enabled and the wallet APPROVED on it */
6529
+ 422: {
6530
+ headers: {
6531
+ [name: string]: unknown;
6532
+ };
6533
+ content: {
6534
+ "application/json": components["schemas"]["ApiErrorResponse"];
6535
+ };
6536
+ };
6528
6537
  /** @description Server error */
6529
6538
  500: {
6530
6539
  headers: {
@@ -7659,8 +7668,6 @@ export interface components {
7659
7668
  };
7660
7669
  /** @description Bank/beneficiary postal address */
7661
7670
  BankingAddress: {
7662
- /** Format: uuid */
7663
- id?: string;
7664
7671
  /** @description Country ID reference */
7665
7672
  country_id?: number | null;
7666
7673
  city?: string | null;
@@ -7671,8 +7678,6 @@ export interface components {
7671
7678
  } | null;
7672
7679
  /** @description Banking destination details (for SWIFT, SEPA, ACH, Wire, etc.) */
7673
7680
  BankingData: {
7674
- /** Format: uuid */
7675
- id?: string;
7676
7681
  /** @description Bank account number */
7677
7682
  account_number?: string | null;
7678
7683
  /** @description Routing/sort code */
@@ -7705,8 +7710,6 @@ export interface components {
7705
7710
  };
7706
7711
  /** @description Crypto destination details (for CRYPTO_EXTERNAL, CRYPTO_INTERNAL) */
7707
7712
  CryptoData: {
7708
- /** Format: uuid */
7709
- id?: string;
7710
7713
  /** @description Blockchain address */
7711
7714
  address: string;
7712
7715
  /**
@@ -7764,7 +7767,21 @@ export interface components {
7764
7767
  banking_data?: components["schemas"]["BankingData"];
7765
7768
  crypto_data?: components["schemas"]["CryptoData"];
7766
7769
  internal_data?: components["schemas"]["CounterpartyInternalData"];
7770
+ counterparty_account?: components["schemas"]["CounterpartyAccountRef"];
7767
7771
  };
7772
+ /** @description Owning counterparty account, embedded on destination reads; absent on create/update. */
7773
+ CounterpartyAccountRef: {
7774
+ /** Format: uuid */
7775
+ id: string;
7776
+ name: string;
7777
+ /** @enum {string} */
7778
+ type: "BUSINESS" | "INDIVIDUAL";
7779
+ /** Format: uuid */
7780
+ wallet_id?: string | null;
7781
+ nickname?: string | null;
7782
+ email?: string | null;
7783
+ phone?: string | null;
7784
+ } | null;
7768
7785
  ApiSuccessResponse: {
7769
7786
  /** @example true */
7770
7787
  success: boolean;
@@ -1064,6 +1064,8 @@ export interface paths {
1064
1064
  sort_by?: "created_at" | "type" | "name" | "nickname" | "email" | "phone";
1065
1065
  /** @description Sort direction (defaults to ASC). Ignored without `sort_by`. */
1066
1066
  sort_order?: "ASC" | "DESC";
1067
+ /** @description Embed each account's active destinations in the list rows. Omit it and the response is unchanged. With `destinations` every row carries a `destinations` array — empty when the account has none, so "no payment details" is distinguishable from "not loaded". Pagination keeps counting accounts, and the embed combines with `search` / `type` / `sort_by` / `sort_order`. */
1068
+ include?: "destinations";
1067
1069
  };
1068
1070
  header?: never;
1069
1071
  path: {
@@ -1073,7 +1075,7 @@ export interface paths {
1073
1075
  };
1074
1076
  requestBody?: never;
1075
1077
  responses: {
1076
- /** @description Accounts list */
1078
+ /** @description Accounts list. Rows carry their destinations only when `include=destinations` was requested. */
1077
1079
  200: {
1078
1080
  headers: {
1079
1081
  [name: string]: unknown;
@@ -1082,7 +1084,7 @@ export interface paths {
1082
1084
  "application/json": {
1083
1085
  /** @example true */
1084
1086
  success: boolean;
1085
- data: components["schemas"]["CounterpartyAccount"][];
1087
+ data: (components["schemas"]["CounterpartyAccount"] | components["schemas"]["CounterpartyAccountWithDestinations"])[];
1086
1088
  pagination?: components["schemas"]["PaginationResponse"];
1087
1089
  };
1088
1090
  };
@@ -6536,6 +6538,15 @@ export interface paths {
6536
6538
  "application/json": components["schemas"]["ErrorResponse"];
6537
6539
  };
6538
6540
  };
6541
+ /** @description A recipient is not in the wallet's address book (DESTINATION_NOT_FOUND, details.destination_ids) */
6542
+ 404: {
6543
+ headers: {
6544
+ [name: string]: unknown;
6545
+ };
6546
+ content: {
6547
+ "application/json": components["schemas"]["ErrorResponse"];
6548
+ };
6549
+ };
6539
6550
  };
6540
6551
  };
6541
6552
  delete?: never;
@@ -6630,7 +6641,7 @@ export interface paths {
6630
6641
  };
6631
6642
  };
6632
6643
  };
6633
- /** @description Template not found */
6644
+ /** @description Template not found, or a recipient is not in the wallet's address book (DESTINATION_NOT_FOUND, details.destination_ids) */
6634
6645
  404: {
6635
6646
  headers: {
6636
6647
  [name: string]: unknown;
@@ -6770,7 +6781,14 @@ export interface paths {
6770
6781
  requestBody: {
6771
6782
  content: {
6772
6783
  "application/json": {
6773
- /** Format: uuid */
6784
+ /**
6785
+ * Format: uuid
6786
+ * @description Batch source currency. Crypto recipients are paid with it
6787
+ * on-chain, so it must be an on-chain asset; a fiat source
6788
+ * currency cannot fund crypto recipients. Preview reports such
6789
+ * a row as a problem and submit/approve refuse the batch.
6790
+ *
6791
+ */
6774
6792
  currency_id: string;
6775
6793
  /** Format: uuid */
6776
6794
  virtual_account_id?: string;
@@ -6816,6 +6834,15 @@ export interface paths {
6816
6834
  "application/json": components["schemas"]["ErrorResponse"];
6817
6835
  };
6818
6836
  };
6837
+ /** @description A recipient is not in the wallet's address book (DESTINATION_NOT_FOUND, details.destination_ids) */
6838
+ 404: {
6839
+ headers: {
6840
+ [name: string]: unknown;
6841
+ };
6842
+ content: {
6843
+ "application/json": components["schemas"]["ErrorResponse"];
6844
+ };
6845
+ };
6819
6846
  /** @description Rate limit exceeded */
6820
6847
  429: {
6821
6848
  headers: {
@@ -6854,7 +6881,7 @@ export interface paths {
6854
6881
  };
6855
6882
  requestBody?: never;
6856
6883
  responses: {
6857
- /** @description Batch details with progress counters and totals */
6884
+ /** @description Batch details with progress counters and totals, plus the in-flight count and the per-destination-type breakdown (whole batch, independent of the item list paging) */
6858
6885
  200: {
6859
6886
  headers: {
6860
6887
  [name: string]: unknown;
@@ -6863,7 +6890,7 @@ export interface paths {
6863
6890
  "application/json": {
6864
6891
  /** @example true */
6865
6892
  success?: boolean;
6866
- data?: components["schemas"]["MassPayout"];
6893
+ data?: components["schemas"]["MassPayoutDetail"];
6867
6894
  };
6868
6895
  };
6869
6896
  };
@@ -6919,6 +6946,15 @@ export interface paths {
6919
6946
  };
6920
6947
  };
6921
6948
  };
6949
+ /** @description Mass payout not found, or a recipient is not in the wallet's address book (DESTINATION_NOT_FOUND, details.destination_ids) */
6950
+ 404: {
6951
+ headers: {
6952
+ [name: string]: unknown;
6953
+ };
6954
+ content: {
6955
+ "application/json": components["schemas"]["ErrorResponse"];
6956
+ };
6957
+ };
6922
6958
  /** @description Batch is not editable anymore (already submitted) */
6923
6959
  409: {
6924
6960
  headers: {
@@ -6946,7 +6982,7 @@ export interface paths {
6946
6982
  };
6947
6983
  /**
6948
6984
  * List items of a mass payout
6949
- * @description Items in upload order, paginated with limit/offset like the batch list. The optional status filter narrows the tracker view (e.g. failed rows only).
6985
+ * @description Items in upload order, paginated with limit/offset like the batch list. The optional status filter narrows the tracker view (e.g. failed rows only). Every row carries the address-book destination it pays (with its owning account), joined in the same query — a batch page needs no address-book lookups.
6950
6986
  */
6951
6987
  get: {
6952
6988
  parameters: {
@@ -10308,7 +10344,7 @@ export interface paths {
10308
10344
  "application/json": components["schemas"]["ErrorResponse"];
10309
10345
  };
10310
10346
  };
10311
- /** @description Rail pre-check failed — `VENDOR_NOT_CONFIGURED`, `RAIL_NOT_CONFIGURED`, `DEPOSITS_DISABLED`, `WALLET_RAIL_NOT_ONBOARDED` or `WALLET_RAIL_NOT_APPROVED` */
10347
+ /** @description KYC rail gate failed (KYC-enabled tenants, demo programs included) — `VENDOR_NOT_CONFIGURED`, `RAIL_NOT_CONFIGURED`, `RAIL_NOT_ENABLED`, `DEPOSITS_DISABLED`, `WALLET_RAIL_NOT_ONBOARDED`, `WALLET_RAIL_NOT_APPROVED` or `RAIL_GATE_CHECK_FAILED` */
10312
10348
  422: {
10313
10349
  headers: {
10314
10350
  [name: string]: unknown;
@@ -12535,6 +12571,10 @@ export interface paths {
12535
12571
  * @enum {string}
12536
12572
  */
12537
12573
  identity_verification_status?: "APPROVED" | "DECLINED" | "PENDING" | "PROCESSING" | "HOLD" | "NEEDS_ATTENTION" | "DOUBLE" | "SOFT_REJECT" | "REJECT" | "UNVERIFIED" | "WAITING_ON_UBOS" | "WAITING_ON_REVIEW";
12574
+ /** @description The member deleted their account. They keep their row and role in the
12575
+ * team, but have no access and receive no notifications.
12576
+ * */
12577
+ is_deleted?: boolean;
12538
12578
  };
12539
12579
  }[];
12540
12580
  pagination?: components["schemas"]["PaginationResponse"];
@@ -13441,6 +13481,11 @@ export interface components {
13441
13481
  CounterpartyAccount: {
13442
13482
  /** Format: uuid */
13443
13483
  id: string;
13484
+ /**
13485
+ * Format: uuid
13486
+ * @description Wallet the counterparty belongs to
13487
+ */
13488
+ wallet_id?: string | null;
13444
13489
  /** @description Account holder name */
13445
13490
  name: string;
13446
13491
  /** @enum {string} */
@@ -13460,9 +13505,26 @@ export interface components {
13460
13505
  * @default false
13461
13506
  */
13462
13507
  has_internal_destination: boolean;
13508
+ /** @description Number of active destinations. Present on the list response only. */
13509
+ destinations_count?: number;
13463
13510
  /** Format: date-time */
13464
13511
  created_at: string;
13512
+ /** Format: date-time */
13513
+ updated_at?: string;
13465
13514
  };
13515
+ /** @description Owning counterparty account, embedded on destination reads. */
13516
+ CounterpartyAccountRef: {
13517
+ /** Format: uuid */
13518
+ id: string;
13519
+ name: string;
13520
+ /** @enum {string} */
13521
+ type: "BUSINESS" | "INDIVIDUAL";
13522
+ /** Format: uuid */
13523
+ wallet_id?: string | null;
13524
+ nickname?: string | null;
13525
+ email?: string | null;
13526
+ phone?: string | null;
13527
+ } | null;
13466
13528
  /** @description A counterparty account with its embedded active destinations (returned by GET account by id). */
13467
13529
  CounterpartyAccountWithDestinations: components["schemas"]["CounterpartyAccount"] & {
13468
13530
  /** @description Active destinations belonging to this account. */
@@ -13541,6 +13603,11 @@ export interface components {
13541
13603
  CounterpartyDestination: {
13542
13604
  /** Format: uuid */
13543
13605
  id: string;
13606
+ /**
13607
+ * Format: uuid
13608
+ * @description Owning counterparty account
13609
+ */
13610
+ counterparty_account_id: string;
13544
13611
  /**
13545
13612
  * @description Destination / payment rail type
13546
13613
  * @enum {string}
@@ -13550,9 +13617,13 @@ export interface components {
13550
13617
  nickname?: string | null;
13551
13618
  /** Format: date-time */
13552
13619
  created_at: string;
13620
+ /** Format: date-time */
13621
+ updated_at?: string;
13553
13622
  banking_data?: components["schemas"]["CounterpartyBankingData"] | null;
13554
13623
  crypto_data?: components["schemas"]["CounterpartyCryptoData"] | null;
13555
13624
  internal_data?: components["schemas"]["CounterpartyInternalData"] | null;
13625
+ /** @description Embedded on the list and get-by-id reads; absent on create/update. */
13626
+ counterparty_account?: components["schemas"]["CounterpartyAccountRef"] | null;
13556
13627
  };
13557
13628
  /** @description Whether an instant internal transfer is available for a counterparty destination. Two states: available (available=true, target_wallet_id set) and not available (available=false, target_wallet_id=null). Any recipient that cannot receive an instant internal transfer is uniformly reported as not available — the check does not disclose the reason. */
13558
13629
  InternalTransferAvailability: {
@@ -14234,6 +14305,73 @@ export interface components {
14234
14305
  }[];
14235
14306
  kyc_rails?: components["schemas"]["KycRail"] | null;
14236
14307
  };
14308
+ /** @description Bank requisites of a virtual account, grouped per rail. Derived from `deposit_instructions` — a rail key is present only when the account carries an instruction for it, and an account with no instructions serializes as `{}`. */
14309
+ VirtualAccountAccountDetails: {
14310
+ ach?: {
14311
+ accountNumber?: string;
14312
+ routingNumber?: string;
14313
+ } | null;
14314
+ wire?: {
14315
+ accountNumber?: string;
14316
+ routingNumber?: string;
14317
+ } | null;
14318
+ swift?: {
14319
+ swiftCode?: string;
14320
+ accountNumber?: string;
14321
+ } | null;
14322
+ sepa?: {
14323
+ iban?: string;
14324
+ swiftCode?: string;
14325
+ } | null;
14326
+ ukPayments?: {
14327
+ accountNumber?: string;
14328
+ sortCode?: string;
14329
+ } | null;
14330
+ swiftCode?: string | null;
14331
+ bankName?: string | null;
14332
+ bankAddress?: string | null;
14333
+ beneficiary?: {
14334
+ name?: string;
14335
+ address?: string | null;
14336
+ } | null;
14337
+ };
14338
+ /** @description Postal address carried by a deposit instruction. Note `country_code` — the originator address block spells the same idea `country`. */
14339
+ DepositInstructionAddress: {
14340
+ address_line1?: string | null;
14341
+ address_line2?: string | null;
14342
+ city?: string | null;
14343
+ state?: string | null;
14344
+ postal_code?: string | null;
14345
+ /** @description ISO country code */
14346
+ country_code?: string | null;
14347
+ };
14348
+ /** @description One way to fund a virtual account: the requisites of a single payment rail. An account issues one instruction per rail its program enables, so the same bank details may appear twice under different `instruction_type` values. Only `instruction_type` is guaranteed — which identifiers a rail carries differs (an IBAN rail has no routing number, a US rail has no IBAN). An element may carry further keys that are provider bookkeeping rather than payment requisites — they are not part of this contract. */
14349
+ DepositInstruction: {
14350
+ /**
14351
+ * @description Rail discriminator. Uppercase; a new provider rail is added to this list when it ships.
14352
+ * @enum {string}
14353
+ */
14354
+ instruction_type: "ACH" | "FEDWIRE" | "SWIFT" | "SEPA_CT" | "CHAPS" | "FPS";
14355
+ /** @description Domestic account number (some IBAN-only rails repeat the IBAN here) */
14356
+ account_number?: string | null;
14357
+ /** @description ABA / sort-code style routing number */
14358
+ account_routing_number?: string | null;
14359
+ iban?: string | null;
14360
+ swift_bic?: string | null;
14361
+ sort_code?: string | null;
14362
+ /** @description Receiving bank */
14363
+ institution_name?: string | null;
14364
+ institution_address?: components["schemas"]["DepositInstructionAddress"] | null;
14365
+ intermediary_institution_name?: string | null;
14366
+ intermediary_institution_swift_bic?: string | null;
14367
+ /** @description Beneficiary the payment must be addressed to */
14368
+ account_holder_name?: string | null;
14369
+ account_holder_address?: components["schemas"]["DepositInstructionAddress"] | null;
14370
+ /** @description Reference the payer must quote, when the rail requires one */
14371
+ memo?: string | null;
14372
+ } & {
14373
+ [key: string]: unknown;
14374
+ };
14237
14375
  /** @description Fields shared by every virtual-account read shape. */
14238
14376
  VirtualAccountBase: {
14239
14377
  /** Format: uuid */
@@ -14257,40 +14395,13 @@ export interface components {
14257
14395
  /** @description Customer name the account is held under */
14258
14396
  customer_name?: string | null;
14259
14397
  /** @description Bank requisites summary derived from deposit_instructions. Empty object when the account has no instructions; null when deposits are disabled on the program's KYC rail. */
14260
- account_details?: {
14261
- ach?: {
14262
- accountNumber?: string;
14263
- routingNumber?: string;
14264
- } | null;
14265
- wire?: {
14266
- accountNumber?: string;
14267
- routingNumber?: string;
14268
- } | null;
14269
- swift?: {
14270
- swiftCode?: string;
14271
- accountNumber?: string;
14272
- } | null;
14273
- sepa?: {
14274
- iban?: string;
14275
- swiftCode?: string;
14276
- } | null;
14277
- ukPayments?: {
14278
- accountNumber?: string;
14279
- sortCode?: string;
14280
- } | null;
14281
- swiftCode?: string | null;
14282
- bankName?: string | null;
14283
- bankAddress?: string | null;
14284
- beneficiary?: {
14285
- name?: string;
14286
- address?: string | null;
14287
- } | null;
14288
- } | null;
14398
+ account_details?: components["schemas"]["VirtualAccountAccountDetails"] | null;
14289
14399
  /** @description Deposit requisites (source of truth). Emptied to [] (never null) when deposits are disabled on the program's KYC rail. */
14290
- deposit_instructions?: {
14400
+ deposit_instructions?: components["schemas"]["DepositInstruction"][] | null;
14401
+ /** @description Provider bookkeeping for the account. Deliberately left opaque — the keys are per-vendor internals, not a contract to code against. */
14402
+ meta?: {
14291
14403
  [key: string]: unknown;
14292
- }[] | null;
14293
- meta?: Record<string, never> | null;
14404
+ } | null;
14294
14405
  };
14295
14406
  /** @description Virtual bank account as returned by the list read. Currencies come embedded as full objects; the raw uuids are exposed as `account_currency_id` / `destination_currency_id`. Only ACTIVE accounts are listed. */
14296
14407
  VirtualAccount: components["schemas"]["VirtualAccountBase"] & {
@@ -14383,10 +14494,13 @@ export interface components {
14383
14494
  /** @description Customer name the account is held under */
14384
14495
  customer_name?: string | null;
14385
14496
  /** @description Bank account details for deposits, derived from deposit_instructions. Returned null when deposits are disabled on the program's KYC rail. */
14386
- account_details?: Record<string, never> | null;
14497
+ account_details?: components["schemas"]["VirtualAccountAccountDetails"] | null;
14387
14498
  /** @description Deposit requisites (source of truth). Emptied to [] (never null) when deposits are disabled on the program's KYC rail. */
14388
- deposit_instructions?: Record<string, never>[];
14389
- meta?: Record<string, never> | null;
14499
+ deposit_instructions?: components["schemas"]["DepositInstruction"][];
14500
+ /** @description Provider bookkeeping for the account. Deliberately left opaque — the keys are per-vendor internals, not a contract to code against. */
14501
+ meta?: {
14502
+ [key: string]: unknown;
14503
+ } | null;
14390
14504
  /** @description Account currency details */
14391
14505
  account_currency_details?: components["schemas"]["CurrencyDetails"] | null;
14392
14506
  /** @description Destination currency details */
@@ -14412,6 +14526,61 @@ export interface components {
14412
14526
  /** @description Number of minor-unit decimals */
14413
14527
  decimal: number;
14414
14528
  };
14529
+ /** @description Postal address of the sender, as the rail reported it. */
14530
+ OrderOriginatorAddress: {
14531
+ address_line1?: string | null;
14532
+ address_line2?: string | null;
14533
+ city?: string | null;
14534
+ state?: string | null;
14535
+ postal_code?: string | null;
14536
+ /** @description ISO country code */
14537
+ country?: string | null;
14538
+ };
14539
+ /** @description Who sent the money. `name` is the only key every rail supplies. */
14540
+ OrderOriginatorProfile: {
14541
+ /** @description Sender name as reported by the rail (rails may truncate it) */
14542
+ name: string;
14543
+ /**
14544
+ * @description Kind of sender. Present on internal transfers, where it comes from the sending wallet's KYC entity — `unknown` when the wallet has none. Bank rails do not report it.
14545
+ * @enum {string}
14546
+ */
14547
+ type?: "individual" | "business" | "universal" | "unknown";
14548
+ address?: components["schemas"]["OrderOriginatorAddress"] | null;
14549
+ };
14550
+ /** @description Bank identifiers of the sending account. Normalized on read: rails disagree about which slot an IBAN or a BIC belongs in, so a value is filed by its shape rather than by the slot it was stored in. The block is all-or-nothing — when it is present every key below is present too, with an empty string standing for "not supplied" (so `swift_bic: ''` means unknown, not "no BIC exists"). */
14551
+ OrderOriginatorAccountInformation: {
14552
+ /** @description Domestic account number. Empty when the stored value turned out to be an IBAN — read `iban` then. */
14553
+ account_number: string;
14554
+ /** @description ABA-style routing number. Empty when the stored value turned out to be a BIC — read `swift_bic` then. */
14555
+ routing_number: string;
14556
+ iban: string;
14557
+ swift_bic: string;
14558
+ sort_code: string;
14559
+ currency_code: string;
14560
+ /** @description Sending bank. Empty when the rail merely echoed the sender name here. */
14561
+ institution_name: string;
14562
+ intermediary_institution_name: string;
14563
+ };
14564
+ /** @description Crypto counterpart of `account_information`: present on internal (on-platform) transfers, where the sender is a wallet rather than a bank account. */
14565
+ OrderOriginatorWalletInformation: {
14566
+ /**
14567
+ * Format: uuid
14568
+ * @description Sending wallet
14569
+ */
14570
+ wallet_uuid: string;
14571
+ wallet_name?: string | null;
14572
+ crypto_address?: string | null;
14573
+ };
14574
+ /** @description Sender of an inbound order, normalized to one shape across every rail (bank deposits, on-ramps, internal transfers). Rendered from an allowlist, so no key beyond the five below is ever returned; which of them appear depends on the rail — a bank deposit carries `profile` + `account_information`, an internal transfer carries `profile` + `wallet_information`. Surfaced in the transaction panel (Sender, Account number, SWIFT / BIC, Bank name, Routing number) and in the PDF statement. */
14575
+ OrderOriginator: {
14576
+ profile?: components["schemas"]["OrderOriginatorProfile"];
14577
+ account_information?: components["schemas"]["OrderOriginatorAccountInformation"];
14578
+ wallet_information?: components["schemas"]["OrderOriginatorWalletInformation"];
14579
+ /** @description Payment reference quoted by the sender */
14580
+ reference?: string | null;
14581
+ /** @description Free-text memo carried by the rail */
14582
+ memo?: string | null;
14583
+ };
14415
14584
  /** @description Public order metadata. List and single-read responses reduce the stored `meta` JSONB to a fixed allowlist of public keys; create/approve/cancel responses return the stored meta minus scheduler-internal keys. Every field is optional: presence depends on the order type (crypto transfer, fiat off-ramp, exchange, internal transfer, card top-up, deposit). */
14416
14585
  OrderMeta: {
14417
14586
  /** @description Legacy idempotency key — null on orders created by the current flow */
@@ -14483,10 +14652,8 @@ export interface components {
14483
14652
  * @description Card sub-account (card top-up orders)
14484
14653
  */
14485
14654
  sub_account_id?: string | null;
14486
- /** @description Sender details on inbound (deposit) orders, normalized to one canonical shape across rails. Keys: `profile` (sender identity), `account_information` (bank identifiers: account_number, routing_number, iban, swift_bic, sort_code, currency_code, institution_name, intermediary_institution_name), `wallet_information` (crypto counterpart on internal transfers), `reference`, `memo`. */
14487
- originator?: {
14488
- [key: string]: unknown;
14489
- } | null;
14655
+ /** @description Sender details on inbound (deposit) and internal-transfer orders. */
14656
+ originator?: components["schemas"]["OrderOriginator"] | null;
14490
14657
  /** @description Card authorizations: card id */
14491
14658
  card_id?: string | null;
14492
14659
  /** @description Card authorizations: merchant name */
@@ -14508,25 +14675,28 @@ export interface components {
14508
14675
  /** Format: date-time */
14509
14676
  completed_at?: string | null;
14510
14677
  };
14511
- /** @description Order record */
14678
+ /** @description Order record. The `required` list below is what every order response carries, on every route that returns an order. `required` is about presence, not about value: a field marked both required and nullable is always in the payload and may be `null`. Everything outside that list is genuinely conditional — `is_threshold_amount` comes with the list read, `mass_payout` with the list and single reads, and the fee / compliance fields are absent from the create, approve, cancel and comment responses. */
14512
14679
  Order: {
14513
14680
  /** Format: uuid */
14514
- id?: string;
14681
+ id: string;
14515
14682
  /** Format: uuid */
14516
- order_uuid?: string;
14683
+ order_uuid: string;
14517
14684
  /** Format: uuid */
14518
14685
  request_id?: string | null;
14519
14686
  /** Format: uuid */
14520
- wallet_uuid?: string;
14687
+ wallet_uuid: string;
14521
14688
  /** Format: uuid */
14522
- from_uuid?: string;
14689
+ from_uuid: string;
14523
14690
  /** Format: uuid */
14524
- to_uuid?: string;
14525
- amount_from?: number;
14526
- amount_to?: number | null;
14527
- order_type?: string;
14528
- /** @enum {string} */
14529
- status?: "NEW" | "PENDING" | "EXPECTED" | "PROCESSING" | "COMPLETE" | "FAILED" | "CANCELED" | "REFUNDED";
14691
+ to_uuid: string;
14692
+ amount_from: number;
14693
+ amount_to: number | null;
14694
+ order_type: string;
14695
+ /**
14696
+ * @description Complete set for these routes — a failure is always `FAILED`, there is no second failure status. `EXPECTED` is a scheduled payment waiting for its `scheduled_at`; `REFUNDED` is a failed order whose funds were paid back, as opposed to `CANCELED`, where nothing ever moved.
14697
+ * @enum {string}
14698
+ */
14699
+ status: "NEW" | "PENDING" | "EXPECTED" | "PROCESSING" | "COMPLETE" | "FAILED" | "CANCELED" | "REFUNDED";
14530
14700
  /**
14531
14701
  * @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.
14532
14702
  * @enum {string|null}
@@ -14577,7 +14747,8 @@ export interface components {
14577
14747
  sig_key_version?: string | null;
14578
14748
  /** @description Computed dust flag — amount below the render threshold for either currency. Returned by the list endpoint (GET /frontend/orders/wallet/{wallet_uuid}); absent from single-order reads. */
14579
14749
  is_threshold_amount?: boolean;
14580
- meta?: components["schemas"]["OrderMeta"];
14750
+ /** @description Always present; `null` for an order that carries no metadata at all. */
14751
+ meta: components["schemas"]["OrderMeta"] | null;
14581
14752
  /** @description Batch this order was created by, when it was sent as part of a mass payout; null for a standalone order. Filter the list by it with `filters=[{"mass_payout_id":"<uuid>"}]`. */
14582
14753
  mass_payout?: {
14583
14754
  /** Format: uuid */
@@ -14591,9 +14762,9 @@ export interface components {
14591
14762
  */
14592
14763
  scheduled_at?: string | null;
14593
14764
  /** Format: date-time */
14594
- created_at?: string;
14765
+ created_at: string;
14595
14766
  /** Format: date-time */
14596
- updated_at?: string | null;
14767
+ updated_at: string | null;
14597
14768
  };
14598
14769
  /** @description Single-order read shape (GET /orders/id/{order_id} and GET /orders/uuid/{order_uuid}) — the base Order plus context objects hydrated from its `meta` references. */
14599
14770
  OrderDetail: components["schemas"]["Order"] & {
@@ -14880,6 +15051,8 @@ export interface components {
14880
15051
  record_type: string;
14881
15052
  /** Format: uuid */
14882
15053
  wallet_id: string;
15054
+ /** @description Computed dust flag — amount below the render threshold for the currency. Hidden from the list unless `show_low_balance=true`. */
15055
+ is_threshold_amount?: boolean;
14883
15056
  currency: components["schemas"]["Currency"];
14884
15057
  meta: components["schemas"]["TransactionMeta"];
14885
15058
  };
@@ -14999,7 +15172,10 @@ export interface components {
14999
15172
  wallet_id?: string;
15000
15173
  /**
15001
15174
  * Format: uuid
15002
- * @description Source currency the batch is funded in
15175
+ * @description Source currency the batch is funded in. Crypto recipients are
15176
+ * paid with it on-chain, so it must be an on-chain asset; a fiat
15177
+ * source currency cannot fund crypto recipients.
15178
+ *
15003
15179
  */
15004
15180
  currency_id?: string;
15005
15181
  /**
@@ -15084,11 +15260,32 @@ export interface components {
15084
15260
  created_at?: string;
15085
15261
  /** Format: date-time */
15086
15262
  processed_at?: string | null;
15263
+ /** @description The address-book destination this row pays, with its owning account under counterparty_account — the same shape the counterparty endpoints return, raw data (no formatting). Always present; a destination deleted from the address book after the batch was made is still returned. Null only if the destination row no longer exists at all. */
15264
+ destination?: components["schemas"]["CounterpartyDestination"] | null;
15265
+ };
15266
+ /** @description Progress of the batch for one destination type. total minus completed, failed and cancelled is what is still in flight for that type. */
15267
+ MassPayoutMethodBreakdown: {
15268
+ /**
15269
+ * @description Type of the destinations the rows pay (CounterpartyDestination.type)
15270
+ * @enum {string}
15271
+ */
15272
+ destination_type: "ACH" | "RTP" | "SWIFT" | "SEPA" | "CRYPTO_EXTERNAL" | "CRYPTO_INTERNAL" | "CHAPS" | "FPS" | "FEDWIRE" | "INTERNAL";
15273
+ total: number;
15274
+ completed: number;
15275
+ failed: number;
15276
+ cancelled: number;
15277
+ };
15278
+ /** @description The batch as returned by the single-batch read: the MassPayout fields plus the progress cuts a tracker page draws from. Both are computed over the whole batch and never depend on how the item list is paged or filtered. */
15279
+ MassPayoutDetail: components["schemas"]["MassPayout"] & {
15280
+ /** @description Payments not yet finished: total_items minus completed_count, failed_count and cancelled_count */
15281
+ processing_count: number;
15282
+ /** @description Progress per destination type: one entry per type present in the batch (a type without rows is not listed), in order of first appearance; the totals add up to total_items */
15283
+ method_breakdown: components["schemas"]["MassPayoutMethodBreakdown"][];
15087
15284
  };
15088
15285
  MassPayoutItemInput: {
15089
15286
  /**
15090
15287
  * Format: uuid
15091
- * @description Existing counterparty destination of the source wallet
15288
+ * @description Counterparty destination from the source wallet's own address book. A destination of another wallet, or an unknown id, is refused with 404 DESTINATION_NOT_FOUND (details.destination_ids lists the offending ids); the two cases are deliberately not distinguished.
15092
15289
  */
15093
15290
  destination_id: string;
15094
15291
  /** @description The amount the recipient receives, in the payout currency of this row */
@@ -15114,7 +15311,10 @@ export interface components {
15114
15311
  * documents to the rows of a batch instead.
15115
15312
  * */
15116
15313
  MassPayoutTemplateItemInput: {
15117
- /** Format: uuid */
15314
+ /**
15315
+ * Format: uuid
15316
+ * @description Counterparty destination from the wallet's own address book; a destination of another wallet, or an unknown id, is refused with 404 DESTINATION_NOT_FOUND
15317
+ */
15118
15318
  destination_id: string;
15119
15319
  /** @description Optional in a template: omit it (or send null) to save a recipient
15120
15320
  * list whose amounts are filled in later. When present it must be
@@ -1639,224 +1639,6 @@ export interface paths {
1639
1639
  patch?: never;
1640
1640
  trace?: never;
1641
1641
  };
1642
- "/issuing/cards/prepaid": {
1643
- parameters: {
1644
- query?: never;
1645
- header?: never;
1646
- path?: never;
1647
- cookie?: never;
1648
- };
1649
- get?: never;
1650
- put?: never;
1651
- /**
1652
- * Create a new prepaid card
1653
- * @deprecated
1654
- * @description **Deprecated.** Use `POST /frontend/issuing/cards` (unified, routes by the program's
1655
- * `sub_account_type`) instead — it carries the same fee/top-up handling.
1656
- *
1657
- * Creates a new prepaid card for the user. Initial topup amount is determined by user group settings.
1658
- *
1659
- * **Cardholder is required**: Every card must be associated with a cardholder.
1660
- * Create a cardholder first, then pass the `cardholder_id` here.
1661
- *
1662
- */
1663
- post: {
1664
- parameters: {
1665
- query?: never;
1666
- header?: never;
1667
- path?: never;
1668
- cookie?: never;
1669
- };
1670
- requestBody: {
1671
- content: {
1672
- "application/json": {
1673
- /** @description Card nickname */
1674
- nick_name: string;
1675
- /**
1676
- * Format: uuid
1677
- * @description Issuing program ID
1678
- */
1679
- program_id: string;
1680
- /**
1681
- * Format: uuid
1682
- * @description Wallet ID
1683
- */
1684
- wallet_id: string;
1685
- /**
1686
- * Format: uuid
1687
- * @description ID of the cardholder to associate with this card. **Required.**
1688
- *
1689
- */
1690
- cardholder_id: string;
1691
- /**
1692
- * Format: uuid
1693
- * @description Currency ID for card fees (required if program has issuing fee or initial topup)
1694
- */
1695
- currency_id?: string;
1696
- /**
1697
- * @deprecated
1698
- * @description **Deprecated.** Use `cardholder_id` instead.
1699
- */
1700
- email?: string;
1701
- /**
1702
- * @deprecated
1703
- * @description **Deprecated.** Use `cardholder_id` instead.
1704
- */
1705
- vendor_user_id?: string;
1706
- /** @description User data ID (optional) */
1707
- user_data_id?: string;
1708
- };
1709
- };
1710
- };
1711
- responses: {
1712
- /** @description Prepaid card created successfully */
1713
- 200: {
1714
- headers: {
1715
- [name: string]: unknown;
1716
- };
1717
- content: {
1718
- "application/json": {
1719
- card_id?: string;
1720
- /** @enum {string} */
1721
- status?: "ACTIVE";
1722
- };
1723
- };
1724
- };
1725
- /** @description Bad Request - missing required fields or validation error */
1726
- 400: {
1727
- headers: {
1728
- [name: string]: unknown;
1729
- };
1730
- content: {
1731
- "application/json": components["schemas"]["Error"];
1732
- };
1733
- };
1734
- /** @description Server Error */
1735
- 500: {
1736
- headers: {
1737
- [name: string]: unknown;
1738
- };
1739
- content: {
1740
- "application/json": components["schemas"]["Error"];
1741
- };
1742
- };
1743
- };
1744
- };
1745
- delete?: never;
1746
- options?: never;
1747
- head?: never;
1748
- patch?: never;
1749
- trace?: never;
1750
- };
1751
- "/issuing/cards/balance": {
1752
- parameters: {
1753
- query?: never;
1754
- header?: never;
1755
- path?: never;
1756
- cookie?: never;
1757
- };
1758
- get?: never;
1759
- put?: never;
1760
- /**
1761
- * Create a new balance card
1762
- * @deprecated
1763
- * @description **Deprecated.** Use `POST /frontend/issuing/cards` (unified, routes by the program's
1764
- * `sub_account_type`) instead — it carries the same fee/top-up handling.
1765
- *
1766
- * Creates a new card linked to an existing balance account for the user. Card fees and initial topup are determined by user group settings.
1767
- *
1768
- * **Cardholder is required**: Every card must be associated with a cardholder.
1769
- * Create a cardholder first, then pass the `cardholder_id` here.
1770
- *
1771
- */
1772
- post: {
1773
- parameters: {
1774
- query?: never;
1775
- header?: never;
1776
- path?: never;
1777
- cookie?: never;
1778
- };
1779
- requestBody: {
1780
- content: {
1781
- "application/json": {
1782
- /** @description Card nickname */
1783
- nick_name: string;
1784
- /**
1785
- * Format: uuid
1786
- * @description Issuing program ID
1787
- */
1788
- program_id: string;
1789
- /**
1790
- * Format: uuid
1791
- * @description Wallet ID
1792
- */
1793
- wallet_id: string;
1794
- /**
1795
- * Format: uuid
1796
- * @description Fiat account (sub-account) ID to link the card to
1797
- */
1798
- fiat_account_id: string;
1799
- /**
1800
- * Format: uuid
1801
- * @description ID of the cardholder to associate with this card. **Required.**
1802
- *
1803
- */
1804
- cardholder_id: string;
1805
- /**
1806
- * Format: uuid
1807
- * @description Currency ID for card fees (required if program has issuing fee)
1808
- */
1809
- currency_id?: string;
1810
- /**
1811
- * @deprecated
1812
- * @description **Deprecated.** Use `cardholder_id` instead.
1813
- */
1814
- vendor_user_id?: string;
1815
- /** @description User data ID (optional) */
1816
- user_data_id?: string;
1817
- };
1818
- };
1819
- };
1820
- responses: {
1821
- /** @description Balance card created successfully */
1822
- 200: {
1823
- headers: {
1824
- [name: string]: unknown;
1825
- };
1826
- content: {
1827
- "application/json": {
1828
- card_id?: string;
1829
- /** @enum {string} */
1830
- status?: "ACTIVE";
1831
- };
1832
- };
1833
- };
1834
- /** @description Bad Request - missing required fields, validation error, or cards limit reached */
1835
- 400: {
1836
- headers: {
1837
- [name: string]: unknown;
1838
- };
1839
- content: {
1840
- "application/json": components["schemas"]["Error"];
1841
- };
1842
- };
1843
- /** @description Server Error */
1844
- 500: {
1845
- headers: {
1846
- [name: string]: unknown;
1847
- };
1848
- content: {
1849
- "application/json": components["schemas"]["Error"];
1850
- };
1851
- };
1852
- };
1853
- };
1854
- delete?: never;
1855
- options?: never;
1856
- head?: never;
1857
- patch?: never;
1858
- trace?: never;
1859
- };
1860
1642
  "/issuing/cards/{card_id}/freeze": {
1861
1643
  parameters: {
1862
1644
  query?: never;
@@ -2547,7 +2329,7 @@ export interface paths {
2547
2329
  "application/json": components["schemas"]["ErrorResponse"];
2548
2330
  };
2549
2331
  };
2550
- /** @description Forbidden - KYC not approved for this wallet */
2332
+ /** @description Forbidden - KYC not approved for this wallet, or (KYC-enabled tenants) the wallet is not APPROVED on the program's KYC rail / the rail is disabled — `code` carries WALLET_RAIL_NOT_ONBOARDED, WALLET_RAIL_NOT_APPROVED, RAIL_NOT_ENABLED or RAIL_NOT_CONFIGURED */
2551
2333
  403: {
2552
2334
  headers: {
2553
2335
  [name: string]: unknown;
@@ -3943,6 +3725,12 @@ export interface paths {
3943
3725
  * @example 123e4567-e89b-12d3-a456-426614174000
3944
3726
  */
3945
3727
  card_id?: string;
3728
+ /**
3729
+ * Format: uuid
3730
+ * @description Optional client-generated UUID for idempotency. Retrying with the same reference_id returns the original order instead of debiting the wallet again.
3731
+ * @example 3f0b8f61-52a4-4f0e-9f0d-2f6f4f1b9a11
3732
+ */
3733
+ reference_id?: string;
3946
3734
  };
3947
3735
  };
3948
3736
  };
@@ -4013,119 +3801,6 @@ export interface paths {
4013
3801
  patch?: never;
4014
3802
  trace?: never;
4015
3803
  };
4016
- "/orders/TRANSFER_CARD_PREPAID": {
4017
- parameters: {
4018
- query?: never;
4019
- header?: never;
4020
- path?: never;
4021
- cookie?: never;
4022
- };
4023
- get?: never;
4024
- put?: never;
4025
- /**
4026
- * Create a wholesale card deposit order
4027
- * @description Transfer funds from crypto to a wholesale card vendor
4028
- */
4029
- post: {
4030
- parameters: {
4031
- query?: never;
4032
- header?: never;
4033
- path?: never;
4034
- cookie?: never;
4035
- };
4036
- requestBody: {
4037
- content: {
4038
- "application/json": {
4039
- /**
4040
- * @description Amount to transfer
4041
- * @example 100
4042
- */
4043
- amount: number;
4044
- /**
4045
- * @description Source wallet UUID
4046
- * @example 8205c701-cd41-4929-910f-fccbb949729a
4047
- */
4048
- wallet_uuid: string;
4049
- /**
4050
- * @description UUID of cryptocurrency from currency table to withdraw from
4051
- * @example c6d0c728-2624-403d-8e42-0c3f8b1e5e41
4052
- */
4053
- from_uuid: string;
4054
- /**
4055
- * @description Card ID
4056
- * @example 509eca03-bc0d-4a38-b7dc-d136d2bdaa43
4057
- */
4058
- card_id: string;
4059
- };
4060
- };
4061
- };
4062
- responses: {
4063
- /** @description Order successfully created */
4064
- 200: {
4065
- headers: {
4066
- [name: string]: unknown;
4067
- };
4068
- content: {
4069
- "application/json": {
4070
- /** Format: date-time */
4071
- created_at?: string;
4072
- order_uuid?: string;
4073
- wallet_uuid?: string;
4074
- from_uuid?: string;
4075
- to_uuid?: string;
4076
- amount_from?: number;
4077
- /** @example TRANSFER_CARD_PREPAID */
4078
- order_type?: string;
4079
- /** @enum {string} */
4080
- status?: "PENDING" | "COMPLETE" | "FAILED";
4081
- amount_to?: number;
4082
- info?: string;
4083
- meta?: {
4084
- fee?: number;
4085
- order_uuid?: string;
4086
- fee_currency?: string;
4087
- exchange_rate?: number;
4088
- billing_amount?: number;
4089
- vendor_id?: string;
4090
- transaction_amount?: number;
4091
- billing_currency?: string;
4092
- transaction_currency?: string;
4093
- network_fee?: number;
4094
- };
4095
- id?: string;
4096
- };
4097
- };
4098
- };
4099
- /** @description Bad request - validation error */
4100
- 400: {
4101
- headers: {
4102
- [name: string]: unknown;
4103
- };
4104
- content: {
4105
- "application/json": {
4106
- error?: string;
4107
- };
4108
- };
4109
- };
4110
- /** @description Server error */
4111
- 500: {
4112
- headers: {
4113
- [name: string]: unknown;
4114
- };
4115
- content: {
4116
- "application/json": {
4117
- error?: string;
4118
- };
4119
- };
4120
- };
4121
- };
4122
- };
4123
- delete?: never;
4124
- options?: never;
4125
- head?: never;
4126
- patch?: never;
4127
- trace?: never;
4128
- };
4129
3804
  "/orders/EXCHANGE_CRYPTO_INTERNAL": {
4130
3805
  parameters: {
4131
3806
  query?: never;
@@ -7101,6 +6776,23 @@ export interface paths {
7101
6776
  };
7102
6777
  };
7103
6778
  };
6779
+ /** @description KYC rail gate (KYC-enabled tenants) — the program's rail is disabled, deposits are disabled, or the wallet is not APPROVED on that rail */
6780
+ 422: {
6781
+ headers: {
6782
+ [name: string]: unknown;
6783
+ };
6784
+ content: {
6785
+ "application/json": {
6786
+ /** @example This wallet is not onboarded on this rail yet. */
6787
+ error?: string;
6788
+ /**
6789
+ * @example WALLET_RAIL_NOT_ONBOARDED
6790
+ * @enum {string}
6791
+ */
6792
+ code?: "RAIL_NOT_CONFIGURED" | "RAIL_NOT_ENABLED" | "DEPOSITS_DISABLED" | "WALLET_RAIL_NOT_ONBOARDED" | "WALLET_RAIL_NOT_APPROVED" | "RAIL_GATE_CHECK_FAILED";
6793
+ };
6794
+ };
6795
+ };
7104
6796
  /** @description Server error */
7105
6797
  500: {
7106
6798
  headers: {
@@ -4982,6 +4982,11 @@ export interface paths {
4982
4982
  /**
4983
4983
  * Create virtual account
4984
4984
  * @description Create a virtual account for a specific wallet. Tenant API can create VA for any user. Supports force_create to bypass existing VA check.
4985
+ *
4986
+ * On KYC-enabled tenants the program's KYC rail gate applies exactly as on the client API — the rail must be enabled
4987
+ * (`kyc_rails.is_active`, `is_deposit_enabled`) and the wallet must be APPROVED on it (`wallet_kyc_rails`); otherwise 422 with
4988
+ * `RAIL_NOT_ENABLED`, `DEPOSITS_DISABLED`, `WALLET_RAIL_NOT_ONBOARDED` or `WALLET_RAIL_NOT_APPROVED`. `force_create` never bypasses it.
4989
+ *
4985
4990
  */
4986
4991
  post: {
4987
4992
  parameters: {
@@ -5055,6 +5060,13 @@ export interface paths {
5055
5060
  };
5056
5061
  content?: never;
5057
5062
  };
5063
+ /** @description KYC rail gate — rail disabled, deposits disabled, or wallet not APPROVED on the program's rail */
5064
+ 422: {
5065
+ headers: {
5066
+ [name: string]: unknown;
5067
+ };
5068
+ content?: never;
5069
+ };
5058
5070
  /** @description Internal server error */
5059
5071
  500: {
5060
5072
  headers: {
@@ -8438,8 +8450,6 @@ export interface components {
8438
8450
  destinations_count?: number;
8439
8451
  };
8440
8452
  BankingData: {
8441
- /** Format: uuid */
8442
- id?: string;
8443
8453
  account_number?: string | null;
8444
8454
  routing_number?: string | null;
8445
8455
  bank_name: string | null;
@@ -8449,8 +8459,6 @@ export interface components {
8449
8459
  sort_code?: string | null;
8450
8460
  note?: string | null;
8451
8461
  address?: {
8452
- /** Format: uuid */
8453
- id?: string;
8454
8462
  country_id?: number | null;
8455
8463
  city?: string | null;
8456
8464
  postcode?: string | null;
@@ -8462,8 +8470,6 @@ export interface components {
8462
8470
  created_at: string;
8463
8471
  } | null;
8464
8472
  CryptoData: {
8465
- /** Format: uuid */
8466
- id?: string;
8467
8473
  address: string;
8468
8474
  /** Format: uuid */
8469
8475
  currency_id?: string;
@@ -8505,7 +8511,21 @@ export interface components {
8505
8511
  banking_data?: components["schemas"]["BankingData"];
8506
8512
  crypto_data?: components["schemas"]["CryptoData"];
8507
8513
  internal_data?: components["schemas"]["CounterpartyInternalData"];
8514
+ counterparty_account?: components["schemas"]["CounterpartyAccountRef"];
8508
8515
  };
8516
+ /** @description Owning counterparty account, embedded on destination reads; absent on create/update. */
8517
+ CounterpartyAccountRef: {
8518
+ /** Format: uuid */
8519
+ id: string;
8520
+ name: string;
8521
+ /** @enum {string} */
8522
+ type: "BUSINESS" | "INDIVIDUAL";
8523
+ /** Format: uuid */
8524
+ wallet_id?: string | null;
8525
+ nickname?: string | null;
8526
+ email?: string | null;
8527
+ phone?: string | null;
8528
+ } | null;
8509
8529
  AdminApiKey: {
8510
8530
  /** Format: uuid */
8511
8531
  id?: string;
@@ -260,6 +260,23 @@ export interface paths {
260
260
  patch?: never;
261
261
  trace?: never;
262
262
  };
263
+ "/user/account": {
264
+ parameters: {
265
+ query?: never;
266
+ header?: never;
267
+ path?: never;
268
+ cookie?: never;
269
+ };
270
+ get?: never;
271
+ put?: never;
272
+ post?: never;
273
+ /** Delete own account */
274
+ delete: operations["UserController_deleteOwnAccount"];
275
+ options?: never;
276
+ head?: never;
277
+ patch?: never;
278
+ trace?: never;
279
+ };
263
280
  "/user/email": {
264
281
  parameters: {
265
282
  query?: never;
@@ -2667,6 +2684,30 @@ export interface operations {
2667
2684
  };
2668
2685
  };
2669
2686
  };
2687
+ UserController_deleteOwnAccount: {
2688
+ parameters: {
2689
+ query?: never;
2690
+ header?: never;
2691
+ path?: never;
2692
+ cookie?: never;
2693
+ };
2694
+ requestBody?: never;
2695
+ responses: {
2696
+ 204: {
2697
+ headers: {
2698
+ [name: string]: unknown;
2699
+ };
2700
+ content?: never;
2701
+ };
2702
+ /** @description Unauthorized */
2703
+ 401: {
2704
+ headers: {
2705
+ [name: string]: unknown;
2706
+ };
2707
+ content?: never;
2708
+ };
2709
+ };
2710
+ };
2670
2711
  AuthenticatedUserController_changeEmailConfirm: {
2671
2712
  parameters: {
2672
2713
  query?: never;
@@ -564,12 +564,19 @@ export declare namespace API {
564
564
  type Response = CounterpartyWithDestinations;
565
565
  }
566
566
  namespace List {
567
- type Request = pathsV1Frontend['/frontend/counterparty/accounts/wallet/{wallet_id}']['get']['parameters']['path'] & NonNullable<pathsV1Frontend['/frontend/counterparty/accounts/wallet/{wallet_id}']['get']['parameters']['query']>;
567
+ type Request = Omit<pathsV1Frontend['/frontend/counterparty/accounts/wallet/{wallet_id}']['get']['parameters']['path'] & NonNullable<pathsV1Frontend['/frontend/counterparty/accounts/wallet/{wallet_id}']['get']['parameters']['query']>, 'include'>;
568
568
  type Response = {
569
569
  total: number;
570
570
  data: Counterparty[];
571
571
  };
572
572
  }
573
+ namespace ListWithDestinations {
574
+ type Request = List.Request;
575
+ type Response = {
576
+ total: number;
577
+ data: CounterpartyWithDestinations[];
578
+ };
579
+ }
573
580
  namespace Create {
574
581
  type Request = pathsV1Frontend['/frontend/counterparty/accounts/wallet/{wallet_id}']['post']['parameters']['path'] & pathsV1Frontend['/frontend/counterparty/accounts/wallet/{wallet_id}']['post']['requestBody']['content']['application/json'];
575
582
  type Response = Counterparty;
@@ -1427,6 +1434,16 @@ export declare namespace API {
1427
1434
  type TemplateRoot = pathsV1Frontend['/frontend/mass-payouts/{wallet_id}/templates/{template_id}'];
1428
1435
  /** The batch itself: progress counters, totals and the approval/schedule state. */
1429
1436
  export type MassPayout = componentsV1Frontend['schemas']['MassPayout'];
1437
+ /**
1438
+ * The batch as the single read returns it (`getById`) — the base `MassPayout` plus the two
1439
+ * progress cuts a tracker page draws from. Both are computed over the whole batch and ignore
1440
+ * how the item list is paged or filtered. The list read and every mutation still answer with
1441
+ * the plain `MassPayout`, so a page that needs the breakdown after `approve` / `cancel` must
1442
+ * re-read the batch.
1443
+ */
1444
+ export type MassPayoutDetail = componentsV1Frontend['schemas']['MassPayoutDetail'];
1445
+ /** Progress of the batch for one destination type; `total` minus the three counters is in flight. */
1446
+ export type MassPayoutMethodBreakdown = componentsV1Frontend['schemas']['MassPayoutMethodBreakdown'];
1430
1447
  /** A stored recipient row, with its own status and the order created for it at execution. */
1431
1448
  export type MassPayoutItem = componentsV1Frontend['schemas']['MassPayoutItem'];
1432
1449
  /** A recipient row as written on create/update. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "squarefi-bff-api-module",
3
- "version": "1.36.56",
3
+ "version": "1.36.58",
4
4
  "description": "Squarefi BFF API client module",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",