PHPackages                             zero-to-prod/spapi-orders-cli - 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. [CLI &amp; Console](/categories/cli)
4. /
5. zero-to-prod/spapi-orders-cli

ActiveLibrary[CLI &amp; Console](/categories/cli)

zero-to-prod/spapi-orders-cli
=============================

A CLI for Amazon Selling Partner API (SPAPI) Orders API.

v1.5.0(1y ago)11651MITPHPPHP &gt;=8.1CI passing

Since Feb 8Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/zero-to-prod/spapi-orders-cli)[ Packagist](https://packagist.org/packages/zero-to-prod/spapi-orders-cli)[ Docs](https://github.com/zero-to-prod/spapi-orders-cli)[ Fund](https://github.com/sponsors/zero-to-prod)[ RSS](/packages/zero-to-prod-spapi-orders-cli/feed)WikiDiscussions main Synced today

READMEChangelog (8)Dependencies (8)Versions (9)Used By (1)

Zerotoprod\\SpapiOrdersCli
==========================

[](#zerotoprodspapiorderscli)

[![](art/logo.png)](art/logo.png)

[![Repo](https://camo.githubusercontent.com/9a90a3efeee26aed7d7f2feee9cd84566a26f9c362cc773b184d076210906e1c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6769746875622d677261793f6c6f676f3d676974687562)](https://github.com/zero-to-prod/spapi-orders-cli)[![GitHub Actions Workflow Status](https://camo.githubusercontent.com/b4819ea444a1fe32fcf772a048567ed869e5fe7ab39c1c120ced7bf2001e9b1c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7a65726f2d746f2d70726f642f73706170692d6f72646572732d636c692f746573742e796d6c3f6c6162656c3d74657374)](https://github.com/zero-to-prod/spapi-orders-cli/actions)[![GitHub Actions Workflow Status](https://camo.githubusercontent.com/ce3d1d7a8312c00f3dd1d7a5f8312b57dbbd5022fa3d579290400d386ee6cac5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7a65726f2d746f2d70726f642f73706170692d6f72646572732d636c692f6261636b77617264735f636f6d7061746962696c6974792e796d6c3f6c6162656c3d6261636b77617264735f636f6d7061746962696c697479)](https://github.com/zero-to-prod/spapi-orders-cli/actions)[![GitHub Actions Workflow Status](https://camo.githubusercontent.com/836f61a648c9afcb6ff6dbccc25e267d796efd829b34a59c792ba4a43d79f1fa/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7a65726f2d746f2d70726f642f73706170692d6f72646572732d636c692f6275696c645f646f636b65725f696d6167652e796d6c3f6c6162656c3d6275696c645f646f636b65725f696d616765)](https://github.com/zero-to-prod/spapi-orders-cli/actions)[![Packagist Downloads](https://camo.githubusercontent.com/918bb54a4691fc062fa3b6df08f02c7ba6a1bd4632bbff3c33db17b213f5d25a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7a65726f2d746f2d70726f642f73706170692d6f72646572732d636c693f636f6c6f723d626c7565)](https://packagist.org/packages/zero-to-prod/spapi-orders-cli/stats)[![php](https://camo.githubusercontent.com/1dbc42cc19eea1a537f190d96d9dbf1eec555d4089fd74c61cedbaf878935bdd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7a65726f2d746f2d70726f642f73706170692d6f72646572732d636c692e7376673f636f6c6f723d707572706c65)](https://packagist.org/packages/zero-to-prod/spapi-orders-cli/stats)[![Packagist Version](https://camo.githubusercontent.com/b9d6944168421b89316a6ddfdca772b001055a84a67cefb5e4e3648cbdfb1302/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7a65726f2d746f2d70726f642f73706170692d6f72646572732d636c693f636f6c6f723d663238643161)](https://packagist.org/packages/zero-to-prod/spapi-orders-cli)[![License](https://camo.githubusercontent.com/4d317c2d1351ba98b1d8256a184b835638240f0fae9c11b5df9f01380e3633b4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7a65726f2d746f2d70726f642f73706170692d6f72646572732d636c693f636f6c6f723d70696e6b)](https://github.com/zero-to-prod/spapi-orders-cli/blob/main/LICENSE.md)[![wakatime](https://camo.githubusercontent.com/3d26feca6fc806a349a4485fb6c544e7bcf497b37f6d26375f274dacfb0c4584/68747470733a2f2f77616b6174696d652e636f6d2f62616467652f6769746875622f7a65726f2d746f2d70726f642f73706170692d6f72646572732d636c692e737667)](https://wakatime.com/badge/github/zero-to-prod/spapi-orders-cli)[![Hits-of-Code](https://camo.githubusercontent.com/7cebf863184874b4fa98e3febee335087e46748730a16789bcfbd4f3fbe37fb5/68747470733a2f2f686974736f66636f64652e636f6d2f6769746875622f7a65726f2d746f2d70726f642f73706170692d6f72646572732d636c693f6272616e63683d6d61696e)](https://hitsofcode.com/github/zero-to-prod/spapi-orders-cli/view?branch=main)

Contents
--------

[](#contents)

- [Introduction](#introduction)
- [Requirements](#requirements)
- [Installation](#installation)
- [Documentation Publishing](#documentation-publishing)
    - [Automatic Documentation Publishing](#automatic-documentation-publishing)
- [Usage](#usage)
    - [Available Commands](#available-commands)
        - [`spapi-orders-cli:src`](#spapi-orders-clisrc)
        - [`spapi-orders-cli:get-order`](#spapi-orders-cliget-order)
        - [`spapi-orders-cli:get-order-items`](#spapi-orders-cliget-order-items)
        - [`spapi-orders-cli:get-order-buyer-info`](#spapi-orders-cliget-order-buyer-info)
        - [`spapi-orders-cli:get-order-address`](#spapi-orders-cliget-order-address)
- [Docker Image](#docker-image)
- [Local Development](./LOCAL_DEVELOPMENT.md)
- [Image Development](./IMAGE_DEVELOPMENT.md)
- [Contributing](#contributing)

Introduction
------------

[](#introduction)

A CLI for Amazon Selling Partner API (SPAPI) Orders API.

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

[](#requirements)

- PHP 8.1 or higher.

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

[](#installation)

Install `Zerotoprod\SpapiOrdersCli` via [Composer](https://getcomposer.org/):

```
composer require zero-to-prod/spapi-orders-cli
```

This will add the package to your project's dependencies and create an autoloader entry for it.

Documentation Publishing
------------------------

[](#documentation-publishing)

You can publish this README to your local documentation directory.

This can be useful for providing documentation for AI agents.

This can be done using the included script:

```
# Publish to default location (./docs/zero-to-prod/spapi-orders-cli)
vendor/bin/zero-to-prod-spapi-orders-cli

# Publish to custom directory
vendor/bin/zero-to-prod-spapi-orders-cli /path/to/your/docs
```

### Automatic Documentation Publishing

[](#automatic-documentation-publishing)

You can automatically publish documentation by adding the following to your `composer.json`:

```
{
    "scripts": {
        "post-install-cmd": [
            "zero-to-prod-spapi-orders-cli"
        ],
        "post-update-cmd": [
            "zero-to-prod-spapi-orders-cli"
        ]
    }
}
```

Usage
-----

[](#usage)

Run this command to see the available commands:

```
vendor/bin/spapi-orders-cli list
```

### Available Commands

[](#available-commands)

#### `spapi-orders-cli:src`

[](#spapi-orders-clisrc)

Displays the project's GitHub repository URL.

**Usage:**

```
vendor/bin/spapi-orders-cli spapi-orders-cli:src
```

**Arguments:** None

**Example:**

```
vendor/bin/spapi-orders-cli spapi-orders-cli:src
```

**Sample Output:**

```
https://github.com/zero-to-prod/spapi-orders-cli

```

#### `spapi-orders-cli:get-order`

[](#spapi-orders-cliget-order)

Retrieves order details from Amazon's Selling Partner API for a specific order ID.

**Usage:**

```
vendor/bin/spapi-orders-cli spapi-orders-cli:get-order      [options]
```

**Required Arguments:**

- `refresh_token` - The LWA refresh token
- `client_id` - Get this value when you register your application
- `client_secret` - Get this value when you register your application
- `target_application` - The application ID for the target application to which access is being delegated
- `order_id` - The Amazon Order ID

**Options:**

- `--user_agent` - User Agent (optional)
- `--response` - Returns the full response (flag)
- `--expiresIn` - The expiresIn value for the restrictedDataToken (flag)

**Example:**

```
vendor/bin/spapi-orders-cli spapi-orders-cli:get-order "refresh_token_here" "client_id_here" "client_secret_here" "app_id_here" "123-4567890-1234567"
```

**Sample Output:**

```
{
    "AmazonOrderId": "123-4567890-1234567",
    "PurchaseDate": "2023-12-01T14:30:00Z",
    "LastUpdateDate": "2023-12-02T10:15:00Z",
    "OrderStatus": "Shipped",
    "FulfillmentChannel": "MFN",
    "SalesChannel": "Amazon.com",
    "OrderChannel": "Online",
    "ShipServiceLevel": "Std US D2D Dom",
    "NumberOfItemsShipped": 1,
    "NumberOfItemsUnshipped": 0,
    "PaymentExecutionDetail": [],
    "PaymentMethod": "Other",
    "MarketplaceId": "ATVPDKIKX0DER",
    "BuyerEmail": "buyer@example.com",
    "BuyerName": "John Doe",
    "BuyerCounty": "King",
    "BuyerTaxInfo": {
        "CompanyLegalName": "Example Company",
        "TaxingRegion": "WA",
        "TaxClassifications": []
    },
    "ShipmentServiceLevelCategory": "Standard",
    "ShippedByAmazonTFM": false,
    "TFMShipmentStatus": "PendingPickUp",
    "OrderType": "StandardOrder",
    "EarliestShipDate": "2023-12-01T00:00:00Z",
    "LatestShipDate": "2023-12-03T23:59:59Z",
    "EarliestDeliveryDate": "2023-12-05T00:00:00Z",
    "LatestDeliveryDate": "2023-12-08T23:59:59Z",
    "IsBusinessOrder": false,
    "IsPrime": true,
    "IsPremiumOrder": false,
    "IsGlobalExpressEnabled": false,
    "ReplacedOrderId": null,
    "IsReplacementOrder": false,
    "PromiseResponseDueDate": "2023-12-01T16:30:00Z",
    "IsEstimatedShipDateSet": false
}
```

#### `spapi-orders-cli:get-order-items`

[](#spapi-orders-cliget-order-items)

Retrieves the items for a specific order from Amazon's Selling Partner API.

**Usage:**

```
vendor/bin/spapi-orders-cli spapi-orders-cli:get-order-items      [options]
```

**Required Arguments:**

- `refresh_token` - The LWA refresh token
- `client_id` - Get this value when you register your application
- `client_secret` - Get this value when you register your application
- `target_application` - The application ID for the target application to which access is being delegated
- `order_id` - The Amazon Order ID

**Options:**

- `--user_agent` - User Agent (optional)
- `--response` - Returns the full response (flag)
- `--expiresIn` - The expiresIn value for the restrictedDataToken (flag)

**Example:**

```
vendor/bin/spapi-orders-cli spapi-orders-cli:get-order-items "refresh_token_here" "client_id_here" "client_secret_here" "app_id_here" "123-4567890-1234567"
```

**Sample Output:**

```
{
    "OrderItems": [
        {
            "ASIN": "B08N5WRWNW",
            "SellerSKU": "SKU-12345",
            "OrderItemId": "12345678901234",
            "Title": "Example Product Title",
            "QuantityOrdered": 1,
            "QuantityShipped": 1,
            "ProductInfo": {
                "NumberOfItems": 1
            },
            "PointsGranted": {
                "PointsNumber": 0
            },
            "ItemPrice": {
                "CurrencyCode": "USD",
                "Amount": "29.99"
            },
            "ShippingPrice": {
                "CurrencyCode": "USD",
                "Amount": "5.99"
            },
            "ItemTax": {
                "CurrencyCode": "USD",
                "Amount": "2.70"
            },
            "ShippingTax": {
                "CurrencyCode": "USD",
                "Amount": "0.54"
            },
            "ShippingDiscount": {
                "CurrencyCode": "USD",
                "Amount": "0.00"
            },
            "PromotionDiscount": {
                "CurrencyCode": "USD",
                "Amount": "0.00"
            },
            "ConditionId": "New",
            "ConditionSubtypeId": "New",
            "ConditionNote": "",
            "PriceDesignation": "BusinessPrice",
            "TaxCollection": {
                "Model": "MarketplaceFacilitator",
                "ResponsibleParty": "Amazon Services, Inc."
            },
            "SerialNumberRequired": false,
            "IsTransparency": false,
            "IossNumber": "",
            "StoreChainStoreId": "",
            "DeemedResellerCategory": "IOSS",
            "BuyerInfo": {
                "BuyerCustomizedInfo": {
                    "CustomizedURL": ""
                },
                "GiftWrapPrice": {
                    "CurrencyCode": "USD",
                    "Amount": "0.00"
                },
                "GiftWrapTax": {
                    "CurrencyCode": "USD",
                    "Amount": "0.00"
                },
                "GiftMessageText": "",
                "GiftWrapLevel": "None"
            }
        }
    ]
}
```

#### `spapi-orders-cli:get-order-buyer-info`

[](#spapi-orders-cliget-order-buyer-info)

Retrieves buyer information for a specific order from Amazon's Selling Partner API.

**Usage:**

```
vendor/bin/spapi-orders-cli spapi-orders-cli:get-order-buyer-info      [options]
```

**Required Arguments:**

- `refresh_token` - The LWA refresh token
- `client_id` - Get this value when you register your application
- `client_secret` - Get this value when you register your application
- `target_application` - The application ID for the target application to which access is being delegated
- `order_id` - The Amazon Order ID

**Options:**

- `--user_agent` - User Agent (optional)
- `--response` - Returns the full response (flag)
- `--expiresIn` - The expiresIn value for the restrictedDataToken (flag)

**Example:**

```
vendor/bin/spapi-orders-cli spapi-orders-cli:get-order-buyer-info "refresh_token_here" "client_id_here" "client_secret_here" "app_id_here" "123-4567890-1234567"
```

**Sample Output:**

```
{
    "AmazonOrderId": "123-4567890-1234567",
    "BuyerEmail": "buyer@example.com",
    "BuyerName": "John Doe",
    "BuyerCounty": "King",
    "BuyerTaxInfo": {
        "CompanyLegalName": "Example Company Inc.",
        "TaxingRegion": "WA",
        "TaxClassifications": [
            {
                "Name": "VAT",
                "Value": "US123456789"
            }
        ]
    },
    "PurchaseOrderNumber": "PO-2023-12345"
}
```

#### `spapi-orders-cli:get-order-address`

[](#spapi-orders-cliget-order-address)

Returns the shipping address for the specified order from Amazon's Selling Partner API.

**Usage:**

```
vendor/bin/spapi-orders-cli spapi-orders-cli:get-order-address      [options]
```

**Required Arguments:**

- `refresh_token` - The LWA refresh token
- `client_id` - Get this value when you register your application
- `client_secret` - Get this value when you register your application
- `target_application` - The application ID for the target application to which access is being delegated
- `order_id` - The Amazon Order ID

**Options:**

- `--user_agent` - User Agent (optional)
- `--response` - Returns the full response (flag)
- `--expiresIn` - The expiresIn value for the restrictedDataToken (flag)

**Example:**

```
vendor/bin/spapi-orders-cli spapi-orders-cli:get-order-address "refresh_token_here" "client_id_here" "client_secret_here" "app_id_here" "123-4567890-1234567"
```

**Sample Output:**

```
{
    "AmazonOrderId": "123-4567890-1234567",
    "ShippingAddress": {
        "Name": "John Doe",
        "AddressLine1": "123 Main Street",
        "AddressLine2": "Apt 456",
        "AddressLine3": "",
        "City": "Seattle",
        "County": "King",
        "District": "",
        "StateOrRegion": "WA",
        "Municipality": "",
        "PostalCode": "98101",
        "CountryCode": "US",
        "Phone": "555-123-4567",
        "AddressType": "Residential"
    }
}
```

**Note:** All SPAPI commands return JSON-formatted responses. Make sure to have valid Amazon SP-API credentials and proper permissions to access order data.

Docker Image
------------

[](#docker-image)

You can also run the cli using the [docker image](https://hub.docker.com/repository/docker/davidsmith3/spapi-orders-cli/general):

```
docker run --rm davidsmith3/spapi-orders-cli
```

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

[](#contributing)

Contributions, issues, and feature requests are welcome! Feel free to check the [issues](https://github.com/zero-to-prod/spapi-orders-cli/issues) page if you want to contribute.

1. Fork the repository.
2. Create a new branch (`git checkout -b feature-branch`).
3. Commit changes (`git commit -m 'Add some feature'`).
4. Push to the branch (`git push origin feature-branch`).
5. Create a new Pull Request.

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance48

Moderate activity, may be stable

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 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 ~0 days

Total

8

Last Release

511d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/502649f05d36c87d494988bd99193a4d908d345335d99c080928a726277371f5?d=identicon)[zero-to-prod](/maintainers/zero-to-prod)

---

Top Contributors

[![zero-to-prod](https://avatars.githubusercontent.com/u/61474950?v=4)](https://github.com/zero-to-prod "zero-to-prod (19 commits)")

---

Tags

zero-to-prodspapi-orders-cli

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/zero-to-prod-spapi-orders-cli/health.svg)

```
[![Health](https://phpackages.com/badges/zero-to-prod-spapi-orders-cli/health.svg)](https://phpackages.com/packages/zero-to-prod-spapi-orders-cli)
```

PHPackages © 2026

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