API Documentation

Our set of API allows you to integrate our services, manage organisations, users in a simple and programmatic way, using conventional HTTP requests. The endpoints are intuitive and powerful, allowing you to easily make calls to retrieve information or to execute actions.

The API documentation will start with a general overview about the design and technology that has been implemented, followed by reference information about specific endpoints.

Types of integration

  1. Service Redirect
    • This method requires minimal development time as most of the logic is hosted on our service page you are redirecting to.
    • This method will still require the setup of a auth token before redirecting.
    • Services that supports redirect: Agent Assist, Agent Monitor and Agent Request.
  2. Service Enterprise
    • Most of the API's are straight forward REST.
    • Some services like ASSIST/MONITOR/REQUEST are event driven. This will require you to setup Websocket event listeners using the WAMP2 protocol. You can use a cross platform library like Autobahn to connect to our endpoint.
    • This type of integration requires you to setup your own UI logic.
    • Services that supports enterprise integration: Agent Assist, Agent Monitor, Agent Request, Express and POS.
  3. Webhooks
    • Used for recon.
    • Will send you related information right after a transaction is completed.
    • Configurable under Settings→Integration in the admin console.

Webhook payload example

In settings you can configure your success and error webhook urls. The result will be sent as an HTTP POST request in the following format:

Webhook sample post request

                
                POST = [
                    'success' => {1 or 0}
                    'organisation_id' => {merchant_id}
                    'callpay_transaction_id' => {gateway_transaction_id}
                    'reason' => ‘{reasonForFailureIfApplicable}’
                    'user' => ‘{paymentUser}’
                    'merchant_reference' => ‘{merchant_reference}’
                    'gateway_reference' => ‘{psp_reference}'
                    'gateway_response' => ‘{additionalDataFromPSP}’
                ]
                
            

Types of Services


This document is filtered services assigned for: Do NOT DELETE FOR DOCS
Your account currently has the following services activated:
Service Integration methods Activated
Agent Assist
A call center service for taking payment details while on call
Redirect & Enterprise No
Agent Monitor
A call center service for taking payment details by forwarding the customer on the call to an IVR
Redirect & Enterprise No
Agent Request
A call center service for taking payment details over network initiated USSD.
Enterprise No
POS (Point of Sale)
A service requesting payments via a IVR phone call to the customer.
Enterprise No
Pay Direct (Coming Soon)
A website or mobile service for accepting credit card payments via a redirect.
Redirect No
EFTsecure
A website or mobile service for accepting instant EFT
Hosted & Self Hosted Yes
Notify Express
A notification service for Pay Direct and EFTsecure. Email and SMS supported.
Enterprise No

Requests

Any tool that is fluent in HTTP can communicate with the API simply by requesting the correct URI. Requests should be made using the HTTPS protocol so that traffic is encrypted. The interface responds to different methods depending on the action required.

Method Usage
GET

For simple retrieval of information you should use the GET method. The information you request will be returned to you as a JSON object.

DELETE

To destroy a resource and remove it from your account and environment, the DELETE method should be used.

PUT

To update the information about a resource in your account, the PUT method is available.

POST

To create a new object, your request should specify the POST method.

The POST request includes all of the attributes necessary to create a new object. When you wish to create a new object, send a POST request to the target endpoint.

HTTP Statuses

Along with the HTTP methods that the API responds to, it will also return standard HTTP statuses, including error codes.

In the event of a problem, the status will contain the error code, while the body of the response will usually contain additional information about the problem that was encountered.

In general, if the status returned is in the 200 range, it indicates that the request was fulfilled successfully and that no error was encountered.

Return codes in the 400 range typically indicate that there was an issue with the request that was sent. Among other things, this could mean that you did not authenticate correctly, that you are requesting an action that you do not have authorization for, that the object you are requesting does not exist, or that your request is malformed.

If you receive a status in the 500 range, this generally indicates a server-side problem. This means that we are having an issue on our end and cannot fulfill your request currently.

HTTP status example

RESPONSE


{
    "name": "Unauthorized",
    "message": "",
    "code": 0,
    "status": 401,
    "type": "yii\\web\\UnauthorizedHttpException"
}

Responses

When a request is successful, a response body will typically be sent back in the form of a JSON object.

For example, if you send a GET request to /api/v1/user/$USER_ID you will get back an object for that user. If you send the GET request /api/v1/organisation/$ORGANISATION_ID/user

Examples

Single Object


{
    "id": 1,
    "name": "John",
    ...
}

Object Collection


[
    {
        "id": 1,
        "name": "John",
        ...
    },
    {
        "id": 2,
        "name": "Joe",
        ...
    },
    {
        "id": 3,
        "name": "Jane",
        ...
    }
]

Response Language

Setting the Accept-Language header will change the language (if supported by platform).

Examples

Request

curl -X GET -H 'Accept-Language:tr-TR' -H 'X-Token:xyzxyz' https://eftsecure.callpay.com/api/v1/organisation/1234567

Internationalised Response


{
    "name": "Unauthorized",
    "message": "Hatalı kullanıcı adı veya şifre.",
    "code": 0,
    "status": 401,
    "type": "yii\\web\\UnauthorizedHttpException"
}

Authentication

A token must be sent in the headers of a request for authentication

A token can be created for a user by making an API call with basic authentication (a valid user's username and password must be sent as credentials) to following URL:

Url: https://eftsecure.callpay.com/api/v1/token

Keep in mind that Agent users are limited to service api calls that they are authorised to use.

Fetch token example

Request

curl -X POST -u validusername:validpassword https://eftsecure.callpay.com/api/v1/token

Response


{
    "token": "b5cfaae0e94e79d0073f4925143dca2c",
    "expires": "2016-09-07 08:46:16"
}

Constants

Some of these constants are required for certain API calls.

Available Service IDs

These are the service IDs available to your organisation.

ID Service
12 EftX

Available Gateway IDs

List of available gateways

ID Gateway
1 PayU

User roles

List of available user roles Post with string value
eg. User[role] = 'agent'

Role Description
administrator User that can manage the organisation and users
agent Call centre agent that uses our services

Using services

Allows agents and apps to make use of our services through the API.

EFTsecure Introduction

The EFTsecure service is our instant EFT payment method. It requires a customer to login as if on their internet banking system and automates the rest of the payment process and notifies to merchant through web hooks or enterprise api's that the payment has been made. A merchants banking details can be setup under settings→eft in the admin console.

Integration methods:

  • Hosted: Redirect to a secure payment page hosted on our system. We manage the security and redirect back with a result.
  • Self Hosted: EFTsecure's enterprise integration, allows you to change the styling and host on your own pages. Requires a SSL certificate.
  • Checkout: EFTsecure's on page payment popup. Allows payments to be processed on page without leaving the site and still being descoped from PCI compliance. Requires a SSL certificate.

Requirements

  • A unique payment-key securely generated server side.
  • The self hosted and checkout integration requires JQuery 1.* and a SSL certificate hosted page for production.
  • At the moment this is a web based service, if you require a in-app solution you will need to see if your framework supports web views.

EFTsecure Payment Key

The payment key is a identifier for each payment and required by all of the the EFTsecure integrations.

Url: https://eftsecure.callpay.com/api/v1/eft/payment-key

This will save the parameter values for the transaction and then must be used to authenticate request on the different integrations.

Authentication options include basic auth or using an Auth Token

NB: Following are valid banks for beneficiary_bank field:
[ABSA, Nedbank, Capitec, FNB, Standard, Investec]

NB: Following are valid account types for beneficiary_account_type field:
[cheque, savings, transmission]

NB: If sending custom beneficiary bank details the hash field is required.
You must add an API salt in your organisation's settings under the general tab for this.
To generate the hash concatenate the beneficiary_account_number, beneficiary_name, beneficiary_account_type,
beneficiary_bank fields and your API salt in that order. Convert the string to lower case then hash that string using SHA-256 algorithm.
See code examples below on how to generate in different programming languages.

Post parameters:

Attribute Type Description Required
token Auth token ie. c8e542542bcd6b35a5bb708a6df66f08 If no bauth
amount decimal[10,2] 10.00 Yes
merchant_reference string transaction reference Yes
success_url string Redirect url for success No
error_url string Redirect url on error No
cancel_url string Redirect url on cancel No
notify_url string Webhook for getting notified about results No
listed_beneficiary_account string The account number reference for the customer if merchant is public listed beneficiary at the bank No
default_beneficiary_reference string The default reference when creating the beneficiary. Useful for account numbers. No
beneficiary_account_number string To override beneficiary account number. No
beneficiary_name string To override beneficiary name. No *required if beneficiary account number set
beneficiary_account_type string Beneficiary account number type No *required if beneficiary account number set
beneficiary_bank string Beneficiary account number bank No *required if beneficiary account number set
hash string A sha1 hash of account details and API salt No *required if beneficiary account number set

Fetch payment key example

Request using auth token

curl -X POST -H 'X-Token:xyzxyz' https://eftsecure.callpay.com/api/v1/eft/payment-key -d "amount=1&merchant_reference=testref123"

Request using basic auth

curl -X POST -u validusername:validpassword https://eftsecure.callpay.com/api/v1/eft/payment-key -d "amount=1&merchant_reference=testref123"

Response


{
    "key": "4ea1ea853463dab5b24f7066c1fc8f4b",
    "url": "https://eftsecure.callpay.com/eft?payment_key=4ea1ea853463dab5b24f7066c1fc8f4b"
}

How to generate Hash in different languages


// PHP
$stringToHash = $beneficiary_account_number.$beneficiary_name.$beneficiary_account_type.$beneficiary_bank.$api_salt;
$hash = hash('sha256', strtolower($stringToHash));

// RUBY
require 'digest'
stringToHash = beneficiary_account_number+beneficiary_name+beneficiary_account_type+beneficiary_bank+api_salt;
hash = Digest::SHA256.hexdigest(stringToHash.downcase);

// PYTHON
import hashlib
string_to_hash = beneficiary_account_number+beneficiary_name+beneficiary_account_type+beneficiary_bank+api_salt
hash = hashlib.sha256(string_to_hash.lower()).hexdigest()

EFTsecure Hosted (Redirect)

Our hosted method for instant EFT's requires minimal development.

It requires a redirect to a endpoint which will in turn be the payment page hosted on our platform.

After a payment is complete we can notify your system through our web hooks or you can do a lookup of the transaction.

First you will need to create a payment key. This will be used to setup the payment.

EFTsecure Hosted Example

Sample url to redirect to


https://eftsecure.callpay.com/eft?payment_key={generatedPaymentKey}                
            

EFTsecure Self Hosted (Enterprise)

This integration method gives you more flexibility and allows you to host it on your own website/platform.

You can apply your own stylesheet or use our bootstrap stylesheet. See framework option in the javascript library.

After a payment is complete we can notify your system through our web hooks or you can do a lookup of the transaction.

First you will need to create a Payment key. This will be used by the library to authenticate every jsonp call and save your initial data.

Then you will need to copy a code snippet (see example below) onto your page which will invoke a EFTsecure javascript plugin. Link to javascript plugin

EFTsecure javascript plugin parameters:

onLoadStart: function(){}, onLoadStop: function(){}, submitMessage: null, onCancelUrl: "", onCompleteUrl: "", sessionID: null, server: null
Attribute Type Description Required
key string Payment key generated server side Yes
baseUrl string
Default:https://eftsecure.callpay.com/api/v1
Override to specific a specific button container No
formId string
default:"eftx-form"
The html ID of the form to populate No
titleId string
default:"eftx-title"
The html ID of the primary heading to populate No
subTitleId string
default:"eftx-subtitle"
The html ID of the secondary heading to populate No
cssFramework string[plain,bootstrap]
default:"plain"
How to format the html for the form No
buttonContainerId string Override to specific a specific button container No
buttonContainerId string Override to specific a specific button container No
onLoadStart callback Executed when form is submitted on each step No
onLoadStop callback Executed when result is received for each step No

Examples

Unstyled example

Add the following to your <head> tag:

                
<!-- If you do not already use jQuery include it  -->
<script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="https://eftsecure.callpay.com/js/eft-secure.min.js"></script>
                
            

Copy and paste the following html and insert the dynamic {{parameters}}:


                    
<!-- Eftx plain START --> <h1 id="eftx-title">Initialising Transaction</h1> <div>Merchant: {{merchantName}} ({{merchantBank}}), Amount: {{currencyFormattedAmount}}</div> <h2 id="eftx-subtitle"></h2> <div id="loader" style="display: none;">Loading...</div> <form id="eftx-form" autocomplete="false"></form> <div style="clear:both"></div> <div id="eftx-button-container"></div> <script> $(document).ready(function() { new Eftx({ key: "{{paymentKey}}", formId: "eftx-form", titleId: "eftx-title", subTitleId: "eftx-subtitle", cssFramework: "plain", buttonContainerId: "eftx-button-container", //onCancelUrl: "{{yourCancelUrl}}", //onCompleteUrl: "{{yourCompleteUrl}}", onLoadStart: function(){ $("#loader").hide(); $("#eftx-form").hide(); $("#eftx-button-container").hide(); //Do other stuff here }, onLoadStop: function(){ $("#loader").addClass("hide"); $("#eftx-form").show(); $("#eftx-button-container").show(); //Do other stuff here } }); }); </script> <!-- Eftx plain END -->

Boostrap styled example

Add the following to your <head> tag:

                
<!-- If you do not already use jQuery include it  -->
<script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="https://eftsecure.callpay.com/js/eft-secure.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://eftsecure.callpay.com/css/eftx.css">
                
            

Copy and paste the following html and insert the dynamic {{parameters}}:


                    
<!-- Eftx boostrap START --> <div class="eft modal" id="eftxModal" tabindex="-1" role="dialog" aria-labelledby="title"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h4 class="modal-title pull-left" id="eftx-title">Initialising Transaction</h4> <h4 class="modal-title pull-right">Amount: {{currencyFormattedAmount}}</h4> <div class="clearfix"></div> <div>Merchant: {{merchantName}} ({{merchantBank}})</div> </div> <div class="modal-body"> <h4 id="eftx-subtitle"></h4> <div class="eftx-loader"> <div class="container"> <div class="loader"> <div class="loader--dot"></div> <div class="loader--dot"></div> <div class="loader--dot"></div> <div class="loader--dot"></div> <div class="loader--dot"></div> <div class="loader--dot"></div> <div class="loader--text"></div> </div> </div> </div> <form id="eftx-form" autocomplete="false"></form> <div class="clearfix"></div> </div> <div class="modal-footer" id="eftx-button-container"> </div> </div> </div> </div> <script type="text/javascript"> $(document).ready(function() { new Eftx({ key: "{{paymentKey}}", //enum[bootstrap, none] cssFramework: "bootstrap", buttonContainerId: "eftx-button-container", //onCancelUrl: "{{yourCancelUrl}}", //onCompleteUrl: "{{yourCompleteUrl}}", backgroundEnabled: true, onLoadStart: function(){ $(".eftx-loader").removeClass("hide"); $("#eftx-form").hide(); $(".modal-footer button").hide(); //Do other stuff here }, onLoadStop: function(){ $(".eftx-loader").addClass("hide"); $("#eftx-form").show(); $(".modal-footer button").show(); //Do other stuff here } }); }); </script> <!-- Eftx bootstrap END -->

Checkout Widget

This integration method allows you to host EFT on your own website/platform and still descope you from PCI compliance.

NB: A SSL certificate is required to ensure compatibility with the frame.

First you will need to create a Payment key. This will be used by the widget to authenticate the payment in the frame.

NB: When creating a payment key you must specify the redirect success and error urls, if not set page will redirect to callpay default receipt page after transaction

You will need to copy a code snippet (see example below) onto your page which will invoke a EFTsecure checkout widget. Click here to view a live example

Checkout widget parameters:

Attribute Type Description Required
paymentKey string Payment key generated server side Yes
onLoad event Override for example re-enable payment button No

Checkout Example

Add the following to your <head> tag:

                
<!-- If you do not already use jQuery include it  -->
<script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="https://eftsecure.callpay.com/ext/checkout/v2/checkout.js"></script>
                                    
            

Copy and paste the following html and insert the dynamic {{parameters}}:


                    
<form id="#payment-form" action="/checkout?confirm=1" style="margin-top: 50px"> <div class="text-center"> <button id="pay-button" class="btn btn-primary btn-sx" type="button" data-payment-key="{{paymentKey}}">Pay</button> </div> </form> <script type="text/javascript"> window.addEventListener("message", function(event) { if (typeof event.data != 'undefined') { eval(event.data); //handle frame events from child frame } }); $(function() { $('#pay-button').on('click', function() { $(this).hide(); var paymentKey = $(this).data('payment-key'); eftSec.checkout.init({ paymentKey: paymentKey, paymentType: 'credit_card', // optional: force payment type to credit_card or eft onLoad: function() { $('#pay-button').show(); } }); }); }); </script>

Transaction & Recon

Allows you to view/confirm or list a organisation transactions.

List organisation transactions

Fetch all transactions for an organisation by organisation id.' Organisation id is required in url

Request Method: GET

Url: https://eftsecure.callpay.com/api/v1/organisation/$ORGANISATION_ID/gateway-transaction

Returned attributes per transaction:

Attribute Type Description
id integer unique primary key for transaction
successful integer integer indicating whether transaction was successful or not (1 being true 0 being false)
amount decimal transaction amount
gateway_reference text payment gateway reference number
created date date and time of transaction
service text name of service used by agent

List organisation transactions example

cURL Request

curl -X GET -H 'X-Token:xyzxyz' https://eftsecure.callpay.com/api/v1/organisation/$ORGANISATION_ID/gateway-transaction

Response


[
    {
        "id": 166,
        "successful": 1,
        "amount": "123.00",
        "gateway_reference": "Gateway_merchant_ref_1434026074",
        "created": "2015-06-11 12:34:34",
        "service": "Scan Card"
    },
    {
        "id": 167,
        "successful": 1,
        "amount": "123.00",
        "gateway_reference": "Gateway_merchant_ref_1434026303",
        "created": "2015-06-11 12:38:23",
        "service": "POS"
    },
    {
        "id": 168,
        "successful": 1,
        "amount": "123.00",
        "gateway_reference": "Gateway_merchant_ref_1434027451",
        "created": "2015-06-11 12:57:31",
        "service": "POS"
    }
]

List transactions by User

Fetch all transactions for user by user id.User id is required in url

Request Method: GET

Url: https://eftsecure.callpay.com/api/v1/user/$USER_ID/gateway-transaction

Returned attributes per transaction:

Attribute Type Description
id integer unique primary key for the transaction
successful integer integer indicating whether transaction was successful or not (1 being true 0 being false)
amount decimal transaction amount
gateway_reference text payment gateway reference number
created date date and time of transaction
service text name of service used by agent

List gateway transactions by user example

cURL Request

curl -X GET -H 'X-Token:xyzxyz' https://eftsecure.callpay.com/api/v1/user/$USER_ID/gateway-transaction

Response


[
    {
        "id": 166,
        "successful": 1,
        "amount": "123.00",
        "gateway_reference": "Gateway_merchant_ref_1434026074",
        "created": "2015-06-11 12:34:34",
        "service": "Scan Card"
    },
    {
        "id": 167,
        "successful": 1,
        "amount": "123.00",
        "gateway_reference": "Gateway_merchant_ref_1434026303",
        "created": "2015-06-11 12:38:23",
        "service": "POS"
    },
    {
        "id": 168,
        "successful": 1,
        "amount": "123.00",
        "gateway_reference": "Gateway_merchant_ref_1434027451",
        "created": "2015-06-11 12:57:31",
        "service": "POS"
    }
]

View Transaction

View transaction by id. Will be sent back as single object and status 200. Transaction id is required

Request Method: GET

Url: https://eftsecure.callpay.com/api/v1/gateway-transaction/$GATEWAY_TRANSACTION_ID

Returned attributes:

Attribute Type Description
id integer unique primary key for transaction
successful integer integer indicating whether transaction was successful or not (1 being true 0 being false)
amount decimal transaction amount
gateway_reference text payment gateway reference number
created date date and time of transaction
service text name of service used by agent

Fetch transaction example

cURL By ID

curl -X GET -H 'X-Token:xyzxyz' https://eftsecure.callpay.com/api/v1/gateway-transaction/$GATEWAY_TRANSACTION_ID
OR

cURL By merchant reference

curl -X GET -H 'X-Token:xyzxyz' https://eftsecure.callpay.com/api/v1/gateway-transaction/?reference=$MERCHANT_REFERENCE
OR

cURL By payment key

curl -X GET -H 'X-Token:xyzxyz' https://eftsecure.callpay.com/api/v1/gateway-transaction/?key=$PAYMENT_KEY

Response


{
    "id": 168,
    "successful": 1,
    "amount": "123.00",
    "gateway_reference": "Gateway_merchant_ref_1434027451",
    "created": "2015-06-11 12:57:31",
    "service": "POS"
}

Refund a transaction

Some gateways supports refund capability of the full amount.

Request Method: PUT

Url: https://eftsecure.callpay.com/api/v1/gateway-transaction/refund/$transaction_id

Refund transaction example

cURL Request

curl -X PUT -H 'X-Token:xyzxyz' https://eftsecure.callpay.com/api/v1/gateway-transaction/refund/$transaction_id<

Response


{
    "result": true
}

User

Allows you manage organisation users.

List all Users

Fetch all users for an organisation by organisation id.' Organisation id is required in url

Request Method: GET

Url: https://eftsecure.callpay.com/api/v1/organisation/$ORGANISATION_ID/user

Returned attributes per user:

Attribute Type Description
id integer unique primary key for user
name text user first name
lastname text user last name
username text user username
email valid email address user email address
contact_number integer user contact number
organisation_id integer user organisation id
created date date user was created
extension integer If user is type agent will return an extension for him/her

List all example

cURL Request

curl -X GET -H 'X-Token:xyzxyz' https://eftsecure.callpay.com/api/v1/organisation/$ORGANISATION_ID/user

Response


[
    {
        "id": 2,
        "name": "John",
        "lastname": "Doe",
        "username": "johndoe",
        "email": "johndoe@merchantcompany.co.za",
        "contact_number": 0821234567,
        "organisation_id": 3,
        "created": "2015-02-03 14:19:39",
        "extension": "4444"
    },
    {
        "id": 3,
        "name": "Joe",
        "lastname": "Doe",
        "username": "joedoe",
        "email": "joedoe@merchantcompany.co.za",
        "contact_number": 0821234567,
        "organisation_id": 3,
        "created": "2015-02-03 14:19:39",
        "extension": "5555"
    }
]

View User

View existing user by User id. Will be sent back as single object and status 200. User id is required

Request Method: GET

Url: https://eftsecure.callpay.com/api/v1/user/$USER_ID

Returned attributes:

Attribute Type Description
id integer unique primary key for user
name text user first name
lastname text user last name
username text user username
email valid email address user email address
contact_number integer user contact number
organisation_id integer user organisation id
created date date user was created
extension integer If user is type agent will return an extension for him/her

View example

cURL Request

curl -X GET -H 'X-Token:xyzxyz' https://eftsecure.callpay.com/api/v1/user/3

Response


{
    "id": 3,
    "name": "Joe",
    "lastname": "Doe",
    "username": "joedoe",
    "email": "joedoe@merchantcompany.co.za",
    "contact_number": 0821234567,
    "organisation_id": 3,
    "created": "2015-02-03 14:19:39",
    "extension": "5555"
}

Create User

Create new user Will be send back a single object (see View User for returned attributes) and status 201 (Created).

Request Method: POST

Url: https://eftsecure.callpay.com/api/v1/user

User Post parameters: post as User[$ATTRIBUTE]

Attribute Type Description Required
username text user username Yes
role valid user role See list of user roles Yes
password text user password No
name text user first name No
lastname text user last name No
email valid email address user email address No
contact_number integer user contact number No

Create example

cURL Request

curl -X POST -H 'X-Token:xyzxyz' https://eftsecure.callpay.com/api/v1/user -d "User[username]=unique&User[role]=agent"

Response


{
    "id": 8,
    "name": null,
    "lastname": null,
    "username": "unique",
    "email": null,
    "contact_number": null,
    "organisation_id": 3,
    "created": "2015-02-03 14:19:39",
    "extension": null
}
      

Update User

Update existing organisation by User id.User id is required in url'); ?>

Request Methods: PUT

Url: https://eftsecure.callpay.com/api/v1/user/$USER_ID

User Put parameters: post as User[$ATTRIBUTE]

Attribute Type Description
username text user username
password text user password
role valid user role See list of user roles
name text user first name
lastname text user last name
email valid email address user email address
contact_number integer user contact number

Update example

cURL Request

curl -X PUT -H 'X-Token:xyzxyz' https://eftsecure.callpay.com/api/v1/user/8 -d "User[name]=Jason"

Response


{
    "id": 8,
    "name": "Jason",
    "lastname": null,
    "username": "unique",
    "email": null,
    "contact_number": null,
    "organisation_id": 3,
    "created": "2015-02-03 14:19:39",
    "extension": null
}

Licenses

Allows you to update organisation licenses and activate/deactivate agent licenses.

Update organisation licenses

Update amount of licenses organisation has for a service by Organisation id.Organisation id is required in url

Request Method: PUT

Url: https://eftsecure.callpay.com /api/v1/organisation/$ORGANISATION_ID/licenseupdate

Put parameters: post array of service ids with service id as key and amount of licenses as value
eg. serviceId[$SERVICE_ID_ONE]=$AMOUNT_OF_LICENSES
eg. serviceId[$SERVICE_ID_TWO]=$AMOUNT_OF_LICENSES
See available service IDs

Update example

cURL Request

curl -X PUT -H 'X-Token:xyzxyz' https://eftsecure.callpay.com/api/v1/organisation/10/licenseupdate -d "serviceId[1]=25&serviceId[2]=35"

Response


{
    "Organisation": "Organisation name",
    "Services": {
        "serviceId": {
            "1": "25",
            "2": "35"
        }
    }
}

Activate user

Activate user license for service/s by user id.User id is required in url

Request Method: PUT

Url: https://eftsecure.callpay.com/api/v1/user/$USER_ID/activate

Put parameters: post array of service ids
eg. serviceId[]=$SERVICE_ID_ONE
serviceId[]=$SERVICE_ID_TWO
See available service IDs

Activate user example

cURL Request

curl -X PUT -H 'X-Token:xyzxyz' https://eftsecure.callpay.com/api/v1/user/2/activate -d "serviceId[]=1&serviceId[]=2"

Response


{
    "services": {
            "service_one": "Activated",
            "service_two": "Activated"
        },
    "User": {
            "id": 2,
            "name": "4315",
            "lastname": "4315",
            "email": "4315@callpay.co.za",
            "username": "4315"
        }
}

Deactivate user

Deactivate user license for service/s by user id.User id is required in url

Request Method: PUT

Url: https://eftsecure.callpay.com/api/v1/user/$USER_ID/deactivate

Put parameters: post array of service ids
eg. serviceId[]=$SERVICE_ID_ONE
eg. serviceId[]=$SERVICE_ID_TWO
See available service IDs

Deactivate user example

cURL Request

curl -X PUT -H 'X-Token:xyzxyz' https://eftsecure.callpay.com/api/v1/user/3/deactivate -d "serviceId[]=1&serviceId[]=2"

Response


{
    "services": {
            "service_one": "Deactivated",
            "service_two": "Deactivated"
        },
    "User": {
            "id": 3,
            "name": "4315",
            "lastname": "4315",
            "email": "4315@callpay.co.za",
            "username": "4315"
        }
}