squarefi-bff-api-module 1.36.87 → 1.36.89

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.
@@ -80,6 +80,7 @@ export declare const orders: {
80
80
  getByWalletUuid: ({ wallet_uuid, filters, ...props }: API.Orders.Frontend.List.Csv.Request) => Promise<API.Orders.Frontend.List.Csv.Response>;
81
81
  };
82
82
  };
83
+ scheduledFunding: ({ wallet_uuid, }: API.Orders.Frontend.ScheduledFunding.Request) => Promise<API.Orders.Frontend.ScheduledFunding.Response>;
83
84
  types: {
84
85
  list: () => Promise<API.Orders.Frontend.Types.List.Response>;
85
86
  getById: ({ id, }: API.Orders.Frontend.Types.GetById.Request) => Promise<API.Orders.Frontend.Types.GetById.Response>;
@@ -149,6 +149,7 @@ export const orders = {
149
149
  },
150
150
  },
151
151
  },
152
+ scheduledFunding: ({ wallet_uuid, }) => apiClientV1Frontend.getRequest(`/frontend/orders/wallet/${wallet_uuid}/scheduled/funding`),
152
153
  types: {
153
154
  list: () => apiClientV1Frontend.getRequest('/frontend/orders/types'),
154
155
  getById: ({ id, }) => apiClientV1Frontend.getRequest(`/frontend/orders/types/${id}`),
@@ -784,7 +784,138 @@ export interface paths {
784
784
  };
785
785
  };
786
786
  put?: never;
787
- post?: never;
787
+ /** Create destination */
788
+ post: {
789
+ parameters: {
790
+ query?: never;
791
+ header?: never;
792
+ path?: never;
793
+ cookie?: never;
794
+ };
795
+ requestBody: {
796
+ content: {
797
+ "application/json": {
798
+ /**
799
+ * Format: uuid
800
+ * @description Parent counterparty account ID
801
+ */
802
+ counterparty_account_id: string;
803
+ /**
804
+ * @description Payment rail type
805
+ * @enum {string}
806
+ */
807
+ type: "ACH" | "RTP" | "SWIFT" | "SEPA" | "CRYPTO_EXTERNAL" | "CRYPTO_INTERNAL" | "CHAPS" | "FPS" | "FEDWIRE" | "INTERNAL";
808
+ /** @description User-friendly alias for this destination */
809
+ nickname?: string;
810
+ /** @description Required for banking types (ACH, RTP, SWIFT, SEPA, CHAPS, FPS, FEDWIRE). What each rail needs:
811
+ *
812
+ * | Rail | Required | Format |
813
+ * | --- | --- | --- |
814
+ * | ACH, RTP, FEDWIRE | `routing_number`, `account_number` | ABA routing number (9 digits, valid check digit); account 4–17 letters or digits |
815
+ * | SEPA | `iban` | IBAN of a SEPA-zone country; length, account format and check digits per country; `swift_bic` optional |
816
+ * | SWIFT | `swift_bic`, `account_number` (or `iban`) | valid SWIFT/BIC (not a test BIC); an IBAN-shaped account must be a valid IBAN; for a US bank `routing_number` is optional and must be valid when given |
817
+ * | CHAPS, FPS | `sort_code`, `account_number` | UK: 6-digit sort code and 8-digit account; FPS in HKD: 3-digit bank clearing code |
818
+ *
819
+ * Every problem is returned at once in `error.details.issues`. `POST /api/counterparty/destinations/validate` checks a payload without saving it.
820
+ * */
821
+ banking_data?: {
822
+ /** @description Bank account number (on SWIFT, the IBAN where the bank's country uses one) */
823
+ account_number?: string;
824
+ /** @description US ABA routing number */
825
+ routing_number?: string;
826
+ /** @description Bank name */
827
+ bank_name?: string;
828
+ /** @description SWIFT/BIC code */
829
+ swift_bic?: string;
830
+ /** @description IBAN */
831
+ iban?: string;
832
+ /** @description Sort code (6 digits, UK banking) */
833
+ sort_code?: string;
834
+ /** @description Additional notes/reference */
835
+ note?: string;
836
+ /** @description Bank/beneficiary postal address */
837
+ address?: {
838
+ country_id?: number;
839
+ city?: string;
840
+ postcode?: string;
841
+ street1?: string;
842
+ street2?: string;
843
+ /** @description Required when the selected country has states; countries without states may omit it */
844
+ state_id?: number | null;
845
+ };
846
+ };
847
+ /** @description Required for crypto types (CRYPTO_EXTERNAL, CRYPTO_INTERNAL) */
848
+ crypto_data?: {
849
+ /** @description Blockchain address */
850
+ address?: string;
851
+ /**
852
+ * Format: uuid
853
+ * @description Currency UUID
854
+ */
855
+ currency_id?: string;
856
+ /** @description Memo/tag (for XRP, XLM, etc.) */
857
+ memo?: string;
858
+ /**
859
+ * @description Hosting classification of the address (custodial VASP, self-hosted/unhosted, or unknown)
860
+ * @default unknown
861
+ * @enum {string}
862
+ */
863
+ wallet_custody_type?: "custodial" | "selfhosted" | "unknown";
864
+ };
865
+ /** @description Required for type INTERNAL — points at the receiver wallet on the same platform. An account holds one INTERNAL destination per wallet; if it already has an active one to this wallet, that destination is returned instead of a new one. */
866
+ internal_data?: {
867
+ /**
868
+ * Format: uuid
869
+ * @description Target (receiver) wallet uuid on the same platform.
870
+ */
871
+ wallet_id: string;
872
+ /** @description Optional, reserved for future use. */
873
+ description?: string;
874
+ };
875
+ };
876
+ };
877
+ };
878
+ responses: {
879
+ /** @description Destination created */
880
+ 201: {
881
+ headers: {
882
+ [name: string]: unknown;
883
+ };
884
+ content: {
885
+ "application/json": {
886
+ /** @example true */
887
+ success?: boolean;
888
+ data?: {
889
+ destination?: components["schemas"]["CounterpartyDestination"];
890
+ /** @example Destination created successfully */
891
+ message?: string;
892
+ };
893
+ };
894
+ };
895
+ };
896
+ /** @description Validation error. Bank-details problems come as `VALIDATION_ERROR` with every problem in `error.details.issues` (`field`, `code`, `message`, optional `country` / `detected`).
897
+ *
898
+ * **Until 2026-10-12 00:00 UTC** the stricter bank-details rules (per-country IBAN checks, SEPA-zone IBAN, BIC format, ABA check digit, account formats) are reported by the validation endpoint but do not refuse this request; from then on they do.
899
+ * */
900
+ 400: {
901
+ headers: {
902
+ [name: string]: unknown;
903
+ };
904
+ content: {
905
+ "application/json": components["schemas"]["ApiErrorResponse"];
906
+ };
907
+ };
908
+ /** @description Account not found */
909
+ 404: {
910
+ headers: {
911
+ [name: string]: unknown;
912
+ };
913
+ content: {
914
+ "application/json": components["schemas"]["ApiErrorResponse"];
915
+ };
916
+ };
917
+ };
918
+ };
788
919
  delete?: never;
789
920
  options?: never;
790
921
  head?: never;
@@ -931,6 +1062,78 @@ export interface paths {
931
1062
  };
932
1063
  trace?: never;
933
1064
  };
1065
+ "/api/counterparty/destinations/validate": {
1066
+ parameters: {
1067
+ query?: never;
1068
+ header?: never;
1069
+ path?: never;
1070
+ cookie?: never;
1071
+ };
1072
+ get?: never;
1073
+ put?: never;
1074
+ /**
1075
+ * Validate destination details without saving
1076
+ * @description Dry run of `POST /api/counterparty/destinations`: the same body and the same checks — bank details per
1077
+ * payment method, address completeness, location reference data, bank-country consistency — with nothing
1078
+ * saved and no counterparty account needed. Answers `200` whether or not the details are valid;
1079
+ * `valid: false` comes with every problem in `issues`.
1080
+ *
1081
+ * It always applies the strict bank-details rules, including before they start refusing creation on this
1082
+ * surface (2026-10-12 00:00 UTC) — use it to find out what your integration sends that will be refused.
1083
+ * Without an account it cannot tell whether an INTERNAL target wallet is active — creation still checks
1084
+ * that. Rate limited to 60 requests per minute per API key's wallet.
1085
+ *
1086
+ */
1087
+ post: {
1088
+ parameters: {
1089
+ query?: never;
1090
+ header?: never;
1091
+ path?: never;
1092
+ cookie?: never;
1093
+ };
1094
+ requestBody: {
1095
+ content: {
1096
+ "application/json": {
1097
+ /** @enum {string} */
1098
+ type: "ACH" | "RTP" | "SWIFT" | "SEPA" | "CRYPTO_EXTERNAL" | "CRYPTO_INTERNAL" | "CHAPS" | "FPS" | "FEDWIRE" | "INTERNAL";
1099
+ /** @description Same shape as in `POST /api/counterparty/destinations`. */
1100
+ banking_data?: Record<string, never>;
1101
+ crypto_data?: Record<string, never>;
1102
+ internal_data?: Record<string, never>;
1103
+ };
1104
+ };
1105
+ };
1106
+ responses: {
1107
+ /** @description Validation result */
1108
+ 200: {
1109
+ headers: {
1110
+ [name: string]: unknown;
1111
+ };
1112
+ content: {
1113
+ "application/json": {
1114
+ /** @example true */
1115
+ success?: boolean;
1116
+ data?: components["schemas"]["DestinationValidationResult"];
1117
+ };
1118
+ };
1119
+ };
1120
+ /** @description Too many validation requests */
1121
+ 429: {
1122
+ headers: {
1123
+ [name: string]: unknown;
1124
+ };
1125
+ content: {
1126
+ "application/json": components["schemas"]["ApiErrorResponse"];
1127
+ };
1128
+ };
1129
+ };
1130
+ };
1131
+ delete?: never;
1132
+ options?: never;
1133
+ head?: never;
1134
+ patch?: never;
1135
+ trace?: never;
1136
+ };
934
1137
  "/api/crypto_wallets": {
935
1138
  parameters: {
936
1139
  query?: never;
@@ -4808,6 +5011,9 @@ export interface paths {
4808
5011
  * Besides order columns it accepts `mass_payout_id` (uuid), which narrows the
4809
5012
  * result to the orders of one mass payout batch — the same batch reported by
4810
5013
  * the `mass_payout_id` field of each order. A non-uuid value is rejected with 400.
5014
+ * `scheduled` narrows it to scheduled payments: `all`, `upcoming` (approved and
5015
+ * waiting, `EXPECTED`) or `past` (any status but `NEW` and `EXPECTED`); it combines
5016
+ * with `status`. Any other value is rejected with 400.
4811
5017
  * */
4812
5018
  filters?: string;
4813
5019
  date_from?: string;
@@ -4921,6 +5127,9 @@ export interface paths {
4921
5127
  * status NEW can be approved. Orders
4922
5128
  * created with `scheduled_at` move to EXPECTED instead — no funds are
4923
5129
  * debited until execution at the requested time.
5130
+ * A scheduled order is approved only while its `scheduled_at` is at least
5131
+ * one hour away; a later approve answers 400 `SCHEDULED_AT_TOO_SOON`
5132
+ * (create the payment again with a new date).
4924
5133
  *
4925
5134
  */
4926
5135
  post: {
@@ -4948,7 +5157,7 @@ export interface paths {
4948
5157
  };
4949
5158
  };
4950
5159
  };
4951
- /** @description Insufficient funds (`INSUFFICIENT_FUNDS` — the order is released back to NEW) or validation error */
5160
+ /** @description Insufficient funds (`INSUFFICIENT_FUNDS` — the order is released back to NEW), a scheduled order less than an hour before its `scheduled_at` (`SCHEDULED_AT_TOO_SOON`), or validation error */
4952
5161
  400: {
4953
5162
  headers: {
4954
5163
  [name: string]: unknown;
@@ -5141,7 +5350,7 @@ export interface paths {
5141
5350
  note?: string;
5142
5351
  /**
5143
5352
  * Format: date-time
5144
- * @description Optional. Schedule the transfer for a future time (min 1 hour, max 90 days ahead). No funds are reserved; after approval the order waits in EXPECTED status and executes automatically.
5353
+ * @description Optional. Schedule the transfer for a future time (min 1 hour, max 90 days ahead). No funds are reserved; after approval the order waits in EXPECTED status and executes automatically, once. If the balance does not cover it then, it fails with `scheduled_failure.code` INSUFFICIENT_FUNDS and is not retried. Approve at least 1 hour before scheduled_at.
5145
5354
  * @example 2026-07-20T12:00:00Z
5146
5355
  */
5147
5356
  scheduled_at?: string;
@@ -6646,14 +6855,14 @@ export interface paths {
6646
6855
  * - Returns raw balance records without aggregation
6647
6856
  * - Includes crypto metadata for each balance
6648
6857
  * - No currency conversion or totals calculation
6649
- * - **Automatically filters out dust balances** below render_threshold
6858
+ * - **Automatically filters out dust balances** — smaller than the currency threshold in absolute value; a negative balance (a debt) beyond it is always returned
6650
6859
  * - **Does NOT include icon in crypto meta** (use frontend endpoint if icon needed)
6651
6860
  *
6652
6861
  */
6653
6862
  get: {
6654
6863
  parameters: {
6655
6864
  query?: {
6656
- /** @description When false (default), dust balances below threshold are hidden */
6865
+ /** @description When false (default), dust balances — smaller than the currency threshold in absolute value — are hidden */
6657
6866
  show_low_balance?: boolean;
6658
6867
  };
6659
6868
  header?: never;
@@ -7274,8 +7483,10 @@ export interface components {
7274
7483
  * @enum {string}
7275
7484
  */
7276
7485
  brand?: "VISA" | "MASTERCARD";
7277
- /** @description Whether card can be tokenized */
7486
+ /** @description Whether this card can be added to a mobile wallet; set when the card was issued. Which ones: `digital_wallets`. */
7278
7487
  tokenizable?: boolean;
7488
+ /** @description Mobile wallets this card can be added to: the wallets of the card's program, or none when the card's `tokenizable` is false. Left out when the program could not be read. */
7489
+ digital_wallets?: ("APPLE_PAY" | "GOOGLE_PAY")[];
7279
7490
  /** @description Total spending cap/limit */
7280
7491
  spend_cap?: number;
7281
7492
  /** @description Total amount spent */
@@ -7671,8 +7882,16 @@ export interface components {
7671
7882
  form_factor?: "virtual" | "physical" | "both";
7672
7883
  /** @description Program type */
7673
7884
  type?: string;
7674
- /** @description Whether cards can be tokenized */
7885
+ /** @description Whether cards of this program can be added to at least one mobile wallet. Which ones: `digital_wallets`. */
7675
7886
  tokenizable?: boolean;
7887
+ /**
7888
+ * @description Mobile wallets cards of this program can be added to. Empty when none; a program can support one wallet without the other.
7889
+ * @example [
7890
+ * "APPLE_PAY",
7891
+ * "GOOGLE_PAY"
7892
+ * ]
7893
+ */
7894
+ digital_wallets?: ("APPLE_PAY" | "GOOGLE_PAY")[];
7676
7895
  /** @description What a cardholder on this program must carry. Set per program in the vendor config, so it can change without a release — read it instead of hardcoding the form. */
7677
7896
  cardholder_requirements?: {
7678
7897
  /**
@@ -7870,7 +8089,7 @@ export interface components {
7870
8089
  * @description Destination/payment rail type
7871
8090
  * @enum {string}
7872
8091
  */
7873
- type?: "ACH" | "SWIFT" | "SEPA" | "CRYPTO_EXTERNAL" | "CRYPTO_INTERNAL" | "CHAPS" | "FPS" | "FEDWIRE" | "INTERNAL";
8092
+ type?: "ACH" | "RTP" | "SWIFT" | "SEPA" | "CRYPTO_EXTERNAL" | "CRYPTO_INTERNAL" | "CHAPS" | "FPS" | "FEDWIRE" | "INTERNAL";
7874
8093
  /** @description User-friendly alias */
7875
8094
  nickname?: string | null;
7876
8095
  /** Format: date-time */
@@ -7880,8 +8099,37 @@ export interface components {
7880
8099
  banking_data?: components["schemas"]["BankingData"];
7881
8100
  crypto_data?: components["schemas"]["CryptoData"];
7882
8101
  internal_data?: components["schemas"]["CounterpartyInternalData"];
8102
+ /** @description Banking destinations only: problems that make the stored bank details unpayable (an IBAN that fails its checks, an IBAN outside SEPA on a SEPA destination, a routing number that fails the ABA check). Non-empty means withdrawals to this destination are refused with `DESTINATION_INVALID` — details cannot be edited, so add a new destination. Empty for valid banking destinations; absent for crypto and internal ones. */
8103
+ validation_issues?: components["schemas"]["DestinationValidationIssue"][];
7883
8104
  counterparty_account?: components["schemas"]["CounterpartyAccountRef"];
7884
8105
  };
8106
+ /** @description One problem with a destination payload. `field` is the request path of the offending value (`iban`, `routing_number`, `address.city`…); `message` is ready to show under that field. */
8107
+ DestinationValidationIssue: {
8108
+ /** @example iban */
8109
+ field: string;
8110
+ /**
8111
+ * @description Machine-readable reason. Bank details: `REQUIRED`, `IBAN_WRONG_FORMAT`, `IBAN_INVALID_CHARACTERS`, `IBAN_COUNTRY_NOT_SUPPORTED`, `IBAN_WRONG_LENGTH`, `IBAN_WRONG_BBAN_FORMAT`, `IBAN_WRONG_CHECKSUM`, `IBAN_WRONG_NATIONAL_CHECKSUM`, `IBAN_QR_NOT_ALLOWED`, `IBAN_NOT_SEPA`, `IBAN_BIC_COUNTRY_MISMATCH`, `BIC_WRONG_FORMAT`, `BIC_UNKNOWN_COUNTRY`, `BIC_TEST_CODE`, `ROUTING_NUMBER_INVALID`, `ACCOUNT_NUMBER_INVALID`, `SORT_CODE_INVALID`, `WRONG_IDENTIFIER_TYPE`, `INVALID_VALUE`; reference data: `BANK_COUNTRY_MISMATCH`, `VALIDATION_ERROR`; dry run only: `INVALID_TYPE`. New codes may be added — show `message` for an unknown one.
8112
+ * @example IBAN_NOT_SEPA
8113
+ */
8114
+ code: string;
8115
+ /** @example IBAN country AE is outside the SEPA zone — SEPA transfers cannot reach it */
8116
+ message: string;
8117
+ /**
8118
+ * @description ISO 3166-1 alpha-2 country the problem is about, when there is one
8119
+ * @example AE
8120
+ */
8121
+ country?: string;
8122
+ /**
8123
+ * @description For `WRONG_IDENTIFIER_TYPE`: what the value looks like (an IBAN typed into a US account-number field…)
8124
+ * @enum {string}
8125
+ */
8126
+ detected?: "IBAN" | "BIC" | "ROUTING_NUMBER";
8127
+ };
8128
+ DestinationValidationResult: {
8129
+ /** @description True when creating the destination with this payload would pass every check */
8130
+ valid: boolean;
8131
+ issues: components["schemas"]["DestinationValidationIssue"][];
8132
+ };
7885
8133
  /** @description Owning counterparty account, embedded on destination reads; absent on create/update. */
7886
8134
  CounterpartyAccountRef: {
7887
8135
  /** Format: uuid */
@@ -8304,6 +8552,16 @@ export interface components {
8304
8552
  * @description Requested execution time for scheduled payments (status EXPECTED); null for immediate orders
8305
8553
  */
8306
8554
  scheduled_at?: string | null;
8555
+ /** @description Why a scheduled payment failed — set on a scheduled order in `FAILED`, null on any other scheduled order, absent on an immediate one. A scheduled payment is attempted once and never retried: `INSUFFICIENT_FUNDS` means nothing was debited and the payment can be created again; `PROVIDER_ERROR` — the payment was debited and the provider side failed; `EXECUTION_ERROR` — any other reason. */
8556
+ scheduled_failure?: {
8557
+ /** @enum {string} */
8558
+ code: "INSUFFICIENT_FUNDS" | "PROVIDER_ERROR" | "EXECUTION_ERROR";
8559
+ /**
8560
+ * @description Customer-facing text of the code.
8561
+ * @example The balance was insufficient at the scheduled time.
8562
+ */
8563
+ message: string;
8564
+ } | null;
8307
8565
  /** Format: date-time */
8308
8566
  created_at?: string;
8309
8567
  /** Format: date-time */
@@ -8355,7 +8613,7 @@ export interface components {
8355
8613
  note?: string;
8356
8614
  /**
8357
8615
  * Format: date-time
8358
- * @description Optional. Schedule the payment for a future time (min 1 hour, max 90 days ahead). No funds are reserved; after approval the order waits in `EXPECTED` status and executes automatically at the requested time (balance is checked then, with retries and email notifications on insufficient funds).
8616
+ * @description Optional. Schedule the payment for a future time (min 1 hour, max 90 days ahead). No funds are reserved; after approval the order waits in `EXPECTED` status and executes automatically at the requested time, once: the balance is checked then, and if it does not cover the payment the order fails with `scheduled_failure.code` `INSUFFICIENT_FUNDS` and is not retried. Approve at least 1 hour before `scheduled_at`.
8359
8617
  * @example 2026-07-20T12:00:00Z
8360
8618
  */
8361
8619
  scheduled_at?: string;
@@ -8407,7 +8665,7 @@ export interface components {
8407
8665
  note?: string;
8408
8666
  /**
8409
8667
  * Format: date-time
8410
- * @description Optional. Schedule the payment for a future time (min 1 hour, max 90 days ahead). No funds are reserved; after approval the order waits in `EXPECTED` status and executes automatically at the requested time (balance is checked then, with retries and email notifications on insufficient funds).
8668
+ * @description Optional. Schedule the payment for a future time (min 1 hour, max 90 days ahead). No funds are reserved; after approval the order waits in `EXPECTED` status and executes automatically at the requested time, once: the balance is checked then, and if it does not cover the payment the order fails with `scheduled_failure.code` `INSUFFICIENT_FUNDS` and is not retried. Approve at least 1 hour before `scheduled_at`.
8411
8669
  * @example 2026-07-20T12:00:00Z
8412
8670
  */
8413
8671
  scheduled_at?: string;