PHPackages                             sellerlegend/sellerlegend-sdk-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. sellerlegend/sellerlegend-sdk-php

ActiveLibrary[API Development](/categories/api)

sellerlegend/sellerlegend-sdk-php
=================================

Official SellerLegend SDK for Laravel applications

1.0.6(4y ago)11112MITPHPPHP ^7.1

Since Jul 30Pushed 2y ago3 watchersCompare

[ Source](https://github.com/sellerlegend/sellerlegend-sdk-php)[ Packagist](https://packagist.org/packages/sellerlegend/sellerlegend-sdk-php)[ Docs](https://sellerlegend.com/)[ RSS](/packages/sellerlegend-sellerlegend-sdk-php/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (10)Used By (0)

SellerLegend SDK
================

[](#sellerlegend-sdk)

Synopsis
--------

[](#synopsis)

Official SellerLegend SDK for Laravel applications.

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

[](#requirements)

php: ^7.1
ext-curl: \*
ext-json: \*
ext-zlib: \*

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

[](#documentation)

[Postman](https://documenter.getpostman.com/view/17637582/UUxwD9Ao)
[Access Request](https://app.sellerlegend.com/account/developers)
[Getting Started](http://docs.sellerlegend.com)

License
-------

[](#license)

The MIT License (MIT). Please see License File for more information.

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

[](#installation)

The recommended way to install sellerlegend-sdk-php is through Composer:

```
composer require sellerlegend/sellerlegend-sdk-php

```

### Service Provider

[](#service-provider)

```
SellerLegend\SellerLegendServiceProvider::class

```

### Publish Assets

[](#publish-assets)

```
$ php artisan vendor:publish --tag=sellerlegend

```

And that's it!

Quick Start
-----------

[](#quick-start)

### Get Authorization Code

[](#get-authorization-code)

To get an authorization code you only need client id and redirect path.

```
use SellerLegend\Http\Client;

$config = [
    "client_id"     => "CLIENT_ID",
    "client_secret" => "CLIENT_SECRET",
    "redirect"      => "REDIRECT_PATH"
];

$client = new Client($config);

$request = $client->getAuthorizationCode('YOUR_STATE_HERE');

```

### Get Access Token

[](#get-access-token)

To get access token you need to send the received auth code. The auth code is for one time use only.

```
$request = $client->getAccessToken($request->get("code"));

```

### Instantiate the Client

[](#instantiate-the-client)

Once you have your `access_token` or the `refresh_token` you only need one of these along with client credentials to instantiate the client.

```
use SellerLegend\Http\Client;

$config = [
    "client_id"     => "CLIENT_ID",
    "client_secret" => "CLIENT_SECRET",
    "refresh_token" => "REFRESH_TOKEN"
];

$client = new Client($config);

```

### Refresh Access Token

[](#refresh-access-token)

You can refresh your access token when it expires by using the following method. The new access token will be in the request response.

```
$request = $client->refreshAccessToken();

```

### Check Service Status

[](#check-service-status)

```
$request = $client->getServiceStatus();

```

```
{
    "status": "Success",
    "code": 200,
    "message": "Active",
    "path": "api\/service-status"
}

```

### Get User Details

[](#get-user-details)

```
use SellerLegend\Http\UserClient;

$client = new UserClient($config);
$request = $client->getUser();

```

```
{
    "id": 1xxxxx,
    "name": "Fxxxxx Dxxxxx",
    "email": "fdxxxxx@domain.co",
    "status": "ACTIVE",
    "active": 1
}

```

### Get Accounts List

[](#get-accounts-list)

This method fetches list of all marketplaces connected on SellerLegend against the provided access\_token

```
use SellerLegend\Http\UserClient;

$client = new UserClient($config);
$request = $client->getAccountsList();

```

```
[{
    "id": 1xxxxx,
    "account_title": "[ACCOUNT-TITLE]",
    "country_code": "US",
    "currency_code": "USD",
    "timezone": "America\/Los_Angeles",
    "marketplace": "ATVPDKIKX0DER",
    "seller_id": "[SELLER-ID]"
}]

```

### Get Connections List

[](#get-connections-list)

This method returns a list of Amazon connections between SellerLegend and the Amazon Selling Partner API and the Amazon Advertising API. With connection token status and details about all connected marketplaces.

```
use SellerLegend\Http\UserClient;

$client = new UserClient($config);
$response = $client->getConnectionsList();

```

```
[{
    "account_title": "MyAccountTitle (Europe)",
    "seller_id": "",
    "region": "Europe",
    "sp": {
        "status": "CONNECTED",
        "last_connected_at": "2023-03-26T06:58:53Z",
        "last_refreshed_at": "2023-04-10T02:10:23Z",
        "brand_analytics_access": true
    },
    "ppc": {
        "status": "CONNECTED",
        "last_connected_at": "2023-03-26T04:25:53Z",
        "last_refreshed_at": "2023-04-10T02:10:23Z",
    },
    "marketplaces": {
        "DE": {
            "account_title": "MyAccountTitle 2 (ES)",
            "country": "DE",
            "marketplace_id": "A1RKKUPIHCS9HS",
            "status": "ONBOARDED",
            "account_updates": {
                "orders_updated_at": "2023-04-01T00:10:53Z",
                "products_updated_at": "2023-04-02T01:30:20Z",
                "finances_updated_at": "2023-04-02T02:00:24Z",
                "inventory_updated_at": "2023-04-02T03:50:43Z",
                "ppc_updated_at": "2023-04-06T07:00:23Z"
            }
        },
        "ES": {
          "status": "NOT_STARTED_BY_USER"
        }
    }
}]

```

Once you've your account id you can start making report requests using that account id.

Example API Calls
-----------------

[](#example-api-calls)

### Request Report

[](#request-report)

Request report method can accept `product_sku`, `dps_date` and/or `last_updated_at` parameters. See documentation for details.

The request report method returns `report_id` in response, which is a required parameter of other report calls.

```
use SellerLegend\Http\ReportsClient;

$client = new ReportsClient($config);

$data = [
    'account_id' => '1xxxxx',
    'dps_date'   => '2020-07-01'
];

$response = $client->requestReport($data);

```

```
{
    "status": "Success",
    "code": 200,
    "message": "Request Submitted",
    "path": "api\/report\/request",
    "report_id": 7xxxxx
}

```

### Get Report Status

[](#get-report-status)

This method is supposed to return a status from the list of possible statuses. See documentation for details.

```
$report_id = 7xxxxx;

$response = $client->getReportStatus($report_id);

```

```
{
    "status": "working",
    "code": 200,
    "message": "Report Status",
    "path": "api\/reports\/status",
    "report_id": 7xxxxx
}

```

### Get Report

[](#get-report)

Retrieves `,` delimited csv report content.

```
$report_id = 7xxxxx;

$response = $client->getReport($report_id);

```

### Get Notifications List

[](#get-notifications-list)

This method accepts one of the SellerLegend registered notification types and responds with the list of notifications sent during the last 24 hours using zapier notification channel. See documentation for details.

```
use SellerLegend\Http\NotificationsClient;

$client = new NotificationsClient($config);

$notification_type = "Export Report";
$response = $client->getNotificationsList($notification_type);

```

```
[{
  "id": 8xxx2,
  "report_name": "US-COGS-20200827-080xxx.xlsx",
  "type": "COGS",
  "download_url": "https:\/\/app.sellerlegend.com\/reports\/download-report\/8xxx2",
  "status": "done",
  "requested_by": "Fxxxxx Dxxxxx",
  "requested_at": "2020-08-27 08:54:36",
  "completed_at": "2020-08-27 08:55:10"
}]

```

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 76.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 ~67 days

Recently: every ~24 days

Total

9

Last Release

1626d ago

Major Versions

0.1.4 → 1.0.02021-10-14

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/68988611?v=4)[SellerLegend](/maintainers/sellerlegend)[@sellerlegend](https://github.com/sellerlegend)

---

Top Contributors

[![taskeenfatima](https://avatars.githubusercontent.com/u/19680103?v=4)](https://github.com/taskeenfatima "taskeenfatima (29 commits)")[![waleedmazhar-histone](https://avatars.githubusercontent.com/u/93695821?v=4)](https://github.com/waleedmazhar-histone "waleedmazhar-histone (7 commits)")[![histonedev](https://avatars.githubusercontent.com/u/4409234?v=4)](https://github.com/histonedev "histonedev (1 commits)")[![sellerlegend](https://avatars.githubusercontent.com/u/68988611?v=4)](https://github.com/sellerlegend "sellerlegend (1 commits)")

---

Tags

laravel-packagesellerlegendlaravelslsellerlegendsellerlegend-sdk

### Embed Badge

![Health badge](/badges/sellerlegend-sellerlegend-sdk-php/health.svg)

```
[![Health](https://phpackages.com/badges/sellerlegend-sellerlegend-sdk-php/health.svg)](https://phpackages.com/packages/sellerlegend-sellerlegend-sdk-php)
```

###  Alternatives

[rakibdevs/openweather-laravel-api

Laravel package to connect https://openweathermap.org/ to get customized weather data for any location on the globe immediately

7652.6k](/packages/rakibdevs-openweather-laravel-api)

PHPackages © 2026

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