PHPackages                             aglipanci/postmates-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. [HTTP &amp; Networking](/categories/http)
4. /
5. aglipanci/postmates-client

AbandonedArchivedLibrary[HTTP &amp; Networking](/categories/http)

aglipanci/postmates-client
==========================

Client library for Postmates On Demand Logistics

v1.1.4(8y ago)1142MITPHP

Since Feb 13Pushed 8y ago1 watchersCompare

[ Source](https://github.com/aglipanci/postmates-client)[ Packagist](https://packagist.org/packages/aglipanci/postmates-client)[ RSS](/packages/aglipanci-postmates-client/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (1)Versions (6)Used By (0)

postmates-client
================

[](#postmates-client)

Magento Module
--------------

[](#magento-module)

Are you reading this because you need to integrate Postmates into your Magento store? Do yourself a favor and checkout the [Postmates Shipping extension](http://www.magentocommerce.com/magento-connect/postmates-shipping-30057.html); you’ll save time and money!

Overview
--------

[](#overview)

An API client for [Postmates](https://postmates.com/developer) on demand logistics. You can find the Postmates documentation [here](https://postmates.com/developer/docs).

The Postmates API is RESTful and the Postmates client library extends [`\Guzzlehttp\Client`](http://guzzle.readthedocs.org/en/latest/). You may easily incorporate the Postmates client into your project using composer.

### Installing via Composer

[](#installing-via-composer)

The recommended way to install the Postmates client is through [Composer](http://getcomposer.org).

```
# Install Composer
curl -sS https://getcomposer.org/installer | php
```

Next, run the Composer command to install the latest stable version of postmates-client:

```
composer require quickshiftin/postmates-client
```

After installing, you need to require Composer's autoloader:

```
require 'vendor/autoload.php';
```

Authentication
--------------

[](#authentication)

You instantiate `\Postmates\Client` the same as you would `\Guzzlehttp\Client` except there are 2 new required configuration options and one new optional configuration option. The new required options are `customer_id` and `api_key` which you get once you [register](https://postmates.com/developer/register) your app. There's also an optional configuration option `postmates_version` which you can use to ensure consistent fields. Instantiating the client then looks like so

```
$oClient = new Client(['customer_id' => $cust_id, 'api_key' => $api_key]);
```

Where `$cust_id` and `$api_key` are your respective credentials.

API Methods
-----------

[](#api-methods)

All the API methods have become public member functions of the \\Postmates\\Client class.

### Request Delivery Quote

[](#request-delivery-quote)

```
// $oQuote is an instance of \Postmates\Dao\DeliveryQuote
$oQuote = $oClient->requestDeliveryQuote($sPickupAddress, $sDropoffAddress);

// You may access a value from the JSON using array notation.
// Also remember the timestamps have been converted to \DateTime instances for us.
$oDropoffEta = $oQuote['dropoff_eta'];
echo 'Dropoff ETA: ' . $oDropoffEta->format("h:i a\n");
```

### Create a Delivery

[](#create-a-delivery)

```
// $oDelivery is an instance of \Postmates\Dao\Delivery
$oDelivery = $oClient->createDelivery(
    /* Required arguments */
    $sManifest,
    $sPickupName,
    $sPickupAddress,
    $sDropoffName,
    $sDropoffAddress,
    $sDropoffPhoneNumber,

    /* Optional arguments */
    $sDropoffBusinessName='',
    $sManifestReference='',
    $sPickupBusinessName='',
    $sPickupNotes='',
    $sDropoffNotes='',
    $iQuoteId=null // @hint You can pass the id of a quote as $oQuote['id']
);
```

### List Deliveries

[](#list-deliveries)

When listing deliveries you may filter by one of the order statuses, *pending*, *pickup*, *pickup\_complete*, *dropoff*, *canceled*, *delivered*, *returned*. There are more details on the meanings of each status in the code and on the Postmates API documentation.

```
// Get a list of all Deliveries
// $oDeliveries is an instance of \Postmates\Dao\PList
// Assuming there is at least one Delivery in the response,
// $oDeliveries[0] is an instance of \Postmates\Dao\Delivery
$oDeliveries = $oClient->listDeliveries();

// Get a list of *pickup_complete* Deliveries
$oDelivereies = $oClient->listDeliveries(\Postmates\Client::STATUS_PICKUP_COMPLETE);
```

### Get Delivery Status

[](#get-delivery-status)

```
// Just pass the id of a delivery and you'll get back a \Postmates\Dao\Delivery.
$oDelivery = $oClient->getDeliveryStatus($sDeliveryId);
```

### Cancel a Delivery

[](#cancel-a-delivery)

A delivery can only be canceled prior to a courier completing pickup, which means the status must be either *pending* or *pickup*.

```
$oDelivery = $oClient->cancelDelivery($iDeliveryId);
```

### Return a Delivery

[](#return-a-delivery)

A delivery can only be reversed once the courier completed pickup and before the courier has completed dropoff. This means the status can only be *pickup\_complete*.

```
$oDelivery = $oClient->returnDelivery($iDeliveryId);
```

Client Library Data Objects
---------------------------

[](#client-library-data-objects)

The Postmates client handily converts response JSON objects from the API into objects that subclass \\ArrayObject. As a matter of convenience the client library also converts textual timestamps from the response to \\DateTime instances.

TODO
----

[](#todo)

- Pagination support and testing
- Configurable Exception handling
- Configurable Dao classes
- Optional Dao instead of id for client library methods
    - EG $oDelivery = $oClient-&gt;createDelivery(); $oClient-&gt;cancelDelivery($oDelivery);

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~235 days

Total

5

Last Release

3213d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2675283?v=4)[Agli Pançi](/maintainers/aglipanci)[@aglipanci](https://github.com/aglipanci)

---

Top Contributors

[![quickshiftin](https://avatars.githubusercontent.com/u/96733?v=4)](https://github.com/quickshiftin "quickshiftin (13 commits)")

### Embed Badge

![Health badge](/badges/aglipanci-postmates-client/health.svg)

```
[![Health](https://phpackages.com/badges/aglipanci-postmates-client/health.svg)](https://phpackages.com/packages/aglipanci-postmates-client)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.2k532.1M2.5k](/packages/aws-aws-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k496.1k34](/packages/neuron-core-neuron-ai)[illuminate/http

The Illuminate Http package.

11937.2M6.6k](/packages/illuminate-http)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.2M46](/packages/tencentcloud-tencentcloud-sdk-php)[dreamfactory/df-core

DreamFactory(tm) Core Components

1652.0k38](/packages/dreamfactory-df-core)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

252.5k](/packages/eslazarev-wildberries-sdk)

PHPackages © 2026

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