jeremydirect
5/2/2018 - 9:29 PM

Brightpearl API - HTTPRequest Order Lookup

Must have OrderID handy

<?php
 
$request = new HttpRequest();
$request->setUrl('https://{brightpearl-datacenter}.brightpearl.com/public-api/{brightpearl-account}/order-service/order/{order-id}');
$request->setMethod(HTTP_METH_GET);
 
$request->setHeaders(array(
  'Cache-Control' => 'no-cache',
  'Authorization' => 'Basic Og==',
  'brightpearl-account-token' => '{insert brightpearl account token}',
  'brightpearl-app-ref' => '{insert app reference}'
));
 
try {
  $response = $request->send();
 
  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}