Download the PHP package highsidelabs/laravel-spapi without Composer

On this page you can find all versions of the php package highsidelabs/laravel-spapi. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-spapi

Highside Labs logo

Total downloads Latest stable version License

Selling Partner API wrapper for Laravel

Simplify connecting to the Selling Partner API with Laravel. Uses jlevers/selling-partner-api under the hood.

[!NOTE] There is a lot of boilerplate involved in building a Selling Partner API application: setting up credential management, OAuth, infrastructure for handling feeds and reports, and more. I built an SP API Laravel starter kit that comes with all that functionality baked in, so you can focus on writing business logic. The starter kit uses this package, along with jlevers/selling-partner-api, to make developing SP API applications easier. Read the full documentation here.

Related packages


This package is developed and maintained by Highside Labs. If you need support integrating with Amazon's (or any other e-commerce platform's) APIs, we're happy to help! Shoot us an email at [email protected]. We'd love to hear from you :)

If you've found any of our packages useful, please consider becoming a Sponsor, or making a donation via the button below. We appreciate any and all support you can provide!

Donate to Highside Labs


There is a more in-depth guide to using this package on our blog.

Installation

Table of Contents


Overview

This library has two modes:

  1. Single-seller mode, which you should use if you only plan to make requests to the Selling Partner API with a single set of credentials (most people fall into this category, so if you're not sure, this is probably you).
  2. Multi-seller mode, which makes it easy to make requests to the Selling Partner API from within Laravel when you have multiple sets of SP API credentials (for instance, if you operate multiple seller accounts, or operate one seller account in multiple regions).

Single-seller mode

Setup

  1. Publish the config file:

  2. Add these environment variables to your .env:

Set SPAPI_ENDPOINT_REGION to the region code for the endpoint you want to use (EU for Europe, FE for Far East, or NA for North America). The default is North America.

Usage

SellerConnector and VendorConnector can be type-hinted, and the connector classes can be used to create instances of all APIs supported by jlevers/selling-partner-api. This example assumes you have access to the Selling Partner Insights role in your SP API app configuration (so that you can call SellingPartnerApi\Seller\SellersV1\Api::getMarketplaceParticipations()), but the same principle applies to calling any other Selling Partner API endpoint.

Multi-seller mode

Setup

  1. Publish the config file:

  2. Change the installation_type in config/spapi.php to multi.

  3. Publish the multi-seller migrations:

  4. Run the database migrations to set up the spapi_sellers and spapi_credentials tables (corresponding to the HighsideLabs\LaravelSpApi\Models\Seller and HighsideLabs\LaravelSpApi\Models\Credentials models, respectively):

Usage

First you'll need to create a Seller, and some Credentials for that seller. The Seller and Credentials models work just like any other Laravel model.

[!NOTE] client_id and client_secret are nullable. If you are authorizing multiple sellers on a single SP API application, they will all use the same client ID and client secret. If you leave client_id and client_secret empty, the library will try to load those values from the SPAPI_LWA_CLIENT_ID and SPAPI_LWA_CLIENT_SECRET environment variables that are used in single-seller mode. That means that the single-seller credentials can effectively be used as master credentials in multi-seller mode.

Once you have credentials in the database, you can use them to retrieve a SellerConnector instance, from which you can get an instance of any seller API:

The same goes for a VendorConnector instance:

Troubleshooting

If you encounter an error like String data, right truncated: 7 ERROR: value too long for type character varying(255), it's probably because you're using Laravel's database cache, which by default has a 255-character limit on cache keys and values. This library has a migration available to fix this:


All versions of laravel-spapi with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
illuminate/support Version ^11.0|^12.0
illuminate/database Version ^11.0|^12.0
illuminate/cache Version ^11.0|^12.0
jlevers/selling-partner-api Version ^7.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package highsidelabs/laravel-spapi contains the following files

Loading the files please wait ....