NYYU Logo
APIWithdraw

Approve Fiat Withdrawal Request

Admin approval of bank withdrawal after manual fund transfer

Approve Fiat Withdrawal Request

Confirm manual bank transfer completion with 2FA verification

ADMIN Only

Overview

The approveBankWithdrawRequest mutation allows administrators to approve bank withdrawal requests after manually transferring funds. Since bank transfers cannot be automated, admins must physically send the funds and then call this mutation to update the request status.

Manual Transfer Required

The admin must manually transfer funds to the specified bank account before calling this mutation to mark the request as approved.

GraphQL Schema

🏦
Mutation Schema
Approve bank withdrawal after manual transfer
approveBankWithdrawRequest(
  id: Int!,
  code: String!
): Int

Parameters

📋
Required Parameters
idInt! Required

The unique ID of the bank withdrawal request to approve

codeString! Required

Admin 2FA verification code received via SMS from sendWithdrawConfirmCode

Return Value

📊
Integer Response
Updated status value
Return Type: Int

Returns an integer indicating the updated status of the withdrawal request (typically 1 for approved).

Example Mutation

Approve Bank Withdrawal After Transfer
mutation {
  approveBankWithdrawRequest(
    id: 123,
    code: "654321"
  )
}
Example Response
{
  "data": {
    "approveBankWithdrawRequest": 1
  }
}

Implementation Example

async function approveBankWithdrawal(requestId: number) {
  try {
    // Step 1: Verify funds have been manually transferred
    const confirmed = await confirmManualTransferComplete(requestId);

    if (!confirmed) {
      throw new Error('Funds must be transferred before approval');
    }

    // Step 2: Request 2FA code
    const codeRequest = await client.request(gql`
      mutation {
        sendWithdrawConfirmCode
      }
    `);

    if (!codeRequest.sendWithdrawConfirmCode) {
      throw new Error('Failed to send 2FA code');
    }

    console.log('✅ 2FA code sent to admin phone');

    // Step 3: Get 2FA code from admin
    const twoFactorCode = await promptAdminFor2FACode();

    // Step 4: Approve the withdrawal
    const result = await client.request(gql`
      mutation ApproveBank($id: Int!, $code: String!) {
        approveBankWithdrawRequest(
          id: $id,
          code: $code
        )
      }
    `, {
      id: requestId,
      code: twoFactorCode
    });

    console.log('✅ Bank withdrawal approved in system');

    // Step 5: Notify user
    await notifyUserOfApproval(requestId);

    return result.approveBankWithdrawRequest;

  } catch (error) {
    console.error('Bank withdrawal approval failed:', error);
    throw error;
  }
}

Admin Workflow

Complete Bank Withdrawal Process
1
Review Withdrawal Request
Verify all banking details, account holder name, and user verification status
2
Initiate Bank Transfer
Manually transfer funds via bank wire, SWIFT, or domestic transfer to user's account
3
Confirm Transfer Completion
Verify bank transfer was successful and funds were sent
4
Request 2FA Code
Call sendWithdrawConfirmCode to receive SMS verification
5
Approve in System
Call approveBankWithdrawRequest with 2FA code to update status
6
Record Transfer Details
Document transaction reference number and transfer date for records

Security Features

🔒Security Measures
📱
2FA SMS Required

All approvals require valid 2FA SMS verification code

👨‍💼
Admin-Only Access

Only users with ADMIN role can approve bank withdrawals

Transfer Verification

Admin must confirm funds were actually transferred before approval

📊
Audit Trail

All approvals logged with timestamp, admin identity, and transfer details

Best Practices

Verify Transfer Before Approval

Always confirm funds were successfully sent before calling this mutation

Document Transfer Reference

Record bank transaction reference number for dispute resolution

Double-Check Banking Details

Verify account number, routing codes, and account holder name match request

Notify User of Approval

Send notification to user confirming transfer completion with expected arrival time

⏱️
Account for Processing Time

Inform users that bank transfers may take 3-7 business days to appear in their account

🏦
Manual Transfer Required
Always confirm the bank transfer was completed successfully before approving the withdrawal request in the system