All requests to the Web API must be sent as an XML or JSON document within the body of a POST request sent to:
https://www.billandpay.com/webservices/service.php
Sample XML Request
<?xml version="1.0"?>
<request>
<response>
<type>xml</type>
</response>
<biller>
<authenticate>
<id>sample_id</id>
<password>sample_password</password>
</authenticate>
<customerinfo />
</biller>
</request>
Sample JSON Request
{
"request": {
"response": {
"type": "json"
},
"biller": {
"authenticate": {
"id": "sample_id",
"password": "sample_password"
},
"customerinfo": {
}
}
}
}
All requests must be contained within a request sub-object. Within the request sub-object you can specify how the Web API response will be returned to you using the response sub-object. Within the response sub-object you can use the type property to choose the format of the response from among the following:
| XML | The response is returned as an XML document. |
| JSON | The response is returned as JSON which is easily processed by JavaScript. |
| PHP | The response is a serialized PHP array variable. Use the unserialize() PHP function to transform the response back into a PHP array containing the response. |
Request Classes
The Web API is divided into requests classes. A class is a discrete portion of the Bill & Pay system. There are three request classes: biller, reseller, and developer. The biller class handles all Web API interactions with a specific biller account. The request must contain the authentication credentials for a specific biller or a Developer App. The reseller class handles all Web API interactions with a specific reseller account. The request must contain the authentication credentials for a specific reseller.
In the example above the biller sub-object specifies that the request is to be processed by the biller class. Within the biller sub-object is the authenticate sub-object which contains the biller credentials. Also within the biller sub-object is the customerinfo sub-object which is the method of the biller class to call.
You can only reference a single Web API class within a single call to the server. So you can not, for example, place two sets of <biller> and </biller> tags, or a set of <biller> tags and a set of <reseller> tags, in the same server call.
Encryption
All requests must be made over HTTPS using the TLS 1.2 or higher encryption method.
Multiple API Calls In a Single Request
You can call multiple API methods for a single API class within a single call to the server. For example:
<?xml version="1.0"?>
<request>
<response>
<type>xml</type>
</response>
<biller>
<authenticate>
<id>sample_id</id>
<password>sample_password</password>
</authenticate>
<billerinfo />
<customerinfo />
</biller>
</request>
This sample will call both the biller.billerinfo API method as well as the biller.customerinfo API method in a single request to the server. You can add an <apicallid> tag to each API method call and it will be returned in the response for each API method. For example:
<?xml version="1.0"?>
<request>
<response>
<type>xml</type>
</response>
<biller>
<authenticate>
<id>sample_id</id>
<password>sample_password</password>
</authenticate>
<billerinfo>
<apicallid>1</apicallid>
</billerinfo>
<customerinfo>
<apicallid>2</apicallid>
</customerinfo>
</biller>
</request>