PayThem.Net - Distributor API - API Developer Guide v1.0.3
PayThem.Net - Distributor API - API Developer Guide v1.0.3
Version 1.0.3
Related documents
No Document name Description
Business Process: Inbound API Describes the process for new, inbound
Integration integrations.
1. Documentation location
The API documentation is constantly updated as new requirements or features are added.
https://downloads.paythem.net/05_API_Libraries/
If you receive this documentation via email or other means, please immediately check the above link
to confirm you have received the latest.
If you are using one of our client repositories, best practice is to review the repo monthly.
3rd party clients can connect to PayThem’s Virtual Voucher System (VVS) to expand their current
offerings or build new applications via direct integration with PayThem.
2.3.Environments
PayThem provides two separate environments for client access.
Environment Purpose
Demo For testing connectivity between client system and VVS and testing
functionality of VVS.
All information is like Production environment, but all transactions issued have
no monetary impact.
Retailer IDs differ from production.
A balance is loaded onto the accounts for testing.
No static IP required.
Production Production environment, all data is real-time and all transactions are real and
carry a monetary impact on the client.
Client must provide a static, public IP address for additional security.
Client to provide an estimated number of calls to be performed per hour.
Client to provide a maximum number of top-ups they expect to do per day.
Client to provide a maximum value per day that is allowed for top-up.
2.4.Environment endpoints
Environment URL Endpoint
Demo https://vvsdemo.paythem.net/API/49972/
Production https://vvs.paythem.net/API/49972/
When using one of our provided libraries, the library will receive a parameter that defines which
environment the current call will use.
It is crucial to note that the Demo environment’s information will not work on Production
environment and repeated posting with incorrect details will lead to the account being locked out
and the source IP blacklisted.
During an account’s API user creation process, PayThem will provide the client with:
Public key – Passed unencrypted with each query, base64 encoded.
Private key – used to encrypt JSON parameters before posting to API server.
Username – encrypted into each post.
IMPORTANT: It is the client’s responsibility to keep all public, private, username and password
details secure and hidden from end users and non-critical staff. If credentials are compromised
(knowingly or unknowingly) PayThem will not be held liable for any damages.
Packagist:
https://packagist.org/packages/paythemnet/inbound_distributor_api_client
If a library or example is not available for your environment, please contact PayThem technical
support through your distributor representative.
3.2.Type handling
3.2.1. Dates & time
o During VVS API posts, dates are converted from and to client’s time zone
automatically.
o IMPORTANT: be sure that your time zone is correctly set and that your server time is
not out from international atomic time by more than 29 seconds. Else, determine
and pass the time as needed to allow for proper usage.
o IMPORTANT: All dates passed from client to server and server to client will be in the
format “CCYY-MM-DD HH:MM:SS”.
o The client’s timestamp must be in “ccyy-mm-dd H:i:s” format and must be inserted
into each query to prevent replay attacks. Please ensure your time zone and time
is set correctly, preferably by a NTP service to minimize risk. A maximum of 30
second deviation from our servers will be tolerated before errors are raised.
cc = century
yy = year
mm = month (zero, left padded)
dd = day of month (zero, left padded)
o The client’s passed dates must be in “ccyy-mm-dd”.
cc = century
yy = year
mm = month (zero, left padded)
dd = day of month (zero, left padded)
3.2.2. Encoding
All content must be UTF-8.
The response (once decoded / decrypted) will contain a JSON string containing the following fields:
SERVER_TRANSACTION_ID
The log ID of the client call. This is used to error check with PayThem support in the event of
issues. All calls return a unique call ID.
RESULT
0 = No error,
-1 = global error
else a code representing an error encountered.
ERROR_DESCRIPTION
A human-legible error description, only populated if an error has occurred.
CONTENT
A string (and optionally encrypted with base64 encoding, depending on call encryption
parameters) representing a JSON string, representing the result of the call made.
This field will contain the word “ERROR” (non-JSON-encoded) if an error has occurred with
the request.
A PayThem library will base64 decode, decrypt and return a JSON string which can be passed to a
JSON handler.
topup_listRetailers
topup_topupRetailer
Production credentials will only be issued once all these calls have been demonstrated successfully,
including error handling.
For production environment, a static IP address is required. No user will be created unless a static
IP is provided.