Skip to content

Sync Payment Status

An endpoint to get the updated status of a transaction.

To get the updated payment status of a transaction, send the request header and body parameters via POST.

POST/sync

Request Description

HEADER PARAMETERS

Content-Type optional
string
Default content type of the API.

Authorization required
string
Unique identifier of the integrator.

REQUEST BODY SCHEMA: application/json

transaction_id required
string
Payment transaction reference ID.

notify_user required
string
True or false value. Directs function whether to notify the customer via email.

Request Samples

curl
   -X POST "https://test-api.tlpe.io/sync" \
   -H "Content-Type: application/json" \
   -H "Authorization: {integratorToken}" \
   -d "{
         "transaction_id":"{transactionId}",
         "notify_user":"false"
      }"
public Dictionary<string, dynamic> Sync()
   {
         Dictionary<string, dynamic> responseData;
         string payload = "{\"transaction_id\":\"{transactionId}\",\"notify_user\":\"false\"}";
         string url = "https://test-api.tlpe.io/sync";
         byte[] buffer = Encoding.ASCII.GetBytes(payload);
         HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url);
         request.Method = "POST";
         request.Headers["Authorization"] = "{integratorToken}";
         request.ContentType = "application/json";
         Stream PostData = request.GetRequestStream();
         PostData.Write(buffer, 0, buffer.Length);
         PostData.Close();
      using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
         {
            Stream responseStream = response.GetResponseStream();
            StreamReader reader = new StreamReader(responseStream);
            StringReader sr = new StringReader(reader.ReadToEnd());

            JsonReader jreader = new JsonTextReader(sr);
            JsonSerializer jss = new JsonSerializer();
            responseData = jss.Deserialize<Dictionary<string, dynamic>>(jreader);
            reader.Close();
            responseStream.Close();
         }

      return responseData;

   }
Public Function Sync() As Dictionary(Of String, Object)
  Dim payload As String = "{""transaction_id"":""{transactionId}"",""notify_user"":false}"
  Dim url As String = "https://test-api.tlpe.io/sync"
  Dim request As WebRequest = WebRequest.Create(url)
  request.Method = "POST"
  request.Headers.Add("Authorization", "{integratorToken}")
  request.ContentType = "application/json"
  Dim byteArray As Byte() = Encoding.UTF8.GetBytes(payload)
  request.ContentLength = byteArray.Length
  Dim dataStream As Stream = request.GetRequestStream()
  dataStream.Write(byteArray, 0, byteArray.Length)
  dataStream.Close()

  Dim response As WebResponse = request.GetResponse()
  Dim responseStream = response.GetResponseStream()
  Dim reader As New StreamReader(responseStream)
  Dim responseReader As StringReader = New StringReader(reader.ReadToEnd())
  Dim jreader As JsonReader = New JsonTextReader(responseReader)
  reader.Close()
  responseStream.Close()
  response.Close()
  Dim jss As New JsonSerializer()
  Dim responseData As Dictionary(Of String, Object) = jss.Deserialize(Of Dictionary(Of String, Object))(jreader)

  Return responseData
End Function
import http.client
import json

conn = http.client.HTTPSConnection('test-api.tlpe.io')
payload = json.dumps({'transaction_id': '{transactionID}',
                     'notify_user': 'false'})
headers = {'Content-Type': 'application/json',
         'Authorization': '{integratorToken}'}
conn.request('POST', '/sync', payload, headers)
res = conn.getresponse()
data = res.read()
print data.decode('utf-8')
<?php
$curl = curl_init();

curl_setopt_array($curl, array(
   CURLOPT_URL => 'https://test-api.tlpe.io/sync',
   CURLOPT_RETURNTRANSFER => true,
   CURLOPT_ENCODING => '',
   CURLOPT_MAXREDIRS => 10,
   CURLOPT_TIMEOUT => 0,
   CURLOPT_FOLLOWLOCATION => true,
   CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
   CURLOPT_CUSTOMREQUEST => 'POST',
   CURLOPT_POSTFIELDS => '{
                     "transaction_id":"{transactionID}",
                     "notify_user":"false"
                  }',
   CURLOPT_HTTPHEADER => array(
      'Content-Type: application/json',
      'Authorization: {integratorToken}'
   ) ,
));

$response = curl_exec($curl);

curl_close($curl);
echo 
$response;
require 'rest-client'
require 'json'

response = RestClient::Request.execute(
method:  :post, 
url:     "https://test-api.tlpe.io/sync",
payload: '{
   "transaction_id":"{transactionId}",
   "notify_user":"false"
   }',
headers: { authorization: '{integratorToken}', content_type: 'application/json', accept: 'application/json'}
)

responseJson = JSON.parse(response)

puts JSON.pretty_generate(responseJson)
var request = require('request');
var options = {
   'method': 'POST',
   'url': 'https://test-api.tlpe.io/sync',
   'headers': {
      'Content-Type': 'application/json',
      'Authorization': '{ integratorToken }'
   },
   body: JSON.stringify({
      "transaction_id": "{transaction_id}",
      "notify_user": "false"
   })
};
request(options, function(error, response) {
   if (error) throw new Error(error);
   console.log(response.body);
});

Download Postman request here

200 Successful Response

RESPONSE SCHEMA: application/json

timestamp
string
Transaction timestamp

status
string
HTTP status code

message
string
HTTP status code message/description

path
string
Endpoint path used for the transaction

data
object
Contains transaction-related response

transaction_id
string
Payment reference number of the transaction

status_code
string
API status code

status_description
string
API status code message/description

Response Samples

{
   "timestamp":2020-07-14T09:29:49.843+0000,
   "status":200,
   "message":"Request processed successfully",
   "path":"/sync",
   "data":{
      "transaction_id":"{transactionId}",
      "status_code":"OK.00.00",
      "status_description":"Payment successful"
   }
}