Sanjoy Roy

[MCM, MCP, SCJP] – Senior PHP Programmer

TNT API Documentation




From Direct Link:

Demo Link:

1. System Overview
The External RTT application provides an interface for TNT customers to retrieve a list of TNT’s available operational services, their cutoff times, estimated delivery dates and prices. This service has been designed for integration into the software or websites of TNT customers. The system overview is presented in figure1, the client application will make an HTTP POST request over SSL and an XML document will be returned.
1.1. Authentication

In order to use the External RTT service users will need to authenticate successfully to the system. This will require users to have a valid account with TNT which has been registered for use with the system. During the registration process users will be assigned a username and password which will be used for authentication. In addition to the username and password authentication the account number passed in the xml request body will be validated.

1.2. Request Format 

The External RTT service will take an application/x-www-form-urlencoded HTTP POST request in the following format. Where the username and password are those provided by TNT during the registration process and the XML Request is an XML string which conforms to the schema listed in section 2 of this document. The xml string should be URL encoded. The request content type should be application/x-www-form-urlencoded NOT text/xml.

Post Data:

1.3. Response Format

The response will be an XML document conforming to the schema listed in section 3 of this document. The http headers for the response will set the MIME type to “text/xml”. Any errors encountered by the system will be returned in an XML format for consumption by the client application.
Examples of the request and response format are show in section 6 of this document.
1.4. Security
In order maintain the security of your username and password you should not perform request to RTT service from client side scripts (AJAX). Doing so will expose your username and password on the internet. Requests to the service should be performed from server side code using SSL.
The client side requests to the service can also cause cross domain security exceptions in modern browsers depending on how your scripts are coded.
It is suggested that a ‘proxy’ page could be created on your web server (under the same domain) for client side scripts. This page could pass the requests to the RTT service and return the unaltered result back to the client page. This will avoid any cross domain security exceptions and will ensure the security of your username and password which would only be sent from the server side script.


Comments are closed.

%d bloggers like this: