# Marco

Testing the API is best carried out with a tool such as:

WARNING

❗️ Please Note: Testing the API should be carried out on the r8 staging server.

The staging server is r8staging.wafoods.net

The production server is r8.wafoods.net

TIP

The path to the marco api is /marco/

# Here are some example calls

# Example to GET a list of customers

https://r8staging.wafoods.net/marco/customer

# Example to GET a list of orders

https://r8staging.wafoods.net/marco/order

# Example to GET details of an order

 




https://r8staging.wafoods.net/marco/order/?id=

// With paramameter/s:
// id = order_id

TIP

For the rest of this document, we will miss out the full path, and start from the / after https://r8staging.wafoods.net

https://r8staging.wafoods.net/marco/customer will be /customer (See below)

# Example to GET a list of customers now becomes

/customer

# The HTTP header details











 







<?php

$client = new http\Client;
$request = new http\Client\Request;

$request->setRequestUrl('https://r8staging.wafoods.net/marco/customer');
$request->setRequestMethod('GET');
$request->setHeaders(array(
  'accept' => 'application/json',
  'content-type' => 'application/x-www-form-urlencoded',
  'authorization' => 'Bearer -TOKEN-'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();

-TOKEN- in the header code above, should be replaced with your issued Bearer TOKEN.

# The API calls to test the Marco API

# Table of API rediness

New API call Legacy API call Ready to test Tested
/customer /customer yes no
/customer/ id /customer/?id= yes no
/supplier /supplier yes no
/supplier/ id /supplier?id= yes no
/product /product yes no
/product/ id /product?id= yes no
/delivery/ id /delivery?id= yes no
/delivery-new/ data /delivery?new= no no
/orders /order yes no
/order/ id /order/?id= yes no
/order-done/ id /order?done= no no
/orderiteme/ id = no no
/orderitem-update/ id /orderitem?update= no no
/list/ id /list?retrieve=slaughtered yes no
/list/ id /list?retrieve=born yes no
/list/ id /list?retrieve=reared yes no
/list/ id /list?retrieve=cut yes no
/list/ id /list?retrieve=cut2 yes no
/list/ id /list?retrieve=origin yes no
/list-create/ /list?create= slaughtered no no
/list-create/ /list?create= born no no
/list-create/ /list?create= reared no no
/list-create/ /list?create= cut no no
/list-create/ /list?create= cut2 no no
/list-create/ /list?create= origin no no
/stock/ id /stock?id= yes no
/stock-new/ data /stock?new no no

# GET a list of customers

/customer