General Overview
Introduction
Welcome to PT API. It is Prepaid Technologies' end-to-end platform that makes it simple to create digital banking and branded card experiences. This documentation includes comprehensive information for building financial products and integrating with PT API.
The PT API is RESTful, so it uses HTTP methods (POST, PUT, GET) to perform functions on objects. For example, to login with the client user, you send a POST request to the /login endpoint. Some requests include data in their message body, for example, to define the attributes of the object being created or updated, and the PT API requires that this data be in JSON format.
The fastest way to get your integration up and running is to use our Quick Start guide, which walks you through the essential integration steps. We've tried to make this documentation user-friendly, but if you have any questions, please head to our Discord Server. <TODO - setup the server>
API Protocols
The PT API uses GET and POST requests to communicate and HTTP response codes to indicate status and errors. All requests must include a Content-Type
of application/json
and the body must be valid JSON. All responses are in standard JSON.
API Design Guidelines
Allowed HTTP methods with PT APIs
GET
The GET method is used to retrieve information from the given server using a given URI. Requests using GET should only retrieve data and should have no other effect on the data.POST
A POST request is used to send data to the server.PUT
Replaces all current representations of the target resource with the uploaded content.DELETE
Removes all current representations of the target resource given by a URI.
Standard PT API Query parameters
Paging
limit/offset
parameter enables pagination for the client application. PT supports Offset Pagination implementation. Limit/Offset Paging would look like GET /cards?limit=20&offset=100. This query would return the 20 rows starting with the 100th row.
Example of pagination with 20 cards in each call:-
A client makes a request for the most recent cards:
GET /cards?limit=20
On scroll/next page, client makes second request
GET /cards?limit=20&offset=20
On scroll/next page, client makes third request
GET /cards?limit=20&offset=40
Filtering
Filtering consists of restricting the number of queried resources by specifying some attributes and their expected values. URL parameters are the easiest way to add basic filtering to REST APIs. If you have an /cards endpoint, you can filter via the property name such as:-
GET /cards?status=active
GET /cards?status=active&expDate=12242021
Sorting
Sorting the result of a query on a collection of resources. A sort parameter should contain the names of the attributes on which the sorting is performed, separated by a comma. To enable sorting, add a sort_by
URL parameter that can take a field name as the value and the asc/desc
functions to specify ascending or descending order respectively.
Example formatsGET /users?sort_by=asc(email) and GET /users?sort_by=desc(email)
GET /users?sort_by=desc(last_modified),asc(email)
Searching
A search is a sub-resource of a collection. Searching can allow fuzziness matching and provide flexible queries for API users. For example, we could search cardholders for those that have a first name as Joe and the age is greater than or equal to 20 and less than or equal to 30.
GET /cardholders?q=firstName:joe AND age:[20 TO 30]
PT APIs Status Codes
200 – OK
Everything is working
201 – CREATED
A new resource has been created
204 – NO CONTENT
The resource was successfully deleted, no response body
304 – NOT MODIFIED
The date returned is cached data (data has not changed)
400 – BAD REQUEST
The request was invalid or cannot be served. The exact error should be explained in the error payload. E.g. „The JSON is not valid “.
401 – UNAUTHORIZED
The request requires user authentication. Find details in the Error codes table.
403 – FORBIDDEN
The server understood the request but is refusing it or the access is not allowed. Find details in the Error codes table.
404 – NOT FOUND
There is no resource behind the URI. Find details in the Error codes table.
500 – INTERNAL SERVER ERROR
This is a generic error response with no details. If an unhandled error occurs on the server-side then the stack trace will be logged and not returned as a response. Find details in the Error codes table.
Error Codes:
HTTP Response Code | Error Code | Error Message | Error Description |
400 | 400001 | invalid query parameters | Invalid HTTP query parameters were used in the request |
400 | 400002 | invalid header parameters | Invalid HTTP header parameters were used in the request |
400 | 400003 | invalid JSON parameters | Invalid JSON parameters were used in the request |
400 | 400004 | failed precondition | Request cannot be executed in the current system state |
400 | 400005 | out of range | Client specified an invalid range for the request parameter |
401 | 401001 | expired login credentials | API credentials have expired and new credentials must be generated |
401 | 401002 | invalid login credentials | The provided credentials don't match a provisioned credentials |
402 | 402001 | account creation error | A PT system error occurred when creating the account |
402 | 402002 | account inactive due to fraud | The account has been deactivated due to potentially fraudulent activity |
402 | 402003 | account is charged off | The Account has been closed due to inactivity |
402 | 402004 | cardholder not active | The Cardholder status is not active |
402 | 402005 | destination account limit violation | The transfer failed because a load limit on the destination account was violated |
402 | 402006 | destination account velocity violation | The transfer failed because a velocity limit on the destination account was violated |
402 | 402007 | duplicate cardholder | A Cardholder with this identity already exists |
402 | 402008 | duplicate email | A Cardholder with this email already exists |
402 | 402009 | duplicate mobile | A Cardholder with this mobile already exists |
402 | 402010 | insufficient funds | There were not enough funds to cover the transaction |
402 | 402011 | source account velocity violation | The transfer failed because a velocity limit on the source account was violated |
402 | 402012 | transaction denied | The simulated authorization was denied |
403 | 403001 | not permitted | An action was performed that is not allowed |
403 | 403002 | permission denied | Client does not have sufficient permission |
404 | 404001 | not found | A specified resource is not found |
409 | 409001 | already exists | The resource that a client tried to create already exists. |
499 | 499001 | canceled | Request canceled by the client |
500 | 500001 | error contacting server | Unable to communicate with PT’s backend services |
500 | 500002 | system exception | Generic PT system exception that is unhandled |
501 | 501001 | not implemented | API method not implemented by the server |
503 | 503001 | unavailable | Service unavailable |
Glossary
Term | Description |
|
---|---|---|
|
|
|
|
|
|
|
|
|
About the Platform
PT API is built on the Prepaid Technologies Platform, which processes millions of dollars of payments annually and inherits all scalability, reliability, and security features of the Prepaid Technologies platform.
Digital Banking
Cardholders need a way to manage their accounts. This includes viewing balances, tracking spending, and accessing monthly statements. Digital banking is how we describe any user interface that provides these functions for cardholders.
PT API Components
Four components of PT API product are below :
Developer Portal: A web tool for Developers and Businesses to explore the Prepaid Technologies offerings and subscribe to PT products.
Product: It contains one or more APIs as well as a usage quota and the terms of use. Once a product is published, developers can subscribe to the product and begin to use the product's APIs.
Feature: Feature is a business functionality to the end-user. Set of PT APIs need to be called in the correct order to implement a Feature in the client application.
API: It stands for 'Application Programming Interface'. PT API enables our clients to create financial applications that access the features or data of Prepaid Technologies.
Developer Portal
Before using PT API to create financial products, enroll your business through our Developer Portal, and get Subscription details - Primary key and Secondary key.
Developer portal URL | |
Gateway URL | |
Virtual IP (VIP) addresses | 40.86.88.107 |
Master Funds Account
Prepaid Technologies creates a master funds account for every business that enrolls in PT API. This account can be used to instantly fund cardholder accounts, enabling a wide variety of product use cases.
Parent-Client Hierarchy
To manage the card programs for clients using the Prepaid Technologies platform, a parent client hierarchy is created. There are two business models to support client requirements.
Business Model 1
It has 3 general levels as explained below:-
Group Level - This represents the complete client business or corporation. The client admin users will have direct access to this hierarchy level. In the PT system, this is identified with
parentId
.Client Level - This represents the individual client business units. So a corporation can have multiple business units known as “Client”. In the PT system, this is identified with
customerId
.Program Level - This represents financial products like gift cards, rewards, payroll, etc. So a business unit can have multiple enrollments to financial products known as “Program Type”. In the PT system, this is identified with
rowed
.
Business Model 2
It has 2 general levels as explained below:-
Client Level - This represents the individual client business units. So a corporation can have multiple business units known as “Client”. In the PT system, this is identified with
customerId
.Program Level - This represents financial products like gift cards, rewards, payroll, etc. So a business unit can have multiple enrollments to financial products known as “Program Type”. In the PT system, this is identified with
rowed
.
PT API Object Model
Business - this object represents PT’s clients which are using the Prepaid Technologies platform and in a business relationship with PT.
User - this object represents a person from a business who uses the Prepaid Technologies platform to manage their cards, cardholders, and funds. This endpoint enables you to log in, log out, reset the user’s password on the Prepaid Technologies platform.
Standard Product
This product enables a client to build a stand-alone application or integrate features into their existing financial application. It provides the 4 basic and most used features from the Prepaid Technologies platform.
Advance Product
This product enables a client to build an advanced stand-alone application or integrate enhanced features into their existing financial application. It provides advanced features in addition to the standard product which includes the Service cards and cardholders feature. There will be a technical due diligence and approval process to get a subscription for the Advance product. Consumer for Advance Product needs to support an ongoing regular audit.