Receipts

Make sure you familiarize yourself with the following important concepts of our API:
Prices and Quantities, Products and Articles, Sync Markers
After taking the time to understand these concepts, you will much better understand the basics of our API.

Introduction

Using these API functions, you will be able to request the receipts based on certain search criteria you set in the request.

Contents

Retrieving receipts

 '2014-08-01',
  'throughFinancialDate' => '2014-08-31',
  // Only get receipts that are booked on branch 1
  'branchNumbers' => array(1),
  // We don't want to filter by employee, so we leave this empty
  'employeeNumbers' => array(),
  // We don't want to filter by customer, so we leave this empty
  'relationNumbers' => array(),
  // We only want receipts that contain an article with barcode '87123456789'
  'articleBarcodes' => array('87123456789'),
  // We don't care about the remaining article filters
  'articleNumbers' => array(),
  'articleTurnoverGroups' => array(),
  'articlePluNumbers' => array(),
);

// Then we call the getReceipts() function wrapped in a try/catch block to intercept any exceptions.
try {
  if (false !== ($receipts_result = $mplusqapiclient->getReceipts($request))) {
    // Success, we show the number of found receipts
    exit(sprintf('Found %d receipt(s).', count($receipts_result)));
  } else {
    exit('Invalid result after running getReceipts.');
  }
} catch (MplusQAPIException $e) {
  exit($e->getMessage());
}