PHPackages                             namelivia/travelperk-http-php - 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. namelivia/travelperk-http-php

AbandonedArchivedLibrary[API Development](/categories/api)

namelivia/travelperk-http-php
=============================

PHP SDK for accessing the TravelPerk API

1.7.0(3y ago)2923[3 issues](https://github.com/namelivia/travelperk-http-php/issues)[3 PRs](https://github.com/namelivia/travelperk-http-php/pulls)1MITPHPPHP ^7.4|^8.0

Since Aug 1Pushed 3y agoCompare

[ Source](https://github.com/namelivia/travelperk-http-php)[ Packagist](https://packagist.org/packages/namelivia/travelperk-http-php)[ RSS](/packages/namelivia-travelperk-http-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (7)Versions (98)Used By (1)

travelperk-http-php [![tag](https://camo.githubusercontent.com/986c93a95a63777dd4dbfffd8e01b867ce64fb179de86d4f13ca96e6b1c1173e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7461672f6e616d656c697669612f74726176656c7065726b2d687474702d7068702e737667)](https://github.com/namelivia/travelperk-http-php/releases) [![Build Status](https://camo.githubusercontent.com/5beb6f7367913c4375c2bf66e17f7f1d3428cb079ef569022997ad82a5d183cc/68747470733a2f2f7472617669732d63692e636f6d2f6e616d656c697669612f74726176656c7065726b2d687474702d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/namelivia/travelperk-http-php) [![codecov](https://camo.githubusercontent.com/ea634d678670457837d802c043c488d929b9bee1d6374b9921d9f4de3eb6c7f3/68747470733a2f2f636f6465636f762e696f2f67682f6e616d656c697669612f74726176656c7065726b2d687474702d7068702f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/namelivia/travelperk-http-php) [![StyleCI](https://camo.githubusercontent.com/eb6a7e8cd43971478703993758ca9c14f942baf56e97f049f3f0c49cd264affd/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3238343032313631322f736869656c643f6272616e63683d6d6173746572267374796c653d666c6174)](https://github.styleci.io/repos/284021612?branch=master)
==================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#travelperk-http-php----)

 [![TravelPerk PHP SDK](https://user-images.githubusercontent.com/1571416/89100428-2c30cd00-d3f7-11ea-9c4a-37b17f9e9ae4.png)](https://user-images.githubusercontent.com/1571416/89100428-2c30cd00-d3f7-11ea-9c4a-37b17f9e9ae4.png)

About
-----

[](#about)

This is an unofficial package for acessing the [TravelPerk official Web API](https://developers.travelperk.com) from your PHP language project. It is designed so you can easily query and retrieve all data hold on their platform and accessible through the API.

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

[](#installation)

Require this package, with [Composer](https://getcomposer.org/), in the root directory of your project.

```
$ composer require namelivia/travelperk-http-php:~1.4.0
```

Getting started
---------------

[](#getting-started)

Before getting started retrieving querying information from the TravelPerk Web API you first need to [get an API Key](https://developers.travelperk.com/reference#authentication).

### Getting a TravelPerk instance

[](#getting-a-travelperk-instance)

For querying the data you need to get a TravelPerk instance, here are two ways to get a TravelPerk API instance depending on how you authenticate with their API.

At TravelPerk there are [two ways to authenticate](https://developers.travelperk.com/reference#authentication), using an API Key or OAuth2.

#### For API Key Authentication

[](#for-api-key-authentication)

If you have an [API Key](https://developers.travelperk.com/reference#api-keys-1) for authenticating you need to call the Service Provider's `build` method passing your api key, and a boolean indicating if you will be using the [sandbox environment](https://developers.travelperk.com/docs/postman-collection#step-2---configure-the-postman-environment) or not like this:

```
use Namelivia\TravelPerk\ServiceProvider;
$isSandbox = false;
$travelperk = (new ServiceProvider())->build('your-api-key', $isSandbox);
```

#### For OAuth Authentication

[](#for-oauth-authentication)

If you want to use [OAuth](https://developers.travelperk.com/reference#oauth) for authenticating you need to call the Service Provider's `buildOAuth2` method passing [your desired access token peristence method](https://github.com/kamermans/guzzle-oauth2-subscriber#access-token-persistence), your oauth credentials, an array of scopes your application will be accessing to, and a boolean indicating if you will be using the [sandbox environment](https://developers.travelperk.com/docs/postman-collection#step-2---configure-the-postman-environment) or not like this:

```
use Namelivia\TravelPerk\ServiceProvider;
$isSandbox = false;
$travelperk = (new ServiceProvider())->buildOAuth2(
  'your-client-id',
  'your-client-secret',
  'http://your-app/redirect-url',
  ['expenses:read', 'scim:read'],
  $isSandbox
);
```

### Retrieving data

[](#retrieving-data)

Everything is ready, you can start asking for the data.

```
$travelperk->expenses()->invoices()->all();
```

For further information refer to the documentation linked in the next section.

Documentation
-------------

[](#documentation)

The full documentation can be found [in the wiki section of this github repository](https://github.com/namelivia/travelperk-http-php/wiki). Also you can refer to the [official TravelPerk Web API documentation](https://developers.travelperk.com/reference)

License
-------

[](#license)

[MIT](LICENSE)

Contributing
------------

[](#contributing)

Any suggestion, bug reports, prs or any other kind enhacements are welcome. Just [open an issue first](https://github.com/namelivia/travelperk-http-php/issues/new), for creating a PR remember this project has linting checkings and unit tests so any PR should comply with both before beign merged, this checks will be automatically applied when opening or modifying the PRs.

Local development
-----------------

[](#local-development)

This project comes with a `docker-compose.yml` file so if you use Docker and docker-compose you can develop without installing anything on your local environment. Just run `docker-compose up --build` for the first time to setup the container and launch the tests. PHPUnit is configured as the entrypoint so just run `docker-compose up` everytime you want the tests to execute on the Dockerized PHP development container.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 89.3% 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

Every ~9 days

Recently: every ~121 days

Total

93

Last Release

1233d ago

Major Versions

0.0.59 → 1.0.02020-11-01

PHP version history (4 changes)0.0.1PHP ^7.1

0.0.21PHP ^7.3

1.5.10PHP ^7.3|^8.0

1.5.15PHP ^7.4|^8.0

### Community

Maintainers

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

---

Top Contributors

[![namelivia](https://avatars.githubusercontent.com/u/1571416?v=4)](https://github.com/namelivia "namelivia (208 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (16 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (8 commits)")[![DannyvdSluijs](https://avatars.githubusercontent.com/u/618940?v=4)](https://github.com/DannyvdSluijs "DannyvdSluijs (1 commits)")

---

Tags

apisdktravelperk

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/namelivia-travelperk-http-php/health.svg)

```
[![Health](https://phpackages.com/badges/namelivia-travelperk-http-php/health.svg)](https://phpackages.com/packages/namelivia-travelperk-http-php)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[hubspot/api-client

Hubspot API client

23414.2M16](/packages/hubspot-api-client)[mailchimp/transactional

458.9M16](/packages/mailchimp-transactional)[resend/resend-php

Resend PHP library.

564.7M21](/packages/resend-resend-php)[checkout/checkout-sdk-php

Checkout.com SDK for PHP

553.3M7](/packages/checkout-checkout-sdk-php)[mozex/anthropic-laravel

Anthropic PHP for Laravel is a supercharged PHP API client that allows you to interact with the Anthropic API

71226.4k1](/packages/mozex-anthropic-laravel)

PHPackages © 2026

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