Withdrawals API

Withdrawals

The Withdrawals service (client.withdrawals) allows you to withdraw USDC funds either to a SUI wallet or to a connected bank account. The service supports both direct cryptocurrency transfers and fiat off-ramping through banking partners.

Create a Withdrawal

Create a new withdrawal request:

import { WithdrawDestinationType } from '@suipay/api';

// Withdraw to SUI wallet
const walletWithdrawal = await client.withdrawals.create({
  amount_usdc: 50,
  destination_type: WithdrawDestinationType.WALLET,
  wallet_address: '0x1234567890abcdef1234567890abcdef12345678'
});

console.log(`Withdrawal created: ${walletWithdrawal.id}`);
console.log(`Status: ${walletWithdrawal.status}`);

Method Signature

client.withdrawals.create(request: CreateWithdrawalRequest): Promise<Withdrawal>

Request Parameters

Field
Type
Required
Description

amount_usdc

number

Yes

The amount in USDC to withdraw

destination_type

WithdrawDestinationType

Yes

Where to send the funds (WALLET or BANK_ACCOUNT)

wallet_address

string

Conditional

Required when destination_type is WALLET. Must be a valid SUI address

bank_account_id

string

Conditional

Required when destination_type is BANK_ACCOUNT. Must be a valid bank account ID

Response Type

List Withdrawals

Retrieve all withdrawals for your account:

Method Signature

Response Type

Get Withdrawal

Retrieve detailed information about a specific withdrawal:

Method Signature

Response Type

Withdrawal Fields

Field
Type
Description

id

string

Unique withdrawal identifier

user_id

string

Associated user identifier

amount_usdc

number

Withdrawal amount in USDC

destination_type

WithdrawDestinationType

Where funds are sent (WALLET or BANK_ACCOUNT)

bank_account_id

string?

Bank account ID (for BANK_ACCOUNT destinations)

wallet_address

string?

SUI wallet address (for WALLET destinations)

status

WithdrawStatus

Current withdrawal status

error_message

string?

Error description if withdrawal failed

transaction_hash

string?

SUI transaction hash (for wallet withdrawals)

bridge_transfer_id

string?

Bridge service transfer ID (for bank withdrawals)

created_at

string

Withdrawal creation timestamp

updated_at

string

Last update timestamp

completed_at

string?

Completion timestamp

Withdrawal Status

Status Enum

Status Monitoring

Monitor withdrawal status changes:

State Transitions

  • Normal: PENDINGPROCESSINGCOMPLETED

  • Failure: PENDINGPROCESSINGFAILED

Destination Types

WALLET

Withdraw USDC directly to a SUI wallet address:

Requirements:

  • Valid SUI address starting with "0x"

  • Address format is validated

Processing:

  • Direct USDC transfer on SUI blockchain

  • Generally faster than bank withdrawals

  • Transaction hash available after completion

BANK_ACCOUNT

Withdraw USD to your connected bank account:

Requirements:

  • KYC verification completed

  • Bank account connected via Bridge service

  • Valid bank account ID

Processing:

  • USD conversion and ACH transfer via Bridge service

  • Takes 1-3 business days for settlement

  • Bridge transfer ID tracked for status

Error Handling

Handle common withdrawal errors:

Complete Example

Here's a comprehensive withdrawal example:

Important Notes

  • Minimum withdrawal: 0.01 USDC

  • Balance check: Verify sufficient balance before creating withdrawals

  • Status monitoring: Use webhooks or polling to track progress

  • Bank settlements: Bank account withdrawals take 1-3 business days

  • Transaction hashes: Available for wallet withdrawals for blockchain verification

  • Error handling: Always handle validation and authentication errors

Last updated