NYYU Logo
APIWithdraw

Confirm PayPal Withdrawal Request

Admin approval or denial of PayPal withdrawal requests with 2FA

Confirm PayPal Withdrawal Request

Approve or deny PayPal withdrawal requests with 2FA verification

ADMIN Only

Overview

The confirmPaypalWithdraw mutation allows administrators to approve or deny PayPal withdrawal requests. This operation requires 2FA SMS verification for security.

Admin-Only Operation

This mutation is accessible only to users with ADMIN privileges and requires a valid 2FA SMS code.

GraphQL Schema

💳
Mutation Schema
Approve or deny PayPal withdrawal
confirmPaypalWithdraw(
  id: Int!,
  status: Int!,
  deniedReason: String,
  code: String!
): Int

Parameters

📋
Parameters
idInt! Required

The unique ID of the PayPal withdrawal request to confirm

statusInt! Required

Action to take on the withdrawal request

1: Approve withdrawal

2: Deny withdrawal

deniedReasonString Optional

Reason for denial (required if status is 2)

Examples: "PayPal email not verified", "Suspicious activity detected", "Account limitations"

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 (1 for approved, 2 for denied).

Example Mutations

Approve PayPal Withdrawal
mutation {
  confirmPaypalWithdraw(
    id: 123,
    status: 1,
    code: "654321"
  )
}
Response
{
  "data": {
    "confirmPaypalWithdraw": 1
  }
}
Deny PayPal Withdrawal with Reason
mutation {
  confirmPaypalWithdraw(
    id: 124,
    status: 2,
    deniedReason: "PayPal account email does not match user verification records",
    code: "654321"
  )
}
Response
{
  "data": {
    "confirmPaypalWithdraw": 2
  }
}

Implementation Example

async function reviewPayPalWithdrawal(
  requestId: number,
  approve: boolean,
  denialReason?: string
) {
  try {
    // Step 1: 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 2: Get 2FA code from admin
    const twoFactorCode = await promptAdminFor2FACode();

    // Step 3: Confirm withdrawal
    const result = await client.request(gql`
      mutation ConfirmPayPal(
        $id: Int!,
        $status: Int!,
        $deniedReason: String,
        $code: String!
      ) {
        confirmPaypalWithdraw(
          id: $id,
          status: $status,
          deniedReason: $deniedReason,
          code: $code
        )
      }
    `, {
      id: requestId,
      status: approve ? 1 : 2,
      deniedReason: approve ? null : denialReason,
      code: twoFactorCode
    });

    if (approve) {
      console.log('✅ PayPal withdrawal approved');
      // Trigger PayPal payout
      await processPayPalPayout(requestId);
    } else {
      console.log('❌ PayPal withdrawal denied');
    }

    return result.confirmPaypalWithdraw;

  } catch (error) {
    console.error('PayPal withdrawal confirmation failed:', error);
    throw error;
  }
}

Best Practices

Verify PayPal Email

Confirm PayPal email matches user's verified contact information

Check PayPal Account Status

Verify the PayPal account is active and can receive payments

Review User Verification

Ensure user has completed required KYC/verification for withdrawal amount

Fast Processing

PayPal withdrawals can be processed quickly - aim for same-day approval when possible

💳
Fast & Secure Processing
PayPal withdrawals offer faster processing than bank transfers while maintaining security through 2FA approval