Download the PHP package survos/marketplace-contracts without Composer

On this page you can find all versions of the php package survos/marketplace-contracts. 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 marketplace-contracts

survos/marketplace-contracts

Provider-neutral contracts and models for listing items on online marketplaces — currently eBay and Mercado Libre.

Framework-agnostic and dependency-free: no Symfony kernel, no container, no HTTP client, no require beyond PHP itself. The same models are used from a Symfony application (survos/marketplace-bundle), a WordPress plugin, or a plain script.

This package is to marketplaces what survos/record-store is to record backends: the shared vocabulary, with the drivers shipped separately.

The shape

Model\ListingDraft everything needed to publish one listing, provider-neutral and immutable
Model\AttributeSchema what a category demands — and toJsonSchema() for structured model output
Model\Money exact amounts in minor units; never a float
Model\ShippingSpec flat shipping: first item + each additional
Model\MarketplaceToken an OAuth pair, with rotation handled correctly
Contract\MarketplaceAdapterInterface what a driver implements
Registry\MarketplaceRegistry resolves a ConnectionConfiguration to an adapter

Why the interface is this narrow

publish() barely generalizes. On eBay it is an inventory item, then an offer, then a publish — against business policies and a merchant location that must already exist. On Mercado Libre it is a single POST /items. The two adapters share no code and there is nothing to be gained from pretending otherwise.

What does generalize is the step before it:

Asking the provider what a category requires, and feeding that back into generation, is identical on both marketplaces and is what decides whether a listing publishes or bounces. That loop is the reason this package exists.

Three things this package is opinionated about

Money is never a float. Money holds minor units and an explicit currency exponent. Prices get compared, summed and echoed back to sellers; binary floating point loses cents, and the loss shows up in a live listing.

Shipping is linear, not banded. Neither provider can express "1–3 units $0.90, 4–10 units $1.40" on a listing — every automatic mechanism they offer is a first-item cost plus a flat per-additional delta. Modelling bands here would invent a feature that does not exist and quietly mis-price the result. Pack size belongs in the SKU.

Refresh tokens rotate. MarketplaceToken is immutable and refreshed() always returns a new instance carrying whatever refresh token came back. Mercado Libre's refresh tokens are single-use — a new one is issued on every refresh and only the newest is accepted. A store that treats the refresh token as write-once passes every eBay test and then locks the Mercado Libre account out permanently on its first refresh, with an error that points at authorization rather than at storage. TokenStoreInterface::save() documents this as an implementation requirement.

Tests


All versions of marketplace-contracts with dependencies

PHP Build Version
Package Version
Requires php Version ^8.5
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 survos/marketplace-contracts contains the following files

Loading the files please wait ...