Check Payment Status

GET /v1/payments/payment/{payment_id}

To check the status of payment transactions processed by the Liquid Platform. This is useful in the event of a payment transaction sent to the Liquid Platform and the process is interrupted or the response times out from the Liquid Platform, hence requester can utilize the function to check if the transaction has been processed.

 

Parameter

payment_id String Mandatory

Unique Identifier of payment transaction

Response Body

code Number

Please refer to Response Code

description String

Description of response

payment_id String

Unique Identifier of payment transaction

merchant_ref_no String

Merchant reference number

original_currency_code 3 letter currency code

Currency code of the transaction before currency conversion

original_amount Number with 2 decimal

The amount to be charged to the payee by the payer before currency conversion

paid_currency_code 3 letter currency code

Currency code of the transaction before currency conversion

paid_amount Number with 2 decimal

The gross amount paid to the payee by the payer after currency conversion

product_type String

Please refer to Product Types

payment_code String

Payment code which is returned in the QR

payment_status String

Status of the transaction, value is

  • P = Pending (Waiting customer to pick up)
  • W = Waiting >(Waiting customer to pay)
  • E = Transaction expired
  • F = Transaction failed
  • V = Transaction voided
  • A = Transaction completed successfully
payment_date Timestamp

Unix timestamp of payment date

Example:

payee Object

Please refer to Payee Object

payer Object

Please refer to Payer Object

source Object

Please refer to Source Object

fee Array

Array of fee object

Please refer to Fee Object

metadata Object

Please refer to Metadata

Sample Code


curl -X GET https://sandbox.api.liquidpay.com/openapi/v1/payments/payment/{{payment_id}} \
  -H 'Liquid-Api-Key: {{api_key}}'

$request = new HttpRequest();
$request->setUrl('https://sandbox.api.liquidpay.com/openapi/v1/payments/payment/{{payment_id}}');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'Liquid-Api-Key' => '{{api_key}}'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

var client = new RestClient("https://sandbox.api.liquidpay.com/openapi/v1/payments/payment/{{payment_id}}");
var request = new RestRequest(Method.GET);
request.AddHeader("Liquid-Api-Key", "{{api_key}}");
IRestResponse response = client.Execute(request);

var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://sandbox.api.liquidpay.com/openapi/v1/payments/payment/{{payment_id}}",
  "method": "GET",
  "headers": {
    "Liquid-Api-Key": "{{api_key}}"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});

HttpResponse response = Unirest.get("https://sandbox.api.liquidpay.com/openapi/v1/payments/payment/{{payment_id}}")
  .header("Liquid-Api-Key", "{{api_key}}")
  .asString();

#import 

NSDictionary *headers = @{ @"Liquid-Api-Key": @"{{api_key}}" };

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://sandbox.api.liquidpay.com/openapi/v1/payments/payment/{{payment_id}}"]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                            completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                if (error) {
                                                    NSLog(@"%@", error);
                                                } else {
                                                    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                    NSLog(@"%@", httpResponse);
                                                }
                                            }];
[dataTask resume];

import Foundation

let headers = [
  "Liquid-Api-Key": "{{api_key}}"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox.api.liquidpay.com/openapi/v1/payments/payment/{{payment_id}}")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()