PHP Wrapper to the metrc api

Installs: 48

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 2

Forks: 2

Open Issues: 1

pkg:composer/alternatehealth/metrc

dev-master 2019-01-09 20:06 UTC

This package is auto-updated.

Last update: 2025-10-10 10:46:59 UTC


README

PHP SDK/API for working with metrc (https://metrc.com).

Installation

This library is written for php 7.1 or better, and uses the ext-curl, and ext-json libraries

Using Composer

composer require alternatehealth/metrc

Example Usage

Fetching a List of Facilities

<?php

// 3rd and 4th optional parameters are $sandbox (bool) and $state (string, defaults to 'ca' for california)
$api = new \MetrcApi\MetrcApi('username', 'password', 'licenseNumber');

$facilities = $api->getFacilities();

var_dump($facilities);

Creating a Room

<?php

$api = new \MetrcApi\MetrcApi('username', 'password', 'licenseNumber');

$room = new \MetrcApi\Models\Room;
$room->setName("Room Name");
$response = $api->createRoom($room);

var_dump($response);