Download the PHP package edos-engineering/reverb-marketplace without Composer

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

Reverb Marketplace for PHP and Laravel

A client for the Reverb.com marketplace API: listings, orders, shipping, offers, refunds, payouts, messages and webhooks.

This is not Laravel Reverb, the WebSocket server. This package talks to reverb.com, where people buy and sell music gear. Everything here is named reverb-marketplace / ReverbMarketplace, and its environment variables are prefixed REVERB_MARKETPLACE_, so the two can live in one application.

Not affiliated with or endorsed by Reverb.

Requirements

PHP 8.2+. Laravel 12 or 13 for the service provider, facade, webhook route and Artisan command; the client itself also runs without Laravel.

Install

Create the token on Reverb under My Profile → API & Integrations. For a shop integration Reverb recommends the scopes public, read_listings, write_listings, read_orders and write_orders; add read_payouts, read_messages/write_messages, read_offers/write_offers and read_feedback/write_feedback for those resources. Tokens do not expire.

Then check what the application can reach. This writes nothing:

To publish the config file:

Environments

REVERB_MARKETPLACE_ENVIRONMENT Base URL
production https://api.reverb.com/api
sandbox (default) https://sandbox.reverb.com/api

Anything other than the exact word production — unset, a typo — resolves to the sandbox, so a misconfiguration cannot write to a live shop. Tokens are bound to one environment: a production token is refused by the sandbox and the reverse. Sandbox accounts are separate accounts, created at https://sandbox.reverb.com/signup.

One application can address both:

usingEnvironment() and usingToken() return copies; the shared client is never changed.

Usage

Resolve Edos\ReverbMarketplace\ReverbClient from the container, or use the facade. Responses are the decoded HAL+JSON arrays Reverb sent. Collections are a Page (iterable, with total, currentPage, totalPages), and the all… methods return a LazyCollection that fetches pages as it is consumed.

Listings

Reverb's rule for a sync: look the item up by SKU first, update it if it exists, create it only if it does not. Skipping the lookup is how an item ends up listed twice.

Things Reverb's behaviour makes worth knowing:

Orders

Poll on updated_start_date, not created_start_date: an order placed before the window and paid inside it is otherwise missed. One order is one listing; items bought together share order_bundle_id.

Everything else

Resource Covers
account() Account details, badge counts
shop() Shop, shipping profiles, vacation mode
catalog() Categories, conditions, shipping regions and providers, countries, currencies, payment methods (cached)
listings() Search, find, create, update, publish, end, delete, images, drafts
orders() Selling and buying orders, ship, mark picked up
refundRequests() List, approve, conditionally approve, deny, create
negotiations() Offers: list, accept, decline, counter
directOffers() Automatic offers to watchers
sales() Sale membership (Preferred Sellers only for the listing calls)
bumps() Bump stats, bid, remove
conversations() Messages: list, read, reply
feedback() Received, sent, leave for a buyer
payments() Payments per order
payouts() Payouts and their line items
webhooks() Registrations

Reverb's API is wider than its documentation. Anything not wrapped is still one call away with the same headers, error handling and environment safety:

follow() checks that a link points at a Reverb host and then sends the request to the client's own environment, so a payload can neither leak the token to another host nor steer a sandbox client to production.

Errors

Every failure is an Edos\ReverbMarketplace\Exceptions\ReverbException with status(), errors(), body() and the raw response.

Exception When
AuthenticationException 401. Bad token, wrong environment, or an OAuth-only operation
AuthorizationException 403. Missing scope, or a feature the account does not have
NotFoundException 404
ConstraintException 406
ValidationException 400, 412, 422. errors() has the field breakdown
RateLimitException 429, after retries. retryAfter() when Reverb says
ClientException Any other 4xx
ServerException 5xx
TransportException No response at all

Connection failures and 429s are retried (retries, retry_delay_ms). A 5xx is never retried, and a TransportException on a write is ambiguous: the create may have happened. Look the listing up by SKU before repeating it.

Reverb's limits are 2,000 reads or 600 writes a minute (10,000 / 3,000 per ten minutes). Queue bulk syncs rather than looping.

Webhooks

Reverb's guides do not document webhooks. What this package knows comes from calling the API:

Since deliveries are unsigned, the package gates its route with a secret in the URL and refuses everything while none is configured:

Register https://your-app.test/webhooks/reverb-marketplace?token=a-long-random-string and listen:

Reverb retries a delivery that is not answered 2xx, so listeners must be idempotent and slow work belongs on a queue. Keep polling orders()->allSelling() as well: a webhook is the fast path, not the only one. Set webhooks.path to null to skip the route.

Without Laravel

Testing your application

The client uses Laravel's HTTP client, so Http::fake() works as usual:

Developing

The suite never touches the network.

License

MIT.


All versions of reverb-marketplace with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/contracts Version ^12.0|^13.0
illuminate/http Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0
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 edos-engineering/reverb-marketplace contains the following files

Loading the files please wait ...