It is possible to create POLi Links through automation by integration with POLi Link API. When creating POLi Links in this way, there are a few characteristics to be aware of:

ValidationWhen creating POLi Links via Console, the user interface covers all validation and helps the user identify errors in their data entry. Through automation, you will be required to ensure that all data types and values fall within expected ranges and formats.
Extended FeaturesWhen creating POLi Links via Console, the user interface will only show extended features that the merchant has enabled. When setting features like partial payment and due date through POLi Link API, make sure these features are enabled by the merchant
Feature CombinationsThere are constraints which must be met when defining a POLi Link. These include requirements for the type of POLi Link and restrictions for extended features. Please consult the features page for more information

If care is taken with the above considerations, back-end validation will succeed and a POLi Link will be created. Failure will return limited information. For more information about using the Create command, visit the create page.

This code example will show you how to generate a POLi Link.

  • PHP
Loading ...
$json_builder = '{
  "LinkExpiry":"2020-10-24 16:00:00+11",
 $auth = base64_encode("MerchCode:AuthCode");
 $header = array();
 $header[] = 'Content-Type: application/json';
 $header[] = 'Authorization: Basic '.$auth;
 $ch = curl_init("");
 //See the cURL documentation for more information:
 //We recommend using this bundle:
 curl_setopt( $ch, CURLOPT_CAINFO, "ca-bundle.crt");
 curl_setopt( $ch, CURLOPT_HTTPHEADER, $header);
 curl_setopt( $ch, CURLOPT_HEADER, 0);
 curl_setopt( $ch, CURLOPT_POST, 1);
 curl_setopt( $ch, CURLOPT_POSTFIELDS, $json_builder);
 curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 0);
 curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);
 $response = curl_exec( $ch );
 curl_close ($ch);
 $json = json_decode($response, true);

polilinkapi_create.txt · Last modified: 2017/10/24 10:03 (external edit)