PHPackages                             freshheads/harvest-api-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. freshheads/harvest-api-client

AbandonedArchivedLibrary[API Development](/categories/api)

freshheads/harvest-api-client
=============================

An API client to read and write to Harvest via the Harvest API version 2

1.0.0(7y ago)22763MITPHPPHP &gt;=7.1.3

Since Jan 25Pushed 6y ago3 watchersCompare

[ Source](https://github.com/freshheads/harvest-api-client)[ Packagist](https://packagist.org/packages/freshheads/harvest-api-client)[ RSS](/packages/freshheads-harvest-api-client/feed)WikiDiscussions develop Synced 2mo ago

READMEChangelog (1)Dependencies (10)Versions (2)Used By (0)

Harvest API Client
==================

[](#harvest-api-client)

[![Build Status](https://camo.githubusercontent.com/a373e1a99f7cd4f947c2746e493fbbb82c7b9147287749d6baa1b2e57510868e/68747470733a2f2f7472617669732d63692e6f72672f667265736868656164732f686172766573742d6170692d636c69656e742e706e673f6272616e63683d646576656c6f70)](https://travis-ci.org/freshheads/harvest-api-client)

This library provides an API client for the [Harvest](https://www.getharvest.com/) [V2 API](https://help.getharvest.com/api-v2/). Plain PHP classes are used to map the data from the API. [JMS Serializer](https://jmsyst.com/libs/serializer) is used for the serialization/deserializtion of this model classes.

It is also perfectly possible to use this Client without using the endpoints and models.

Requirements
------------

[](#requirements)

Harvest API Client works with PHP 7.1.3 and up. This library depends on the [HTTPPlug](http://httplug.io/), see .

Installation
------------

[](#installation)

Harvest API Client can easily be installed using [Composer](https://getcomposer.org/). You must have a [php-http/client-implementation](https://packagist.org/providers/php-http/client-implementation) compatible client (+ adapter) installed to be able to make requests. You can run the following command, to install Guzzle6 and it's php-http adapter.

```
composer require 'freshheads/harvest-api-client' 'php-http/guzzle6-adapter'
```

You can replace `php-http/guzzle6-adapter` with any other compatible client implementation.

Usage
-----

[](#usage)

Instantiate the client and replace the configuration with your personal credentials:

```
// Use the composer autoloader to load dependencies
require_once 'vendor/autoload.php';

use FH\HarvestApiClient\Client\ClientFactory;

// API Client configuration
$clientConfiguration =
    'access_token' => 'YourAccessToken',
    // Your harvest account ID
    'account_id'    => 12345678,
    // Harvest asks you to customize the user agent header, so that they can contact you in case you're doing something wrong
    'user_agent'   => 'My Application (my@email.com)'
];

// In this example we made use of the Guzzle6 as HTTPClient in combination with an HTTPPlug compatible adapter.
$client = ClientFactory::create([], null, null, $clientConfiguration);

// Make some calls directly via the client
$response = $client->get('/clients', ['page' => 1]);
```

### Endpoints

[](#endpoints)

To use the harvest entity specific [Endpoints](src/Endpoint), you need to install [jms/serializer](https://packagist.org/packages/jms/serializer):

```
composer require 'jms/serializer' 'symfony/yaml'
```

The serializer needs to know where to find the serialization configuration of the models. The configuration is located in [src/Model/configuration](src/Model/configuration). An example is given below:

```
// Code is based on the example above.

// Creates the serializer and configures it with the serialization configuration
$serializer = SerializerBuilder::create()
      ->addMetadataDir(__DIR__ . '/vendor/freshheads/harvest-api-client/src/Model/configuration')
      ->build();

$harvestClientEndpoint = new ClientEndpoint($client, $serializer);

// List harvest clients (returns an array of Client objects).
$harvestClients = $harvestClientEndpoint->list();
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2662d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ff992fa795ece06cce9b7703889c79e728c345d5abbfedd53b89b023ca3f0b95?d=identicon)[freshheads](/maintainers/freshheads)

---

Top Contributors

[![larsjanssen6](https://avatars.githubusercontent.com/u/7254997?v=4)](https://github.com/larsjanssen6 "larsjanssen6 (6 commits)")[![fruitwasp](https://avatars.githubusercontent.com/u/3208699?v=4)](https://github.com/fruitwasp "fruitwasp (1 commits)")[![valentin-meyer](https://avatars.githubusercontent.com/u/40666543?v=4)](https://github.com/valentin-meyer "valentin-meyer (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/freshheads-harvest-api-client/health.svg)

```
[![Health](https://phpackages.com/badges/freshheads-harvest-api-client/health.svg)](https://phpackages.com/packages/freshheads-harvest-api-client)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M650](/packages/sylius-sylius)[brd6/notion-sdk-php

Notion SDK for PHP

5918.0k](/packages/brd6-notion-sdk-php)[wordpress/php-ai-client

A provider agnostic PHP AI client SDK to communicate with any generative AI models of various capabilities using a uniform API.

26236.6k14](/packages/wordpress-php-ai-client)[darthsoup/php-whmcs-api

WHMCS API client for PHP

2317.3k4](/packages/darthsoup-php-whmcs-api)[apigee/apigee-client-php

Client library for connecting to the Apigee Edge API.

27558.7k3](/packages/apigee-apigee-client-php)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
