Skip to content

Commit

Permalink
Adds locations support
Browse files Browse the repository at this point in the history
  • Loading branch information
stephangroen committed Jun 5, 2018
1 parent 7737121 commit c41642f
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ public function updateOrder($idorder, $params)
}

/*
* Orders
* Picklists
*/
public function getPicklists($filters = array())
{
Expand Down Expand Up @@ -614,6 +614,39 @@ public function getTemplates()
return $this->sendRequest('/templates');
}

/*
* Locations
*/
public function getLocations($filters = array())
{
return $this->sendRequest('/locations', array(), self::METHOD_GET, $filters);
}

public function getLocation($id)
{
return $this->sendRequest('/locations/' . $id);
}

public function addLocation($params, $autoLinkToParent = false)
{
return $this->sendRequest('/locations', $params, self::METHOD_POST, array('auto_link_to_parent' => $autoLinkToParent));
}

public function updateLocation($id, $params)
{
return $this->sendRequest('/locations/' . $id, $params, self::METHOD_PUT);
}

public function deleteLocation($id)
{
return $this->sendRequest('/locations/' . $id, array(), self::METHOD_DELETE);
}

public function getProductsOnLocation($id)
{
return $this->sendRequest('/locations/' . $id . '/products', array(), self::METHOD_GET);
}


/*
* General
Expand Down

0 comments on commit c41642f

Please sign in to comment.