---
updatedAt: 2026-11-06T21:42:25.000Z
agentTools:
  projectIndex: https://developer-docs.paga.com/llms.txt
---

# Python Library

Paga-connect Python Library is a Python module that helps you make API calls when processing Paga Transactions.

## 1. Installation

Steps to using the Paga-Connect Library. Install pip on your local environment. Then run the command below.

```python
pip install pagaconnect
```

## 2. Usage

To use Paga-connect, you would need to import it

See the sample  code below

```python Sample Code
from paga_connect_client.paga_connect_client_core import PagaConnectCore
import json

principal = "publicId"
credential = "password"
test = True

pagaConnect = PagaConnectCore(principal, credential, True)
```

## 4. Paga Connect Functions

## Authorisation Code

To obtain your authorisation code, click [here](https://developer-docs.paga.com/docs/getting-started-2#obtaining-the-authorization-code)

## Get Access Token

To get Access tokens, Use the authorization code from the HTML call  :

```python Sample Code
data = pagaconnect.get_access_token(authorization_code, redirect_uri, scope, user_data)

token_data = json.loads(data)
access_token = token_data['access_token']
```

## Make Payment

This is the operation executed to make a payment to you on behalf of the customer. To make use of this function, call the getAccessToken in pagaconnect which will return a response with the access token which will be used to complete payment.

To get Access tokens, Use the authorization code gotten from the call to the backend :

```python Sample Code
payment_data = pagaconnect.make_payment(access_token, reference_number, amount, user_id, product_code, currency)
```

## Money Transfer

This operation allows Merchant to credit a user's Paga account. To make use of this function, call the **moneyTransfer** in pagaconnect which will return a MoneyTransferResponse.

```python Sample Response
money_transfer = pagaconnect.
                    money_transfer(access_token,reference_number,
                    amount,skip_messaging,recipient_credential)
```

## User Details

This Operation allows the client to get the user's personal details. The data requested is included in the authentication and authorization request in the data parameter. Additionally, the scope parameter must contain the USER\_DETAILS\_REQUEST option. To make use of this function, call the getUserDetails in paagconnect which will return a UserDetailResponse with user details.

```python Sample Code
user_detail = pagaconnect.get_user_details(access_token)
```