squarefi-bff-api-module 1.36.31 → 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.
@@ -624,6 +624,12 @@ export interface paths {
624
624
  /** Format: uuid */
625
625
  currency_id?: string;
626
626
  memo?: string;
627
+ /**
628
+ * @description Hosting classification of the address
629
+ * @default unknown
630
+ * @enum {string}
631
+ */
632
+ wallet_custody_type?: "custodial" | "selfhosted" | "unknown";
627
633
  };
628
634
  /** @description Required for type INTERNAL — points at the receiver wallet on the same platform. */
629
635
  internal_data?: {
@@ -1417,6 +1423,11 @@ export interface paths {
1417
1423
  * @description Creates KYC data for a wallet. Each wallet can have only one KYC record.
1418
1424
  * Created with status `UNVERIFIED`.
1419
1425
  *
1426
+ * The entity is owned by the wallet's active OWNER
1427
+ * (`kyc_entity.user_data_uuid`) and the wallet is linked to it via
1428
+ * `wallets.kyc_entity_id` — a wallet without an active owner is rejected
1429
+ * with 400.
1430
+ *
1420
1431
  */
1421
1432
  post: {
1422
1433
  parameters: {
@@ -1527,7 +1538,7 @@ export interface paths {
1527
1538
  };
1528
1539
  };
1529
1540
  };
1530
- /** @description Missing required fields or wallet already has KYC */
1541
+ /** @description Missing required fields, wallet already has KYC, or wallet has no active owner */
1531
1542
  400: {
1532
1543
  headers: {
1533
1544
  [name: string]: unknown;
@@ -1541,6 +1552,13 @@ export interface paths {
1541
1552
  };
1542
1553
  content?: never;
1543
1554
  };
1555
+ /** @description Concurrent creation for this wallet is in progress — retry later */
1556
+ 409: {
1557
+ headers: {
1558
+ [name: string]: unknown;
1559
+ };
1560
+ content?: never;
1561
+ };
1544
1562
  };
1545
1563
  };
1546
1564
  delete?: never;
@@ -2418,95 +2436,6 @@ export interface paths {
2418
2436
  patch?: never;
2419
2437
  trace?: never;
2420
2438
  };
2421
- "/admin/orders/{wallet_id}/deposit/card": {
2422
- parameters: {
2423
- query?: never;
2424
- header?: never;
2425
- path?: never;
2426
- cookie?: never;
2427
- };
2428
- get?: never;
2429
- put?: never;
2430
- /** Card */
2431
- post: {
2432
- parameters: {
2433
- query?: never;
2434
- header?: never;
2435
- path: {
2436
- /** @description Target wallet UUID */
2437
- wallet_id: string;
2438
- };
2439
- cookie?: never;
2440
- };
2441
- requestBody: {
2442
- content: {
2443
- "application/json": {
2444
- amount: number;
2445
- /** Format: uuid */
2446
- sub_account_id: string;
2447
- };
2448
- };
2449
- };
2450
- responses: {
2451
- /** @description Card return order created */
2452
- 200: {
2453
- headers: {
2454
- [name: string]: unknown;
2455
- };
2456
- content: {
2457
- "application/json": {
2458
- /** @example true */
2459
- success?: boolean;
2460
- data?: components["schemas"]["TenantOrder"];
2461
- /** @example Card return order created */
2462
- message?: string;
2463
- };
2464
- };
2465
- };
2466
- /** @description Missing required fields or invalid amount */
2467
- 400: {
2468
- headers: {
2469
- [name: string]: unknown;
2470
- };
2471
- content: {
2472
- "application/json": components["schemas"]["ErrorResponse"];
2473
- };
2474
- };
2475
- /** @description Authentication required */
2476
- 401: {
2477
- headers: {
2478
- [name: string]: unknown;
2479
- };
2480
- content: {
2481
- "application/json": components["schemas"]["ErrorResponse"];
2482
- };
2483
- };
2484
- /** @description Forbidden — admin role required or wallet not in tenant */
2485
- 403: {
2486
- headers: {
2487
- [name: string]: unknown;
2488
- };
2489
- content: {
2490
- "application/json": components["schemas"]["ErrorResponse"];
2491
- };
2492
- };
2493
- /** @description Card return failed */
2494
- 500: {
2495
- headers: {
2496
- [name: string]: unknown;
2497
- };
2498
- content: {
2499
- "application/json": components["schemas"]["ErrorResponse"];
2500
- };
2501
- };
2502
- };
2503
- };
2504
- delete?: never;
2505
- options?: never;
2506
- head?: never;
2507
- patch?: never;
2508
- trace?: never;
2509
- };
2510
2439
  "/admin/orders/{wallet_id}/exchange": {
2511
2440
  parameters: {
2512
2441
  query?: never;
@@ -2518,14 +2447,15 @@ export interface paths {
2518
2447
  put?: never;
2519
2448
  /**
2520
2449
  * Exchange
2521
- * @description Crypto-to-crypto exchange within a wallet.
2450
+ * @description Currency exchange within a wallet — a pure ledger swap for any enabled
2451
+ * currency pair (crypto and fiat alike). Pair availability is governed by
2452
+ * the exchange calculation config: a disabled pair is rejected at create.
2522
2453
  *
2523
2454
  * 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.
2527
- *
2528
- * Fiat legs are not supported — only crypto-to-crypto pairs are accepted.
2455
+ * `NEW` without touching the balance. Call `POST /admin/orders/{order_id}/approve`
2456
+ * to check the balance, debit the source funds and execute the swap (the
2457
+ * order lands in `COMPLETE` synchronously), or
2458
+ * `POST /admin/orders/{order_id}/cancel` to discard the order.
2529
2459
  *
2530
2460
  */
2531
2461
  post: {
@@ -2544,7 +2474,7 @@ export interface paths {
2544
2474
  };
2545
2475
  };
2546
2476
  responses: {
2547
- /** @description Exchange order created (status NEW, funds blocked — approve to execute) */
2477
+ /** @description Exchange order created (status NEW — approve to debit and execute) */
2548
2478
  200: {
2549
2479
  headers: {
2550
2480
  [name: string]: unknown;
@@ -2613,10 +2543,11 @@ export interface paths {
2613
2543
  /**
2614
2544
  * Internal
2615
2545
  * @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.
2546
+ * the order is created in `NEW` status without touching the balance;
2547
+ * `POST /admin/orders/{id}/approve` checks the balance, debits the
2548
+ * sender and executes the transfer synchronously receiver credited,
2549
+ * order `COMPLETE`. A `NEW` order can simply be canceled (no funds are
2550
+ * held).
2620
2551
  *
2621
2552
  */
2622
2553
  post: {
@@ -2640,13 +2571,17 @@ export interface paths {
2640
2571
  */
2641
2572
  counterparty_destination_id: string;
2642
2573
  amount: number;
2643
- request_id: string;
2574
+ /**
2575
+ * Format: date-time
2576
+ * @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.
2577
+ */
2578
+ scheduled_at?: string;
2644
2579
  documents?: Record<string, never>[];
2645
2580
  };
2646
2581
  };
2647
2582
  };
2648
2583
  responses: {
2649
- /** @description Transfer created in NEW status (funds blocked, awaiting approve) */
2584
+ /** @description Transfer created in NEW status (awaiting approve; no funds held) */
2650
2585
  200: {
2651
2586
  headers: {
2652
2587
  [name: string]: unknown;
@@ -2706,11 +2641,12 @@ export interface paths {
2706
2641
  /**
2707
2642
  * Crypto
2708
2643
  * @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.
2644
+ * destination. Two-phase: created `NEW` without touching the balance;
2645
+ * `POST /admin/orders/{id}/approve` checks the balance, debits the funds
2646
+ * and dispatches the on-chain send. A destination address internal to
2647
+ * the tenant downgrades the order to `OMNIBUS_INTERNAL_TRANSFER`
2648
+ * still `NEW` at create, debited + settled synchronously to `COMPLETE`
2649
+ * at approve.
2714
2650
  *
2715
2651
  */
2716
2652
  post: {
@@ -3221,104 +3157,6 @@ export interface paths {
3221
3157
  patch?: never;
3222
3158
  trace?: never;
3223
3159
  };
3224
- "/admin/orders/{wallet_id}/withdrawal/card": {
3225
- parameters: {
3226
- query?: never;
3227
- header?: never;
3228
- path?: never;
3229
- cookie?: never;
3230
- };
3231
- get?: never;
3232
- put?: never;
3233
- /** Card */
3234
- post: {
3235
- parameters: {
3236
- query?: never;
3237
- header?: never;
3238
- path: {
3239
- /** @description Source wallet UUID */
3240
- wallet_id: string;
3241
- };
3242
- cookie?: never;
3243
- };
3244
- requestBody: {
3245
- content: {
3246
- "application/json": {
3247
- amount: number;
3248
- /**
3249
- * Format: uuid
3250
- * @description Source currency UUID
3251
- */
3252
- from_uuid: string;
3253
- /** Format: uuid */
3254
- sub_account_id: string;
3255
- /** Format: uuid */
3256
- card_id?: string;
3257
- reference_id?: string;
3258
- note?: string;
3259
- };
3260
- };
3261
- };
3262
- responses: {
3263
- /** @description Card topup order created */
3264
- 200: {
3265
- headers: {
3266
- [name: string]: unknown;
3267
- };
3268
- content: {
3269
- "application/json": {
3270
- /** @example true */
3271
- success?: boolean;
3272
- data?: components["schemas"]["TenantOrder"];
3273
- /** @example Card topup order created */
3274
- message?: string;
3275
- };
3276
- };
3277
- };
3278
- /** @description Missing required fields or invalid amount */
3279
- 400: {
3280
- headers: {
3281
- [name: string]: unknown;
3282
- };
3283
- content: {
3284
- "application/json": components["schemas"]["ErrorResponse"];
3285
- };
3286
- };
3287
- /** @description Authentication required */
3288
- 401: {
3289
- headers: {
3290
- [name: string]: unknown;
3291
- };
3292
- content: {
3293
- "application/json": components["schemas"]["ErrorResponse"];
3294
- };
3295
- };
3296
- /** @description Forbidden — admin role required or wallet not in tenant */
3297
- 403: {
3298
- headers: {
3299
- [name: string]: unknown;
3300
- };
3301
- content: {
3302
- "application/json": components["schemas"]["ErrorResponse"];
3303
- };
3304
- };
3305
- /** @description Card topup failed */
3306
- 500: {
3307
- headers: {
3308
- [name: string]: unknown;
3309
- };
3310
- content: {
3311
- "application/json": components["schemas"]["ErrorResponse"];
3312
- };
3313
- };
3314
- };
3315
- };
3316
- delete?: never;
3317
- options?: never;
3318
- head?: never;
3319
- patch?: never;
3320
- trace?: never;
3321
- };
3322
3160
  "/admin/orders/individual_rates": {
3323
3161
  parameters: {
3324
3162
  query?: never;
@@ -3556,10 +3394,14 @@ export interface paths {
3556
3394
  put?: never;
3557
3395
  /**
3558
3396
  * Approve order
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.
3562
- * Only orders with status NEW can be approved.
3397
+ * @description Transitions the order from NEW to PROCESSING: checks the balance,
3398
+ * debits the funds (transaction written as `complete`) and triggers the
3399
+ * order execution pipeline. Exchange orders (EXCHANGE_OMNI) and internal
3400
+ * transfers (TRANSFER_INTERNAL / OMNIBUS_INTERNAL_TRANSFER) settle
3401
+ * synchronously and land in COMPLETE. An insufficient balance fails the
3402
+ * order (FAILED). Only orders with status NEW can be approved. Orders
3403
+ * created with `scheduled_at` move to EXPECTED instead — no funds are
3404
+ * debited until execution at the requested time.
3563
3405
  *
3564
3406
  */
3565
3407
  post: {
@@ -3622,8 +3464,13 @@ export interface paths {
3622
3464
  put?: never;
3623
3465
  /**
3624
3466
  * Cancel order
3625
- * @description Cancels an order. Orders in NEW or FAILED status can be canceled.
3626
- * Optionally provide a cancellation reason.
3467
+ * @description Cancels an order. Only NEW and EXPECTED orders can be canceled — neither
3468
+ * holds debited funds, so cancel never moves money. Optionally provide a
3469
+ * cancellation reason.
3470
+ *
3471
+ * BREAKING CHANGE (2026-07-26): FAILED is no longer cancelable and returns
3472
+ * 409. Paying back an order that was debited and then failed is now a
3473
+ * separate, admin-panel-only refund action.
3627
3474
  *
3628
3475
  */
3629
3476
  post: {
@@ -5134,6 +4981,10 @@ export interface paths {
5134
4981
  * @description Creates a new wallet owned by the user bound to the tenant API key.
5135
4982
  * Wallet name is auto-generated if not provided.
5136
4983
  *
4984
+ * The wallet is always created without a KYC entity — create one via
4985
+ * `POST /admin/kyc_entity` or start verification via
4986
+ * `POST /admin/kyc_verification/{wallet_id}/init` afterwards.
4987
+ *
5137
4988
  */
5138
4989
  post: {
5139
4990
  parameters: {
@@ -7922,6 +7773,12 @@ export interface components {
7922
7773
  /** Format: uuid */
7923
7774
  currency_id?: string;
7924
7775
  memo?: string | null;
7776
+ /**
7777
+ * @description Hosting classification of the address. Defaults to unknown.
7778
+ * @default unknown
7779
+ * @enum {string}
7780
+ */
7781
+ wallet_custody_type: "custodial" | "selfhosted" | "unknown";
7925
7782
  currency: components["schemas"]["CurrencyRef"];
7926
7783
  /** Format: date-time */
7927
7784
  created_at: string;
@@ -8105,7 +7962,7 @@ export interface components {
8105
7962
  * @example EXCHANGE_OMNI
8106
7963
  * @enum {string}
8107
7964
  */
8108
- OrderTypeId: "EXCHANGE_OMNI" | "EXCHANGE_OMNI_ONRAMP" | "EXCHANGE_OMNI_OFFRAMP" | "EXCHANGE_OMNI_CRYPTO" | "EXCHANGE_CRYPTO_INTERNAL" | "L2F_ACH_ONRAMP" | "L2F_ACH_OFFRAMP" | "L2F_SEPA_ONRAMP" | "L2F_SEPA_OFFRAMP" | "L2F_SWIFT_ONRAMP" | "L2F_SWIFT_OFFRAMP" | "L2F_WIRE_ONRAMP" | "L2F_WIRE_OFFRAMP" | "L2F_CHAPS_ONRAMP" | "L2F_CHAPS_OFFRAMP" | "L2F_FPS_ONRAMP" | "L2F_FPS_OFFRAMP" | "BRL_WIRE_ONRAMP" | "BRL_WIRE_OFFRAMP" | "BRL_ACH_ONRAMP" | "BRL_ACH_OFFRAMP" | "BRL_RTP_OFFRAMP" | "DLS_WIRE_ONRAMP" | "DLS_WIRE_OFFRAMP" | "DLS_ACH_ONRAMP" | "DLS_ACH_OFFRAMP" | "DLS_SEPA_ONRAMP" | "DLS_SEPA_OFFRAMP" | "DLS_SWIFT_ONRAMP" | "DLS_SWIFT_OFFRAMP" | "OMNIBUS_CRYPTO_TRANSFER" | "OMNIBUS_CRYPTO_WITHDRAWAL" | "OMNIBUS_INTERNAL_TRANSFER" | "SEGREGATED_CRYPTO_TRANSFER" | "TRANSFER_INTERNAL" | "TRANSFER_CARD_PREPAID" | "TRANSFER_CARD_SUBACCOUNT" | "TRANSFER_CARD_WHOLESALE" | "WITHDRAW_CARD_PREPAID" | "WITHDRAW_CARD_SUBACCOUNT" | "REFUND_CARD_PREPAID" | "REFUND_CARD_SUBACCOUNT" | "RN_CARDS_OFFRAMP" | "CARD_ISSUING_FEE";
7965
+ OrderTypeId: "EXCHANGE_OMNI" | "EXCHANGE_OMNI_ONRAMP" | "EXCHANGE_OMNI_OFFRAMP" | "EXCHANGE_OMNI_CRYPTO" | "EXCHANGE_CRYPTO_INTERNAL" | "L2F_ACH_ONRAMP" | "L2F_ACH_OFFRAMP" | "L2F_SEPA_ONRAMP" | "L2F_SEPA_OFFRAMP" | "L2F_SWIFT_ONRAMP" | "L2F_SWIFT_OFFRAMP" | "L2F_WIRE_ONRAMP" | "L2F_WIRE_OFFRAMP" | "L2F_CHAPS_ONRAMP" | "L2F_CHAPS_OFFRAMP" | "L2F_FPS_ONRAMP" | "L2F_FPS_OFFRAMP" | "BRL_WIRE_ONRAMP" | "BRL_WIRE_OFFRAMP" | "BRL_ACH_ONRAMP" | "BRL_ACH_OFFRAMP" | "BRL_RTP_OFFRAMP" | "DLS_WIRE_ONRAMP" | "DLS_WIRE_OFFRAMP" | "DLS_ACH_ONRAMP" | "DLS_ACH_OFFRAMP" | "DLS_SEPA_ONRAMP" | "DLS_SEPA_OFFRAMP" | "DLS_SWIFT_ONRAMP" | "DLS_SWIFT_OFFRAMP" | "BC1_SEPA_ONRAMP" | "BC1_SEPA_OFFRAMP" | "BC1_SWIFT_ONRAMP" | "BC1_SWIFT_OFFRAMP" | "BC3_SEPA_ONRAMP" | "BC3_SEPA_OFFRAMP" | "OMNIBUS_CRYPTO_TRANSFER" | "OMNIBUS_CRYPTO_WITHDRAWAL" | "OMNIBUS_INTERNAL_TRANSFER" | "SEGREGATED_CRYPTO_TRANSFER" | "TRANSFER_INTERNAL" | "TRANSFER_CARD_PREPAID" | "TRANSFER_CARD_SUBACCOUNT" | "TRANSFER_CARD_WHOLESALE" | "WITHDRAW_CARD_PREPAID" | "WITHDRAW_CARD_SUBACCOUNT" | "REFUND_CARD_PREPAID" | "REFUND_CARD_SUBACCOUNT" | "RN_CARDS_OFFRAMP" | "CARD_ISSUING_FEE";
8109
7966
  OrderType: {
8110
7967
  id?: components["schemas"]["OrderTypeId"];
8111
7968
  description?: string;
@@ -8157,12 +8014,15 @@ export interface components {
8157
8014
  from_currency_id: string;
8158
8015
  /** Format: uuid */
8159
8016
  counterparty_destination_id: string;
8160
- /** @description Idempotency key (UUID v4 recommended) */
8161
- request_id: string;
8162
8017
  /** @description Free-form reference visible in order/transaction listings */
8163
8018
  reference?: string;
8164
8019
  /** @description Internal note attached to the order */
8165
8020
  note?: string;
8021
+ /**
8022
+ * Format: date-time
8023
+ * @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.
8024
+ */
8025
+ scheduled_at?: string;
8166
8026
  };
8167
8027
  OfframpOrderRequest: {
8168
8028
  amount: number;
@@ -8177,12 +8037,15 @@ export interface components {
8177
8037
  * @description Bank counterparty destination UUID created via POST /api/counterparty/destinations. The destination type must match the rail (WIRE/ACH/SEPA/SWIFT/CHAPS/FPS).
8178
8038
  */
8179
8039
  counterparty_destination_id: string;
8180
- /** @description Idempotency key (UUID v4 recommended) */
8181
- request_id: string;
8182
8040
  /** @description Free-form reference visible in order/transaction listings */
8183
8041
  reference?: string;
8184
8042
  /** @description Internal note attached to the order */
8185
8043
  note?: string;
8044
+ /**
8045
+ * Format: date-time
8046
+ * @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.
8047
+ */
8048
+ scheduled_at?: string;
8186
8049
  };
8187
8050
  ExchangeOrderRequest: {
8188
8051
  /** @description Amount to exchange (in source currency) */
@@ -8197,11 +8060,6 @@ export interface components {
8197
8060
  * @description Destination currency UUID
8198
8061
  */
8199
8062
  to_currency_id: string;
8200
- /**
8201
- * Format: uuid
8202
- * @description Idempotency key (UUID v4 recommended)
8203
- */
8204
- request_id: string;
8205
8063
  };
8206
8064
  TenantOrder: {
8207
8065
  /** Format: uuid */
@@ -8220,12 +8078,17 @@ export interface components {
8220
8078
  amount_to?: number | null;
8221
8079
  order_type?: string;
8222
8080
  /** @enum {string} */
8223
- status?: "NEW" | "PROCESSING" | "COMPLETE" | "FAILED" | "CANCELED";
8081
+ status?: "NEW" | "EXPECTED" | "PROCESSING" | "COMPLETE" | "FAILED" | "CANCELED" | "REFUNDED";
8224
8082
  /** Format: uuid */
8225
8083
  sub_account_id?: string | null;
8226
8084
  info?: string | null;
8227
8085
  /** @description Filtered to META_ALLOWED_FIELDS */
8228
8086
  meta?: Record<string, never> | null;
8087
+ /**
8088
+ * Format: date-time
8089
+ * @description Requested execution time for scheduled payments (status EXPECTED); null for immediate orders
8090
+ */
8091
+ scheduled_at?: string | null;
8229
8092
  /** Format: date-time */
8230
8093
  created_at?: string;
8231
8094
  /** Format: date-time */
@@ -8244,9 +8107,9 @@ export interface components {
8244
8107
  account_currency?: string;
8245
8108
  /** Format: uuid */
8246
8109
  destination_currency?: string;
8247
- /** @description Whether deposits are enabled for this account, resolved from the account's KYC rail (virtual_accounts_programs.kyc_rails.is_deposit_enabled). When false, public (Frontend/Developer) responses suppress deposit_instructions/account_details; admin responses still expose them. */
8110
+ /** @description Whether deposits are enabled for this account, resolved from the account's KYC rail (virtual_accounts_programs.kyc_rails.is_deposit_enabled). When false, deposit_instructions is returned as an empty array on every surface (admin included) since admin routes are also consumed by BaaS API clients. */
8248
8111
  is_deposit_enabled?: boolean;
8249
- /** @description Bank deposit instructions grouped by instruction type (ACH, FEDWIRE, SWIFT) */
8112
+ /** @description Bank deposit instructions grouped by instruction type (ACH, FEDWIRE, SWIFT). Returned as an empty array when is_deposit_enabled is false. */
8250
8113
  deposit_instructions?: {
8251
8114
  /**
8252
8115
  * @description Payment rail type