Skip to content

Verification

AsyncVerification

Bases: BaseAsyncAPI

Provides a wrapper for paystack Verification API

The Verification API allows you to perform KYC processes. https://paystack.com/docs/api/verification/

Note

This feature is only available to businesses in Nigeria.

Source code in src/pypaystack2/api/verification.py
class AsyncVerification(BaseAsyncAPI):
    """Provides a wrapper for paystack Verification API

    The Verification API allows you to perform KYC processes.
    https://paystack.com/docs/api/verification/

    Note:
        This feature is only available to businesses in Nigeria.
    """

    async def resolve_account_number(
        self,
        account_number: str,
        bank_code: str,
    ) -> Response:
        """Confirm an account belongs to the right customer

        Note:
            Feature Availability
                This feature is only available to businesses in Nigeria.

        Args:
            account_number: Account Number
            bank_code: You can get the list of bank codes by calling the
                Miscellaneous API wrapper ``.get_banks`` method.

        Returns:
            A named tuple containing the response gotten from paystack's server.
        """
        url = self._parse_url(
            f"/bank/resolve?account_number={account_number}&bank_code={bank_code}"
        )
        return await self._handle_request(HTTPMethod.GET, url)

    async def validate_account(
        self,
        account_name: str,
        account_number: str,
        account_type: AccountType,
        bank_code: str,
        country_code: Country,
        document_type: Document,
        document_number: Optional[str] = None,
    ) -> Response:
        """Confirm the authenticity of a customer's account number before sending money

        Args:
            account_name: Customer's first and last name registered with their bank
            account_number: Customer's account number
            account_type: bank_code: The bank code of the customer’s bank. You can fetch the bank codes by
                using Miscellaneous API wrapper ``.get_banks`` method.
            bank_code: The bank code of the customer’s bank
            country_code: Any value from the ``Country`` enum
            document_type: Customer’s mode of identity. any value from the
                ``DocumentType`` enum.
            document_number: Customer’s mode of identity number

        Returns:
            A named tuple containing the response gotten from paystack's server.
        """

        payload = {
            "account_name": account_name,
            "account_number": account_number,
            "account_type": account_type,
            "bank_code": bank_code,
            "country_code": country_code,
            "document_type": document_type,
        }
        url = self._parse_url("/bank/validate")

        return await self._handle_request(HTTPMethod.POST, url, payload)

    async def resolve_card_bin(self, bin: str) -> Response:
        """Get more information about a customer's card

        Args:
            bin: First 6 characters of card


        Returns:
            A named tuple containing the response gotten from paystack's server.
        """

        url = self._parse_url(f"/decision/bin/{bin}")
        return await self._handle_request(HTTPMethod.GET, url)

resolve_account_number(account_number, bank_code) async

Confirm an account belongs to the right customer

Note

Feature Availability This feature is only available to businesses in Nigeria.

Parameters:

Name Type Description Default
account_number str

Account Number

required
bank_code str

You can get the list of bank codes by calling the Miscellaneous API wrapper .get_banks method.

required

Returns:

Type Description
Response

A named tuple containing the response gotten from paystack's server.

Source code in src/pypaystack2/api/verification.py
async def resolve_account_number(
    self,
    account_number: str,
    bank_code: str,
) -> Response:
    """Confirm an account belongs to the right customer

    Note:
        Feature Availability
            This feature is only available to businesses in Nigeria.

    Args:
        account_number: Account Number
        bank_code: You can get the list of bank codes by calling the
            Miscellaneous API wrapper ``.get_banks`` method.

    Returns:
        A named tuple containing the response gotten from paystack's server.
    """
    url = self._parse_url(
        f"/bank/resolve?account_number={account_number}&bank_code={bank_code}"
    )
    return await self._handle_request(HTTPMethod.GET, url)

resolve_card_bin(bin) async

Get more information about a customer's card

Parameters:

Name Type Description Default
bin str

First 6 characters of card

required

Returns:

Type Description
Response

A named tuple containing the response gotten from paystack's server.

Source code in src/pypaystack2/api/verification.py
async def resolve_card_bin(self, bin: str) -> Response:
    """Get more information about a customer's card

    Args:
        bin: First 6 characters of card


    Returns:
        A named tuple containing the response gotten from paystack's server.
    """

    url = self._parse_url(f"/decision/bin/{bin}")
    return await self._handle_request(HTTPMethod.GET, url)

validate_account(account_name, account_number, account_type, bank_code, country_code, document_type, document_number=None) async

Confirm the authenticity of a customer's account number before sending money

Parameters:

Name Type Description Default
account_name str

Customer's first and last name registered with their bank

required
account_number str

Customer's account number

required
account_type AccountType

bank_code: The bank code of the customer’s bank. You can fetch the bank codes by using Miscellaneous API wrapper .get_banks method.

required
bank_code str

The bank code of the customer’s bank

required
country_code Country

Any value from the Country enum

required
document_type Document

Customer’s mode of identity. any value from the DocumentType enum.

required
document_number Optional[str]

Customer’s mode of identity number

None

Returns:

Type Description
Response

A named tuple containing the response gotten from paystack's server.

Source code in src/pypaystack2/api/verification.py
async def validate_account(
    self,
    account_name: str,
    account_number: str,
    account_type: AccountType,
    bank_code: str,
    country_code: Country,
    document_type: Document,
    document_number: Optional[str] = None,
) -> Response:
    """Confirm the authenticity of a customer's account number before sending money

    Args:
        account_name: Customer's first and last name registered with their bank
        account_number: Customer's account number
        account_type: bank_code: The bank code of the customer’s bank. You can fetch the bank codes by
            using Miscellaneous API wrapper ``.get_banks`` method.
        bank_code: The bank code of the customer’s bank
        country_code: Any value from the ``Country`` enum
        document_type: Customer’s mode of identity. any value from the
            ``DocumentType`` enum.
        document_number: Customer’s mode of identity number

    Returns:
        A named tuple containing the response gotten from paystack's server.
    """

    payload = {
        "account_name": account_name,
        "account_number": account_number,
        "account_type": account_type,
        "bank_code": bank_code,
        "country_code": country_code,
        "document_type": document_type,
    }
    url = self._parse_url("/bank/validate")

    return await self._handle_request(HTTPMethod.POST, url, payload)

Verification

Bases: BaseAPI

Provides a wrapper for paystack Verification API

The Verification API allows you to perform KYC processes. https://paystack.com/docs/api/verification/

Note

This feature is only available to businesses in Nigeria.

Source code in src/pypaystack2/api/verification.py
class Verification(BaseAPI):
    """Provides a wrapper for paystack Verification API

    The Verification API allows you to perform KYC processes.
    https://paystack.com/docs/api/verification/

    Note:
        This feature is only available to businesses in Nigeria.
    """

    def resolve_account_number(
        self,
        account_number: str,
        bank_code: str,
    ) -> Response:
        """Confirm an account belongs to the right customer

        Note:
            Feature Availability
                This feature is only available to businesses in Nigeria.

        Args:
            account_number: Account Number
            bank_code: You can get the list of bank codes by calling the
                Miscellaneous API wrapper ``.get_banks`` method.

        Returns:
            A named tuple containing the response gotten from paystack's server.
        """
        url = self._parse_url(
            f"/bank/resolve?account_number={account_number}&bank_code={bank_code}"
        )
        return self._handle_request(HTTPMethod.GET, url)

    def validate_account(
        self,
        account_name: str,
        account_number: str,
        account_type: AccountType,
        bank_code: str,
        country_code: Country,
        document_type: Document,
        document_number: Optional[str] = None,
    ) -> Response:
        """Confirm the authenticity of a customer's account number before sending money

        Args:
            account_name: Customer's first and last name registered with their bank
            account_number: Customer's account number
            account_type: bank_code: The bank code of the customer’s bank. You can fetch the bank codes by
                using Miscellaneous API wrapper ``.get_banks`` method.
            bank_code: The bank code of the customer’s bank
            country_code: Any value from the ``Country`` enum
            document_type: Customer’s mode of identity. any value from the
                ``DocumentType`` enum.
            document_number: Customer’s mode of identity number

        Returns:
            A named tuple containing the response gotten from paystack's server.
        """

        payload = {
            "account_name": account_name,
            "account_number": account_number,
            "account_type": account_type,
            "bank_code": bank_code,
            "country_code": country_code,
            "document_type": document_type,
            "document_number": document_number,
        }
        url = self._parse_url("/bank/validate")

        return self._handle_request(HTTPMethod.POST, url, payload)

    def resolve_card_bin(self, bin: str) -> Response:
        """Get more information about a customer's card

        Args:
            bin: First 6 characters of card


        Returns:
            A named tuple containing the response gotten from paystack's server.
        """

        url = self._parse_url(f"/decision/bin/{bin}")
        return self._handle_request(HTTPMethod.GET, url)

resolve_account_number(account_number, bank_code)

Confirm an account belongs to the right customer

Note

Feature Availability This feature is only available to businesses in Nigeria.

Parameters:

Name Type Description Default
account_number str

Account Number

required
bank_code str

You can get the list of bank codes by calling the Miscellaneous API wrapper .get_banks method.

required

Returns:

Type Description
Response

A named tuple containing the response gotten from paystack's server.

Source code in src/pypaystack2/api/verification.py
def resolve_account_number(
    self,
    account_number: str,
    bank_code: str,
) -> Response:
    """Confirm an account belongs to the right customer

    Note:
        Feature Availability
            This feature is only available to businesses in Nigeria.

    Args:
        account_number: Account Number
        bank_code: You can get the list of bank codes by calling the
            Miscellaneous API wrapper ``.get_banks`` method.

    Returns:
        A named tuple containing the response gotten from paystack's server.
    """
    url = self._parse_url(
        f"/bank/resolve?account_number={account_number}&bank_code={bank_code}"
    )
    return self._handle_request(HTTPMethod.GET, url)

resolve_card_bin(bin)

Get more information about a customer's card

Parameters:

Name Type Description Default
bin str

First 6 characters of card

required

Returns:

Type Description
Response

A named tuple containing the response gotten from paystack's server.

Source code in src/pypaystack2/api/verification.py
def resolve_card_bin(self, bin: str) -> Response:
    """Get more information about a customer's card

    Args:
        bin: First 6 characters of card


    Returns:
        A named tuple containing the response gotten from paystack's server.
    """

    url = self._parse_url(f"/decision/bin/{bin}")
    return self._handle_request(HTTPMethod.GET, url)

validate_account(account_name, account_number, account_type, bank_code, country_code, document_type, document_number=None)

Confirm the authenticity of a customer's account number before sending money

Parameters:

Name Type Description Default
account_name str

Customer's first and last name registered with their bank

required
account_number str

Customer's account number

required
account_type AccountType

bank_code: The bank code of the customer’s bank. You can fetch the bank codes by using Miscellaneous API wrapper .get_banks method.

required
bank_code str

The bank code of the customer’s bank

required
country_code Country

Any value from the Country enum

required
document_type Document

Customer’s mode of identity. any value from the DocumentType enum.

required
document_number Optional[str]

Customer’s mode of identity number

None

Returns:

Type Description
Response

A named tuple containing the response gotten from paystack's server.

Source code in src/pypaystack2/api/verification.py
def validate_account(
    self,
    account_name: str,
    account_number: str,
    account_type: AccountType,
    bank_code: str,
    country_code: Country,
    document_type: Document,
    document_number: Optional[str] = None,
) -> Response:
    """Confirm the authenticity of a customer's account number before sending money

    Args:
        account_name: Customer's first and last name registered with their bank
        account_number: Customer's account number
        account_type: bank_code: The bank code of the customer’s bank. You can fetch the bank codes by
            using Miscellaneous API wrapper ``.get_banks`` method.
        bank_code: The bank code of the customer’s bank
        country_code: Any value from the ``Country`` enum
        document_type: Customer’s mode of identity. any value from the
            ``DocumentType`` enum.
        document_number: Customer’s mode of identity number

    Returns:
        A named tuple containing the response gotten from paystack's server.
    """

    payload = {
        "account_name": account_name,
        "account_number": account_number,
        "account_type": account_type,
        "bank_code": bank_code,
        "country_code": country_code,
        "document_type": document_type,
        "document_number": document_number,
    }
    url = self._parse_url("/bank/validate")

    return self._handle_request(HTTPMethod.POST, url, payload)