Patasente Api

Patasente API documentation

Welcome to Patasente’s API documentation. The Patasente API is REST based. All responses shall be returned using JSON .

You access Patasente’s API at the following endpoint

https://demo.patasente.com/phantom-api/

Getting started

Authentication

All requests must use https. Patasente API uses Token Based Authentication, and requires an API key for authentication called bearer . Your API key is generated when registering or logging into your account. You must supply your API key with all API requests using the “Authorization” header as shown in the examples. You should include your API key with all requests

          accessToken = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImE2ZTkxZDk4NDQxOGJlMDFlYTRjNWJ
            jMDVhMjdjOTlmNzhkYWIxYQ4YTg4ZmRjYmU5NGU4YjJhYzQ1YjlmM2U0NGE0YWE5MDk5In0.ey
            JhdWQiOiIyIiwianRpIjoiYTZlOTFkOTg0NDE4YmUwMWVhNGM1YmMwNWEyN2M5OWY3OGRh';

            The code below is in JavaScript , workout in your own programming language
              but following the rule of access token 

            getUserDetails() {
                    let accessToken = 'the token from login response';

                    axios.get(
                    'https://demo.patasente.com/phantom-api/get-company-details' ,
                        { headers: {
                                Authorization : 'Bearer ' + accessToken  ,
                                'Accept' : 'application/json',
                                'Content-Type' : 'application/json'
                            }
                        }
                    )
                    .then((response) => {
                            console.log(response.data);
                        },
                        (error) => {
                            let status = error.response.status
                            console.log(status)
                        }
                    );
                },

          
        

Register

This section will take you through the steps for registering an account on Patasente API.

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/register

A user can register for an account using either an email or a phone number The parameters that should be sent to this endpoint by a user registering using phone number are "registered_with" , "business_phone" , "account_type" , "name" , "password" , "account_currency" , like

https://demo.patasente.com/phantom-api/register?registered_with=phone&
        business_phone=25678000000&account_type=4&
        account_currency=1password=myPassword&name=Patasente
.

If the phone number already exists a response with error code 404 will be sent back for example

 { "error":"Account with that phone number already exists !" }.

A 4 digit confirmation code that will be used to verify the account will be sent to the phone number used during registration.

1234 

The parameters that should be sent to this endpoint by a user registering using email are "registered_with" , "email" , "account_type" , "name" , "password" , "account_currency" , like

https://demo.patasente.com/phantom-api/register?registered_with=email
        &email=dev@developer.dev&account_type=4&account_currency=1
        password=myPassword&name=Patasente.

If the phone number already exists a response with error code 404 will be sent back for example "Account with that email already exists !".

A confirmation code that will be used to verify the account will be sent to the email used during registration.

https://demo.patasente.com/register/verify?email=32943r8uj4vndurfviueiwrw 

If a user registration is successful a response with success code 200 will be sent and an access token which will be attached to the header while requesting other resources. json response with a bearer token

 { "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImE2ZTkxZ
        Dk4NDQxOGJlMDFlYTRjNWJjMDVhMjdjOTlmNzhkYWIxYzI2NGQ4YTg4ZmRj
        YmU5NGU4YjA0MWJhYzQ1YjlmM2U0NGE0YWE5MDk5In0.eyJhdWQiOiI
        yIiwianRpIjoiYTZlOTFkOTg0NDE4YmUwMWVhNGM1YmMwNWEyN2M" }
          s
        

Below are the fields required by the API

Field Type Required Description
registered_with string Yes if user registers using email the value should be email else phone
business_phone number Yes (if registered_with phone) This should be a Ugandan phone number in international format without (+) e.g 256780000001
email email Yes (if registered_with email) This should be a valid email e.g dev@developer.dev
account_type number Yes This should be a number which is the "id" of the different account types
account_currency number Yes This should be a number which is the "id" of the different currencies supported on the platform
name text Yes This should the name of the business
password text Yes This should be password for the account

Get Currencies

This section will take you through the steps for fetching a list of all supported currencies on Patasente API .

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-currencies

NO parameter should be sent to this endpoint , a json response with a list of currencies

[ { "id": 1, "currency_symbol": "UGX", "currency_format": "/=" }, { "id": 2, "currency_symbol": "USD", "currency_format": "$" } ]

Get Account Types

This section will take you through the steps for fetching a list of all supported account types on Patasente API .

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-account-types

NO parameter should be sent to this endpoint , a json response with a list of account types

[ { "id": 3, "name": "Individual Account" }, { "id": 4, "name": "Business Account" }, ]

Get Patasente Terms & Conditions Types

This section will take you through the steps for fetching a list of patasente terms and conditions types on Patasente API .

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-patasente-limited-terms-and-conditions-types

NO parameter should be sent to this endpoint, a json response with a list of patasente terms and conditions types

[ { "id": 1, "type": "Patasente terms and conditions" }, { "id": 2, "type": "Card holder agreement" }, { "id": 3, "type": "Borrower terms and conditions" } ]

Show Patasente Terms & Conditions by types

This section will take you through the steps for showing a patasente terms and conditions by types on Patasente API .

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/view-terms-and-conditions/

The parameter that should be sent to this endpoint is "type}

https://demo.patasente.com/phantom-api/view-terms-and-conditions/Borrower terms and conditions

Below are the fields required by the API

Field Type Required Description
type string Yes This is the type from Get Patasente Terms & Conditions Types

Login

This section will take you through the steps for logging into an account on Patasente API .

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/login

The parameter that should be sent to this endpoint are "username" and "password", A user can login with a merchant code , email or phone number like

https://demo.patasente.com/phantom-api/login?username=dev@developer.dev&password=myPassword

https://demo.patasente.com/phantom-api/login?username=M3454302&password=myPassword

https://demo.patasente.com/phantom-api/login?username=2567800000001&password=myPassword

If the account doesn't exists a response with error code 404 will be sent back. for example

{ "error": "Account with hward@gmail.com doesn't exist !!" }

If a user login is successful a response with success code 200 will be sent and an access token which will be attached to the header while requesting other resources json response with a bearer token

{ "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjFlZjkzMDY4 NmM3YTg2OGRmMjQ1MTM5MjgzM2FjNTJhZDA3YzhmNWIwOGM3OD. U5NjkzNzEyMTk1In0.wZGIwMDk5NTFkNDY5N jRiMGJlYjUzZGE2YzdhODY4ZGYyNDUxMzkyODMzY TM3MTIxOTUiLCJpYXQiOjE1NjI2MjYwNzEsIm5iZiI6MTU2MjNDcxLCJzdWIiOi I3Iiwic2NvcGVzIjpbXX0.RZFG" }

Below are the fields required by the API

Field Type Required Description
username text Yes The username can be email or merchant code or phone number. This should be a Ugandan phone number in international format without (+) e.g 256780000001
password text Yes This should be the password in plain text

Send Forget Password Token

This section will take you through the steps for sending a forget Password token for an account on Patasente API .

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/send-forget-password-token

The parameter that should be sent to this endpoint is "email_or_phone" like

https://demo.patasente.com/phantom-api/send-forget-password-token?email_or_phone=ssekalegga@gmail.com

If the email or phone number doesn't match in the system, a response with error code 404 will be sent back. for example

{ "error": "Account with email or phone number doesn\'t exist!" }

If the email or phone number matches in the system, a response with success code 200 will be sent

{ "success": "A reset token code has been sent to ss****@***.com" }

Below are the fields required by the API

Field Type Required Description
email_or_phone string Yes This is the username of the account whose password your trying to reset.it's either and email or phone number. The phone number should be in international format with a country code but not + (plus) sign e.g 256780000000

Reset Password

This section will take you through the steps for resetting a Password for an account on Patasente API .

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/reset-password

The parameters that should be sent to this endpoint are "email_or_phone" , "token" , "new_password" like

https://demo.patasente.com/phantom-api/reset-password?token=123456789&email_or_phone=ssekalegga@gmail.com&new_password=keepkeep

If the email or phone number doesn't match in the system, a response with error code 404 will be sent back. for example

{ "error": "Your Password Reset token is invalid" }

If the email or phone number matches in the system, a response with success code 200 will be sent

{ "success": "Your Password has been reset" }

Below are the fields required by the API

Field Type Required Description
email_or_phone string Yes This is the username of the account whose password your trying to reset.it's either and email or phone number. The phone number should be in international format with a country code but not + (plus) sign e.g 256780000000
new_password string Yes This is the new password and it should be atleast 6 characters
token number Yes This is the token that was sent to an account holder's phone or email , it should be be 9 digits

Phone Code Verification

This section will take you through the steps for verifying an account using the phone code sent to a user's phone number on Patasente API .

A PUT request should be made to this API endpoint

https://demo.patasente.com/phantom-api/phone-code-verification

The parameter that should be sent to this endpoint is "code" like

https://demo.patasente.com/phantom-api/phone-code-verification?code=3035

If the verification code doesn't match the code in the system, a response with error code 404 will be sent back. for example

{ "error": "Your verification code doesn't match" }

If the verification code matches in the system, a response with success code 200 will be sent

{ "success": "Your verification code has Matched" }

Below are the fields required by the API

Field Type Required Description
code number Yes This is a 4 digit number that has been sent to user's phone number

Resend Phone Verification Code

This section will take you through the steps for resending a verification code to a user's phone number on Patasente API .

A PUT request should be made to this API endpoint

https://demo.patasente.com/phantom-api/resend-phone-verification-code

NO parameter should be sent to this endpoint , a response with success code 200 will be sent

{ "success": "A four digit code has been sent to this phone number +25678000002"}

Resend Email Confirmation Code

This section will take you through the steps for resending an email confirmation code to email on Patasente API .

A PUT request should be made to this API endpoint

https://demo.patasente.com/phantom-api/resend-confirmation-code

NO parameter should be sent to this endpoint , a response with success code 200 will be sent

{ "success": "An email with a confirmation code has been sent to dev@developer.dev"}

Get Security Questions

This section will take you through the steps for fetching a list of all supported security questions on Patasente API .

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-security-questions

NO parameter should be sent to this endpoint , a json response with alist of security questions

[ { "id": 1, "description": "What was your childhood nickname?" }, { "id": 2, "description": "What is the name of your favorite childhood friend?" }, { "id": 3, "description": "In what city or town did your mother and father meet?" } ]

Check Security Questions

This section will take you through the steps for checking if a user has set up security questions for the account on Patasente API .

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/check-security-questions

NO parameter should be sent to this endpoint , a response with success code 200 will be sent

{ "success": true }

If security questions are not , a response with success code 404 will be sent

{ "error": false }

Add Security Questions

This section will take you through the steps for adding security questions to an account on Patasente API .

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/add-security-questions

The parameter that should be sent to this endpoint are "question_1" , "question_2" ,"answer_1" and "answer_2", like

https://demo.patasente.com/phantom-api/add-security-questions?question_1=5&answer_1=Arsenal&question_2=10&answer_2=Max

If the request was successful, a response with success code 200 will be sent

{ "success": "Your account is now secure" }

Below are the fields required by the API

Field Type Required Description
question_1 number Yes This is the first id of the security question chosen by the user
answer_1 text Yes This is the answer to the first id of the security question chosen by the user
question_2 number Yes This is the second id of the security question chosen by the user
answer_2 text Yes This is the answer to the second id of the security question chosen by the user

Get User Device Token

This section will take you through the steps for fetching user device token on Patasente API .

A PUT request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-user-device-token

The parameter that should be sent to this endpoint are "token" ,"name" , "os_version" ,"model" like

https://demo.patasente.com/phantom-api/get-user-device-token?token=3qw45e6r7ttgggu7675687688568&name=samsung&os_version=10.0.1&model=android

If the request was successful, a response with success code 200 will be sent

{ "success": "Device Token Updated" }

Below are the fields required by the API

Field Type Required Description
token string Yes This is the user device token
model string Yes This is the user device model
os_version string Yes This is the user device OS version
name string Yes This is the user device name

Delete User Device Token

This section will take you through the steps for deleting user device token on Patasente API .

A PUT request should be made to this API endpoint

https://demo.patasente.com/phantom-api/delete-user-device-token

The parameter that should be sent to this endpoint are "token" ,

https://demo.patasente.com/phantom-api/delete-user-device-token?token=3qw45e6r7ttgggu7675687688568

If the request was successful, a response with success code 200 will be sent

{ "success": "Device Token deleted" }

Below are the fields required by the API

Field Type Required Description
token string Yes This is the user device token

Company

Get Company Details

This section will take you through the steps for fetching company details of an account on Patasente API .

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-company-details

NO parameter should be sent to this endpoint , a json response with details

If an account is of account_type Business Account or account 4 these are the details that will be returned

{ "id": 6, "user_id": 6, "business_name": "Senior Developer", "business_email": "dev@develope", "business_website": "patasente.com", "business_description": "Building software", "address": "Najjanankumbi", "business_billing_address": null, "business_shipping_address": null, "nature_of_business": "ICT", "duration_of_business": null, "business_monthly_turnover": null, "PoB": null, "tin": null, "registration_date": "2016", "business_partner_names": null, "business_partner_phone": null, "business_phone": "+25678000000", "wallet_balance": 4011217, "currency": "UGX", "currency_id": 1, "local_currency": true, "merchant_code": "M20723163", "region": "Kampala", "country": "UG", "account": 3, "account_type": "Individual Account", "user_type": "Business", "status": "active", "verified": "verified", "email_phone_verification": "verified", "ip": "127.0.0.1", "pin": "set", "has_products": 0, "has_services": 0, "updated_at": "2020-03-23 12:48:12", "created_at": "2018-08-07 01:48:59", "reseller_account": true, "agent_account": "active", "prepaid_account": "active", "notifiable_email": "dev@developer.com", "notifiable_phone": null, "notifiable_channel": "email", "registered_with": "email", "registered_using": "Web", "timezone": "Africa/Kampala" }

If an account is of account_type Individual Account or account 3 these are the details that will be returned

{ "id": 2, "user_id": 2, "business_name": "Kakooza Sadati", "personal_name": "Kakooza S", "business_email": "ssekalegga@gmail.com", "business_website": null, "business_description": "Million Kilometers", "address": "Masaka, Uganda", "PoB": null, "business_phone": "NA", "wallet_balance": 1400102, "currency": "UGX", "currency_id": 1, "local_currency": true, "merchant_code": "M000002", "region": null, "country": null, "account": 3, "account_type": "Individual Account", "user_type": "Business", "status": "active", "verified": "verified", "email_phone_verification": "verified", "ip": "127.0.0.1", "pin": "set", "has_products": 0, "has_services": 0, "updated_at": "2020-05-29 06:43:29", "created_at": { "date": "2020-04-04 14:40:18" }, "reseller_account": true, "agent_account": "active", "prepaid_account": "active", "notifiable_email": "ssekalegga@gmail.com", "notifiable_phone": "+256783159235", "notifiable_channel": "email", "registered_with": "email", "registered_using": "Web", "timezone": "America/Toronto" }

This section will take you through the steps for fetching company logo of an account on Patasente API .

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-company-logo

NO parameter should be sent to this endpoint , a json response with company logo. The image is in base64 format.

{ "id": 2, "logo": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAqQAAAJaCAIAAAB2vMKXAAAA AXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwdwjr+9vzrVrzIzt2X+SlhO9eIa HwCeYtgDwOUMewC4WmsdAuLQMiKK2zcAAAAASUVORK5CYII=AAAqQAAAJaCAIAAAB2 vMKXAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwdw" }

Update Company Profile

This section will take you through the steps for updating company information on Patasente API .

A PUT request should be made to this API endpoint

https://demo.patasente.com/phantom-api/update-company-information/

Parameters that should be sent to this endpoint include "company id" and other fields that should be updated. The company id identifies the resource that should be updated

https://demo.patasente.com/phantom-api/update-company-information/2?business_name=Postman&PoB=Pobox 232 Kampala&address=kiwatule&nature_of_business=ict&business_phone=2567800000&business_monthly_turnover=20 millions&duration_of_business=5&business_partner_names=Yiga Ivan , Bakka George&business_partner_phone=2567000000000 , 256790000000&business_description=Tech&business_email=dev@developer.com&business_type=non government&business_website=www.patasente.com&location_coordinates=27.2038° N, 77.5011° E&tin=534®istration_date=2019-07-10

If the request was successful, a response with success code 200 will be sent

{ "success": "Senior Developer information has been updated" }

If the request wasn't successful, a response with success code 404 will be sent

{ "error": "Company not found" }

Below are the fields required by the API

Field Type Required Description
company_id number Yes This is the id of the company that ahould be updated
business_name text No This is the name of the business
PoB string No This is the P.O.Box address / number
address text No This is the address of the business
nature_of_business string No This is the nature of business
business_phone number No This is the phone number business and it is in international format without (+) sign like 256780000
business_monthly_turnover text No This is monthly turnover of a business
business_partner_names text No These are the names of the partners of a business separated by a comma like Tim Kaka , Star Stone
business_partner_phone text No These are the phone numbers of the partners of a business separated by a comma like 2567820000 , +2567870000
business_description text No This is a description of a business
business_email email No This is the offical email of the company
business_type boolean Yes This is the type of the business and its either "government" or "non government"
business_website link No This is the website link of the business
location_coordinates text No These are the location longitude and latitude of the business captured using google maps api like 27.2038° N, 77.5011° E
tin text No This is the trading identification number of the business
registration_date date No This is the official registration date of the business by the government like 2008-05-02

This section will take you through the steps for updating company logo on Patasente API .

A PUT request should be made to this API endpoint

https://demo.patasente.com/phantom-api/update-logo

Parameters that should be sent to this endpoint include "company id" and "image". The company id identifies the resource that should be updated

https://demo.patasente.com/phantom-api/update-logo/2?image=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAqQAAAJaCAIAAAB2vMKXAAAA AXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwdwjr+9vzrVrzIzt2X+SlhO9eIa HwCeYtgDwOUMewC4WmsdAuLQMiKK2zcAAAAASUVORK5CYII=AAAqQAAAJaCAIAAAB2 vMKXAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwdw

If the request was successful, a response with success code 200 will be sent

{ "success": "Logo has updated" }

If the request wasn't successful, a response with success code 404 will be sent

{ "error": "Company not found" }

Below are the fields required by the API

Field Type Required Description
company_id number Yes This is the id of the company that ahould be updated
image longText Yes A base64 version of the picture/image/logo should be uploaded.

Update Account Password

This section will take you through the steps for updating an account password on Patasente API .

A POST request should be made to this API endpoint to send a PIN update OTP Code

https://demo.patasente.com/phantom-api/send-update-password-otp-code

NO parameters should be sent to this endpoint.

If the request was successful, a response with success code 200 will be sent

{ "success": "Enter the 4-digit code sent to your phone." }

If the request wasn't successful, a response with success code 404 will be sent

{ "error": "No PIN update OTP code sent." }

A PUT request should be made to this API endpoint

https://demo.patasente.com/phantom-api/update-password

The parameter that should be sent to this endpoint "new_password", "code" and "current_password".

https://demo.patasente.com/phantom-api/update-password?current_password=oldPassword&new_password=myNewPassword232&code=0232.

If the request was successful, a response with success code 200 will be sent

{ "success": "Password updated" }

If the request wasn't successful, a response with success code 404 will be sent

{ "error": "Your new password is similar to your current Password" }

Below are the fields required by the API

Field Type Required Description
new_password text Yes This is the new account password which should have a minimum of 6 alpha numeric characters like "myNewPassword232"
current_password text Yes This is your current password for the account
code number Yes This is the 4 digit OTP code sent to user's phone

Update Account PIN

This section will take you through the steps for updating an account PIN on Patasente API .

A POST request should be made to this API endpoint to send a PIN update OTP Code

https://demo.patasente.com/phantom-api/send-update-pin-otp-code

NO parameters should be sent to this endpoint.

If the request was successful, a response with success code 200 will be sent

{ "success": "Enter the 4-digit code sent to your phone." }

If the request wasn't successful, a response with success code 404 will be sent

{ "error": "No PIN update OTP code sent." }

A PUT request should be made to this API endpoint

https://demo.patasente.com/phantom-api/update-pin

The parameters that should be sent to this endpoint are "new_pin" ,"code" and "current_password".

https://demo.patasente.com/phantom-api/update-pin?current_password=myPassword&new_pin=1234&code=1035

If the request was successful, a response with success code 200 will be sent

{ "success": "PIN updated" }

If the request wasn't successful, a response with success code 404 will be sent

{ "error": "Your Current Password doesn't match our records" }

Below are the fields required by the API

Field Type Required Description
new_pin number Yes This is the new 4 digit PIN for the account
current_password text Yes This is your current password for the account
code number Yes This is the 4 digit OTP code sent to user's phone

Delete Account

This section will take you through the steps for deleting an account PIN on Patasente API .

A POST request should be made to this API endpoint to send an account delete OTP Code

https://demo.patasente.com/phantom-api/send-account-deletion-code

NO parameters should be sent to this endpoint.

If the request was successful, a response with success code 200 will be sent

{ "success": "Enter the 4-digit code sent to your phone." }

If the request wasn't successful, a response with success code 404 will be sent

{ "error": "No account deletion OTP code sent." }

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/delete-account

The parameters that should be sent to this endpoint are "reason" and ,"code".

https://demo.patasente.com/phantom-api/delete-account?reason=Njikoye&code=1035

If the request was successful, a response with success code 200 will be sent

LOGOUT THE USER FROM THE APP

{ "success": "Your account is now under deletion process, You can recover your account by logging in with 30 days from today" }

If the request wasn't successful, a response with success code 404 will be sent

{ "error": "Account deletion failed" }

Below are the fields required by the API

Field Type Required Description
reason text No This is a reason why account is being deleted but its optional
code number Yes This is the 4 digit OTP code sent to user's phone

Terms and conditions

This is the section where a Business sets all its terms and conditions for Financial Instruments e.g invoices , purchase orders etc.

Get Terms & Conditions

This section will take you through the steps for fetching the terms and conditions of an account on Patasente API .

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-terms-and-conditions

NO parameter should be sent to this endpoint , a json response with the terms and conditions

[ { "id": 2, "type": "invoice", "message": "kyakabi" }, { "id": 5, "type": "receipt", "message": "Thank you." }, { "id": 6, "type": "purchase order", "message": "rogers.com" } ]

Get Single Terms & Conditions

This section will take you through the steps for fetching a single terms and conditions for a given type of financial instrument on Patasente API .

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-terms-and-conditions-for/

The parameter that should be sent to this endpoint is the "type" of financial instrument you want to fetch like invoice , purchase order , a json response with the terms and conditions will be returned

https://demo.patasente.com/phantom-api/get-terms-and-conditions-for/receipt

If the request was successful, a response with success code 200 will be sent

{ "message": "Thank you." }

Below are the fields required by the API

Field Type Required Description
type text Yes This is the type of terms and conditions that should be fetched like invoice , purchase order , receipt , quotation , delivery note ,proforma

Set Terms & Conditions

This section will take you through the steps for setting up terms and conditions for a given type of financial instrument on Patasente API .

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/set-terms-and-conditions

The parameter that should be sent to this endpoint is the "type" of financial instrument like invoice , purchase order etc and "message".

https://demo.patasente.com/phantom-api/set-terms-and-conditions?type=invoice&message=Thank you

If the request was successful, a response with success code 200 will be sent

{ "success": "Terms and Conditions for invoices have been set" }

If the terms and conditions already exist, a response with error code 400 will be sent

{ "error": "Terms and Conditions for invoices already exist " }

Below are the fields required by the API

Field Type Required Description
type text Yes This is the type of terms and conditions that should be fetched like invoice , purchase order , receipt , quotation , delivery note ,proforma
message text Yes This is the description for the terms and conditions

Update Terms & Conditions

This section will take you through the steps for updating terms and conditions for a given type of financial instrument on Patasente API .

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/update-terms-and-conditions/

The parameter that should be sent to this endpoint is the "id" of the terms and condition and other parameters like "message".

https://demo.patasente.com/phantom-api/update-terms-and-conditions/2?message=Thank you

If the request was successful, a response with success code 200 will be sent

{ "success": "Terms and Conditions for invoices have been updated" }

If there is an error in the request , a response with error code 400 will be sent

Below are the fields required by the API

Field Type Required Description
id number Yes This is id of the terms and conditions
message text Yes This is the description for the terms and conditions

Delete Terms & Conditions

This section will take you through the steps for deleting terms and conditions for a given type of financial instrument on Patasente API .

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/delete-terms-and-conditions/

The parameter that should be sent to this endpoint is the "id" of the terms and condition .

https://demo.patasente.com/phantom-api/delete-terms-and-conditions/2

If the request was successful, a response with success code 200 will be sent

{ "success": "Terms and Conditions for invoices have been deleted" }

If there is an error in the request , a response with error code 400 will be sent

Below are the fields required by the API

Field Type Required Description
id number Yes This is id of the terms and conditions to be deleted

Get Financial Instrument Types

This section will take you through the steps for fetching all types of financial instrument on Patasente API .

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-financial-instrument-types/

NO parameters should be sent to this endpoint.

If the request was successful, a response with success code 200 will be sent

[ "invoice", "purchase order", "receipt", "quotation", "proforma", "delivery note" ]

Payment Settings

This is the section where a Business sets all its payment settings for the account.

List Bank Accounts

This section will take you through the steps for fetching a list of bank accounts for a company on Patasente API .

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-bank-accounts/company?id=

The parameter that should be sent to this endpoint is the "id" of the company , a json response with the list of bank accounts

https://demo.patasente.com/phantom-api/get-bank-accounts/company?id=2

[ { "id": 1, "company_id": 2, "user_id": 2, "registered_name": "Senior Developer", "bank_name": "Patasente Bank", "bank_branch": "Kiwatule", "bank_acc_number": "80000000050", "bank_signatories": null, "payment_method": "bank", "verified": "verified", "deleted": 0, "created_at": { "date": "2018-11-06 01:03:14.000000", "timezone_type": 3, "timezone": "UTC" }, "updated_at": { "date": "2018-11-06 01:03:14.000000", "timezone_type": 3, "timezone": "UTC" } } ]

Get single Bank Account

This section will take you through the steps for fetching a bank accounts for a company on Patasente API .

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-bank-account/bank/

The parameter that should be sent to this endpoint is the "id" of the company , a json response with the bank accounts

https://demo.patasente.com/phantom-api/get-bank-account/bank/1

{ "id": 1, "company_id": 2, "user_id": 2, "registered_name": "Senior Developer", "bank_name": "Patasente Bank", "bank_branch": "Kiwatule", "bank_acc_number": "80000000050", "bank_signatories": null, "payment_method": "bank", "verified": "unverified", "deleted": 0, "created_at": { "date": "2018-11-06 01:03:14.000000", "timezone_type": 3, "timezone": "UTC" }, "updated_at": { "date": "2018-11-06 01:03:14.000000", "timezone_type": 3, "timezone": "UTC" } }

Below are the fields required by the API

Field Type Required Description
id number Yes This is id of the company

Add Bank Account

This section will take you through the steps for adding anew bank account for a company on Patasente API .

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/add-bank

The parameter that should be sent to this endpoint is the "registered_name" , "bank_name" , "bank_branch" , "bank_acc_number" and "bank_signatories".

https://demo.patasente.com/phantom-api/add-bank?registered_name=Senior Developer&bank_name=Patasente bank&bank_branch=Kiwatule&bank_acc_number=43400043&bank_signatories=Iham

If the request was successful, a response with success code 200 will be sent

{ "success": "New Bank Account Added" }

If there is an error, a response with error code 400 will be sent

{ "error": "Bank Account Not Added" }

Below are the fields required by the API

Field Type Required Description
bank_signatories text No These are the bank signatories if any
registered_name text Yes This is the bank account names
bank_name text Yes This the name of bank
bank_branch text Yes This the branch or transit number of bank
bank_acc_number number Yes This the account number of bank

Update Bank Account

This section will take you through the steps for updating a bank account for a company on Patasente API .

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/update-bank

The parameter that should be sent to this endpoint is the "id" for the bank account and other parameters like "registered_name" , "bank_name" , "bank_branch" , "bank_acc_number" and "bank_signatories".

https://demo.patasente.com/phantom-api/update-bank/2?registered_name=Senior Developer&bank_name=Patasente bank&bank_branch=Kiwatule&bank_acc_number=43400043&bank_signatories=Iham

If the request was successful, a response with success code 200 will be sent

{ "success": "Bank Account information Updated" }

If there is an error, a response with error code 400 will be sent

{ "error": "You can't perform this action" }

Below are the fields required by the API

Field Type Required Description
id number Yes This is the id of the bank account
bank_signatories text No These are the bank signatories if any
registered_name text Yes This is the bank account names
bank_name text Yes This the name of bank
bank_branch text Yes This the branch or transit number of bank
bank_acc_number number Yes This the account number of bank

Delete Bank Account

This section will take you through the steps for deleting a bank account of a company on Patasente API .

A PUT request should be made to this API endpoint

https://demo.patasente.com/phantom-api/delete-bank-account/

The parameter that should be sent to this endpoint is the "id" of the bank account.

https://demo.patasente.com/phantom-api/delete-bank-account/2

If the request was successful, a response with success code 200 will be sent

{ "success": "Bank Account has been deleted" }

If there is an error in the request , a response with error code 400 will be sent

Below are the fields required by the API

Field Type Required Description
id number Yes This is id of the bank account to be deleted

List Mobile Money Numbers

This section will take you through the steps for fetching a list of mobile money phone numbers for a company on Patasente API .

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-mobile-money/company?id=

The parameter that should be sent to this endpoint is the "id" of the company , a json response with the list of mobile money phone numbers

https://demo.patasente.com/phantom-api/get-mobile-money/company?id=2

[ { "id": 2, "company_id": 2, "user_id": 2, "first_name": "Senior", "last_name": "Developer", "mobile_money_company_id": 1, "mobile_money_company_name": "MTN", "mobile_money_company_country": "Uganda", "payment_method": "mobile", "mobile_money_phone": "256700000005", "deleted": 0, "created_at": { "date": "2018-11-22 23:03:03.000000", "timezone_type": 3, "timezone": "UTC" }, "updated_at": { "date": "2018-11-22 23:03:03.000000", "timezone_type": 3, "timezone": "UTC" } } ]

Get a single Mobile Money number

This section will take you through the steps for fetching asingle mobile money phone number for a company on Patasente API .

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-phone-number/mobile/

The parameter that should be sent to this endpoint is the "id" of the company , a json response with the mobile money phone number

https://demo.patasente.com/phantom-api/get-phone-number/mobile/2

{ "id": 2, "company_id": 2, "user_id": 2, "first_name": "Senior", "last_name": "Developer", "mobile_money_company_id": 1, "mobile_money_company_name": "MTN", "mobile_money_company_country": "Uganda", "payment_method": "mobile", "mobile_money_phone": "256700000005", "deleted": 0, "created_at": { "date": "2018-11-22 23:03:03.000000", "timezone_type": 3, "timezone": "UTC" }, "updated_at": { "date": "2018-11-22 23:03:03.000000", "timezone_type": 3, "timezone": "UTC" } }

Below are the fields required by the API

Field Type Required Description
id number Yes This is id of the company

list of phone networks

This section will take you through the steps for fetching supported phone networks on Patasente API .

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-phone-networks

No parameter should be sent to this endpoint

https://demo.patasente.com/phantom-api/get-phone-networks

If the request was successful, a response with success code 200 will be sent

[ { "id": 1, "network_name": "MTN", "country": "Uganda" }, { "id": 2, "network_name": "AIRTEL", "country": "Uganda" } ]

Add Mobile Money Phone Number

This section will take you through the steps for adding a new mobile money phone number for a company on Patasente API .

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/add-phone

The parameter that should be sent to this endpoint is the "registered_first_name" , "registered_last_name" , "mobile_money_company_id" , "phone_number" .

https://demo.patasente.com/phantom-api/add-phone?registered_first_name=Developer®istered_last_name=Senior&mobile_money_company_id=2&phone_number=25678000002

If the request was successful, a response with success code 200 will be sent

{ "success": "Phone Number Added" }

If there is an error, a response with error code 400 will be sent

{ "error": "Phone Number Not Added" }

Below are the fields required by the API

Field Type Required Description
registered_first_name text Yes This is the registered first name of the phone number
registered_last_name text Yes This is the registered last name of the phone number
mobile_money_company_id text Yes This is id of the mobile money company service provider from the List phone networks
phone_number number Yes This the registered mobile money phone number and it should be in international format without plus (+) sign

Update Mobile Money Phone Number

This section will take you through the steps for updating a mobile money phone number for a company on Patasente API .

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/update-phone

The parameter that should be sent to this endpoint is the "id" for the mobile money number and other parameters like "registered_first_name" , "registered_last_name" , "mobile_money_company_id" and "phone_number".

https://demo.patasente.com/phantom-api/update-phone/2?registered_first_name=Developer®istered_last_name=Senior&mobile_money_company_id=2&phone_number=25678000002

If the request was successful, a response with success code 200 will be sent

{ "success": "Phone Number Updated" }

If there is an error, a response with error code 400 will be sent

{ "error": "Phone Number not found" }

Below are the fields required by the API

Field Type Required Description
id number Yes This is the id of the mobile money phone number that should be edited
registered_first_name text Yes This is the registered first name of the phone number
registered_last_name text Yes This is the registered last name of the phone number
mobile_money_company_id text Yes This is id of the mobile money company service provider from the List phone networks
phone_number number Yes This the registered mobile money phone number and it should be in international format without plus (+) sign

Verify Payment Method

This section will take you through the steps for verifying a payment method for a company on Patasente API .

A PUT request should be made to this API endpoint

https://demo.patasente.com/phantom-api/payment/phone-code-verification

The parameter that should be sent to this endpoint is "code" and "id" like

https://demo.patasente.com/phantom-api/payment/phone-code-verification?code=3035&id=4

If the verification code doesn't match the code in the system, a response with error code 404 will be sent back. for example

{ "error": "Your verification code doesn't match" }

If the verification code matches in the system, a response with success code 200 will be sent

{ "success": "Your bank account has been verified" }

Below are the fields required by the API

Field Type Required Description
id number Yes This is the id of the payment method from list of Bank Accounts , Mobile Money numbers or Website collection Widgets
code number Yes This is a 4 digit number that has been sent to user's phone number or email

Resend Payment Method Verification Code

This section will take you through the steps for resending a payment method verification code for a company on Patasente API .

A PUT request should be made to this API endpoint

https://demo.patasente.com/phantom-api/payment/resend-phone-verification-code

The parameter that should be sent to this endpoint is "id" like

https://demo.patasente.com/phantom-api/payment/resend-phone-verification-code/4

If the verification code doesn't match the code in the system, a response with error code 404 will be sent back. for example

{ "error": "Payment method not found" }

If the verification code matches in the system, a response with success code 200 will be sent

{ "success": "A four (4) digit code has been sent" }

Below are the fields required by the API

Field Type Required Description
id number Yes This is the id of the payment method from list of Bank Accounts , Mobile Money numbers or Website collection Widgets

Delete Mobile Money Phone Number

This section will take you through the steps for deleting a mobile money phone number of a company on Patasente API .

A PUT request should be made to this API endpoint

https://demo.patasente.com/phantom-api/delete-phone/

The parameter that should be sent to this endpoint is the "id" of the bank account.

https://demo.patasente.com/phantom-api/delete-phone/2

If the request was successful, a response with success code 200 will be sent

{ "success": "Mobile Money Phone number deleted" }

If there is an error in the request , a response with error code 400 will be sent

{ "error": "Mobile Money Phone number not found" }

Below are the fields required by the API

Field Type Required Description
id number Yes This is id of the mobile money number to be deleted

list of website widgets

This section will take you through the steps for fetching a company's website widgets on Patasente API .

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-website-widgets

No parameter should be sent to this endpoint

https://demo.patasente.com/phantom-api/get-website-widgets

If the request was successful, a response with success code 200 will be sent

[ { "id": 7, "company_id": 2, "user_id": 2, "registered_name": "Mail Trap", "website_url": "https://mailtrap.io/", "widget_link": "http://localhost:8000/pay-me/M00001/Senior Developer", "widget_button_name": "Donate", "widget_button_generator": http://localhost:8000/pay-with-patasente/0f736223f3bd29bccbf9ab7818f5dcc3/7932mcF3D", "payment_method": "website widget", "deleted": 0, "created_at": { "date": "2020-03-27 00:21:28.000000", "timezone_type": 3, "timezone": "UTC" }, "updated_at": { "date": "2020-03-27 05:57:41.000000", "timezone_type": 3, "timezone": "UTC" }, "verified": "verified", "admin_verification": "verified" }, ]

Add Website Widget

This section will take you through the steps for adding a new website widget for a company on Patasente API .

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/add-website-widget

The parameter that should be sent to this endpoint is the "registered_name" "widget_button_name" , "website_url" .

https://demo.patasente.com/phantom-api/add-website-widget?registered_name=Patasente&website_url=https://patasente.com&widget_button_name=Pay

If the request was successful, a response with success code 200 will be sent

{ "message": "New Website Widget Added, A four (4) digit code has been sent to sse*****com. check in your inbox or spam", "id": 9 }

If there is an error, a response with error code 400 will be sent

{ "error": "Widget Not Added" }

Below are the fields required by the API

Field Type Required Description
registered_name text Yes This is the name of the website where the button is going to be added
website_url text No This is the url of the website where the button is going to be added
widget_button_name text No This is the label name that dispays on the button

Update website widget

This section will take you through the steps for updating a website widget for a company on Patasente API .

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/website-widget/

The parameter that should be sent to this endpoint is the "id" for the website widgett and other parameters like "registered_name" , "website_url" and "widget_button_name".

https://demo.patasente.com/phantom-api/website-widget/2?registered_name=Web Brooker&website_url=https://demo.patasente.com&widget_button_name=Pay

If the request was successful, a response with success code 200 will be sent

{ "success": "Website Widget Updated, A four (4) digit code has been sent to sse*****com. check in your inbox or spam", "id": 8 }

If there is an error, a response with error code 400 will be sent

{ "error": "Website Widget not found" }

Below are the fields required by the API

Field Type Required Description
id number Yes This is the id of the website that should be edited
registered_name text Yes This is the name of the website where the button is going to be added
website_url text No This is the url of the website where the button is going to be added
widget_button_name text No This is the label name that dispays on the button

Delete Website Widget

This section will take you through the steps for deleting a website widget of a company on Patasente API .

A PUT request should be made to this API endpoint

https://demo.patasente.com/phantom-api/delete-website-widget/

The parameter that should be sent to this endpoint is the "id" of the website widget.

https://demo.patasente.com/phantom-api/delete-website-widget/2

If the request was successful, a response with success code 200 will be sent

{ "success": "Website Widget deleted" }

If there is an error in the request , a response with error code 400 will be sent

{ "error": "Website Widget not found" }

Below are the fields required by the API

Field Type Required Description
id number Yes This is id of the website widget to be deleted

Uploadable Documents

This is the section where a Business uploads its legal documents for the company to verify there account.

List Uploadable Documents

This section will take you through the steps for fetching a list of accepted Uploadable documents for a company on Patasente API .

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-uploadable-documents

NO parameter that should be sent to this endpoint , a json response with the list accepted Uploadable documents will be sent

https://demo.patasente.com/phantom-api/get-uploadable-documents

[ { "id": 1, "name": "Profile", "deleted": 0 }, { "id": 2, "name": "Incorporation Certificate", "deleted": 0 }, { "id": 3, "name": "Memorandum and Articles of Association", "deleted": 0 } ]

List Company Uploaded Documents

This section will take you through the steps for fetching a list of Company Uploaded Documents on Patasente API .

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-company-documents

NO parameter that should be sent to this endpoint , a json response with the list of Company Uploaded Documents will be sent

https://demo.patasente.com/phantom-api/get-company-documents

[ { "id": 1, "verifier_user_id": null, "company_id": 2, "document_id": 2, "document_name": "Incorporation Certificate", "deleted": 0, "checked": 0, "image": "data:application/pdf;base64,JVBERi0xLjMKJbe+raoKMSAwIG9iago8PAovVHlwZSAvQ2 F0YWxvZwovUGFnZXMgMiAwIFIKPj4KZW5kb2JqCjIgMCBvYmoKPDwKL1R5cGUgL1 BhZ2VzCi9LaWRzIFsgNCAwIFIgXQovQ291bnQgMQo+PgplbmRvYmoKMyAwIG9 iago8PAovUHJvZHVjZXIgKFJ4UmVsZWFzZSBcMDU3IEhhcnUyLjQuMGRldikK Pj4KZW5kb2JqCjQgMCBvYmoKPDwKL1R5cGUgL1BhZ2UKL01lZ } ]

Get a single Document

This section will take you through the steps for fetching a single company document on Patasente API .

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-company-document/

The parameter that should be sent to this endpoint is the "id" of the company , a json response with the company document will be returned

https://demo.patasente.com/phantom-api/get-company-document/2

{ "id": 1, "verifier_user_id": null, "company_id": 2, "document_id": 2, "document_name": "Incorporation Certificate", "deleted": 0, "checked": 0, "image": "data:application/pdf;base64,JVBERi0xLjMKJbe+raoKMSAwIG9iago8PAovVHlwZSAvQ2 F0YWxvZwovUGFnZXMgMiAwIFIKPj4KZW5kb2JqCjIgMCBvYmoKPDwKL1R5cGUgL1 BhZ2VzCi9LaWRzIFsgNCAwIFIgXQovQ291bnQgMQo+PgplbmRvYmoKMyAwIG9 iago8PAovUHJvZHVjZXIgKFJ4UmVsZWFzZSBcMDU3IEhhcnUyLjQuMGRldikK Pj4KZW5kb2JqCjQgMCBvYmoKPDwKL1R5cGUgL1BhZ2UKL01lZ" }

Below are the fields required by the API

Field Type Required Description
id number Yes This is id of the company document

Add Document

This section will take you through the steps for adding a new company document on Patasente API .

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/add-document

The parameter that should be sent to this endpoint is the "image" , "document_id" .

https://demo.patasente.com/phantom-api/add-document?add-document?document_id=3&image=data:application/pdf;base64,JVBERi0xLjMKJbe+raoKMSAwIG9iago8PAovVHlwZSAvQ2 F0YWxvZwovUGFnZXMgMiAwIFIKPj4KZW5kb2JqCjI

If the request was successful, a response with success code 200 will be sent

{ "success": "Document Added" }

If there is an error, a response with error code 400 will be sent

{ "error": "Document already exits" }

Below are the fields required by the API

Field Type Required Description
document_id text Yes This is the id of the document from the list of uploadable documents
image text Yes This is the image in base64 version

Update Document

This section will take you through the steps for updating a company document on Patasente API .

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/update-document

The parameter that should be sent to this endpoint is the "id" for the uploadable document and other parameters like "image".

https://demo.patasente.com/phantom-api/update-document/2?image=data:application/pdf;base64,JVBERi0xLjMKJbe+raoKMSAwIG9iago8PAovVHlwZSAvQ2 F0YWxvZwovUGFnZXMgMiAwIFIKPj4KZW5kb2JqCjI

If the request was successful, a response with success code 200 will be sent

{ "success": "Document Updated" }

If there is an error, a response with error code 400 will be sent

{ "error": "Document not found" }

Below are the fields required by the API

Field Type Required Description
id text Yes This is the id of the company document to be updated
image text Yes This is the image in base64 version

Delete Document

This section will take you through the steps for deleting a company document on Patasente API .

A PUT request should be made to this API endpoint

https://demo.patasente.com/phantom-api/delete-document/

The parameter that should be sent to this endpoint is the "id" of the company document.

https://demo.patasente.com/phantom-api/delete-document/2

If the request was successful, a response with success code 200 will be sent

{ "success": "Document deleted" }

If there is an error in the request , a response with error code 400 will be sent

{ "error": "Document not found" }

Below are the fields required by the API

Field Type Required Description
id number Yes This is id of the bank account to be deleted

Management Information System

This is the section where a company manages its suppliers in the Managment Information System.

MIS Delivery Summary

This section will fetch the MIS delivery summary on Patasente API.

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/deliveries/get-deliveries-summary/

No parameter should be sent to this endpoint

https://demo.patasente.com/phantom-api/deliveries/get-deliveries-summary.

{ "deliveries": "29", "advances": "10,200", "deductions": "5,200", "suppliers": "5", "total_outstanding_balance": "0", "products": 12 }

List of Companies

This section will take you through the steps for fetching a list of companies on Patasente API. Companies will be returned depending on the search query

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-business-companies/

The parameter that should be sent to this endpoint is a search query, a json response with the list of companies depending on the search query like developer

https://demo.patasente.com/phantom-api/get-business-companies/developer .

[ { "logo": null, "id": 9, "user_id": 10, "business_name": "Junior Developer", "name": "Junior Developer", "business_email": null, "merchant_code": "M112399", "business_website": null, "address": null, "business_billing_address": null, "business_shipping_address": null, "nature_of_business": null, "duration_of_business": null, "business_monthly_turnover": null, "PoB": null, "business_partner_names": null, "business_partner_phone": null, "business_phone": "+2567000000", "currency_id": 1, "currency_symbol": "UGX", "region": null, .................... }, { "logo": null, "id": 8, "user_id": 9, "business_name": "Senior Developer", "name": "Senior Developer", "business_email": null, "merchant_code": "M451202", "business_website": null, "address": "khartourm", "business_billing_address": null, "business_shipping_address": null, "nature_of_business": null, "duration_of_business": null, "business_monthly_turnover": null, "PoB": null, "business_partner_names": null, ............ } } ]

List of Suppliers

This section will take you through the steps for fetching a list of Company Suppliers on Patasente API .

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/deliveries/get-suppliers/supplier?

The parameters that should be sent to this endpoint are "search" ,"skip" , "take" .To limit the number of results returned from the query, or to skip a given number of results in the query, you may skip and take a given number of results. This also helps in pagination. A json response with the Company Suppliers will be returned

https://demo.patasente.com/phantom-api/deliveries/get-suppliers/supplier?skip=0&take=7&search=Ivan

[ { "id": 1215, "name": "Daywne Johnson", "customer_or_supplier_id": null, "merchant_code": "M0000011215", "phone_number": "256774222077", "location": "USA", "currency_id": null, "currency": "", "credit_limit": null, "ppi_rank": null, "id_number": null, "gender": "male", "dob": "1992-05-06", "farm_size": null, "email": null, "sacco_details": [ { "id": 80, "bank_acc_number": "2345543", "sacco_branch": "California", "sacco_name": "Universal Studios", "payment_method": "sacco", "registered_name": "Rock" } ], "banking_details": [ { "id": 79, "company_supplier_id": 1215, "first_name": null, "last_name": null, "registered_name": "The Rock", "bank_name": "CITIBANK UGANDA LIMITED (TRADE SERVICES DEPT)", "bank_branch": "Ntinda", "bank_acc_number": "456789", "interswitch_payment_code": "1902464", "payment_method": "bank", "mobile_money_company": null, "mobile_money_phone": null, "country": "Uganda", "platform": "Web", "deleted": 0, "ip": "127.0.0.1", "created_at": "2021-11-13T01:32:19.000000Z", "updated_at": "2021-11-13T01:32:19.000000Z" } ], "mobile_money_details": [ { "id": 78, "company_supplier_id": 1215, "first_name": "The Rock", "last_name": "Johnson", "registered_name": null, "bank_name": null, "bank_branch": null, "bank_acc_number": null, "interswitch_payment_code": null, "payment_method": "mobile", "mobile_money_company": 1, "mobile_money_phone": "256774222077", "country": "Uganda", "platform": "Web", "deleted": 0, "ip": "127.0.0.1", "created_at": "2021-11-13T01:32:19.000000Z", "updated_at": "2021-11-13T01:32:19.000000Z" } ], "type": "Supplier", "supplier_type": "individual", "created_at": "2021-11-13", "outstanding_starting_balance": 23000, "contact_person_name": null, "contact_person_phone": null, "number_of_members": 0, "incorporation_date": "2021-11-13", "center_setup_date": "2021-11-13", "photo": "https://storage.googleapis.com/patasente-prod-file-uploads/company-logos/image-missing.png", "incorporation_certificate": null } ]

Below are the fields required by the API

Field Type Required Description
skip number No This is number of items that should be skipped but default is 0
take number Yes This is number of items that should be fetched per request but default is 15.
search text No This is a search query for your request.

Get a supplier

This section will take you through the steps for fetching a single supplier on Patasente API .

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/deliveries/get-supplier/

The parameter that should be sent to this endpoint is the "id" of the customer or supplier , a json response with the company customer or supplier will be returned

https://demo.patasente.com/phantom-api/deliveries/get-supplier/1215/M0000011215

{ "id": 1215, "name": "Daywne Johnson", "customer_or_supplier_id": null, "merchant_code": "M0000011215", "phone_number": "256774222077", "location": "USA", "currency_id": null, "currency": "", "credit_limit": null, "ppi_rank": null, "id_number": null, "gender": "male", "dob": "1992-05-06", "farm_size": null, "email": null, "sacco_details": [ { "id": 80, "bank_acc_number": "2345543", "sacco_branch": "California", "sacco_name": "Universal Studios", "payment_method": "sacco", "registered_name": "Rock" } ], "banking_details": [ { "id": 79, "company_supplier_id": 1215, "first_name": null, "last_name": null, "registered_name": "The Rock", "bank_name": "CITIBANK UGANDA LIMITED (TRADE SERVICES DEPT)", "bank_branch": "Ntinda", "bank_acc_number": "456789", "interswitch_payment_code": "1902464", "payment_method": "bank", "mobile_money_company": null, "mobile_money_phone": null, "country": "Uganda", "platform": "Web", "deleted": 0, "ip": "127.0.0.1", "created_at": "2021-11-13T01:32:19.000000Z", "updated_at": "2021-11-13T01:32:19.000000Z" } ], "mobile_money_details": [ { "id": 78, "company_supplier_id": 1215, "first_name": "The Rock", "last_name": "Johnson", "registered_name": null, "bank_name": null, "bank_branch": null, "bank_acc_number": null, "interswitch_payment_code": null, "payment_method": "mobile", "mobile_money_company": 1, "mobile_money_phone": "256774222077", "country": "Uganda", "platform": "Web", "deleted": 0, "ip": "127.0.0.1", "created_at": "2021-11-13T01:32:19.000000Z", "updated_at": "2021-11-13T01:32:19.000000Z" } ], "type": "Supplier", "supplier_type": "individual", "created_at": "2021-11-13", "outstanding_starting_balance": 23000, "contact_person_name": null, "contact_person_phone": null, "number_of_members": 0, "incorporation_date": "2021-11-13", "center_setup_date": "2021-11-13", "photo": "https://storage.googleapis.com/patasente-prod-file-uploads/company-logos/image-missing.png", "incorporation_certificate": null

Below are the fields required by the API

Field Type Required Description
id number Yes This is id of the company supplier List of Company suppliers
merchant_code text Yes This is merchant code of the company supplier from List of Company suppliers

Add Supplier

This section will take you through the steps for adding a supplier to a company on Patasente API .

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/deliveries/add-supplier

There are 4 types of suppliers eg "individual" ,"center" , "company" ,"cooperative" (case sentive) and a post request with a supplier_type will differentiate them.

https://demo.patasente.com/phantom-api/deliveries/add-supplier?supplier_type=individual

You can add a supplier who is already registered / has an account on Patasente by making a post request with a customer_or_supplier_id , this customer_or_supplier_id is the id of the company / business that is selected by the user

https://demo.patasente.com/phantom-api/add-supplier?supplier_type=individual&customer_or_supplier_id=23&product_id=4

If the post request has a supplier_type="individual" here are the parameters that should be sent.

https://demo.patasente.com/phantom-api/deliveries/add-supplier?supplier_type=individual&name=Jeo Doe&phone_number=07869594954&customer_or_supplier_id&id_number=65432345654&product_id=4&photo=base64Photo&email=momo19@gmail.com&location=ntungamo&dob=1993-03-03&gender=female&farm_size=120 acres&should_receive_sms_notifications=no&credit_limit&ppi_rqnk&outstanding_starting_balance=23000&banking_details[0][bank_name]=Equity bank&banking_details[0][bank_branch]=Ebb&banking_details[0][registered_name]=Joe Deo&banking_details[0][bank_acc_number]=6859403&banking_details[0][interswitch_payment_code]=434032&banking_details[0][payment_method]=bank&sacco_details[0][registered_name]=Joe Doe&sacco_details[0][sacco_name]=Bulindo sacco&sacco_details[0][payment_method]=sacco&sacco_details[0][bank_acc_number]=68594033202&sacco_details[0][sacco_branch]=Kira &mobile_money_details[0][first_name]=Doe&mobile_money_details[0][last_name]=Jeo&mobile_money_details[0][mobile_money_company]=1&mobile_money_details[0][payment_method]=mobile&mobile_money_details[0][mobile_money_phone]=07756859403

If the post request has a supplier_type="company" here are the parameters that should be sent.

https://demo.patasente.com/phantom-api/deliveries/add-supplier?supplier_type=company&name=Angel's iniative&phone_number=07869594954&product_id=4&customer_or_supplier_id&photo=base65logo&email=momo19@gmail.com&location=ntungamo&credit_limit&ppi_rqnk&outstanding_starting_balance=23000&incorporation_date=2007-10-20&should_receive_sms_notifications=yes&incorporation_certificate=Base64Certificate&contact_person_name=Jane Doe&contact_person_phone=07893459324&banking_details[0][bank_name]=Equity bank&banking_details[0][bank_branch]=Ebb&banking_details[0][registered_name]=Joe Doe&banking_details[0][bank_acc_number]=6859403&banking_details[0][interswitch_payment_code]=434032&banking_details[0][payment_method]=bank&sacco_details[0][registered_name]=Jeo Doe&sacco_details[0][sacco_name]=Bulindo sacco&sacco_details[0][payment_method]=sacco&sacco_details[0][bank_acc_number]=68594033202&sacco_details[0][sacco_branch]=Kira &mobile_money_details[0][first_name]=Joe&mobile_money_details[0][last_name]=Doe&mobile_money_details[0][mobile_money_company]=1&mobile_money_details[0][payment_method]=mobile&mobile_money_details[0][mobile_money_phone]=07756859403

If the post request has a supplier_type="center" here are the parameters that should be sent.

https://demo.patasente.com/phantom-api/deliveries/add-supplier?supplier_type=center&name=Makindye&phone_number=07869594954&customer_or_supplier_id&product_id=4&email=momo19@gmail.com&should_receive_sms_notifications=no&location=ntungamo&credit_limit&ppi_rqnk&outstanding_starting_balance=23000&contact_person_name=Jane Doe&contact_person_phone=07893459324&banking_details[0][bank_name]=Equity bank&banking_details[0][bank_branch]=Ebb&banking_details[0][registered_name]=Joe Doe&banking_details[0][bank_acc_number]=6859403&banking_details[0][interswitch_payment_code]=434032&banking_details[0][payment_method]=bank&sacco_details[0][registered_name]=Jeo Doe&sacco_details[0][sacco_name]=Bulindo sacco&sacco_details[0][payment_method]=sacco&sacco_details[0][bank_acc_number]=68594033202&sacco_details[0][sacco_branch]=Kira &mobile_money_details[0][first_name]=Joe&mobile_money_details[0][last_name]=Doe&mobile_money_details[0][mobile_money_company]=1&mobile_money_details[0][payment_method]=mobile&mobile_money_details[0][mobile_money_phone]=07756859403

If the post request has a supplier_type="cooperative" here are the parameters that should be sent.

https://demo.patasente.com/phantom-api/deliveries/add-supplier?supplier_type=cooperative&name=Makindye&phone_number=07869594954&customer_or_supplier_id&product_id=4&photo=base65logo&email=momo19@gmail.com&should_receive_sms_notifications=yes&location=ntungamo&credit_limit&ppi_rqnk&outstanding_starting_balance=23000&number_of_members=3&incorporation_date=2007-10-20&incorporation_certificate=Base64Certificate&contact_person_name=Jane Doe&contact_person_phone=07893459324&banking_details[0][bank_name]=Equity bank&banking_details[0][bank_branch]=Ebb&banking_details[0][registered_name]=Joe Doe&banking_details[0][bank_acc_number]=6859403&banking_details[0][interswitch_payment_code]=434032&banking_details[0][payment_method]=bank&sacco_details[0][registered_name]=Jeo Doe&sacco_details[0][sacco_name]=Bulindo sacco&sacco_details[0][payment_method]=sacco&sacco_details[0][bank_acc_number]=68594033202&sacco_details[0][sacco_branch]=Kira &mobile_money_details[0][first_name]=Joe&mobile_money_details[0][last_name]=Doe&mobile_money_details[0][mobile_money_company]=1&mobile_money_details[0][payment_method]=mobile&mobile_money_details[0][mobile_money_phone]=07756859403

If the request was successful, a response with success code 200 will be sent

{ "success": "Supplier has been added to your list" }

If the supplier already exist in a company's list, this response will be returned

{ "success": "Already in your list" }

If there is an error, a response with error code 400 will be sent

{ "error": "You can't add this supplier" }

Below are the fields required by the API

Field Type Required Description Supplier type
customer_or_supplier_id number No This is the id of the company from the list of companies All
supplier_type text Yes The type of supplier. its either individual , center , company or cooperative case sentive All
product_id text Yes The id of the product from the buyer's List of Products / Pricelist All
name text Yes The name of the supplier , center , company or cooperative All
id_number text No The national id number of an supplier individual
photo base64 No The photo or logo of the supplier All
phone_number number Yes The phone number of the supplier All
email email No The email of the supplier All
location text No The location of the supplier All
dob date No The date of birth of the supplier individual
gender enum('male','female') No The gender of the supplier, it should either be male or female case senstive Individual
should_receive_sms_notifications enum('no','yes') Yes This field asks a supplier if they want to receive sms notification upon each delivery they make, a disclaimer should be added that when you select yes the supplier will be charged for this sms, it should either be no or yes case senstive All
farm_size text No The farm size of the supplier individual
outstanding_starting_balance number No The outstanding startin _balance of the supplier All
number_of_members text No The number of members in a supplier cooperative or center cooperative , center
incorporation_date date No The date a supplier cooperative or company was incorporated cooperative, company
incorporation_certificate base64 No The incorporation certificate of a cooperative or company cooperative, company
center_setup_date date No The date a supplier center was set up center
contact_person_name text No The contact person's name for cooperative , center or company cooperative, center, company
contact_person_phone number No The contact person's phone number for cooperative , center or company cooperative, center, company
banking_details array No The bank details of a suppler. The array should contain these variables bank_name, bank_branch, registered_name , bank_acc_number ,interswitch_payment_code this code can be got for list of supported banks on Patasente. refer to the list you used on ADD BANK ACCOUNT , payment_method it should be bank all
mobile_money_details array No The mobile money details of a suppler. The array should contain these variables mobile_money_company it should either be 1 for MTN or 2 for Airtel which are found here list phone networks ,mobile_money_phone , first_name , last_name, payment_method it should be mobile all
sacco_details array No The sacco details of a suppler. The array should contain these variables sacco_name, sacco_branch, registered_name , bank_acc_number ,payment_method it should be sacco all

Update Supplier

This section will take you through the steps for updating a supplier on Patasente API .

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/deliveries/update-supplier

The parameter that should be sent to this endpoint .

https://demo.patasente.com/phantom-api/deliveries/update-supplier/1272

If the request was successful, a response with success code 200 will be sent

{ "success": "Supplier has been updated" }

If there is an error, a response with error code 400 will be sent

{ "error": "supplier not found" }

Below are the fields required by the API

Field Type Required Description Supplier type
id number No This is the id of the supplier from the list of suppliers All
customer_or_supplier_id number No This is the id of the company from the list of companies All
name text Yes The name of the supplier , center , company or cooperative All
id_number text No The national id number of an supplier individual
phone_number number Yes The phone number of the supplier All
email email No The email of the supplier All
location text No The location of the supplier All
dob date No The date of birth of the supplier individual
gender enum('male','female') No The gender of the supplier, it should either be male or female case senstive Individual
should_receive_sms_notifications enum('no','yes') Yes This field asks a supplier if they want to receive sms notification upon each delivery they make, a disclaimer should be added that when you select yes the supplier will be charged for this sms, it should either be no or yes case senstive All
farm_size text No The farm size of the supplier individual
outstanding_starting_balance number No The outstanding startin _balance of the supplier All
number_of_members text No The number of members in a supplier cooperative or center cooperative , center
incorporation_date date No The date a supplier cooperative or company was incorporated cooperative, company
incorporation_certificate base64 No The incorporation certificate of a cooperative or company cooperative, company
center_setup_date date No The date a supplier center was set up center
contact_person_name text No The contact person's name for cooperative , center or company cooperative, center, company
contact_person_phone number No The contact person's phone number for cooperative , center or company cooperative, center, company
banking_details array No The bank details of a suppler. The array should contain these variables bank_name, bank_branch, registered_name , bank_acc_number ,interswitch_payment_code this code can be got for list of supported banks on Patasente. refer to the list you used on ADD BANK ACCOUNT , payment_method it should be bank all
mobile_money_details array No The mobile money details of a suppler. The array should contain these variables mobile_money_company it should either be 1 for MTN or 2 for Airtel which are found here list phone networks ,mobile_money_phone , first_name , last_name, payment_method it should be mobile all
sacco_details array No The sacco details of a suppler. The array should contain these variables sacco_name, sacco_branch, registered_name , bank_acc_number ,payment_method it should be sacco all
credit_limit number No This the credit limit for a supplier All
can_use_credit enum(yes , no) No This is whether a supplier can use the credit or not .it should either be no or yes case senstive All

Update Supplier Photo

This section will take you through the steps for updating supplier photo on Patasente API .

A PUT request should be made to this API endpoint

https://demo.patasente.com/phantom-api/deliveries/update-supplier-logo

Parameters that should be sent to this endpoint include "id" and "photo". The id identifies the resource that should be updated

https://demo.patasente.com/phantom-api/deliveries/update-supplier-logo/2?image=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAqQAAAJaCAIAAAB2vMKXAAAA AXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwdwjr+9vzrVrzIzt2X+SlhO9eIa HwCeYtgDwOUMewC4WmsdAuLQMiKK2zcAAAAASUVORK5CYII=AAAqQAAAJaCAIAAAB2 vMKXAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwdw

If the request was successful, a response with success code 200 will be sent

{ "success": "Photo has updated" }

If the request wasn't successful, a response with success code 404 will be sent

{ "error": "Supplier not found" }

Below are the fields required by the API

Field Type Required Description
id number Yes This is the id of the supplier that ahould be updated
photo longText Yes A base64 version of the picture/image/logo should be uploaded.

Delete supplier

This section will take you through the steps for deleting a company's customer or supplier on Patasente API .

A PUT request should be made to this API endpoint

https://demo.patasente.com/phantom-api/deliveries/delete-supplier/

The parameter that should be sent to this endpoint is the "id" of the customer or supplier from the list.

https://demo.patasente.com/phantom-api/deliveries/delete-supplier/2

If the request was successful, a response with success code 200 will be sent

{ "success": "Supplier has been removed from your list" }

If there is an error in the request , a response with error code 400 will be sent

{ "error": "Not found on your list" }

Below are the fields required by the API

Field Type Required Description
id number Yes This is id of the customer or supplier from the list to be deleted

Add Advance

This section will take you through the steps for adding a supplier advance on Patasente API.

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/deliveries/add-advance

The parameters that should be sent to this endpoint , a json response with the list of unit measure will be returned

https://demo.patasente.com/phantom-api/deliveries/add-advance?amount=10000&reason=api testing&supplier_id=1206&type=cash&mis_transaction_type=advance&disbursement_date=11-11-2021&advance_period=20 .

{ "success": "Advance saved" }

If there any errors, a json response with 400 error code will be returned

{ "error": "Advance not saved" }

Below are the fields required by the API

Field Type Required Description
supplier_id number Yes This is id of the supplier from List of suppliers
amount number Yes This is the advance amount
reason text Yes This is the reason for the advance
disbursement_date date Yes This is the date when the advance was disbused, this field should not allow future dates
advance_period number yes This is the length of the is advance in days
type text Yes The default value for type should be cash
mis_transaction_type text Yes The default value for type should be advance

List all Advances

This section will take you through the steps for fetching all advances on Patasente API.

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api//deliveries/get-supplier-transactions/advance/transaction?

The parameters that should be sent to this endpoint are "skip" , "take" .To limit the number of results returned from the query, or to skip a given number of results in the query, you may skip and take a given number of results. This also helps in pagination. "search" , "from_date" , "to_date" .A json response with the wallet balance will be returned

https://demo.patasente.com/phantom-api/deliveries/get-supplier-transactions/advance/transaction?skip=0&take=10&search=patasente&from_date=2019-02-07&to_date=2019-06-05&.

[ { "id": 271, "currency_format": "UGX", "charge_currency_format": "", "amount": "10000", "transaction_id": "00000271", "names": "George Bakka", "phone": null, "balance": "0", "charge": "0", "transaction_status": "Processed", "payment_reason": "Testing", "paid_to": "George Bakka", "paid_by": "Ssekalegga Brian", "paid_to_merchant_code": "M0000011273", "paid_by_merchant_code": "M000001", "charge_bearer": null, "exchange_rate": null, "transaction_type": "cash payment", "type": "cash", "created_at": "2022-02-04", "wallet_balance": "0", "updated_at": "2022-02-04 16:59:37", "platform": "Web", "interswitch_payment_item": "", "advance_status": "outstanding", "deduction_status": null, "advance_due_date": "2022-02-11", "is_mis_transaction": "yes", "mis_transaction_type": "advance", "advance_transaction_id": null, "advance_period": 7, "company_supplier_id": 1273 } ]

Below are the fields required by the API

Field Type Required Description
skip number No This is number of items that should be skipped but default is 0
take number Yes This is number of items that should be fetched per request but default is 10.
search number No This is search query.
from_date date No This is date from where you want to start the filtering of results.
to_date date No This is date from where you want to end the filtering of results.

Get a single Supplier Advances

This section will take you through the steps for fetching advances for a specific supplier on Patasente API.

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/deliveries/get-single-supplier-advances/

The parameters that should be sent to this endpoint is "supplier_id", a json response with success code 200 will be returned

https://demo.patasente.com/phantom-api/deliveries/get-single-supplier-advances/1206.

[ { "id": 530, "transaction_id": "00000530", "currency_format": "UGX", "charge_currency_format": "", "amount": 4300, "company_supplier_id": 1206, "advance_status": "outstanding", "payment_reason": "desciption" } ]

Below are the fields required by the API

Field Type Required Description
supplier_id number Yes This is id of the supplier from List of suppliers

Delete Advance

This section will take you through the steps for deleting an advance on Patasente API.

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/deliveries/delete-advance

The parameters that should be sent to this endpoint is "id", a json response with success code 200 will be returned

https://demo.patasente.com/phantom-api/deliveries/delete-advance/2.

{ "success": "Advance Deleted" }

Below are the fields required by the API

Field Type Required Description
id number Yes This is id of the advance transaction

Add Deduction

This section will take you through the steps for adding a supplier advance on Patasente API.

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/deliveries/add-deduction

The parameters that should be sent to this endpoint , a json response with the list of unit measure will be returned

https://demo.patasente.com/phantom-api/deliveries/add-deduction?advance_transaction_id=530&supplier_id=1206&amount=4300&reason= test deduction&mis_transaction_type=deduction&type=cash.

{ "success": "Deduction saved" }

If there any errors, a json response with 400 error code will be returned

{ "error": "Deduction not saved" }

Below are the fields required by the API

Field Type Required Description
supplier_id number Yes This is id of the supplier from List of suppliers
amount number Yes This is the deduction amount, this field is auto populated when an advance is seleted but can also be edit to enter any desired deductible amount
reason text Yes This is the reason for the advance
advance_transaction_id number Yes This is the id of the advance on which a deduction is being set.This id can be got from List of supplier advanes
advance_period number yes This is the length of the is advance in days
type text Yes The default value for type should be cash
mis_transaction_type text Yes The default value for type should be deduction

List all deductions

This section will take you through the steps for fetching all deductions on Patasente API.

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api//deliveries/get-supplier-transactions/deduction/transaction?

The parameters that should be sent to this endpoint are "skip" , "take" .To limit the number of results returned from the query, or to skip a given number of results in the query, you may skip and take a given number of results. This also helps in pagination. "search" , "from_date" , "to_date" .A json response with the wallet balance will be returned

https://demo.patasente.com/phantom-api/deliveries/get-supplier-transactions/deduction/transaction?skip=0&take=10&search=patasente&from_date=2019-02-07&to_date=2019-06-05&.

[ { id": 272, "currency_format": "UGX", "charge_currency_format": "", "amount": "10000", "transaction_id": "00000272", "balance": "0", "charge": "0", "transaction_status": "Processed", "payment_reason": "Testing", "paid_to": "George Bakka", "paid_by": "Ssekalegga Brian", "paid_to_merchant_code": "M0000011273", "paid_by_merchant_code": "M000001", "charge_bearer": null, "exchange_rate": null, "transaction_type": "cash payment", "type": "cash", "created_at": "2022-02-04", "wallet_balance": "0", "updated_at": "2022-02-04 17:54:14", "platform": "Web", "interswitch_payment_item": "", "advance_status": null, "deduction_status": "outstanding", "advance_due_date": null, "is_mis_transaction": "yes", "mis_transaction_type": "deduction", "advance_transaction_id": "00000271", "advance_period": null, "company_supplier_id": 1273 } ]

Below are the fields required by the API

Field Type Required Description
skip number No This is number of items that should be skipped but default is 0
take number Yes This is number of items that should be fetched per request but default is 10.
search number No This is search query.
from_date date No This is date from where you want to start the filtering of results.
to_date date No This is date from where you want to end the filtering of results.

Delete Deduction

This section will take you through the steps for deleting a deduction on Patasente API.

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/deliveries/delete-deduction

The parameters that should be sent to this endpoint is "id", a json response with success code 200 will be returned

https://demo.patasente.com/phantom-api/deliveries/delete-deduction/2.

{ "success": "Deduction Deleted" }

Below are the fields required by the API

Field Type Required Description
id number Yes This is id of the deduction transaction

Add Delivery

This section will take you through the steps for adding a supplier delviery on Patasente API.

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/deliveries/add-delivery

The parameters that should be sent to this endpoint , a json response with the list of unit measure will be returned

https://demo.patasente.com/phantom-api/deliveries/add-delivery

{ "success": "Delivery added" }

If there any errors, a json response with 400 error code will be returned

{ "error": "Delivery date can't be in the future " }

Below are the fields required by the API

Field Type Required Description
supplier_id number Yes This is id of the supplier from List of suppliers
amount number Yes This is the deduction amount, this field is auto populated when an advance is seleted but can also be edit to enter any desired deductible amount
products array Yes This is an array of product(s) that are being delivered.Your products object array should contain the following variables ,"products":[{"item":"Milk","qty":"34","price":600,"unit_measure":3}]
period enum yes This is the time of the day the delivery was made, the only allowed values are "morning" , "afternoon" ,"evening".These values are case sensitive
date date yes This is the date the delivery was made, this date should be either today or past dates NO future dates are allowed
qualities array No This is an array of qualities of the products that are being delivered.The qualities associated to a product will be returned along with product list . "qualities":[{"level":"20","quality_measure_id":9}]}

Update Delivery

This section will take you through the steps for updating a supplier delviery on Patasente API.

A PUT request should be made to this API endpoint

https://demo.patasente.com/phantom-api/deliveries/update-delivery

The parameters that should be sent to this endpoint , a json response with the list of unit measure will be returned

https://demo.patasente.com/phantom-api/deliveries/update-delivery

{ "success": "Delivery updated" }

If there any errors, a json response with 400 error code will be returned

{ "error": "Delivery not updated " }

Below are the fields required by the API

Field Type Required Description
supplier_id number Yes This is id of the supplier from List of suppliers
products array Yes This is an array of product(s) that are being updated.Your products object array should contain the following variables ,"products":[{"qty":"34","price":600,"id":3}]

List all supplier deliveries

This section will take you through the steps for fetching a list of supplier deliveries on Patasente API.

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/deliveries/get-supplier-deliveries/deliveries

The parameters that should be sent to this endpoint are "skip" , "take" .To limit the number of results returned from the query, or to skip a given number of results in the query,you may skip and take a given number of results. This also helps in pagination. "search" .A json response with the wallet balance will be returned

https://demo.patasente.com/phantom-api/deliveries/get-supplier-deliveries/deliveries?search=Daywne Johnson.

{ "table_headers": [ "Supplier", "", "Mon-12-Sep", "Tue-13-Sep", "Wed-14-Sep", "Thu-15-Sep", "Fri-16-Sep", "Sat-17-Sep", "Sun-18-Sep", "Action" ], "deliveries": [ { "supplier_id": 1285, "supplier": "Group Limited", "supplier_merchant_code": "M0000011285", "products": [ { "id": 801, "qty": 0, "price": "600" }, { "id": 802, "qty": 0, "price": "600" }, { "id": 803, "qty": 0, "price": "600" }, { "id": 804, "qty": 43, "price": "600" }, { "id": 805, "qty": 870, "price": "700" }, { "id": 806, "qty": 0, "price": "600" }, { "id": 807, "qty": 0, "price": "600" }, { "id": 808, "qty": 0, "price": "600" }, { "id": 842, "qty": 3564, "price": "600" }, { "id": 843, "qty": 3564, "price": "600" } ], "edit": false, "id": 212, "generated_instrument_no": "INV00000212" }, { "supplier_id": 1283, "supplier": "Dairy", "supplier_merchant_code": "M0000011283", "products": [ { "id": 782, "qty": 0, "price": 0 }, { "id": 783, "qty": 0, "price": 0 }, { "id": 784, "qty": 0, "price": 0 }, { "id": 785, "qty": 0, "price": 0 }, { "id": 786, "qty": 0, "price": 0 }, { "id": 787, "qty": 0, "price": 0 }, { "id": 788, "qty": 0, "price": 0 }, { "id": 789, "qty": 0, "price": 0 } ], "edit": false, "id": 210, "generated_instrument_no": "INV00000210" }, ] }

Field Type Required Description
skip number No This is number of items that should be skipped but default is 0
take number Yes This is number of items that should be fetched per request but default is 10.
search number No This is search query.
from_date date No This is date from where you want to start the filtering of results.
to_date date No This is date from where you want to start the filtering of results.

Get a single delivery invoice

This section will take you through the steps for fetching a single delivery invoice on Patasente API .

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/deliveries/get-supplier-delivery

The parameter that should be sent to this endpoint is the "id" and "generated_instrument_no" of the invoice, a json response will be returned

https://demo.patasente.com/phantom-api/deliveries/get-supplier-delivery/114/INV00000114

{ "invoice": { "id": 114, "generated_instrument_no": "INV00000114", "user_id": null, "to_merchant_code": "M000001", "to_email": "ssekalegga@gmail.com", "to_phone": "+256783159235", "from_phone": "256774222077", "purchase_order_no": null, "check_po": false, "from_merchant_code": "M0000011215", "from_company_id": 1215, "is_mis_financial_instrument_closed": "no", "is_mis_financial_instrument": "yes", "is_automated_recurring_template": "no", "to_company_id": 6, "from_name": "Daywne Johnson", "from_email": "256774222077", "from_address": "USA", "to_address": "Najjanankumbi", "vat": "0", "status": 0, "to_name": "Ssekalegga Brian", "attachment": null, "terms_and_conditions": "Supplier delivery", "invoice_total": "272380", "grand_total": "272,380", "grandtotal": "272380", "sub_total": "272,380", "type": "invoice", "new_due_date": "2021-11-13", "due_date": "2021-11-13", "overdue_days": "16", "currency_id": 1, "currency_format": "UGX", "current_date": "2021-11-29", "new_created_at": "2021-11-13 04:33:36", "new_updated_at": "2021-11-29 00:28:19", "created_at": { "date": "2021-11-13 04:33:36" }, "updated_at": { "date": "2021-11-29 00:28:19" }, "editable": 1, "platform": "Web", "financial_note_no": null, "payment_status": 0, "receiver_finance_request_status": 0, "sender_finance_request_status": 0, "can_request_early_payment": false, "can_request_factor_payment": false }, "items": [ { "id": 179, "unit_measure": "6", "item": "Iphone 7", "qty": "70", "price": "3464", "total": 242480, "period": "AFTERNOON", "stripped_period": "AFT", "unit_measure_name": "Pieces", "new_created_at": "2021-11-12 22:30:28", "new_updated_at": "2021-11-12 22:30:28", "created_at": { "date": "2021-11-12 22:30:28" }, "updated_at": { "date": "2021-11-12 22:30:28" } }, { "id": 180, "unit_measure": "2", "item": "Beans", "qty": "34", "price": "400", "total": 13600, "period": "EVENING", "stripped_period": "EVE", "unit_measure_name": "Kilograms", "new_created_at": "2021-11-09 21:00:00", "new_updated_at": "2021-11-09 21:00:00", "created_at": { "date": "2021-11-09 21:00:00" }, "updated_at": { "date": "2021-11-09 21:00:00" } }, ], "installments": [], "transactions": [] }

Below are the fields required by the API

Field Type Required Description
id number Yes This is the id of the supplier delivery invoice found here list all deliveries
generated_instrument_no text Yes This is the generated instrument no of the supplier delivery invoice found here list all deliveries

Get single supplier outstanding balance

This section will take you through the steps for fetching a single supplier outstanding-balance on Patasente API .

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/deliveries/get-supplier-outstanding-balance

The parameter that should be sent to this endpoint is the "id" and "merchant_code" of the invoice, a json response will be returned

https://demo.patasente.com/phantom-api/deliveries/get-supplier-outstanding-balance/1272/M0000011272

{ "supplier": { "id": 1272, "name": "Yiga Ivan", "customer_id": null, "merchant_code": "M0000011272", "currency_id": 1, "currency": "ugx", "outstanding_starting_balance": 0, "formatted_outstanding_starting_balance": "0", "formatted_total_deductions": "0", "total_deductions": 0, "total_invoice_value": "43,300", "formatted_total_payable": "43,300", "total_payable": 43300 }, "payment_details": [ { "id": "", "payment_method": "cash", "registered_name": "Yiga Ivan", "acc_number": "", "service_provider": "Cash", "charge": 0 }, { "id": 142, "payment_method": "mobile", "service_provider": "AIRTEL", "registered_name": "Yiga Ivan", "acc_number": "25674000009", "charge": "1000" } ] }

If there any errors, a json response with 400 error code will be returned

{ "error": "Supplier doesn't exist." }

Below are the fields required by the API

Field Type Required Description
id number Yes This is the id of the supplier found here Get outstanding balance list
merchant_code text Yes This is the merchant code of the supplier here Get outstanding balance list

Pay supplier outstanding balance

This section will take you through the steps for paying a supplier outstanding balance on Patasente API.

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/deliveries/pay-supplier-outstanding-balance

The parameter that should be sent to this endpoint is the "type" , "supplier_id" ,"total","payment_method_id".

https://demo.patasente.com/phantom-api/deliveries/pay-supplier-outstanding-balance??supplier_id=1272&type=cash&total=1000&payment_method_id=

A json response with 200 success code will be returned

{ "success": "Transaction is being processed" }

If there any errors, a json response with 400 error code will be returned

{ "error": "Your can't make payments at this moment" }

Below are the fields required by the API

Field Type Required Description
supplier_id number Yes This is the id of the supplier from List of Company supliers
payment_method_id number Yes This is the id of the payment_method_id. The payment_method_id is returned in a specific payment method.For this case its got when a user selects a payment method to use when making a payment which is found Get single supplier outstanding balance in the payment_details object "payment_details": [ { "id": "", "payment_method": "mobile" , "registered_name": "Daywne Johnson", "acc_number": "", "service_provider": "Cash", "charge": 1000 }]
total number Yes This is the amount that should be paid
type text Yes This is the type of the payment method to be used. For this case its got when a user selects a payment method to use when making a payment which is found Get single supplier outstanding balance in the payment_details object "payment_details": [ { "id": "", "payment_method": "cash" , "registered_name": "Daywne Johnson", "acc_number": "", "service_provider": "Cash", "charge": 0 },

Get outstanding balance list

This section will take you through the steps for fetching supplier outstanding balance list on Patasente API.

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/deliveries/get-outstanding-balance-list

The parameters that should be sent to this endpoint are "skip" , "take" .To limit the number of results returned from the query, or to skip a given number of results in the query,you may skip and take a given number of results. This also helps in pagination. "search" .A json response with the wallet balance will be returned

https://demo.patasente.com/phantom-api/deliveries/get-outstanding-balance-list/supplier?search=Ivan Yiga.

[ { "id": 1272, "name": "Yiga Ivan", "customer_id": null, "merchant_code": "M0000011272", "currency_id": null, "currency": "", "outstanding_starting_balance": "600", "total_deductions": "50", "total_closed_invoice_value": "1,600", "total_payable": 2150, "formatted_total_payable": "2,150" }, { "id": 1272, "name": "George kalyango", "customer_id": null, "merchant_code": "M0000011273", "currency_id": null, "currency": "", "outstanding_starting_balance": "1000", "total_deductions": "550", "total_closed_invoice_value": "16,000", "total_payable": 16450, "formatted_total_payable": "16,450" } ]

Field Type Required Description
skip number No This is number of items that should be skipped but default is 0
take number Yes This is number of items that should be fetched per request but default is 10.
search number No This is search query.
from_date date No This is date from where you want to start the filtering of results.
to_date date No This is date from where you want to end the filtering of results.

Products

This is the section where a company's products are managed.

List of Company Products

This section will take you through the steps for fetching a list of company products on Patasente API.

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-company-products

NO parameter should be sent to this endpoint , a json response with the list of company products will be returned

https://demo.patasente.com/phantom-api/get-company-products .

[ { "id": 18, "product_name": "DeskTop Pro HDD Brand New", "unit_price_formatted": "300,000", "unit_price": 300000, "unit_measure": 6, "units": "Pieces", "currency_id": 1, "currency_format": "UGX", "optimum_stock": "10", "optimum_stock_1": "10", "current_stock_1": "5", "current_stock": "5", "stockup": "5", "stock_out_date": "", "previous_stock_date": "2019-02-28", "deleted": 0, "created_at": { "date": "2019-03-07 23:26:53.000000", "timezone_type": 3, "timezone": "UTC" }, "updated_at": { "date": "2019-03-07 23:26:53.000000", "timezone_type": 3, "timezone": "UTC" }, "qualities":[{"id":3,"name":"Clean","company_product_id":809,"deleted":0,"ip":"127.0.0.1","created_at":"2021-11-27T00:57:10.000000Z","updated_at":"2021-11-27T00:57:10.000000Z"}]} ]

Get a Product

This section will take you through the steps for fetching a single on Patasente API .

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-product

The parameter that should be sent to this endpoint is the "id" of the product or service, a json response with the product or service will be returned

https://demo.patasente.com/phantom-api/get-product/2

{ "id": 804, "product_name": "Milk", "company_id": 6, "my_id": 6, "business_name": "Ssekalegga Brian", "merchant_code": "M000001", "unit_measure": 3, "units": "L", "unit_name": "Litres", "currency_id": 1, "currency_format": "UGX", "unit_price_formatted": "800", "unit_price": 800, "optimum_stock": null, "optimum_stock_1": "0", "current_stock_1": "0", "type": "product", "after_pay_terms": 0, "payment_frequency": "", "payment_style": null, "payment_period": null, "number_of_installments": 0, "current_stock": null, "description": "", "stockup": "0", "stock_out_date": "", "previous_stock_date": "", "deleted": 0, "created_at": "2021-11-22 02:35:41", "updated_at": "2021-11-28 16:39:08", "qualities": [ { "id": 9, "name": "Alcohol", "company_product_id": 804, "deleted": 0, } ] }

A json response for a product will look like this

Below are the fields required by the API

Field Type Required Description
id number Yes This is id of the product or service

List of unit Measures

This section will take you through the steps for fetching a list of unit measures on Patasente API.

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-unit-measure

NO parameter should be sent to this endpoint , a json response with the list of unit measure will be returned

https://demo.patasente.com/phantom-api/get-unit-measure .

[ { "id": 1, "initial": "none", "name": "None" }, { "id": 2, "initial": "kg", "name": "Kilograms" }, { "id": 3, "initial": "L", "name": "Litres" }, { "id": 4, "initial": "Pc", "name": "Packets" }, { "id": 5, "initial": "Dz", "name": "Dozens" }, { "id": 6, "initial": "Pcs", "name": "Pieces" }, { "id": 7, "initial": "U", "name": "Units" }, { "id": 8, "initial": "hr", "name": "Hours" }, { "id": 9, "initial": "T", "name": "Tonne" }, { "id": 10, "initial": "lb", "name": "Pound" }, { "id": 11, "initial": "rolls", "name": "Rolls" } ]

Add Product

This section will take you through the steps for adding a product on Patasente API.

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/add-product

The parameters that should be sent to this endpoint , a json response with the list of unit measure will be returned

https://demo.patasente.com/phantom-api/add-product .

{ "success": "Product has been added" }

Below are the fields required by the API

Field Type Required Description
product_name text Yes This is name of product
qualities arrary No This is an array of quality parameter for this product. The array objects are name, for example [{"name": "Alcohol Level"},{"name": "SNF Level"},]
unit_measure number Yes This is the id of unit measure found Get unit measure
unit_price number Yes This is the price for selling the product
purchase_unit_price number No This is the purchase price for the product
type text Yes The default value for type should be product

Update Product

This section will take you through the steps for updating a product on Patasente API.

This section will take you through the steps for updating a product on Patasente API.

A PUT request should be made to this API endpoint

https://demo.patasente.com/phantom-api/update-product

The parameters that should be sent to this endpoint are "service_name" , "description" and "id", a json response with success code 200 will be returned

https://demo.patasente.com/phantom-api/update-product/2?product_name=Testing Api .

{ "success": "Product Updated" }

Field Type Required Description
product_name text Yes This is name of product
qualities arrary No This is an array of quality parameter for this product. The array objects are name, for example [{"name": "Alcohol Level"},{"name": "SNF Level"},]
unit_measure number Yes This is the id of unit measure found Get unit measure
unit_price number Yes This is the price for selling the product
purchase_unit_price number No This is the purchase price for the product

Delete Product

This section will take you through the steps for deleting a product on Patasente API.

A PUT request should be made to this API endpoint

https://demo.patasente.com/phantom-api/delete-product

The parameters that should be sent to this endpoint is "id", a json response with success code 200 will be returned

https://demo.patasente.com/phantom-api/delete-product/2.

{ "success": "Product Deleted" }

Below are the fields required by the API

Field Type Required Description
id number Yes This is id of the product or service to delete

Wallet

This is the section where a company's wallet is managed.

Login to Wallet

This section will take you through the steps for accessing / logging into a company's wallet on Patasente API.

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/wallet/login-wallet

If there any errors, a json response with 400 error code will be returned

{ "success": "Successful" }

The parameter that should be sent to this endpoint is "pin" , a json response will be returned

https://demo.patasente.com/phantom-api/wallet/login-wallet?pin=0360.

{ "error": "Your PIN doesn't match our records, Please update your PIN in Profile Page" }

Below are the fields required by the API

Field Type Required Description
pin number Yes This is the new 4 digit PIN for the account

Get Wallet Balance

This section will take you through the steps for fetching a company's wallet balance on Patasente API.

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-wallet-balance

NO parameter should be sent to this endpoint , a json response with the wallet balance will be returned

https://demo.patasente.com/phantom-api/get-wallet-balance .

{ "id": 3, "company_id": 3, "currency": "UGX", "currency_id": 1, "formated_amount": "474,561", "formated_commission_amount": "0", "commission_amount": 0, "formated_reseller_float": "60,000", "reseller_float": 60000, "formated_prepaid_account_balance" : "50,000" "formated_credit_account_balance" : "150,000" "prepaid_account_balance" : "50000" "credit_account_balance" : "150000" "amount": 474561.0023449999, "account_no": "PATA20183" }

List All Company Transactions

This section will take you through the steps for fetching all company's transaction on Patasente API.

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-all-transactions/{type}/transaction?

The parameters that should be sent to this endpoint are "skip" , "take" .To limit the number of results returned from the query, or to skip a given number of results in the query, you may skip and take a given number of results. This also helps in pagination. "search" , "from_date" , "to_date" .A json response with the wallet balance will be returned

https://demo.patasente.com/phantom-api/get-all-transactions/all/ transaction?skip=0&take=10&search=patasente&from_date=2019-02-07&to_date=2019-06-05&

[ { "id": 64, "currency_format": "UGX", "charge_currency_format": "USD", "amount": "184,285", "transaction_id": "47909134", "transaction_id_from_callback": null, "reference_id_from_callback": null, "financial_instrument_id": 77, "financial_instrument_no": "IN11267", "names": "Junior Developer", "phone": null, "bank_account": null, "bank_name": null, "bank_branch": null, "balance": "1843715.3383", "charge": "1", "transaction_status": "Processed", "payment_reason": "Invoice payment", "paid_to": "Senior Developer", "paid_by": "Junior Developer", "paid_to_company_id": 11, "paid_by_company_id": 3, "paid_to_merchant_code": "M871054", "paid_by_merchant_code": "M528092", "charge_bearer": null, "exchange_rate": 3686, "send_receipt": true, "transaction_type": "wallet payment", "type": "wallet", "transaction_direction": "Money out", "created_at": { "date": "2019-06-24 23:56:00.000000", "timezone_type": 3, "timezone": "UTC" } }, { "id":5324, "currency_format":"UGX", "charge_currency_format":"UGX", "amount":"1,000", "transaction_id":"01297572", "transaction_id_from_callback":null, "reference_id_from_callback":null, "financial_instrument_id":"", "financial_instrument_no":"", "names":"Ssekalegga Brian", "phone":"256704255401", "bank_account":null, "bank_name":null, "bank_branch":null, "balance":"charges", "charge":"0", "transaction_status":"Processed", "payment_reason":"Transaction charge", "paid_to":"Charges", "paid_by":"Ssekalegga Brian", "paid_to_merchant_code":"M673079", "paid_by_merchant_code":"M207163", "paid_to_company_id": 11, "paid_by_company_id": 3, "charge_bearer":null, "exchange_rate":null, "send_receipt":false, "transaction_type":"mobile payment", "type":"mobile", "transaction_direction": "Money out", "created_at":{ "date":"2019-07-05 09:54:01.000000", "timezone_type":3, "timezone":"UTC" } }, { "id": 62, "currency_format": "UGX", "charge_currency_format": "UGX", "amount": "5,000", "transaction_id": "61704372", "transaction_id_from_callback": null, "reference_id_from_callback": null, /..................../ "type": "wallet", "created_at": { "date": "2019-06-24 23:53:00.000000", "timezone_type": 3, "timezone": "UTC" } } ]

Below are the fields required by the API

Field Type Required Description
type text Yes This is the type of transactions for example "all" , "mobile" ,"wallet" ,"bank"
skip number No This is number of items that should be skipped but default is 0
take number Yes This is number of items that should be fetched per request but default is 10.
search number No This is search query.
from_date date No This is date from where you want to start the filtering of results.
to_date date No This is date from where you want to end the filtering of results.

List Company Wallet Transactions

This section will take you through the steps for fetching company's wallet transaction on Patasente API.

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-all-transactions/{type}/transaction?

The parameters that should be sent to this endpoint are "skip" , "take" .To limit the number of results returned from the query, or to skip a given number of results in the query, you may skip and take a given number of results. This also helps in pagination. "search" , "from_date" , "to_date" .A json response with the wallet balance will be returned

https://demo.patasente.com/phantom-api/get-all-transactions/wallet/ transaction?skip=0&take=10&search=patasente&from_date=2019-02-07&to_date=2019-06-05&

[ { "id": 64, "currency_format": "UGX", "charge_currency_format": "USD", "amount": "184,285", "transaction_id": "47909134", "transaction_id_from_callback": null, "reference_id_from_callback": null, "financial_instrument_id": 77, "financial_instrument_no": "IN11267", "names": "Junior Developer", "phone": null, "bank_account": null, "bank_name": null, "bank_branch": null, "balance": "1843715.3383", "charge": "1", "transaction_status": "Processed", "payment_reason": "Invoice payment", "paid_to": "Senior Developer", "paid_by": "Junior Developer", "paid_to_company_id": 11, "paid_by_company_id": 3, "paid_to_merchant_code": "M871054", "paid_by_merchant_code": "M528092", "charge_bearer": null, "exchange_rate": 3686, "send_receipt": true, "transaction_type": "wallet payment", "type": "wallet", "created_at": { "date": "2019-06-24 23:56:00.000000", "timezone_type": 3, "timezone": "UTC" } }, { "id": 62, "currency_format": "UGX", "charge_currency_format": "UGX", "amount": "5,000", "transaction_id": "61704372", "transaction_id_from_callback": null, "reference_id_from_callback": null, "financial_instrument_id": "", "financial_instrument_no": "", "names": "Senior Developer", "phone": null, "bank_account": null, "bank_name": null, "bank_branch": null, "balance": "0", "charge": "500", "transaction_status": "Processed", "payment_reason": "Testing", "paid_to": "Senior Developer", "paid_by": "Junior Developer", "paid_to_company_id": 11, "paid_by_company_id": 3, "paid_to_merchant_code": "M492753", "paid_by_merchant_code": "M871054", "charge_bearer": null, "exchange_rate": null, "send_receipt": false, "transaction_type": "wallet payment", "type": "wallet", "created_at": { "date": "2019-06-24 23:53:00.000000", "timezone_type": 3, "timezone": "UTC" } }, ]

Below are the fields required by the API

Field Type Required Description
type text Yes This is the type of transactions for example "all" , "mobile" ,"wallet" ,"bank"
skip number No This is number of items that should be skipped but default is 0
take number Yes This is number of items that should be fetched per request but default is 10.
search number No This is search query.
from_date date No This is date from where you want to start the filtering of results.
to_date date No This is date from where you want to end the filtering of results.

List Company Mobile Transactions

This section will take you through the steps for fetching company's mobile money transaction on Patasente API.

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-all-transactions/{type}/transaction?

The parameters that should be sent to this endpoint are "skip" , "take" .To limit the number of results returned from the query, or to skip a given number of results in the query, you may skip and take a given number of results. This also helps in pagination. "search" , "from_date" , "to_date" .A json response with the wallet balance will be returned

https://demo.patasente.com/phantom-api/get-all-transactions/mobile/ transaction?skip=0&take=10&search=patasente&from_date=2019-02-07&to_date=2019-06-05&

[ {"id":5609, "currency_format":"UGX", "charge_currency_format":"UGX", "amount":"40,000", "transaction_id":"31859951", "transaction_id_from_callback":"3856855", "reference_id_from_callback":"29062065944", "financial_instrument_id":"", "financial_instrument_no":"", "names":"Brian Ssekalegga", "phone":"256704898421", "bank_account":null,"bank_name":null, "bank_branch":null, "balance":"0", "charge":"1,000", "transaction_status":"Processed", "payment_reason":"GOTV payment", "paid_to":"", "paid_by":"Ssekalegga Brian", "paid_to_merchant_code":"", "paid_by_merchant_code":"M207163", "charge_bearer":null, "exchange_rate":null, "send_receipt":false, "transaction_type":"mobile payment", "type":"mobile", "created_at": { "date":"2019-07-13 15:33:25.000000", "timezone_type":3, "timezone":"UTC"} }, {"id":5608, "currency_format":"UGX", "charge_currency_format":"UGX", "amount":"1,000", "transaction_id":"56422089", "transaction_id_from_callback":null, "reference_id_from_callback":null, "financial_instrument_id":"", "financial_instrument_no":"", "names":"Ssekalegga Brian", "phone":"256704898421", "bank_account":null, "bank_name":null, "bank_branch":null, "balance":"charges", "charge":"0", "transaction_status":"Processed", "payment_reason":"Transaction charge", "paid_to":"Charges", "paid_by":"Ssekalegga Brian", "paid_to_merchant_code":"M673079", "paid_by_merchant_code":"M207163", "charge_bearer":null, "exchange_rate":null, "send_receipt":false, "transaction_type":"mobile payment", "type":"mobile", "created_at":{ "date":"2019-07-13 15:33:25.000000", "timezone_type":3, "timezone":"UTC" } } ]

Below are the fields required by the API

Field Type Required Description
type text Yes This is the type of transactions for example "all" , "mobile" ,"wallet" ,"bank"
skip number No This is number of items that should be skipped but default is 0
take number Yes This is number of items that should be fetched per request but default is 10.
search number No This is search query.
from_date date No This is date from where you want to start the filtering of results.
to_date date No This is date from where you want to end the filtering of results.

List Company Bank Transactions

This section will take you through the steps for fetching company's bank transaction on Patasente API.

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-all-transactions/{type}/transaction?

The parameters that should be sent to this endpoint are "skip" , "take" .To limit the number of results returned from the query, or to skip a given number of results in the query, you may skip and take a given number of results. This also helps in pagination. "search" , "from_date" , "to_date" .A json response with the wallet balance will be returned

https://demo.patasente.com/phantom-api/get-all-transactions/bank/ transaction?skip=0&take=10&search=patasente&from_date=2019-02-07&to_date=2019-06-05&

[ { "id":1932, "currency_format":"UGX", "charge_currency_format":"UGX", "amount":"80,000", "transaction_id":"16913585", "transaction_id_from_callback":"", "reference_id_from_callback":null, "financial_instrument_id":515, "financial_instrument_no":"IN773618", "names":"Bakka George William", "phone":null, "bank_account":"9030012492943", "bank_name":"Stanbic", "bank_branch":"Ntinda", "balance":"20000", "charge":"5,000", "transaction_status":"In process", "payment_reason":"Invoice payment", "paid_to":"", "paid_by":"Ssekalegga Brian", "paid_to_merchant_code":"", "paid_by_merchant_code":"M207163", "charge_bearer":"payer", "exchange_rate":null, "send_receipt":false, "transaction_type":"bank payment", "type":"bank", "created_at":{ "date":"2018-12-04 14:17:30.000000", "timezone_type":3, "timezone":"UTC" } }, { "id":61, "currency_format":"UGX", "charge_currency_format":"UGX", "amount":"17,000,000", "transaction_id":"16736847", "transaction_id_from_callback":"", "reference_id_from_callback":null, "financial_instrument_id":"", "financial_instrument_no":"", "names":"Tumwesigye Asons", "phone":null,"bank_account":"0010146105756001", "bank_name":"Eco Bank", "bank_branch":"Ndeeba", "balance":"0", "charge":"5,000", "transaction_status":"Processed", "payment_reason":"Self withdraw", "paid_to":"SuperTex", "paid_by":"Ssekalegga Brian", "paid_to_merchant_code":"M524155", "paid_by_merchant_code":"M207163", "charge_bearer":"payer", "exchange_rate":null, "send_receipt":true, "transaction_type":"bank withdraw", "type":"bank", "created_at":{ "date":"2018-08-13 00:11:44.000000", "timezone_type":3, "timezone":"UTC" } } ]

Below are the fields required by the API

Field Type Required Description
type text Yes This is the type of transactions for example "all" , "mobile" ,"wallet" ,"bank"
skip number No This is number of items that should be skipped but default is 0
take number Yes This is number of items that should be fetched per request but default is 10.
search number No This is search query.
from_date date No This is date from where you want to start the filtering of results.
to_date date No This is date from where you want to end the filtering of results.

List Payment Transfer Methods

This section will take you through the steps for fetching payment transfer method on Patasente API.

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-transfer-methods

No parameters should be sent to this endpoint. A json response with the payment transfer methods will be returned

https://demo.patasente.com/phantom-api/get-transfer-methods

[ { "id": 1, "name": "EFT", "duration": "2-3 days", "charge": "3000", "type": "bank" }, { "id": 2, "name": "RTGS", "duration": "1 day", "charge": "5000", "type": "bank" }, { "id": 3, "name": "Postmail Cheque", "duration": "5-7 days", "charge": "10000", "type": "bank" }, { "id": 4, "name": "Mobile Withdraws", "duration": "5 minutes", "charge": "1000", "type": "mobile withdraws" }, { "id": 5, "name": "Airtime", "duration": "5 minutes", "charge": "0", "type": "airtime" }, { "id": 6, "name": "Mobile Deposits", "duration": "5 minutes", "charge": "0", "type": "mobile deposits" }, { "id": 7, "name": "UGX Wallet transactions", "duration": "instant", "charge": "500", "type": "ugx" }, { "id": 8, "name": "USD Wallet transactions", "duration": "instant", "charge": "1", "type": "usd" }, { "id": 9, "name": "EUR Wallet transactions", "duration": "instant", "charge": "1", "type": "eur" } ]

List Bank Transfer Methods

This section will take you through the steps for fetching bank transfer method on Patasente API.

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-bank-transfer-methods

No parameters should be sent to this endpoint. A json response with the bank transfer methods will be returned

https://demo.patasente.com/phantom-api/get-bank-transfer-methods

[ { "id": 1, "name": "EFT", "duration": "2-3 days", "charge": "3000", "type": "bank" }, { "id": 2, "name": "RTGS", "duration": "1 day", "charge": "5000", "type": "bank" }, { "id": 3, "name": "Postmail Cheque", "duration": "5-7 days", "charge": "10000", "type": "bank" } ]

List Biller Categories

This section will take you through the steps for fetching a list of biller categories on Patasente API.

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-biller/{category}

Below are the categories that can be sent to this API endpoint

A category should be sent to this endpoint. A json response with the billers will be returned

https://demo.patasente.com/phantom-api/get-billers/Utility

[ { "billerid": 442, "billername": "NWSC", "categoryid": 8, "categoryname": "Utility" }, { "billerid": 250, "billername": "UMEME ", "categoryid": 8, "categoryname": "Utility" } ]

List Biller

This section will take you through the steps for fetching a list of biller on Patasente API.

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-billers

No parameters should be sent to this endpoint. A json response with the billers will be returned

https://demo.patasente.com/phantom-api/get-billers

[ { "billerid": 244, "billername": "Africell Data Bundles", "categoryid": 6, "categoryname": "Data" }, { "billerid": 228, "billername": "Airtel Airtime", "categoryid": 1, "categoryname": "Subscriptions" }, { "billerid": 205, "billername": "Smile Uganda", "categoryid": 1, "categoryname": "Subscriptions" }, ]

List Biller Payment Items

This section will take you through the steps for fetching a list of biller payment items on Patasente API.

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-biller-payment-items/

The parameter that should be sent to this endpoint is billerid. A json response with the payment items will be returned

https://demo.patasente.com/phantom-api/get-biller-payment-items/205

[ { "paymentitemid": 168, "paymentitemname": "Smile 3GB Data Bundle", "isAmountFixed": "1", "billerid": 205, "paymentCode": 205168, "description": "Smile 3GB Data Bundle" }, { "paymentitemid": 170, "paymentitemname": "Smile 10GB Data Bundle", "isAmountFixed": "1", "billerid": 205, "paymentCode": 205170, "description": "Smile 10GB Data Bundle" }, ]

Below are the fields required by the API

Field Type Required Description
billerid number Yes billerid from List Biller

Get a payment item

This section will take you through the steps for fetching a single payment item on Patasente API.

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-payment-item/

The parameter that should be sent to this endpoint is paymentCode. A json response with the payment item will be returned

https://demo.patasente.com/phantom-api/get-payment-item/205170

{ "paymentitemid": 396, "paymentitemname": "Africell 284900 Monthly Bundle (30 GB)", "isAmountFixed": "1", "amount": 284900, "billerid": 244, "paymentCode": 244396, "description": "Africell 284900 Monthly Bundle (30 GB)" }

Below are the fields required by the API

Field Type Required Description
paymentCode number Yes paymentCode from List Biller Payment Items

Get Transfer Method Charges

This section will take you through the steps for fetching a transfer method charge on Patasente API.

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-transfer-method-charge

The parameter that should be sent to this endpoint is the "id". A json response with the transfer method charge will be returned

https://demo.patasente.com/phantom-api/get-transfer-method-charge/3

{ "id": 7, "name": "UGX Wallet transactions", "duration": "instant", "charge": "500", "type": "ugx" }

Below are the fields required by the API

Field Type Required Description
id number Yes This is the id of the transfer method from List Payment Transfer Methods

Convert Currency

This section will take you through the steps for converting charge / amount from one currency to another on Patasente API.

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/convert-currency/{from}/{to}/{amount}

The parameter that should be sent to this endpoint is the "from" , "to" and "amount". A json response with the converted currency will be returned

https://demo.patasente.com/phantom-api/convert-currency/ugx/usd/13000

{ "result": 3.523 }

Below are the fields required by the API

Field Type Required Description
from text Yes This is the currency_symbol from Get Currencies
to text Yes This is the currency_symbol from Get Currencies
amount number Yes This is the amount that should be converted

Payment Transaction Token

This section will take you through the steps for sending a payment transaction token to user's device on Patasente API.

A payment transaction OTP token is required for any transaction that is above 100,000/=.

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/send-payment-transaction-token

No parameter should be sent to this endpoint. A json response will be returned

https://demo.patasente.com/phantom-api/send-payment-transaction-token

{ "message" => A four (6) digit code has been sent to your device }

Pay Someone

This is the section where a company makes it's payments e.g to a company's wallet ,to a bank account , to mobile money or buy airtime .

Pay to Wallet

This section will take you through the steps for making a payment to a company wallet on Patasente API.

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/wallet/save-business-transaction

The parameter that should be sent to this endpoint is the "type" , "transaction_type" , "company_id" , "reason" , "charge_bearer", " bank_method" and "amount".

https://demo.patasente.com/phantom-api/wallet/save-business-transaction ?type=wallet&transaction_type=wallet payment&amount=40000&charge_bearer=payer&company_id=5&reason=tired&bank_method=5

A json response with 200 success code will be returned

{ "success": "Your payment was successful" }

If there any errors, a json response with 400 error code will be returned

{ "error": "Your can't make payments to this account" }

Below are the fields required by the API

Field Type Required Description
company_id number Yes This is the id of the company from List of Companies
bank_method number Yes This is the id of the bank_method from List Payment Transfer Methods . The id differs for every company making a payment. If the company making the payment uses UGX currency for its wallet, then the bank_method "id" should be of "ugx" . If the company making the payment uses USD currency for its wallet, then the bank_method "id" should be of "usd" . If the company making the payment uses EUR currency for its wallet, then the bank_method "id" should be of "eur"
amount number Yes This is the amount that should be paid
reason text Yes This is a brief description of the payment
charge_bearer enum Yes This is the party that bears the charges, its must either be "payer" or "beneficiary" but the default is "payer".
transaction_type text Yes This is the transaction_type of the payment. For this case it must be "wallet payment"
type text Yes This is the type of the payment. For this case it must be "wallet"

Pay to Bank

This section will take you through the steps for making a payment to a bank account on Patasente API.

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/wallet/save-transaction

The parameter that should be sent to this endpoint is the "type" , "transaction_type" , "charge_bearer" , "reason" , " bank_method" , " account_number" , " account_name" , " bank", " branch" , " charge" ,"code" "currency" , "total" and "amount".

https://demo.patasente.com/phantom-api/wallet/save-transaction? type=bank&transaction_type=bank payment&amount=50000&charge_bearer=payer&bank_method=1 &account_number=65435623&account_name=Senior Developer&bank=Patasente Bank&branch=Kampala Road&charge=3000 ¤cy=1&reason=Miss Curvy&total=53000&code=532070

A json response with 200 success code will be returned

{ "success": "You will be notified once this transaction is complete" }

If there any errors, a json response with 400 error code will be returned

{ "error": "Your can't make payments to this account" }

Below are the fields required by the API

Field Type Required Description
currency number Yes This is the id of the currencies from List of Currencies
bank_method number Yes This is the id of the bank_method from List Bank Transfer Methods .
charge number Yes This is the charge for the transaction
charge_bearer enum Yes This is the party that bears the charges, its must either be "payer" or "beneficiary" but the default is "payer".
amount number Yes This is the amount that should be paid
total number Yes This is the total of amount and the charge
reason text Yes This is a brief description of the payment
transaction_type text Yes This is the transaction_type of the payment. For this case it must be "bank payment"
type text Yes This is the type of the payment. For this case it must be "bank"
account_number number Yes This is the bank account number that should receive the payment
account_name text Yes This is the name of the bank account
bank text Yes This is the name of the bank
branch text Yes This is the branch of the bank account
code number No This is required for any transaction more than 100,000/=

Pay to Phone

This section will take you through the steps for making a mobile money payment on Patasente API.

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/wallet/pay-someone-mobile-money-transaction

The parameter that should be sent to this endpoint is the "type" , "transaction_type", "reason" , " first_name" , "charge_bearer" , "last_name" , "phone" , "code" and "amount".

https://demo.patasente.com/phantom-api/wallet/pay-someone-mobile-money-transaction? type=mobile&transaction_type=mobile payment&amount=4000&first_name=Senior &last_name=Developer&phone=256770000077&charge_bearer=payer&reason=Testing mobile money&code=394943

A json response with 200 success code will be returned

{ "success": "Your payment will be complete in less than 5 minutes" }

If there any errors, a json response with 400 error code will be returned

{ "error": "Your can't make payments to this account" }

Below are the fields required by the API

Field Type Required Description
amount number Yes This is the amount that should be paid
reason text Yes This is a brief description of the payment
transaction_type text Yes This is the transaction_type of the payment. For this case it must be "mobile payment"
type text Yes This is the type of the payment. For this case it must be "mobile"
charge_bearer enum Yes This is the party that bears the charges, its must either be "payer" or "beneficiary" but the default is "payer".
phone number Yes This the registered mobile money phone number and it should be in international format without plus (+) sign
first_name text Yes This is the registered first name of the phone number by the Telecom company
last_name text Yes This is the registered last or other name(s) of the phone number by the Telecom company
code number No This is required for any transaction more than 100,000/=

Buy airtime

This section will take you through the steps for buying a mobile phone airtime on Patasente API.

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/wallet/save-business-transaction

The parameter that should be sent to this endpoint is the "type" , "transaction_type", "reason" , " first_name" , "last_name" , "phone" ,"code" and "amount".

https://demo.patasente.com/phantom-api/wallet/save-business-transaction? type=mobile&transaction_type=airtime purchase&amount=4000&first_name=Senior &last_name=Developer&phone=256770000077&code=203943

A json response with 200 success code will be returned

{ "success": "Your payment will be complete in less than 5 minutes" }

If there any errors, a json response with 400 error code will be returned

{ "error": "You can't perform this action at this moment" }

Below are the fields required by the API

Field Type Required Description
amount number Yes This is the amount that should be paid
transaction_type text Yes This is the transaction_type of the payment. For this case it must be "airtime purchase"
type text Yes This is the type of the payment. For this case it must be "mobile"
phone number Yes This the registered mobile money phone number and it should be in international format without plus (+) sign
first_name text Yes This is the registered first name of the phone number by the Telecom company
last_name text Yes This is the registered last or other name(s) of the phone number by the Telecom company
code number No This is required for any transaction more than 100,000/=

Pay Bills

This section will take you through the steps for paying bills on Patasente API.

Two (2) requests should be made to this API endpoint , one request will be for validating a user's / customer's phone/account number and the other request is for posting the transaction request

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/wallet/validate-customer/

The parameter that should be sent to this endpoint is the "paymentCode" , "customer_id" and "amount".

https://demo.patasente.com/phantom-api/wallet/validate-customer/246803/0700000077/8000

A json response with 200 success code will be returned

{ "comment for you developer": "Here show success color like green to indicate that customer_id validation is successful", "validation_message": "Valid", "validation_results": true, "is_amount_fixed": true, "is_amount_fixed_message": "Bill Amount to be paid is fixed", "customerName": "------- -------", //a name is returned or dashes are returned "isAmountFixed": "0", "surcharge ": 0, "isAmountFixed === 1": "0", "amount": 8000, "comment when to developer amount fixed": "Disable editing the AMOUNT input field and fill it with the amount returned", "isAmountFixed === 0": "0", "comment when amount fixed": "Enable editing the AMOUNT input field for user to fill desired amount", "second comment for developer": "Set the is_amount_fixed_message to empty", "charge": 200 }

If there any errors, a json response with 400 error code will be returned

{ "comment for you developer": "Here show error color like red to indicate that customer_id validation failed", "validation_message": "Invalid", "validation_results": true, "is_amount_fixed": false, "is_amount_fixed_message": "", "customerName": "UN RECOGNIZABLE CUSTOMER NUMBER OR TRY AGAIN LATER" }

Below are the fields required by the API

Field Type Required Description
amount number Yes This is the amount that should be paid
payment_code text Yes This is the payment_code of the payment.
customer_id text Yes This is the service account number or phone number.

A second request should be made to send a payment upon successful validation of paymentCode, customer_id and amount from the first request.

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/wallet/save-bill-transaction

The parameters that should be sent to this endpoint are "amount" , "charge_bearer" ,"total" ,"charge" ,"currency" ,"reason" ,"customer_id" , "phone" , "type" , "transaction_type" , "biller_id" ,"payment_code" ,"balance"

https://demo.patasente.com/phantom-api/wallet/save-bill-transaction?type=mobile&transaction_type=bill payment&amount=8000&customer_id=0772993993 &payment_code=151301&phone=256770000077&charge_bearer=payer&reason=Testing bill payments&balance=0&total=8200&charge=200

.A json response with 200 success code will be returned

{ "success": "Iour payment will be complete in less than 5 minutes" }

If there any errors, a json response with 400 error code will be returned

{ "error": "Your can't make payments to this account" }

Below are the fields required by the API

Field Type Required Description
reason text Yes This is the description of the service a user wants to pay
transaction_type text Yes This is the transaction_type of the payment. For this case it must be "bill payment"
type text Yes This is the type of the payment. For this case it must be "mobile"
charge_bearer enum Yes This is the party that bears the charges, its must either be "payer" or "beneficiary" but the default is "payer".
phone number Yes This the registered mobile money phone number and it should be in international format without plus (+) sign
biller_id number Yes This is the id of the biller from List of Billers
code number No This is required for any transaction more than 100,000/=

Pay Invoice through Wallet

This section will take you through the steps for making an invoice payment through Wallet transfer on Patasente API.

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/wallet/save-invoice-wallet-transaction

The parameter that should be sent to this endpoint is the "type" , "transaction_type" , "company_id" , "reason" , "charge_bearer", "charge", " bank_method" , "financial_instrument_id" ,"code" and "amount".

https://demo.patasente.com/phantom-api/wallet/save-invoice-wallet-transaction ?type=wallet&transaction_type=wallet payment&charge=500& amount=40000& charge_bearer=payer&company_id=5 &financial_instrument_id=4567&reason=invoice payment&bank_method=5&code=429482

A json response with 200 success code will be returned

{ "success": "Your payment was successful" }

If there any errors, a json response with 400 error code will be returned

{ "error": "Your can't make payments to this account" }

Below are the fields required by the API

Field Type Required Description
company_id number Yes This is the id of the company from List of Companies
bank_method number Yes This is the id of the bank_method from List Payment Transfer Methods . The id differs for every company making a payment. If the company making the payment uses UGX currency for its wallet, then the bank_method "id" should be of "ugx" . If the company making the payment uses USD currency for its wallet, then the bank_method "id" should be of "usd" . If the company making the payment uses EUR currency for its wallet, then the bank_method "id" should be of "eur"
amount number Yes This is the amount that should be paid
financial_instrument_id number Yes This is the id of the invoice
reason text Yes This is a brief description of the payment and thie should be invoice payment
charge_bearer enum Yes This is the party that bears the charges, its must either be "payer" or "beneficiary" but the default is "payer".
charge number Yes This is the charge for the transaction.
transaction_type text Yes This is the transaction_type of the payment. For this case it must be "wallet payment"
type text Yes This is the type of the payment. For this case it must be "wallet"
code number No This is required for any transaction more than 100,000/=

Wallet Deposit

This is the section where a company makes it's deposits to their wallet .

By Bank

This section will take you through the steps for making a deposit to a company wallet through bank account on Patasente API.

NOTICE

Before doing a Bank deposit, A physical deposit to Patasente Limited Bank Account must be made by the company, then return to the Platform and enter the information on your deposit slip and also upload an image / picture of the deposit slip.

Here is Patasente Banking Information

Bank Name : Stanbic Bank Uganda

Bank Branch: Ntinda

Account Name : Patasente Limited

USD Account : 9030013428866

UGX Account : 9030013428858

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/wallet/save-business-transaction

The parameter that should be sent to this endpoint is the "type" , "transaction_type" , "account_number" , "account_name" , "bank", " branch" , "attachment" , "currency" , "deposit_date" and "amount_deposited".

https://demo.patasente.com/phantom-api/wallet/save-business-transaction? type=bank&transaction_type=bank deposit&account_number=6859430&branch=Kiwatule¤cy=1 &bank=Patasente&amount_deposited=50000&account_name=core&attachment=hifndin&deposit_date=2019-07-31 &attachment=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAqQAAAJaCAIAAAB2vMKXAAAA AXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwdwjr+9vzrVrzIzt2X+SlhO9eIa HwCeYtgDwOUMewC4WmsdAuLQMiKK2zcAAAAASUVORK5CYII=AAAqQAAAJaCAIAAAB2 vMKXAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwdw

A json response with 200 success code will be returned

{ "success": "Your wallet will be credited once we receive your deposit in Patasente Bank Account" }

If there any errors, a json response with 400 error code will be returned

{ "error": "Your can't make this deposit to this account" }

Below are the fields required by the API

Field Type Required Description
currency number Yes This is the id of the currencies from List of Currencies
amount_deposited number Yes This is the amount that should be paid
deposit_date date Yes This is the date when the bank deposit was made
attachment longText Yes This is the image of the deposit slip that was issued by the bank when making a deposit to Patasente Bank Account. A base64 version of the picture/image should be uploaded.
transaction_type text Yes This is the transaction_type of the payment. For this case it must be "bank deposit"
type text Yes This is the type of the payment. For this case it must be "bank"
account_number number Yes This is the bank account number that should receive the payment
account_name text Yes This is the name of the bank account
bank text Yes This is the name of the bank
branch text Yes This is the branch of the bank account

By Mobile Money

This section will take you through the steps for making a mobile money deposit on Patasente API.

if a user selects a phone network with mobile_money_company_id 1 / MTN Uganda or mobile_money_company_id 2 / Airtel Uganda, instructions on how to receive a secret code ( transaction code as referred to by MTN Uganda deposits on Patasente ) should display.

For Airtel Uganda a user has to initiate a cash withdraw and then enter the secret code and amount in the fields above.

A user has to request a transaction code through Patasente App and then enter it.

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/send-transaction-token/

A phone number should be sent to this endpoint.

https://demo.patasente.com/phantom-api/send-transaction-token/2567828000000

A json response with 200 success code will be returned

{ "success": "A four (6) digit code has been sent to 256780000000" }

If there any errors, a json response with 400 error code will be returned

{ "error": "Phone should begin with a country code like 25677 or 25678" }

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/wallet/save-mobile-deposit-transaction

The parameters that should be sent to this endpoint is the "type" , "transaction_type", "phone", "transaction_code" ,"secret_code" ,"mobile_money_company_id" and "amount".

https://demo.patasente.com/phantom-api/wallet/save-mobile-deposit-transaction?transaction_type=mobiledeposit& type=mobile&amount=2000&phone=2567828000000&secret_code=123456&transaction_code=123456&mobile_money_company_id=2

A json response with 200 success code will be returned

{ "success": "Your payment will be complete in less than 5 minutes" }

If there any errors, a json response with 400 error code will be returned

{ "error": "Your can't make payments to this account" }

Below are the fields required by the API

.
Field Type Required Description
transaction_type text Yes This is the transaction_type of the deposit. For this case it must be "mobile deposit"
type text Yes This is the type of the deposit. For this case it must be "mobile"
phone number Yes This the registered mobile money phone number and it should be in international format without plus (+) sign
amount number Yes This is the amount that should be deposited
transaction_code number Yes This is a a 6 (six) digit transaction code issued by Patasente on all deposits
secret_code number No This is a 6 (six) digit secret code issued by Airtel Uganda during Cash Withdraw that should be deposited.
mobile_money_company_id number Yes This is the id of the phone network from List of Phone Networks .

Wallet Withdraw

This is the section where a company makes it's withdraws from their wallet.

By Bank

This section will take you through the steps for making a wallet withdraw through a bank account on Patasente API.

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/wallet/save-transaction

The parameter that should be sent to this endpoint is the "type" , "transaction_type" , "bank_method" "bank_id" , "charge" ,"currency" ,"code" , "total" and "amount".

https://demo.patasente.com/phantom-api/wallet/save-transaction? type=bank&transaction_type=bank withdraw&amount=50000&bank_method=1&bank_id=5 &charge=3000¤cy=1&total=53000&code=053010

A json response with 200 success code will be returned

{ "success": "You will be notified once this transaction is complete" }

If there any errors, a json response with 400 error code will be returned

{ "error": "You don't have enough money in your wallet ,Refresh page and try again" }

Below are the fields required by the API

Field Type Required Description
currency number Yes This is the id of the currencies from List of Currencies
bank_method number Yes This is the id of the bank_method from List Bank Transfer Methods .
charge number Yes This is the charge for the transaction
amount number Yes This is the amount that should be paid
total number Yes This is the total of amount and the charge
transaction_type text Yes This is the transaction_type of the payment. For this case it must be "bank withdraw"
type text Yes This is the type of the payment. For this case it must be "bank"
bank_id number Yes This is the id of the bank from List of Banks .
code number No This is required for any transaction more than 100,000/=

By Mobile Money

This section will take you through the steps for making a wallet withdraw through mobile money on Patasente API.

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/wallet/withdraw-mobile-money-transaction

The parameter that should be sent to this endpoint is the "type" , "transaction_type", "phone_id" ,"code" and "amount".

https://demo.patasente.com/phantom-api/wallet/withdraw-mobile-money-transaction? type=mobile&transaction_type=mobile withdraw&amount=4000&phone_id=2&phone_id=233002

A json response with 200 success code will be returned

{ "success": "Your payment will be complete in less than 5 minutes" }

If there any errors, a json response with 400 error code will be returned

{ "error": "Your can't make payments to this account" }

Below are the fields required by the API

Field Type Required Description
amount number Yes This is the amount that should be withdrawn
transaction_type text Yes This is the transaction_type of the payment. For this case it must be "mobile withdraw"
type text Yes This is the type of the payment. For this case it must be "mobile"
phone_id number Yes This is the id of the mobile money phone number from List Mobile Money Numbers .
code number No This is required for any transaction more than 100,000/=

financial instruments

This is the section where a company manages it's financial instruments.

Purchase Orders

This is the section where a company manages it's purchase orders.

List company purchase orders

This section will take you through the steps for fetching a company's purchase orders on Patasente API.

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-all-my-purchase-order/order?

The parameters that should be sent to this endpoint are "skip" , "take" .To limit the number of results returned from the query, or to skip a given number of results in the query, you may skip and take a given number of results. This also helps in pagination. "search" , "from_date" , "to_date" .A json response with a list of purchase orders will be returned

https://demo.patasente.com/phantom-api/get-all-my-purchase-order/order?skip=0& take=10&search=patasente&from_date=2019-02-07&to_date=2019-06-05&

[ { "from_merchant_code": "M433240", "to_merchant_code": "M906857", "to_email": "chris@gmail.com", "to_phone": null, "logged_id": 2, "id": 2, "generated_instrument_no": "PO701693", "user_id": 2, "quotation_no": null, "from_company_id": 2, "to_company_id": 3, "from_name": "YYYY", "from_billing_address": " ", "to_billing_address": " ", "vat": "0", "validity_period": "10", "to_name": "Sheldon Brenda", "terms_and_conditions": "Najjanankumbi", "grand_total": "58,500", "type": "purchase-order", "delivery_method": "To be delivered", "delivery_status": "Pending", "status": 0, "currency_id": 2, "currency_format": "USD", "created_at": { "date": "2020-03-23 07:18:50.000000", "timezone_type": 3, "timezone": "UTC" }, "updated_at": { "date": "2020-03-23 07:18:50.000000", "timezone_type": 3, "timezone": "UTC" }, "receiver_finance_request_status": 0, "sender_finance_request_status": 0, "to_email_address": null }, /...../ ]

Below are the fields required by the API

Field Type Required Description
skip number No This is number of items that should be skipped but default is 0
take number Yes This is number of items that should be fetched per request but default is 10.
search number No This is search query.
from_date date No This is date from where you want to start the filtering of results.
to_date date No This is date from where you want to end the filtering of results.

List purchase orders for delivery

This section will take you through the steps for fetching purchase orders for delivery on Patasente API.

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/purchase-orders/get-purchase-orders-for-delivery/order?

The parameters that should be sent to this endpoint are "skip" , "take" .To limit the number of results returned from the query, or to skip a given number of results in the query, you may skip and take a given number of results. This also helps in pagination. "search" , "from_date" , "to_date" .A json response with a list of purchase orders will be returned

https://demo.patasente.com/phantom-api/purchase-orders/get-purchase-orders-for-delivery/order?skip=0& take=10&search=patasente&from_date=2019-02-07&to_date=2019-06-05&

[ { "from_merchant_code": "M433240", "to_merchant_code": "M906857", "to_email": "chris@gmail.com", "to_phone": null, "logged_id": 2, "id": 2, "generated_instrument_no": "PO701693", "user_id": 2, "quotation_no": null, "from_company_id": 2, "to_company_id": 3, "from_name": "YYYY", "from_billing_address": " ", "to_billing_address": " ", "vat": "0", "validity_period": "10", "to_name": "Sheldon Brenda", "terms_and_conditions": "Najjanankumbi", "grand_total": "58,500", "type": "purchase-order", "delivery_method": "To be delivered", "delivery_status": "Pending", "status": 0, "currency_id": 2, "currency_format": "USD", "created_at": { "date": "2020-03-23 07:18:50.000000", "timezone_type": 3, "timezone": "UTC" }, "updated_at": { "date": "2020-03-23 07:18:50.000000", "timezone_type": 3, "timezone": "UTC" }, "receiver_finance_request_status": 0, "sender_finance_request_status": 0, "to_email_address": null }, /...../ ]

Below are the fields required by the API

Field Type Required Description
skip number No This is number of items that should be skipped but default is 0
take number Yes This is number of items that should be fetched per request but default is 10.
search number No This is search query.
from_date date No This is date from where you want to start the filtering of results.
to_date date No This is date from where you want to end the filtering of results.

Get a single purchase order

This section will take you through the steps for fetching a company's purchase order on Patasente API.

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-purchase-order/

The parameters that should be sent to this endpoint are "id" , "generated_instrument_no" .A json response with a purchase orderwill be returned

https://demo.patasente.com/phantom-api/get-purchase-order/23/PO408802

{ "purchase_order": { "id": 2, "to_merchant_code": "M906857", "to_email": "chris@gmail.com", "to_phone": null, "from_merchant_code": "M433240", "generated_instrument_no": "PO701693", "user_id": 2, "proforma_invoice_no": null, "from_company_id": 2, "from_phone": null, "from_company_logo": "http://localhost:8000/image-missing.png", "to_company_id": 3, "to_company_logo": "http://localhost:8000/image-missing.png", "from_name": "YYYY", "from_email": "ssekalegga@gmail.com", "from_address": " ", "to_address": " ", "vat": "0", "item_id": null, "after_pay_terms": 0, "validity_period": "10", "to_name": "Sheldon Brenda", "quotation_no": null, "terms_and_conditions": "Najjanankumbi", "grand_total": "58,500", "sub_total": "58,500", "purchase_order_total": "58500", "type": "purchase-order", "delivery_method": "To be delivered", "delivery_status": "Pending", "reason": null, "status": 0, "currency_id": 2, "currency_format": "USD", "created_at": { "date": "2020-03-23 07:18:50.000000", "timezone_type": 3, "timezone": "UTC" }, "updated_at": { "date": "2020-03-23 07:18:50.000000", "timezone_type": 3, "timezone": "UTC" } }, "items": [ { "id": 2, "item": "maple syrup", "price": "450", "qty": "130", "unit_measure": "Litres", "created_at": { "date": "2020-03-23 07:18:50.000000", "timezone_type": 3, "timezone": "UTC" }, "updated_at": { "date": "2020-03-23 07:18:50.000000", "timezone_type": 3, "timezone": "UTC" } } ], "invoice_exists": null, "delivery_note_exists": null, "credit_score": { "Credit Score": 0, "": 100 } }

Below are the fields required by the API

Field Type Required Description
id number Yes This is the id of the purchase order e.g 1
generated_instrument_no string Yes This is generated unique number of the purchase order e.g PO055367.

Save a Purchase Order

This section will take you through the steps for saving or sending a Purchase Order on Patasente API.

Two (2) requests should be made to this API endpoint , one request will be saving Purchase Order items and the other request is for saving other Purchase Order information for example to_company_id , due_date , currency_id etc

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/save-purchase-order-information/

The parameters that should be sent to this endpoint are "company_id" , "currency_id" ,"attachment" ,"vat", "to_name","terms","address","to_email_address","purchase_order_no","validity_period", "sub_total","grand_total".

A json response with the "id" and the "generated_instrument_no" of the Purchase Order will be returned

{ "success": "Purchase Order created" ,"created" : true ,"id" :232 , "generated_instrument_no" : "PO43234" }

If there any errors, a json response with 400 error code will be returned

{ "error": "Your Purchase Order wasn't created" }

A second request should be made to save purchase order items upon return of the invoice id from the first request.

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/save-invoice-items/

The parameters that should be sent to this endpoint are "invoice_id" , "products".products is an array of invoice items and the array objects are "total" ,"qty" ,"price" ,"unit_measure" ,"item"

.A json response with the "id" and the "generated_instrument_no" of the Purchase Order will be returned upon saving the Purchase Order items

{ "success": "Purchase Order sent" ,"created" : true ,"id" :232 , "generated_instrument_no" : "PO43234" }

If there any errors, a json response with 400 error code will be returned

{ "error": "Your Purchase Order wasn't sent" }

Below are the fields required by the API

Field Type Required Description
company_id number No This is the id of the company from List of companies. Thia field is optional in case an Purchase Order is being sent to a company which is not registered on Patasente
currency_id number Yes This is id of the currency from List of currencies.
attachment string No This is the attachment sent along with the Purchase Order , it can be a doc , pdf , img but in base64 format
quotation_no number No This is quotation no of the attached quotationr
validity_period number Yes This is validity period of the purchase order and it should be in days.
vat number Yes This is vat rate / tax rate , The default is 0
sub_total number Yes This is sub total of the Purchase Order items
grand_total number Yes This is grand total of the Purchase Order value
to_name text No This is the name of the company receiving the Purchase Order in case the company isn't registered on Patasente.
to_phone number No This is the phone of the company receiving the Purchase Order in case the company isn't registered on Patasente.
address text No This is the address of the company receiving the Purchase Order in case the company isn't registered on Patasente.
to_email_address text No This is the email address of the company receiving the Purchase Order in case the company isn't registered on Patasente.
delivery_method text Yes This is the delivery method of the e Purchase Order.Delivery method should either be "to be delivered" or "pack for pick up"
terms string Yes These are the terms and conditions for the Purchase Order.
Purchase Order Items
item text Yes This is name the item
qty number Yes This is quantity of the items
price number Yes This is the unit price of the item
unit_measure number Yes This is the id of unit measure from the List of unit measure
total number Yes This is the total price of the item

Update a purchase order

This section will take you through the steps for updating a purchase order on Patasente API.

Two (2) requests should be made to this API endpoint , one request will be saving purchase order items and the other request is for saving other purchase order information for example vat ,terms , validity_period , currency_id etc

A PUT request should be made to this API endpoint

https://demo.patasente.com/phantom-api/update-purchase-order-information/purchase_order_id/generated_instrument_no

The parameters that should be sent to this endpoint are "currency_id" ,"vat", "terms","quotation_no","due_date","sub_total","grand_total".

https://demo.patasente.com/phantom-api/update-purchase-order-information/23/PO4345?currency_id=3&terms=new terms and conditions

A json response with the "id" and the "generated_instrument_no" of the purcahse order will be returned

{ "success": "Purchase Order updated" ,"updated" : true ,"id" :232 , "generated_instrument_no" : "PO43234" }

If there any errors, a json response with 400 error code will be returned

{ "error": "Purchase order not found" }

A second request should be made to save invoice items upon return of the purchase order id from the first request.

A PUT request should be made to this API endpoint

https://demo.patasente.com/phantom-api/update-purchase-order-items/purchase_order_id

The parameters that should be sent to this endpoint are "invoice_id" , "products".products is an array of invoice items and the array objects are "total" ,"qty" ,"price" ,"unit_measure" ,"item"

https://demo.patasente.com/phantom-api/update-purchase-order-items/23?products_array

.A json response with the "id" and the "generated_instrument_no" of the invoice will be returned upon updating the invoice items

{ "success": "Purchase Order updated" ,"updated" : true ,"id" :232 , "generated_instrument_no" : "PO43234" }

If there any errors, a json response with 400 error code will be returned

{ "error": "Purchase Order not found" }

Below are the fields required by the API

Field Type Required Description
invoice_id number Yes This is id of the purchase orders from List of compnay purchase orders.
generated_instrument_no number Yes This is id of the generated_instrument_no from List of compnay purchase orders.
currency_id number Yes This is id of the currency from List of currencies.
quotation_no number No This is quotation no of the attached quotation
vat number Yes This is vat rate / tax rate , The default ifs 0
sub_total number Yes This is sub total of the purchase order items
grand_total number Yes This is grand total of the purchase order value
to_name text No This is the name of the company receiving the purchase order in case the company isn't registered on Patasente.
validity_period number yes This is the validity period of a purchase order.
to_phone number No This is the phone of the company receiving the Purchase Order in case the company isn't registered on Patasente.
address text No This is the address of the company receiving the purchase order in case the company isn't registered on Patasente.
to_email_address text No This is the email address of the company receiving the purchase order in case the company isn't registered on Patasente.
terms string Yes These are the terms and conditions for the invoice.
delivery_method string Yes This is the delivery method of the e Purchase Order.Delivery method should either be "to be delivered" or "pack for pick up"
Invoice Items
item text Yes This is name the item
qty number Yes This is quantity of the items
price number Yes This is the unit price of the item
unit_measure number Yes This is the id of unit measure from the List of unit measure
total number Yes This is the total price of the item

invoices

This is the section where a company manages it's invoices.

List company invoices

This section will take you through the steps for fetching a company's invoices on Patasente API.

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-all-my-invoices/invoice?

The parameters that should be sent to this endpoint are "skip" , "take" .To limit the number of results returned from the query, or to skip a given number of results in the query, you may skip and take a given number of results. This also helps in pagination. "search" , "from_date" , "to_date" .A json response with a list of invoices will be returned

https://demo.patasente.com/phantom-api/get-all-my-invoices/invoice?skip=0& take=10&search=patasente&from_date=2019-02-07&to_date=2019-06-05&

[ { "from_merchant_code": "M492753", "to_merchant_code": "M871054", "logged_id": 3, "id": 97, "generated_instrument_no": "IN055367", "user_id": 3, "from_company_id": 11, "to_company_id": 3, "from_name": "lebronb23@gmail.com", "from_billing_address": "Masaka", "to_billing_address": "2 Armel Court Albion Road, 114", "to_email_address": null, "vat": "0", "due_date": { "date": "2019-07-03 00:00:00.000000", "timezone_type": 3, "timezone": "UTC" }, "to_name": "YYYY", "terms_and_conditions": "You have a balance of 0,Thank you.", "grand_total": "640,000", "grandtotal": "640000", "type": "supply-invoice", "currency_id": 1, "currency_format": "UGX", "current_date": "2019-08-21", "created_at": { "date": "2019-06-25 23:52:47.000000", "timezone_type": 3, "timezone": "UTC" }, "updated_at": { "date": "2019-06-25 23:52:47.000000", "timezone_type": 3, "timezone": "UTC" }, "status": 0, "payment_status": 0, "receiver_finance_request_status": 0, "sender_finance_request_status": 0, "can_request_early_payment": false, "can_request_factor_payment": "factor payment was requested by the supplier" "purchase_order_no": null }, /...../ ]

Below are the fields required by the API

Field Type Required Description
skip number No This is number of items that should be skipped but default is 0
take number Yes This is number of items that should be fetched per request but default is 10.
search number No This is search query.
from_date date No This is date from where you want to start the filtering of results.
to_date date No This is date from where you want to end the filtering of results.

List company supplier early invoices

This section will take you through the steps for fetching a company's supplier early invoices on Patasente API.

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-all-supplier-early-invoices/invoice?

The parameters that should be sent to this endpoint are "skip" , "take" .To limit the number of results returned from the query, or to skip a given number of results in the query, you may skip and take a given number of results. This also helps in pagination. "search" , "from_date" , "to_date" .A json response with a list of invoices will be returned

https://demo.patasente.com/phantom-api/get-all-supplier-early-invoices/invoice?skip=0& take=10&search=patasente&from_date=2019-02-07&to_date=165&

[ { "from_merchant_code": "M186436", "to_merchant_code": "M551473", "id": 1327, "generated_instrument_no": "IN568991", "user_id": 116, "file_attachment_no": null, "from_company_id": 116, "to_company_id": 67, "from_name": "George Bakka", "from_billing_address": "Bulindo, Kira", "to_billing_address": "Rubaga, Kampala", "vat": "0", "expiry_date": null, "purchase_order_no": "PO295416", "due_date": { "date": "2019-07-05 00:00:00.000000", "timezone_type": 3, "timezone": "UTC" }, "to_name": "RealAvant", "terms_and_conditions": " Important", "grand_total": "7,752,600", "grand_total2": "7752600", "type": "early-payment", "currency_id": 1, "currency_format": "UGX", "created_at": { "date": "2019-07-05 10:20:50.000000", "timezone_type": 3, "timezone": "UTC" }, "current_date": "2019-08-29", "updated_at": { "date": "2019-07-05 10:20:50.000000", "timezone_type": 3, "timezone": "UTC" }, "status": 0, "payment_status": 0, "receiver_finance_request_status": 0, "sender_finance_request_status": 0 }, /...../ ]

Below are the fields required by the API

Field Type Required Description
skip number No This is number of items that should be skipped but default is 0
take number Yes This is number of items that should be fetched per request but default is 10.
search number No This is search query.
from_date date No This is date from where you want to start the filtering of results.
to_date date No This is date from where you want to end the filtering of results.

Get a single invoice

This section will take you through the steps for fetching a company's invoice on Patasente API.

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-invoice/

The parameters that should be sent to this endpoint are "id" , "generated_instrument_no" .A json response with a list of invoices will be returned

https://demo.patasente.com/phantom-api/get-invoice/23/IN408802

{ "invoice": { "id": 1421, "generated_instrument_no": "IN408802", "user_id": 88, "to_merchant_code": "M958546", "to_email": "Developer@develop.com", "to_phone": "+256700000000", "from_phone": "+25640000000", "from_merchant_code": "M6308237", "purchase_order_no": null, "check_po": false, "from_company_id": 88, "to_company_id": 2071, "from_name": "Patasente", "from_email": "patasente@patasente.com", "from_address": "Plot 1674, Valley Curve. Ntinda", "to_address": "kampala", "vat": "0", "status": 1, "to_name": "Co limited", "attachment": null, "terms_and_conditions": "Pay on time", "invoice_total": "14008000", "grand_total": "14,008,000", "grandtotal": "14008000", "sub_total": "14,008,000", "type": "factored-invoice", "due_date": { "date": "2019-07-30 00:00:00.000000", "timezone_type": 3, "timezone": "UTC" }, "currency_id": 1, "currency_format": "UGX", "current_date": "2019-08-29", "created_at": { "date": "2019-07-15 15:51:24.000000", "timezone_type": 3, "timezone": "UTC" }, "updated_at": { "date": "2019-07-15 16:48:59.000000", "timezone_type": 3, "timezone": "UTC" }, "editable": 1, "financial_note_no": 655, "payment_status": 0, "receiver_finance_request_status": 0, "sender_finance_request_status": 0, "can_request_early_payment": false, "can_request_factor_payment": "factor payment was requested by the supplier" "to_company_logo": "https://demo.patasente.com/image-missing.png", "from_company_logo": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA2MAAAGhCAYAAADsjmyfAAAACXBIWXMAAC4jAAAuI wF4pT92AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAHdFJREFUeNrs3U1220a6BmD4Hs/lXoGYFUgZZ2BmBWavwMwK=" }, "items": [ { "id": 2231, "item": "Factored Invoice repayment", "price": "14008000", "qty": "1", "unit_measure": "None", "created_at": { "date": "2019-07-15 15:51:24.000000", "timezone_type": 3, "timezone": "UTC" }, "updated_at": { "date": "2019-07-15 15:51:24.000000", "timezone_type": 3, "timezone": "UTC" } } ] }

Below are the fields required by the API

Field Type Required Description
id number Yes This is the id of the invoice e.g 1
generated_instrument_no string Yes This is generated unique number of the invoice e.g IN055367.

Save an invoice

This section will take you through the steps for saving or sending an invoice on Patasente API.

Two (2) requests should be made to this API endpoint , one request will be saving invoice items and the other request is for saving other invoice information for example to_company_id , due_date , currency_id etc

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/save-invoice-information/

The parameters that should be sent to this endpoint are "company_id" , "currency_id" ,"attachment" ,"vat", "to_name","terms","address","to_email_address","purchase_order_no","due_date", "sub_total","grand_total".

A json response with the "id" and the "generated_instrument_no" of the invoice will be returned

{ "success": "Invoice created" ,"created" : true ,"id" :232 , "generated_instrument_no" : "IN43234" }

If there any errors, a json response with 400 error code will be returned

{ "error": "Your invoice wasn't created" }

A second request should be made to save invoice items upon return of the invoice id from the first request.

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/save-invoice-items/

The parameters that should be sent to this endpoint are "invoice_id" , "products".products is an array of invoice items and the array objects are "total" ,"qty" ,"price" ,"unit_measure" ,"item"

.A json response with the "id" and the "generated_instrument_no" of the invoice will be returned upon saving the invoice items

{ "success": "Invoice sent" ,"created" : true ,"id" :232 , "generated_instrument_no" : "IN43234" }

If there any errors, a json response with 400 error code will be returned

{ "error": "Your invoice wasn't sent" }

Below are the fields required by the API

Field Type Required Description
company_id number No This is the id of the company from List of companies. Thia field is optional in case an invoice is being sent to a company which is not registered on Patasente
currency_id number Yes This is id of the currency from List of currencies.
attachment string No This is the attachment sent along with the invoice , it can be a doc , pdf , img but in base64 format
purchase_order_no number No This is vat purchase order no of the attached invoice
vat number Yes This is vat rate / tax rate , The default ifs 0
sub_total number Yes This is sub total of the invoice items
grand_total number Yes This is grand total of the invoice value
to_name text No This is the name of the company receiving the invoice in case the company isn't registered on Patasente.
address text No This is the address of the company receiving the invoice in case the company isn't registered on Patasente.
to_email_address text No This is the email address of the company receiving the invoice in case the company isn't registered on Patasente.
terms string Yes These are the terms and conditions for the invoice.
Invoice Items
item text Yes This is name the item
qty number Yes This is quantity of the items
price number Yes This is the unit price of the item
unit_measure number Yes This is the id of unit measure from the List of unit measure
total number Yes This is the total price of the item

Update an invoice

This section will take you through the steps for updating an invoice on Patasente API.

Two (2) requests should be made to this API endpoint , one request will be saving invoice items and the other request is for saving other invoice information for example vat ,terms , due_date , currency_id etc

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/update-invoice-information/invoice_id/generated_instrument_no

The parameters that should be sent to this endpoint are "currency_id" ,"vat", "terms","purchase_order_no","due_date","sub_total","grand_total".

https://demo.patasente.com/phantom-api/update-invoice-information/23/IN4345?currency_id=3&terms=new terms and conditions

A json response with the "id" and the "generated_instrument_no" of the invoice will be returned

{ "success": "Invoice updated" ,"updated" : true ,"id" :232 , "generated_instrument_no" : "IN43234" }

If there any errors, a json response with 400 error code will be returned

{ "error": "Invoice not found" }

A second request should be made to save invoice items upon return of the invoice id from the first request.

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/update-invoice-items/invoice_id

The parameters that should be sent to this endpoint are "invoice_id" , "products".products is an array of invoice items and the array objects are "total" ,"qty" ,"price" ,"unit_measure" ,"item"

https://demo.patasente.com/phantom-api/update-invoice-items/23?products_array

.A json response with the "id" and the "generated_instrument_no" of the invoice will be returned upon updating the invoice items

{ "success": "Invoice updated" ,"updated" : true ,"id" :232 , "generated_instrument_no" : "IN43234" }

If there any errors, a json response with 400 error code will be returned

{ "error": "Invoice not found" }

Below are the fields required by the API

Field Type Required Description
invoice_id number Yes This is id of the invoice from List of compnay invoives.
generated_instrument_no number Yes This is id of the generated_instrument_no from List of compnay invoives.
currency_id number Yes This is id of the currency from List of currencies.
purchase_order_no number No This is vat purchase order no of the attached invoice
vat number Yes This is vat rate / tax rate , The default ifs 0
sub_total number Yes This is sub total of the invoice items
grand_total number Yes This is grand total of the invoice value
to_name text No This is the name of the company receiving the invoice in case the company isn't registered on Patasente.
to_phone number No This is the phone of the company receiving the Purchase Order in case the company isn't registered on Patasente.
address text No This is the address of the company receiving the invoice in case the company isn't registered on Patasente.
to_email_address text No This is the email address of the company receiving the invoice in case the company isn't registered on Patasente.
terms string Yes These are the terms and conditions for the invoice.
Invoice Items
item text Yes This is name the item
qty number Yes This is quantity of the items
price number Yes This is the unit price of the item
unit_measure number Yes This is the id of unit measure from the List of unit measure
total number Yes This is the total price of the item

Get invoice payment details

This section will take you through the steps for fetching an invoice's payment details on Patasente API.

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-invoice-payment-details/

The parameters that should be sent to this endpoint are "id" , "generated_instrument_no" .A json response with a list of invoices will be returned

https://demo.patasente.com/phantom-api/get-invoice-payment-details/23/IN408802

{ "invoice": { "id": 6, "grand_total": 30000, "generated_no": "IN085174", "currency_id": 1, "currency_format": "UGX", "payment_status": 0, "wallet_charge": "500" }, "amount_paid": 0, "recipient": { "company_id": 3, "business_name": "YYYY", "currency_id": 1, "currency_format": "UGX" }, "balance": 30000 }

Below are the fields required by the API

Field Type Required Description
id number Yes This is the id of the invoice e.g 1
generated_instrument_no string Yes This is generated unique number of the invoice e.g IN055367.

General Financial Instrument Resources

This is the section contains general financial instruments resources.

Delete Financial Instrument

This section will take you through the steps for deleting a financial instrument like invoice ,proforma invoice , purchase order , open order ,quotation , delivery note , receipt etc on Patasente API.

A PUT request should be made to this API endpoint

https://demo.patasente.com/phantom-api/delete-financial-instrument

The parameters that should be sent to this endpoint is "id" and "generated_no", a json response with success code 200 will be returned

https://demo.patasente.com/phantom-api/delete-financial-instrument/2/IN578439.

{ "success": "IN578439 Deleted" }

Below are the fields required by the API

Field Type Required Description
id number Yes This is id of the financial instrument to delete
generated_no string Yes This is generated_no of the financial instrument to delete

Approve Financial Instrument

This section will take you through the steps for approving a financial instrument like invoice ,proforma invoice , purchase order , open order ,quotation , delivery note , receipt etc on Patasente API.

A PUT request should be made to this API endpoint

https://demo.patasente.com/phantom-api/approve-financial-instrument

The parameters that should be sent to this endpoint is "id" and "generated_no", a json response with success code 200 will be returned

https://demo.patasente.com/phantom-api/approve-financial-instrument/2/IN578439.

{ "success": "Invoice Approved" }

Below are the fields required by the API

Field Type Required Description
id number Yes This is id of the financial instrument to approve
generated_no string Yes This is generated_no of the financial instrument to approve

Dispprove Financial Instrument

This section will take you through the steps for disapproving a financial instrument like invoice ,proforma invoice , purchase order , open order ,quotation , delivery note , receipt etc on Patasente API.

A PUT request should be made to this API endpoint

https://demo.patasente.com/phantom-api/disapprove-financial-instrument

The parameters that should be sent to this endpoint is "id" and "generated_no", a json response with success code 200 will be returned

https://demo.patasente.com/phantom-api/disapprove-financial-instrument/2/IN578439.

{ "success": "Invoice Disapproved" }

Below are the fields required by the API

Field Type Required Description
id number Yes This is id of the financial instrument to disapprove
generated_no string Yes This is generated_no of the financial instrument to disapprove

Finance Requests

This is the section where a company manages it's finance requests.

List finance requests

This section will take you through the steps for fetching a company's finance requests on Patasente API.

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-finance-requests/request?

The parameters that should be sent to this endpoint are "skip" , "take" .To limit the number of results returned from the query, or to skip a given number of results in the query, you may skip and take a given number of results. This also helps in pagination. "search" , "from_date" , "to_date" .A json response with a list of finance requests will be returned

https://demo.patasente.com/phantom-api/get-finance-requests/request?skip=0& take=10&search=patasente&from_date=2019-02-07&to_date=165&

[ { "id": 4, "financial_instrument_id": null, "generated_instrument_no": "", "currency_id": 1, "currency": "UGX", "finance_request_no": "FR325621", "company_id": 2, "to_company_id": null, "from_name": "Kakooza Sadati", "type": "lpo-financing", "total_value": "12000000", "loan_amount": "360000", "loan_purpose": "Testing LPO financing", "payment_mode": null, "issued_by": null, "issued_to": null, "issued_by_name": "joana", "issued_to_name": "Briana", "due_date": "2020-06-12", "instrument_issue_date": null, "payment_date": "2020-07-01", "discount_amount": null, "disbursement_amount": "0", "interest": "3", "total_amount_returned": "12,360,000", "loan_period": "32", "loan_payment_frequency": "installments", "list_on_marketplace": 0, "status": 0, "deleted": 0, "created_at": "2020-05-30 02:21:20", "subtotal": "12,000,000", "disbursement_status": 0, "attachment_file_no": "3453" "attachment": " "data:application/pdf;base64,JVBERi0xLjMNCiVAUERGMDEyMzQ1Njc4OSAxDQozIDAgb2JqDQo8PA0K" }, { "id": 3, "financial_instrument_id": 1, "generated_instrument_no": "IN800893", "currency_id": 1, "currency": "UGX", "finance_request_no": "FR154405", "company_id": 2, "to_company_id": null, "from_name": "Kakooza Sadati", "type": "discounted-invoice", "total_value": "3230000", "loan_amount": null, "loan_purpose": "Testing this out", "payment_mode": null, "issued_by": null, "issued_to": null, "issued_by_name": "joana", "issued_to_name": "Briana", "due_date": "2020-06-16", "instrument_issue_date": "2020-06-09", "payment_date": "2020-06-16", "discount_amount": "96900", "disbursement_amount": "3,133,100", "interest": "3", "total_amount_returned": "0", "loan_period": "23", "loan_payment_frequency": "installments", "list_on_marketplace": 0, "status": 0, "deleted": 0, "created_at": "2020-05-30 02:18:47", "subtotal": "3,230,000", "disbursement_status": 0, "attachment_file_no": "4534261" "attachment": " "data:application/pdf;base64,JVBERi0xLjMNCiVAUERGMDEyMzQ1Njc4OSAxDQozIDAgb2JqDQo8PA0K" }, { "id": 2, "financial_instrument_id": 9, "generated_instrument_no": "IN935082", "currency_id": 1, "currency": "UGX", "finance_request_no": "FR251561", "company_id": 2, "to_company_id": null, "from_name": "Kakooza Sadati", "type": "factor-payment", "total_value": "1440", "loan_amount": null, "loan_purpose": "invoice", "payment_mode": null, "issued_by": 3, "issued_to": 2, "issued_by_name": "Sheldon Brenda", "issued_to_name": "YYYY", "due_date": "2020-06-24", "instrument_issue_date": "2020-04-22", "payment_date": "2020-04-22", "discount_amount": "101", "disbursement_amount": "1,339", "interest": "7", "total_amount_returned": "0", "loan_period": "38", "loan_payment_frequency": null, "list_on_marketplace": 0, "status": 0, "deleted": 0, "created_at": "2020-05-30 02:10:59", "subtotal": "1,440", "disbursement_status": 0, "attachment_file_no": null }, { "id": 1, "financial_instrument_id": 9, "generated_instrument_no": "IN935082", "currency_id": 1, "currency": "UGX", "finance_request_no": "FR310430", "company_id": 2, "to_company_id": null, "from_name": "Kakooza Sadati", "type": "early-payment", "total_value": "1440", "loan_amount": "43", "loan_purpose": "buy chairs", "payment_mode": null, "issued_by": 3, "issued_to": 2, "issued_by_name": "Sheldon Brenda", "issued_to_name": "YYYY", "due_date": "2020-04-22", "instrument_issue_date": null, "payment_date": "2020-06-22", "discount_amount": null, "disbursement_amount": "0", "interest": "3", "total_amount_returned": "1,483", "loan_period": "23", "loan_payment_frequency": "installments", "list_on_marketplace": 0, "status": 0, "deleted": 0, "created_at": "2020-05-30 02:03:31", "subtotal": "1,440", "disbursement_status": 0, "attachment_file_no": null } ]

Below are the fields required by the API

Field Type Required Description
skip number No This is number of items that should be skipped but default is 0
take number Yes This is number of items that should be fetched per request but default is 10.
search number No This is search query.
from_date date No This is date from where you want to start the filtering of results.
to_date date No This is date from where you want to end the filtering of results.

List company factored invoices

This section will take you through the steps for fetching a company's factored invoices on Patasente API.

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-all-factored-invoices/invoice?

The parameters that should be sent to this endpoint are "skip" , "take" .To limit the number of results returned from the query, or to skip a given number of results in the query, you may skip and take a given number of results. This also helps in pagination. "search" , "from_date" , "to_date" .A json response with a list of invoices will be returned

https://demo.patasente.com/phantom-api/get-all-factored-invoices/invoice?skip=0& take=10&search=patasente&from_date=2019-02-07&to_date=2019-06-05&

[ { "from_merchant_code": "M630827", "to_merchant_code": "M958546", "id": 1422, "generated_instrument_no": "IN199214", "user_id": 88, "file_attachment_no": null, "from_company_id": 88, "to_company_id": 2071, "from_name": "Patasente Fund", "from_billing_address": "Plot 1674, Valley Curve. Ntinda", "to_billing_address": "Hycon house plot 743 butikilo road mengo kampala", "vat": "0", "expiry_date": null, "purchase_order_no": null, "due_date": { "date": "2019-07-30 00:00:00.000000", "timezone_type": 3, "timezone": "UTC" }, "to_name": "Lake mburo investments co limited", "terms_and_conditions": "Pay on time", "grand_total": "18,035,300", "grand_total2": "18035300", "type": "factored-invoice", "currency_id": 1, "currency_format": "UGX", "created_at": { "date": "2019-07-15 15:52:38.000000", "timezone_type": 3, "timezone": "UTC" }, "current_date": "2019-08-29", "updated_at": { "date": "2019-07-15 16:48:38.000000", "timezone_type": 3, "timezone": "UTC" }, "status": 1, "payment_status": 0, "receiver_finance_request_status": 0, "sender_finance_request_status": 0 }, /...../ ]

Below are the fields required by the API

Field Type Required Description
skip number No This is number of items that should be skipped but default is 0
take number Yes This is number of items that should be fetched per request but default is 10.
search number No This is search query.
from_date date No This is date from where you want to start the filtering of results.
to_date date No This is date from where you want to end the filtering of results.

Get single finance request

This section will take you through the steps for fetching a single company's finance request on Patasente API.

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-finance-request/

The parameters that should be sent to this endpoint are "id" , "finance_request_no" .A json response with a finance request will be returned

https://demo.patasente.com/phantom-api/get-finance-request/4/FR408802

{ "company_id": 2, "business_name": "Kakooza Sadati", "id": 4, "finance_request_no": "FR325621", "financial_instrument_id": null, "generated_instrument_no": null, "generated_purchase_order_no": "3453", "purchase_order_no": null, "to_name": "joana", "from_name": "Briana", "instrument_issue_date": null, "due_date": "2020-06-12", "payment_date": "2020-07-01", "currency_id": 1, "currency": "UGX", "total_value": "12000000", "subtotal": "12,000,000", "type": "lpo-financing", "title": "LPO-FINANCING", "loan_amount": "360,000", "loan_amount_2": "360000", "interest": "3", "total_amount_returned": "12,360,000", "total_amount_returned_2": "12360000", "loan_period": "32", "loan_payment_frequency": "installments", "loan_purpose": "Testing LPO financing", "disbursement_amount": "0", "list_on_marketplace": 0, "status": 0, "repayment_status": 0, "deleted": 0, "created_at": "2020-05-30 02:21:20", "disbursement_status": 0, "issued_by": null, "issued_to": null, "issued_by_name": "joan Doe", "issued_to_name": "John Doe", "attachment_file_no": "3453" }

Below are the fields required by the API

Field Type Required Description
id number Yes This is the id of the finance request e.g 1
finance_request_no string Yes This is generated unique number of the finance e.g FR055367.

Request Early Payment Financing on Invoice

This section will take you through the steps for saving or sending or requesting an Early Payment Financing on Invoice on Patasente API.

Early Payment Financing is requested by the sender of the invoice. The invoice must be approved with has no single payment

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/save-early-payment-request

The parameters that should be sent to this endpoint are "invoice_id" , "discount_rate" ,"due_date"

https://demo.patasente.com/phantom-api/save-early-payment-request?invoice_id=9discount_rate=4& &due_date=2020-05-27T08:41:24.558Z

.A json response will be returned with 200 status code.

{ "success": "You have requested for invoice financing" }

If there any errors, a json response with 400 error code will be returned

{"error": "Finance already requested"}

Below are the fields required by the API

Field Type Required Description
invoice_id number No This is the id of the invoice from List of invoices.
discount_rate number Yes This is the rate at which an invoice should be discounted
due_date date Yes This is the due date for the financing

If you want to display the discount and amount to be received on the fly, Besides is the formula for calculating the discount and amount to be received

discount = ( (discount_rate / 100 ) * invoice_grand_total); amount_to_be_received = invoice_grand_total - discount;

Request Factor Payment Financing on Invoice

This section will take you through the steps for saving or sending or requesting for a Factor Payment Financing on Invoice on Patasente API.

Factor Payment Financing is requested by the receiver of the invoice. The invoice must be approved with no single payment

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/save-factor-pay-finance-request

The parameters that should be sent to this endpoint are "invoice_id" , "rate" ,"loan_payment_frequency", "loan_period" ,"loan_purpose" ,"agreement"

https://demo.patasente.com/phantom-api/save-factor-pay-finance-request?invoice_id=9&rate=4&loan_payment_frequency =installments&loan_period=20&loan_purpose=to buy this&agreement=true

.A json response will be returned with 200 status code.

{ "success": "You have requested for invoice financing" }

If there any errors, a json response with 400 error code will be returned

{"error": "Finance already requested"}

Below are the fields required by the API

Field Type Required Description
invoice_id number No This is the id of the invoice from List of invoices.
rate number Yes This is the loan rate to factor the invoice
loan_payment_frequency string Yes This is the frequency for repayment of the loan. it should either be "installments" or "lumpsum"
loan_period number Yes This is the number of days for repaying this loan
loan_purpose string Yes This is the purpose of the loan
agreement boolean Yes This is an agreement to the borrowers terms and conditions. it should be true or false

If you want to display the interest and amount to be returned on the fly, Besides is the formula for calculating the discount and amount to be returned

interest = ( (rate / 100 ) * invoice_grand_total); amount_to_be_returned = invoice_grand_total + interest;

Request Discounted invoice financing on attached Invoice

This section will take you through the steps for saving or sending or requesting an Discounted invoice Financing on an attached Invoice on Patasente API.

Discounted invoice Financing is requested by the sender of the invoice. The invoice must be approved.

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/save-discounted-invoice-request

The parameters that should be sent to this endpoint are "invoice_no" , "discount_rate" ,"due_date"

https://demo.patasente.com/phantom-api/save-discounted-invoice-request?invoice_no=900935082&discount_rate=4& type=discounted-invoice&due_date=2020-05-27T08:41:24.558Z&issued_to=King&issued_by=Bryan Ways& instrument_issue_date=2020-05-27T08:41:24.558Z&disbursement_amount=3247042¤cy_id=1& discount_value=207258&total_value=3454300&loan_payment_frequency=Installments&loan_period=45& loan_purpose=to buy a new car&attachment=base64;data:sfghjkdf vdbhjfbnsjdbjcubhfd vby8weyb

.A json response will be returned with 200 status code.

{ "success": "You have requested for invoice financing" }

If there any errors, a json response with 400 error code will be returned

{"error": "Finance already requested"}

Below are the fields required by the API

Field Type Required Description
invoice_no number No This is the invoice no on the attached invoice.
discount_rate number Yes This is the rate at which an invoice should be discounted
due_date date Yes This is the due date for the financing
issued_to string Yes This is the person / business to whom the invoice was issued
issued_by string Yes This is the person / business which issued the invoice
instrument_issue_date date Yes This is the date when the invoice was issued
currency_id number Yes This is the id the currency from Get Currencies
total_value number Yes This is the total value of the invoice
attachment file Yes This is the pdf / image of the attached
loan_payment_frequency string Yes This is the frequency for repayment of the loan. it should either be "installments" or "lumpsum"
loan_period number Yes This is the number of days for repaying this loan
loan_purpose string Yes This is the purpose of the loan

If you want to display the discount and amount to be received on the fly, Besides is the formula for calculating the discount and amount to be received

discount = ( (discount_rate / 100 ) * invoice_grand_total); amount_to_be_received = invoice_grand_total - discount;

Request LPO financing on attached Purchase Order

This section will take you through the steps for saving or sending or requesting for a Factor Payment Financing on Invoice on Patasente API.

Factor Payment Financing is requested by the receiver of the invoice. The invoice must be approved with no single payment

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/save-factor-pay-finance-request

The parameters that should be sent to this endpoint are "po_no" , "rate" ,"loan_payment_frequency", "loan_period" ,"loan_purpose" ,"agreement"

https://demo.patasente.com/phantom-api/save-factor-pay-finance-request?po_no=900935082&rate=4& due_date=2020-05-27T08:41:24.558Z&issued_to=King&issued_by=Bryan Ways&instrument_issue_date=2020-05-27T08:41:24.558Z& currency_id=1&total_value=3454300&loan_payment_frequency=Installments&loan_period=45& loan_purpose=to buy a new car&attachment=base64;data:sfghjkdf vdbhjfbnsjdbjcubhfd vby8weyb

.A json response will be returned with 200 status code.

{ "success": "You have requested for LPO financing" }

If there any errors, a json response with 400 error code will be returned

{"error": "Finance already requested"}

Below are the fields required by the API

Field Type Required Description
po_no number No This is the no on the attached purchase order.
rate number Yes This is the loan rate to factor the purchase order
due_date date Yes This is the due date for the financing
issued_to string Yes This is the person / business to whom the purchase order was issued
issued_by string Yes This is the person / business which issued the purchase order
instrument_issue_date date Yes This is the date when the purchase order was issued
currency_id number Yes This is the id the currency from Get Currencies
total_value number Yes This is the total value of the purchase order
attachment file Yes This is the pdf / image of the attached
loan_payment_frequency string Yes This is the frequency for repayment of the loan. it should either be "installments" or "lumpsum"
loan_period number Yes This is the number of days for repaying this loan
loan_purpose string Yes This is the purpose of the loan
agreement boolean Yes This is an agreement to the borrowers terms and conditions. it should be true or false

If you want to display the interest and amount to be returned on the fly, Besides is the formula for calculating the discount and amount to be returned

interest = ( (rate / 100 ) * purchase_order_grand_total); amount_to_be_returned = purchase_order_grand_total + interest;

Request Salary Advance Financing

This section will take you through the steps for saving or sending or requesting for a Salary advance financing on Patasente API.

Salary Advance Financing is requested must be sent to employer for approval

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/save-salary-advance-request

The parameters that should be sent to this endpoint are "employer_id" , "type" ,"currency_id", "salary_amount" ,"repayment_date" ,"agreement","requested_advance_amount",""

https://demo.patasente.com/phantom-api/save-salary-advance-request?employer_id=900& repayment_date=2020-05-27T08:41:24.558Z&type=salary-advance¤cy_id=1 &salary_amount=100000&requested_advance_amount=900000&discount_rate=4&agreement=true

.A json response will be returned with 200 status code.

{ "success": "You have requested for Salary Advance financing" }

If there any errors, a json response with 400 error code will be returned

{"error": "Error while saving salary advance request"}

Below are the fields required by the API

. .
Field Type Required Description
employer_id number Yes This is the id of the company/employer from List of companies.
type string Yes This is the type of finance request and the default should be "salary-advance"
salary_amount number No This is the salary of the borrower
requested_advance_amount number No This is the amount the borrower is requesting from their salary
currency_id number Yes This is the id the currency from Get Currencies
discount_rate number Yes This is the rate to discount the salary advance requested.The discount_rate is the credit_account_interest_rate from Get wallet balance of the borrower
repayment_date date Yes This is the date for repaying this loan
agreement boolean Yes This is an agreement to the borrowers terms and conditions. it should be true or false

If you want to display the discount value and disburment amount to be returned on the fly, Besides is the formula for calculating the discount and amount to be received

discount = ( (discount_rate / 100 ) * requested_advance_amount); amount_to_be_received = requested_advance_amount - discount;

update finance request

This section will take you through the steps for updating a Finance Request on Patasente API.

Update Early Payment Financing

Updating an Early Payment Finance Request can only be done on an finance request that's not funded.

A PUT request should be made to this API endpoint

https://demo.patasente.com/phantom-api/update-finance-request/

The parameters that should be sent to this endpoint are "id", "finance_request_no" , "discount_rate" ,"due_date"

https://demo.patasente.com/phantom-api/update-finance-request/2/FR54343?discount_rate=4& &due_date=2020-05-27T08:41:24.558Z

.A json response will be returned with 200 status code.

{ "success": "Financing Request FR54343 updated" }

If there any errors, a json response with 400 error code will be returned

{"error": "Finance request doesn't exist"}

Below are the fields required by the API

Field Type Required Description
id number Yes This is the id of the finance request from List finance request
finance_request_no string Yes This is the finance_request_no of the finance request from List finance request
discount_rate number Yes This is the rate at which an invoice should be discounted
due_date date Yes This is the due date for the financing

Update Discounted invoice finance request on attached Invoice

Updating a Discounted invoice Finance request must be done on a request which is funded.

A PUT request should be made to this API endpoint

https://demo.patasente.com/phantom-api/update-finance-request

The parameters that should be sent to this endpoint are "id" , "finance_request_no" , "invoice_no" , "discount_rate" ,"due_date"

https://demo.patasente.com/phantom-api/update-finance-request/2/FR5433?invoice_no=900935082&discount_rate=4& due_date=2020-05-27T08:41:24.558Z&issued_to=King&issued_by=Bryan Ways& instrument_issue_date=2020-05-27T08:41:24.558Z&disbursement_amount=3247042¤cy_id=1& discount_value=207258&total_value=3454300&loan_payment_frequency=Installments&loan_period=45& loan_purpose=to buy a new car&attachment=base64;data:sfghjkdf vdbhjfbnsjdbjcubhfd vby8weyb

.A json response will be returned with 200 status code.

{ "success": "Finance Request FR5433 updated." }

If there any errors, a json response with 400 error code will be returned

{"error": "Finance request doesn't exist"}

Below are the fields required by the API

Field Type Required Description
id number Yes This is the id of the finance request from List finance request
finance_request_no string Yes This is the finance_request_no of the finance request from List finance request
invoice_no number No This is the invoice no on the attached invoice.
discount_rate number Yes This is the rate at which an invoice should be discounted
due_date date Yes This is the due date for the financing
issued_to string Yes This is the person / business to whom the invoice was issued
issued_by string Yes This is the person / business which issued the invoice
instrument_issue_date date Yes This is the date when the invoice was issued
currency_id number Yes This is the id the currency from Get Currencies
total_value number Yes This is the total value of the invoice
attachment file Yes This is the pdf / image of the attached
loan_payment_frequency string Yes This is the frequency for repayment of the loan. it should either be "installments" or "lumpsum"
loan_period number Yes This is the number of days for repaying this loan
loan_purpose string Yes This is the purpose of the loan

Update LPO finance Request on attached Purchase Order

Updating LPO Finance request must be done on a finance request that isn't funded

A PUT request should be made to this API endpoint

https://demo.patasente.com/phantom-api/update-finance-request

The parameters that should be sent to this endpoint are "po_no" , "rate" ,"loan_payment_frequency", "loan_period" ,"loan_purpose" ,"agreement"

https://demo.patasente.com/phantom-api/update-finance-request/2/FR5433?po_no=900935082&rate=4& due_date=2020-05-27T08:41:24.558Z&issued_to=King&issued_by=Bryan Ways&instrument_issue_date=2020-05-27T08:41:24.558Z& currency_id=1&total_value=3454300&loan_payment_frequency=Installments&loan_period=45& loan_purpose=to buy a new car&attachment=base64;data:sfghjkdf vdbhjfbnsjdbjcubhfd vby8weyb

.A json response will be returned with 200 status code.

{ "success": "Finance request FR5433 updated" }

If there any errors, a json response with 400 error code will be returned

{"error": "Finance request doesn't exist"}

Below are the fields required by the API

Field Type Required Description
id number Yes This is the id of the finance request from List finance request
finance_request_no string Yes This is the finance_request_no of the finance request from List finance request
po_no number No This is the no on the attached purchase order.
rate number Yes This is the loan rate to factor the purchase order
due_date date Yes This is the due date for the financing
issued_to string Yes This is the person / business to whom the purchase order was issued
issued_by string Yes This is the person / business which issued the purchase order
instrument_issue_date date Yes This is the date when the purchase order was issued
currency_id number Yes This is the id the currency from Get Currencies
total_value number Yes This is the total value of the purchase order
attachment file Yes This is the pdf / image of the attached
loan_payment_frequency string Yes This is the frequency for repayment of the loan. it should either be "installments" or "lumpsum"
loan_period number Yes This is the number of days for repaying this loan
loan_purpose string Yes This is the purpose of the loan
agreement boolean Yes This is an agreement to the borrowers terms and conditions. it should be true or false

Update Factor Payment Finance Request on Invoice

Updating Factor Payment Finance request must be done on a finance request that isn't funded

A PUT request should be made to this API endpoint

https://demo.patasente.com/phantom-api/update-finance-request

The parameters that should be sent to this endpoint are "invoice_id" , "rate" ,"loan_payment_frequency", "loan_period" ,"loan_purpose" ,"agreement"

https://demo.patasente.com/phantom-api/update-finance-request/4/FR3456?invoice_id=9&rate=4&loan_payment_frequency =installments&loan_period=20&loan_purpose=to buy this&agreement=true&due_date=2020-05-27T08:41:24.558Z

.A json response will be returned with 200 status code.

{ "success": "Finance request FR3456 updated " }

If there any errors, a json response with 400 error code will be returned

{"error": "Finance request doesn't exist"}

Below are the fields required by the API

Field Type Required Description
id number Yes This is the id of the finance request from List finance request
finance_request_no string Yes This is the finance_request_no of the finance request from List finance request
invoice_id number No This is the id of the invoice from List of invoices.
rate number Yes This is the loan rate to factor the invoice
loan_payment_frequency string Yes This is the frequency for repayment of the loan. it should either be "installments" or "lumpsum"
loan_period number Yes This is the number of days for repaying this loan
loan_purpose string Yes This is the purpose of the loan
agreement boolean Yes This is an agreement to the borrowers terms and conditions. it should be true or false
due_date date Yes This is the due date for the financing

Update Salary Adavance Finance Request

A PUT request should be made to this API endpoint

https://demo.patasente.com/phantom-api/update-finance-request

The parameters that should be sent to this endpoint are ,"requested_advance_amount", ,"salary_amount" ,"repayment_date" ,"currency_id"

https://demo.patasente.com/phantom-api/update-finance-request/4/FR3456?salary_amount=100000&requested_advance_amount=90000¤cy_id=1&repayment_date=2020-05-27T08:41:24.558Z

.A json response will be returned with 200 status code.

{ "success": "Salary advance financing request FR3456 updated " }

If there any errors, a json response with 400 error code will be returned

{"error": "Finance request doesn't exist"}

Below are the fields required by the API

. .
Field Type Required Description
id number Yes This is the id of the finance request from List finance request
finance_request_no string Yes This is the finance_request_no of the finance request from List finance request
salary_amount number No This is the salary of the borrower
requested_advance_amount number No This is the amount the borrower is requesting from their salary
currency_id number Yes This is the id the currency from Get Currencies
repayment_date date Yes This is the date for repaying this loan

Delete finance request

This section will take you through the steps for deleting a finance request on Patasente API.

A PUT request should be made to this API endpoint

https://demo.patasente.com/phantom-api/delete-finance-request

The parameters that should be sent to this endpoint is "id" and "finance_request_no", a json response with success code 200 will be returned

https://demo.patasente.com/phantom-api/delete-finance-request/2/FR578439.

{ "success": "FR578439 Deleted" }

Below are the fields required by the API

Field Type Required Description
id number Yes This is id of the finance request to delete
finance_request_no string Yes This is finance_request_no of the finance request to delete

Get Outstanding Factor Balance

This section will take you through the steps for fetching the outstanding factor balance of a user on Patasente API.

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-outstanding-factor-balance

No parameter should be sent to this endpoint, a json response with success code 200 will be returned

https://demo.patasente.com/phantom-api/get-outstanding-factor-balance.

{ "currency_symbol": "UGX" "amount": "578,439" }

Approve Factored Invoice

This section will take you through the steps for approving a factored invoice on Patasente API.

A PUT request should be made to this API endpoint

https://demo.patasente.com/phantom-api/approve-factored-invoice

The parameters that should be sent to this endpoint is "id" and "generated_no", a json response with success code 200 will be returned

https://demo.patasente.com/phantom-api/approve-factored-invoice/2/IN578439.

{ "success": "Invoice Approved" }

Below are the fields required by the API

Field Type Required Description
id number Yes This is id of the factored invoice to approve
generated_no string Yes This is generated_no of the factored invoice to approve

Dispprove factored invoice

This section will take you through the steps for disapproving a factored invoice on Patasente API.

A PUT request should be made to this API endpoint

https://demo.patasente.com/phantom-api/disapprove-factored-invoice

The parameters that should be sent to this endpoint is "id" and "generated_no", a json response with success code 200 will be returned

https://demo.patasente.com/phantom-api/disapprove-factored-invoice/2/IN578439.

{ "success": "Invoice Disapproved" }

Below are the fields required by the API

Field Type Required Description
id number Yes This is id of the factored invoice to disapprove
generated_no string Yes This is generated_no of the factored invoice to disapprove

Prepaid Card Account

This is the section where a company manages a prepaid card account on Patasente .

To check if an account has prepaid account active or inactive look at Get Company details to see the additional variable called prepaid_account .

if an account has prepaid account active 2 new fields have been added Get Wallet Balance displaying prepaid account float balance formated_prepaid_account_balance" and "prepaid_account_balance" .

Activate Prepaid Account

This section will take you through the activating Prepaid Account on Patasente API.

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/activate-prepaid-account

NO parameter should be sent to this endpoint

https://demo.patasente.com/phantom-api/activate-prepaid-account

A json response with 200 success code will be returned

{ "success": "Your Prepaid Account is active" }

If there any errors, a json response with 400 error code will be returned

{ "error": "Prepaid Account Activation Failed" }

Deactivate Prepaid Account

This section will take you through the deactivating Prepaid Account on Patasente API.

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/deactivate-prepaid-account

NO parameter should be sent to this endpoint

https://demo.patasente.com/phantom-api/deactivate-prepaid-account

A json response with 200 success code will be returned

{ "success": "Your Prepaid Account is deactivated" }

If there any errors, a json response with 400 error code will be returned

{ "error": "Prepaid Account Deactivation Failed" }

Transfer Funds To Prepaid Card Account

This section will take you through transfering Float to a Prepaid Account on Patasente API.

A PUT request should be made to this API endpoint

https://demo.patasente.com/phantom-api/wallet/transfer-funds-to-prepaid-float

The parameter that should be sent to this endpoint is amount

https://demo.patasente.com/phantom-api/wallet/transfer-funds-to-prepaid-float?amount=50000

A json response with 200 success code will be returned

{ "success": "50,000 has been deposited to your Prepaid Float" }

If there any errors, a json response with 400 error code will be returned

{ "error": "Prepaid Account is not active" }

Below are the fields required by the API

Field Type Required Description
amount number Yes This is the amount to be deposited as Prepaid Float

Patasente Cards

Get Patasente Card Types

This section will take you through fetching supported card types on Patasente API.

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-card-types

NO parameter should be sent to this endpoint

https://demo.patasente.com/phantom-api/get-card-types

A json response with 200 success code will be returned

[ { "name": "Gift Card", "prefix_number": "1663", "id": 2 } ]

Get Patasente Card Printing Charge

This section will take you through the fetching card types on Patasente API.

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-patasente-card-printing-charge

NO parameter should be sent to this endpoint

https://demo.patasente.com/phantom-api/get-patasente-card-printing-charge

A json response with 200 success code will be returned

{ "charge": 500 }

Use this charge to calculate the cost of priting cards on the fly as the user is entering them.

Request For Patasente Cards

This section will take you through requesting for Patasente Cards on Patasente API.

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/request-for-patasente-cards

The parameters that should be sent to this endpoint are "number_of_cards" ,"amount_on_cards" ,"currency_id" ,"card_names" ,"logo" and "card_type_id"

https://demo.patasente.com/phantom-api/request-for-patasente-cards?number_of_cards=3&amount_on_cards=15000¤cy_id=1&card_names=Gift card&card_type_id=2&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAqQAAAJaCAIAAAB2vMKXAAAA AXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwdwjr+9vzrVrzIzt2X+SlhO9eIa HwCeYtgDwOUMewC4WmsdAuLQMiKK2zcAAAAASUVOR

A json response with 200 success code will be returned

{ "success": "Card request sent, You'll be notified once your cards are ready" }

If there any errors, a json response with 400 error code will be returned

{ "error": "Your prepaid account balance is too low to complete this action" }

Below are the fields required by the API

Field Type Required Description
card_type_id number Yes This is the id of card type from Get Patasente Card Types
card_names string Yes This is the name or label of the card that will appear on this card like Gift Card , Shopping Card. The default card name should be Gift Card
currency_id number Yes This is id of the currency from List of currencies. Default currency_id should be 1 since we only support UGX cards
number_of_cards number Yes This is the number of cards being requested
amount_on_cards number Yes This is the amount on the each card. in otherwards its the face value of the card.
logo longText Yes This is a base64 version of the business logo. logo should have a transparent background with dimensions of 200px by 200px with a maximum size of 2250

Update a Patasente Card Request

This section will take you through updating a Patasente Card request on Patasente API.

A PUT request should be made to this API endpoint

https://demo.patasente.com/phantom-api/update-card-request/id

The parameters that should be sent to this endpoint are "id" , "number_of_cards" ,"amount_on_cards" ,"currency_id" ,"card_names" , "logo" and "card_type_id"

https://demo.patasente.com/phantom-api/update-card-request/4?number_of_cards=3&amount_on_cards=15000¤cy_id=1&card_names=Gift card&card_type_id=2&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAqQAAAJaCAIAAAB2vMKXAAAA AXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwdwjr+9vzrVrzIzt2X+SlhO9eIa HwCeYtgDwOUMewC4WmsdAuLQMiKK2zcAAAAASUVOR

A json response with 200 success code will be returned

{ "success": "Card request updated, You'll be notified once your cards are ready" }

If there any errors, a json response with 400 error code will be returned

{ "error": "Your prepaid account balance is too low to complete this action" }

Below are the fields required by the API

Field Type Required Description
id number Yes This is the id of the card request to be updated from Get Card Requests List
card_type_id number Yes This is the id of card type from Get Patasente Card Types
card_names string Yes This is the name or label of the card that will appear on this card like Gift Card , Shopping Card. The default card name should be Gift Card
currency_id number Yes This is id of the currency from List of currencies. Default currency_id should be 1 since we only support UGX cards
number_of_cards number Yes This is the number of cards being requested
amount_on_cards number Yes This is the amount on the each card. in otherwards its the face value of the card.
logo longText Yes This is a base64 version of the business logo. logo should have a transparent background with dimensions of 200px by 200px with a maximum size of 2250

Cancel a Patasente Card Request

This section will take you through cancelling a Patasente Card request on Patasente API.

A PUT request should be made to this API endpoint

https://demo.patasente.com/phantom-api/cancel-card-request/id

The parameters that should be sent to this endpoint are "id"

https://demo.patasente.com/phantom-api/cancel-card-request/4

A json response with 200 success code will be returned

{ "success": "Card request has been cancelled." }

If there any errors, a json response with 400 error code will be returned

{ "error": "Card request is already cancelled." }

Get Patasente Card requests

This section will take you through fetching Patasente cards requests on Patasente API.

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-card-requests

The parameters that should be sent to this endpoint are "skip" , "take" .To limit the number of results returned from the query, or to skip a given number of results in the query, you may skip and take a given number of results. This also helps in pagination. "search" .A json response with a list of invoices will be returned

https://demo.patasente.com/phantom-api/get-card-requests?skip=0&take=10&search=gift

A json response with 200 success code will be returned

[ { "id": 4, "card_type_id": 2, "card_type": "Gift Card", "card_names": "Shopping Card", "number_of_cards": 5, "amount_on_cards": 21000, "cost": 2500, "currency_id": 1, "currency": "UGX", "status": "cancelled", "created_at": "2020-09-10", "associated_transaction_id": 14555, "associated_transaction_currency": "UGX", "has_logo": true, "logo": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAqQAAAJaCAIAAAB2vMKXAAAA AXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwdwjr 9vzrVrzIzt2X SlhO9eIa HwCeYtgDwOUMewC4WmsdAuLQMiKK2zcAAAAASUVOR" }, { "id": 3, "card_type_id": 2, "card_type": "Gift Card", "card_names": null, "number_of_cards": 5, "amount_on_cards": 21000, "cost": 2500, "currency_id": 1, "currency": "UGX", "status": "pending", "created_at": "2020-09-10", "associated_transaction_id": 14553, "associated_transaction_currency": "UGX", "has_logo": true, "logo": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAqQAAAJaCAIAAAB2vMKXAAAA AXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwdwjr 9vzrVrzIzt2X SlhO9eIa HwCeYtgDwOUMewC4WmsdAuLQMiKK2zcAAAAASUVOR" }, { "id": 1, "card_type_id": 2, "card_type": "Gift Card", "card_names": null, "number_of_cards": 4, "amount_on_cards": 5000, "cost": 2000, "currency_id": 1, "currency": "UGX", "status": "approved", "created_at": "2020-08-31", "associated_transaction_id": 14538, "associated_transaction_currency": "UGX", "has_logo": false, "logo": null } ]

If there any errors, a json response with 400 error code will be returned

{ "error": "No Card requests found." }

Get Issued Patasente Cards

This section will take you through fetching Patasente cards requests on Patasente API.

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-issued-patasente-cards

The parameters that should be sent to this endpoint are "skip" , "take" .To limit the number of results returned from the query, or to skip a given number of results in the query, you may skip and take a given number of results. This also helps in pagination. "search" .A json response with a list of invoices will be returned

https://demo.patasente.com/phantom-api/get-issued-patasente-cards?skip=0&take=10

A json response with 200 success code will be returned

[ { "id": 8, "company_id": 6, "card_names": null, "card_request_names": "Gift Card", "card_request_id": 8, "card_type_id": 2, "currency": "UGX", "currency_id": 1, "card_type": "Gift Card", "card_no": "1663********13455034", "amount": 5000, "balance": 2550, "card_limit": 5000, "new_owner_company_id": null, "new_owner_business_name": null, "new_owner_merchant_code": null, "status_modified_by": 6, "status_modified_by_business_name": "Ssekalegga Brian", "status_modified_by_merchant_code": "M000001", "expiry_date": "09/21", "status": "active", "deleted": null, "has_pin": true, "created_at": "2020-09-07", "updated_at": "2020-09-12" }, { "id": 7, "company_id": 6, "card_names": null, "card_request_names": "Gift Card", "card_request_id": 7, "card_type_id": 2, "currency": "UGX", "currency_id": 1, "card_type": "Gift Card", "card_no": "1663********23892955", "amount": 5000, "balance": 0, "card_limit": 5000, "new_owner_company_id": null, "new_owner_business_name": null, "new_owner_merchant_code": null, "status_modified_by": 6, "status_modified_by_business_name": "Ssekalegga Brian", "status_modified_by_merchant_code": "M000001", "expiry_date": "09/21", "status": "inactive", "deleted": null, "has_pin": false, "created_at": "2020-09-07", "updated_at": "2020-09-12" } ]

If there any errors, a json response with 400 error code will be returned

{ "error": "No Card requests found." }

Get Supported Patasente Card statuses

This section will take you through fetching supported card statuses on Patasente API.

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-support-issued-card-statuses

NO parameter should be sent to this endpoint

https://demo.patasente.com/phantom-api/get-support-issued-card-statuses

A json response with 200 success code will be returned

[ "active", "inactive", "expired" ]

Modify a Patasente Card Status

This section will take you through modifying a Patasente Card status on Patasente API.

A PUT request should be made to this API endpoint

https://demo.patasente.com/phantom-api/modify-patasente-card-status/id

The parameters that should be sent to this endpoint are "id" and "status"

https://demo.patasente.com/phantom-api/modify-patasente-card-status/4?status=active&pin=1234

A json response with 200 success code will be returned

{ "success": "Card is active" }

If there any errors, a json response with 400 error code will be returned

{ "error": "Card is inactive" }

Below are the fields required by the API

Field Type Required Description
id number Yes This is the id of the card to be updated from Get Issued Patasente Card List
status string Yes This is the status that should be sent in the request.Here a list of accepted statuses that should be used
pin number Optional This is a four(4) digit PIN that secures the Card. Option for entering a PIN should popup when a card is being activated and notice should pop informing the person activating the card to give the device the client to enter their PIN. Marking a card inactive or expired doesn't require a client enteringa PIN
phone_number number No This is the phone number for the client, it's optional
card_names string No These are the names for the client, it's optional

Credit a Patasente Card

This section will take you through crediting a Patasente Card on Patasente API.

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/credit-patasente-card/id

The parameters that should be sent to this endpoint are "id" and "amount" ,"payment_reason"

https://demo.patasente.com/phantom-api/credit-patasente-card/4?amount=3000&payment_reason=Refund

A json response with 200 success code will be returned

{ "success": "Funds have been transferred to card." }

If there any errors, a json response with 400 error code will be returned

{ "error": "You can't add more than UGX 5,000 on this card.Current balance on this card is UGX 3,000" }

Below are the fields required by the API

Field Type Required Description
id number Yes This is the id of the card to be credited got from scanning a QR Code on the client card. Get a patasente card
amount number Yes This is the amount to be credited on the card.Refer to the data returned from Get a patasente card after scanning the QR Code on the card to determine the balance on the card and how much can be added on to the card. You can't add more than the face value of the card which is returned as amount in this object Get a patasente card. And you can't add more than the balance in your prepaid account float found here.
payment_reason string Yes This is the reason to why a credit is being made against this card.Defualt is reason ."Refund"

List Prepaid Account Transactions

This section will take you through the steps for fetching company's prepaid account transactions on Patasente API.

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-prepaid-transactions?

The parameters that should be sent to this endpoint are "skip" , "take" .To limit the number of results returned from the query, or to skip a given number of results in the query, you may skip and take a given number of results. This also helps in pagination. "search" , "from_date" , "to_date" .A json response with the wallet balance will be returned

https://demo.patasente.com/phantom-api/get-prepaid-transactions?skip=0&take=10&search=patasente&from_date=2019-02-07&to_date=2019-06-05&

[ { "id": 14566, "currency_format": "UGX", "charge_currency_format": "UGX", "amount": "5000", "transaction_id": "00014566", "transaction_id_from_callback": null, "reference_id_from_callback": null, "financial_instrument_id": "", "financial_instrument_no": "", "names": "Gift Card", "phone": null, "bill_account_no": null, "bank_account": null, "bank_name": null, "bank_branch": null, "balance": "0", "charge": "0", "transaction_status": "Processed", "payment_reason": "Funds transferred to card", "paid_to": "", "paid_by": "Ssekalegga Brian", "paid_to_merchant_code": "", "paid_by_merchant_code": "M000001", "charge_bearer": null, "exchange_rate": null, "send_receipt": true, "transaction_type": "wallet payment", "type": "wallet", "created_at": "2020-09-13 03:51:07", "wallet_balance": "91,000", "card_transaction_type": "credit", "patasente_card_no": "1663********46561440" }, { "id": 14562, "currency_format": "UGX", "charge_currency_format": "", "amount": "150", "transaction_id": "00014562", "transaction_id_from_callback": null, "reference_id_from_callback": null, "financial_instrument_id": "", "financial_instrument_no": "", "names": "Gift Card", "phone": null, "bill_account_no": null, "bank_account": null, "bank_name": null, "bank_branch": null, "balance": "0", "charge": "500", "transaction_status": "Processed", "payment_reason": "Orm.s", "paid_to": "Ssekalegga Brian", "paid_by": "", "paid_to_merchant_code": "M000001", "paid_by_merchant_code": "", "charge_bearer": null, "exchange_rate": null, "send_receipt": true, "transaction_type": "wallet payment", "type": "wallet", "created_at": "2020-09-12 03:46:26", "wallet_balance": "348,038", "card_transaction_type": "debit", "patasente_card_no": "1663********13455034" }, ]

Below are the fields required by the API

Field Type Required Description
skip number No This is number of transactions that should be skipped but default is 0
take number Yes This is number of transactions that should be fetched per request but default is 10.
search number No This is search query.
from_date date No This is date from where you want to start the filtering of results.
to_date date No This is date from where you want to end the filtering of results.

Patasente Modules

Get Supported Modules

This section will take you through fetching supported modules on Patasente API.

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-supported-modules

NO parameter should be sent to this endpoint

https://demo.patasente.com/phantom-api/get-supported-modules

A json response with 200 success code will be returned

[ { "id": 1, "name": "Profile", "description": "Tell your clients about your business", "type": "profile", "status": "active" }, { "id": 2, "name": "Current Account", "description": "Makes it easy to deposit, withdraw, and spend your money.", "type": "wallet", "status": "active" }, { "id": 3, "name": "Messages", "description": "Talk to support", "type": "messages", "status": "active" }, { "id": 4, "name": "Notifications", "description": "Know that something new has happened in your account so you don't miss anything ", "type": "notifications", "status": "active" }, { "id": 5, "name": "Purchases", "description": "Send & receive Purchase Orders & Invoices", "type": "purchases", "status": "active" }, { "id": 6, "name": "Agent Account", "description": "Pay bills and receive commission", "type": "wallet", "status": "inactive" }, { "id": 7, "name": "Prepaid Account", "description": "Issue & Process Patasente Cards", "type": "wallet", "status": "inactive" }, { "id": 8, "name": "Credit Account", "description": "Request for financing", "type": "wallet", "status": "active" }, { "id": 8, "name": "Sente Cards", "description": "Activate sente cards.", "type": "cards", "status": "active" } ]

Note:Some modules maybe deactivated by Patasente so the status of modules will show you if its active or inactive.

Get User Active Modules

This section will take you through fetching a user's active modules on Patasente API.

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-active-modules

NO parameter should be sent to this endpoint

https://demo.patasente.com/phantom-api/get-active-modules

A json response with 200 success code will be returned

[ { "id": 1, "name": "Profile", "description": "Tell your clients about your business" }, { "id": 2, "name": "Current Account", "description": "Makes it easy to deposit, withdraw, and spend your money." }, { "id": 3, "name": "Messages", "description": "Talk to support" }, { "id": 4, "name": "Notifications", "description": "Know that something new has happened in your account so you don't miss anything " }, { "id": 7, "name": "Prepaid Account", "description": "Issue & Process Patasente Cards" }, { "id": 8, "name": "Credit Account", "description": "Request for financing" }, { "id": 5, "name": "Purchases", "description": "Send & receive Purchase Orders & Invoices" } ]

Get User Inactive Modules

This section will take you through fetching a user's inactive modules on Patasente API.

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-inactive-modules

NO parameter should be sent to this endpoint

https://demo.patasente.com/phantom-api/get-inactive-modules

A json response with 200 success code will be returned

[ { "id": 6, "name": "Agent Account", "description": "Pay bills and receive commission", "type": "wallet" } ]

Activate a module

This section will take you through activating a module on Patasente API.

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/activate-module/id

The parameters that should be sent to this endpoint are "id" and "status"

https://demo.patasente.com/phantom-api/activate-module/4

A json response with 200 success code will be returned

{ "success": "Credit Account module is active" }

If there any errors, a json response with 400 error code will be returned

{ "error": "Module Activation Failed" }

Below are the fields required by the API

Field Type Required Description
id number Yes This is the id of the module to be activated from Get user inactive modules

Deactivate a module

This section will take you through deactivating a module on Patasente API.

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/deactivate-module/id

The parameters that should be sent to this endpoint are "id" and "status"

https://demo.patasente.com/phantom-api/deactivate-module/4

A json response with 200 success code will be returned

{ "success": "Credit Account module is inctive" }

If there any errors, a json response with 400 error code will be returned

{ "error": "Module Deactivation Failed" }

Below are the fields required by the API

Field Type Required Description
id number Yes This is the id of the module to be deactivated from Get user active modules

Transfer funds between wallet modules

This section will take you through transferring funds between wallet modules on Patasente API.

Two (2) requests should be made.

A GET request should be made to this API endpoint to fetch active wallet modules

https://demo.patasente.com/phantom-api/get-active-modules/wallet

A json response with 200 success code will be returned

[ { "id": 2, "name": "Current Account balance - UGX 3513602", "balance": 3513602 }, { "id": 7, "name": "Prepaid Account balance - UGX 3000000", "balance": 3000000 }, { "id": 8, "name": "Credit Account balance - UGX 0", "balance": 0 } ]

Note the balance in the response can be used to do calculations on the fly against user's entry

A PUT request should be made to this API endpoint

https://demo.patasente.com/phantom-api/transfer-funds-between-wallet-account

The parameters that should be sent to this endpoint are "to_wallet_account" , "from_wallet_account" and "amount"

https://demo.patasente.com/phantom-api/transfer-funds-between-wallet-account?amount=1000&from_wallet_account=2&to_wallet_account=2

A json response with 200 success code will be returned

{ "success": "1,000 has been transferre" }

If there any errors, a json response with 400 error code will be returned

{ "error": "You don\'t have enough funds" }

Below are the fields required by the API

Field Type Required Description
amount number Yes This is the amount to be transferred
from_wallet_account number Yes This is the id of the module to be debited from Get user active modules
to_wallet_account number Yes This is the id of the module to be credited from Get user active modules

Sente Cards

This is the section where a verified merchants can activate Sente cards for users on Patasente .

Inorder for a merchant to be able to activate Sente cards, it must have a Sente Cards module active. This module is activated by Patasente admin at the admin dashboard

Activate a sente card

This section will take you through activating a Sente Card on Patasente API.

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/activate-sente-card

The parameters that should be sent to this endpoint are "card_id" ,"phone_number" ,"email" ,"name" ,"pin" and "document"

https://demo.patasente.com/phantom-api/activate-sente-card?name=Ivan Yiga&phone_number=256783159235&card_id=24&email&pin=2123&document=base64:datafjhdhhvd=4&card_agreement=true&platform_agreement=true

A json response with 200 success code will be returned

{ "success": "A 4 digit verification code has been sent to Yiga Ivan's phone or email.", "phone_number" : "+256780000000", "user_id" : 34 }

If there any errors, a json response with 400 error code will be returned

{ "error": "Card is already assigned to an account" }

Below are the fields required by the API

Field Type Required Description
card_id number Yes This is the id of the scanned card to be activated.This card_id is in the last index position of the string forexample 1613*****65219&11/23&UGX&0&Debit Card&108
card_no : 1613*****65219
expiry date : 11/23
currency : UGX
digit : 0
card_type : Debit Card
card_id : 108
name string Yes This is the name of the card holder, this name should match exactly on the identification document
phone_number number Yes This is the phone number of the card holder.It should be valid and active to receive SMS code
email email No This is the email of the card holder
pin number Yes This is the PIN for the card, it should be 4 digits
document string Yes This is the identification document for the card holder, it can be Passport ,National ID or Drivers License. it should be a in base64 format
card_agreement string Yes These are the card holders terms and conditions.The user has to agree to these terms and the value should be true case senstive
platform_agreement string Yes These are the Patasente terms and conditions.The user has to agree to these terms and the value should be true case senstive

Once a card has been activated json response with 200 success code will be returned and a 4 digit code will be sent to both the card holder's phone and email, the next step is to verify the card holder's phone number.

A PUT request should be made to this API endpoint

https://demo.patasente.com/phantom-api/phone-code-verification

The parameters that should be sent to this endpoint are "user_id" ,"phone_number" and "code"

https://demo.patasente.com/phantom-api/phone-code-verification?phone_number=256783159235&user_id=24&code=2123

A json response with 200 success code will be returned

{ "success": "Phone number has been verified" }

If there any errors, a json response with 400 error code will be returned

{ "error": "Verification code doesn't match" }

Below are the fields required by the API

Field Type Required Description
user_id number Yes This is the id of the card holder returned when activating a Sente card.
code number Yes This is the 4 digit code sent to card holder's phone number or email
phone_number number Yes This is the phone number of the card holder returned when activating a Sente card

Get activate sente cards

This section will take you through fetching a list of activated Sente Cards by a merchant on Patasente API.

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-activated-sente-cards

No parameters should be sent to this endpoint.

https://demo.patasente.com/phantom-api/get-activated-sente-cards

A json response with 200 success code will be returned

[ { "id": 28, "company_id": 6, "business_name": "Ssekalegga Brian", "merchant_code": "M000001", "card_names": "SSEKALEGGA BRIAN", "phone_number": "+256783000001", "card_no": "1613*****32177", "created_at": "2021-04-20T01:23:07.000000Z" }, { "id": 24, "company_id": 2621, "business_name": "Yiga Ivan", "merchant_code": "M002627", "card_names": "IVAN YIGA", "phone_number": "25678300000", "card_no": "1616*****52288", "created_at": "2021-03-18T22:10:59.000000Z" } ]

If there any errors, a json response with 400 error code will be returned

{ "error": "No Cards found" }

Get company sente card

This section will take you through fetching a list of a logged in user Sente Cards on Patasente API.

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-company-sente-cards

No parameters should be sent to this endpoint.

https://demo.patasente.com/phantom-api/get-company-sente-cards

A json response with 200 success code will be returned

[ { "id": 28, "card_no": "1613*****32177", "status": "active", "expiry_date": "04/23" } ]

If there any errors, a json response with 400 error code will be returned

{ "error": "No Cards found" }

Lock Sente Card

This section will take you through locking a Sente Card on Patasente API.

A PUT request should be made to this API endpoint

https://demo.patasente.com/phantom-api/lock-sente-card

The parameters that should be sent to this endpoint are "card_id"

https://demo.patasente.com/phantom-api/lock-sente-card/2123

A json response with 200 success code will be returned

{ "success": "Card is has been locked, no transactions can be done with this card." }

If there any errors, a json response with 400 error code will be returned

{ "error": "Card is already locked" }

Below are the fields required by the API

Field Type Required Description
card_id number Yes This is the id of the card returned from list of company Sente cards.

Unlock Sente Card

This section will take you through activating a Sente Card on Patasente API.

A PUT request should be made to this API endpoint

https://demo.patasente.com/phantom-api/unlock-sente-card

The parameters that should be sent to this endpoint are "card_id"

https://demo.patasente.com/phantom-api/unlock-sente-card/2123

A json response with 200 success code will be returned

{ "success": "Card is active" }

If there any errors, a json response with 400 error code will be returned

{ "error": "Card is already active" }

Below are the fields required by the API

Field Type Required Description
card_id number Yes This is the id of the card returned from list of company Sente cards.

Get A Patasente Card

This section will fetch details of a single Sente card if you scan the QR Code on Patasente API.

A GET request should be made to this API endpoint

https://demo.patasente.com/phantom-api/get-patasente-card/

The parameters that should be sent to this endpoint are "id" and "card_no"

When the QR Code on the card is scanned , you'll get a string with card id and card_no.The id is the second last argument in the string that's stored in the QR Code

https://demo.patasente.com/phantom-api/get-patasente-card/4/1663********06916067

A json response with 200 success code will be returned

{ "id": 24, "company_id": 2621, "currency": "UGX", "currency_id": 1, "card_no": "1616*****52241141888", "credit_account_limit": "10000", "available_credit": "1200", "current_account_wallet_balance": 0, "total_monetary_points_value": 0, "total_points": 0, "status": "active", "has_pin": true, "expiry_date": 04/22, "wallets": [ { "name": "Current Account" }, { "name": "Credit Account" } ] }

If there any errors, a json response with 400 error code will be returned

{ "error": "Card doesn't exist." }

Debit a Patasente Card

This section will take you through modifying a Patasente Card status on Patasente API.

A POST request should be made to this API endpoint

https://demo.patasente.com/phantom-api/debit-patasente-card/id

The parameters that should be sent to this endpoint are "id" and "amount" ,"payment_reason" ,"pin" ,"wallet_account"

https://demo.patasente.com/phantom-api/debit-patasente-card/107?amount=3000&payment_reason=payment for bananas&pin=7364&wallet_account=Credit Account

A json response with 200 success code will be returned

{ "success": "Funds have been debited from card 1663********06916067" }

If there any errors, a json response with 400 error code will be returned

{ "error": "This card requires a PIN to complete this transaction" }

Below are the fields required by the API

Field Type Required Description
id number Yes This is the id of the card to be debited got from scanning a QR Code on the client card. Get a patasente card
amount number Yes This is the amount to be debited for the transaction.
payment_reason string Yes This is the reason to why a debit is being made against this card.
pin number Yes This is a four(4) digit PIN that secures the Card. Option for entering a PIN should popup if the card requires a PIN to complete a transaction. A notice should pop informing the merchant to give the device the client to enter their Card PIN
wallet_account string Yes This is the wallet_account a user wants to use for the transaction.Refer to the data returned from Get a patasente card after scanning the QR Code on the card to determine the you'll get an array of available wallets for this card. You can't debit more than the balance of the Current Account or more than the available_credit or credit_account_limit which is returned as amount in this object Get a patasente card

Acknowledgements

© 2020.

Patasente is developed and maintained by @LebronBrian23 .