@paysafe/paysafe-wallet-saas-web
    Preparing search index...

    Class WithdrawalService

    Service class for managing withdrawals related operations.

    Hierarchy

    • ApiService
      • WithdrawalService
    Index

    Methods

    • Requests a withdrawal status update.

      Parameters

      Returns Promise<Withdrawal>

      A promise that resolves to the updated withdrawal.

      If the HTTP request fails.

      // Example usage:
      withdrawalService.confirm(withdrawalId)
      .then((response) => {
      console.log(response);
      })
      .catch((error) => {
      console.error(`Error processing withdrawal.`);
      });
    • Requests a withdrawal creation.

      Parameters

      Returns Promise<Withdrawal>

      A promise that resolves to the updated withdrawal.

      If the HTTP request fails.

      // Example usage:
      withdrawalService.create(withdrawalCreate)
      .then((response) => {
      console.log(response);
      })
      .catch((error) => {
      console.error(`Error creating withdrawal.`);
      });
    • Retrieves a withdrawal by id.

      Parameters

      • id: string

        The id of the withdrawal.

      Returns Promise<Withdrawal>

      A promise that resolves to a withdrawal.

      If the HTTP request fails.

      // Example usage:
      withdrawalService.get(withdrawalId)
      .then((response) => {
      console.log(response);
      })
      .catch((error) => {
      console.error(`Error fetching withdrawal.`);
      });
    • Retrieves user withdrawals with pagination metadata.

      Parameters

      Returns Promise<WithdrawalList>

      A promise that resolves to a withdrawal list.

      If the HTTP request fails.

      // Example usage:
      withdrawalService.getAll({ limit: 5 })
      .then((response) => {
      console.log(response);
      })
      .catch((error) => {
      console.error(`Error fetching withdrawals.`);
      });
    • Retrieves all withdrawal options.

      Returns Promise<WithdrawalOption[]>

      A promise that resolve to a list of withdrawal options.

      If the HTTP request fails.

      // Example usage:
      withdrawalService.getOptions()
      .then((response) => {
      console.log(response);
      })
      .catch((error) => {
      console.error(`Error fetching withdrawal options.`);
      });
    • Creates a withdrawal preview.

      Parameters

      • withdrawalRequest: WithdrawalRequest

        The request payload for creating a withdrawal preview.

      • OptionalinstrumentType: InstrumentType

        The instrument type for localization when no instrument reference is provided.

      Returns Promise<Withdrawal>

      A promise that resolves to the newly created withdrawal preview.

      If the HTTP request fails.

      // Example usage:
      withdrawalService.preview(withdrawalRequest)
      .then((response) => {
      console.log(response);
      })
      .catch((error) => {
      console.error(`Error creating withdrawal.`);
      });
    • Function

      Retrieves the singleton instance of the WithdrawalService class.

      Returns WithdrawalService

      The singleton instance of the WithdrawalService class.

      // Usage:
      const withdrawalService = WithdrawalService.getInstance();