Download the PHP package beziworld/laravel-allegro without Composer

On this page you can find all versions of the php package beziworld/laravel-allegro. 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-allegro

Laravel Allegro

tests Latest Version

Allegro REST API client for Laravel, built for shops and SaaS platforms that serve one or many Allegro sellers:

Polska wersja dokumentacji

Installation

Register an application at apps.developer.allegro.pl (sandbox: apps.developer.allegro.pl.allegrosandbox.pl).

Allegro requires every integration to send a User-Agent in the format AppName/Version (+https://info-page-url), consistent with the name of the registered application; the package refuses to start without it. Requests also carry Accept/Content-Type: application/vnd.allegro.public.v1+json (the beta media type for beta resources) and Accept-Language (ALLEGRO_LANGUAGE, default pl-PL), which sets the language of error messages.

Connecting a seller

Authorization code with PKCE

Without PKCE call authorizationUrl($state) and exchangeCode($code). Pass scopes as the third argument (or set allegro.scopes) to request fewer permissions, and 'confirm' as the fourth one to show the account confirmation screen.

Device flow

For back-office tools and terminals (the application must be registered as a device application):

Or in code:

Application token

Public resources (categories, parameters, carriers, billing types) accept a client credentials token:

Tokens

Access tokens live 12 hours; refresh tokens live 3 months and are single use: every refresh returns a new pair and the previous refresh token stays valid for only 60 seconds. The client refreshes expired tokens under a cache lock, re-reads the store after acquiring the lock, and stores the new pair immediately. After HTTP 401 it refreshes once and repeats the request.

Tokens are kept in the cache by default (CacheTokenStore, 90-day TTL). To keep them in your database, implement Beziworld\Allegro\Contracts\TokenStore (get, put, forget; the key is the account name or the forUser() key) and set allegro.token_store to your class, or bind the interface in the container. An account can also be seeded with a refresh token in the config (ALLEGRO_REFRESH_TOKEN).

When Allegro revokes the authorization (password change, unlinking the application, expired refresh token), calls throw AuthenticationException with requiresReauthorization() === true: ask the seller to connect again.

Multiple seller accounts

One application serves any number of sellers, each with its own tokens:

Account entries may override any shared option, including client_id, client_secret and sandbox.

Orders

Polling new orders

Allegro has no webhooks; changes are read from event journals. allegro:poll-orders reads /order/events from the last stored event id and dispatches OrderEventReceived for every new event. On the first run of an account it starts at the newest event (set allegro.events.start to beginning to replay the last 60 days).

The cursor is saved after each event and a lock prevents overlapping runs. Allegro may repeat events or deliver them out of order, so key your processing on checkoutFormId and make listeners idempotent. Address and invoice data are final only at READY_FOR_PROCESSING. allegro:poll-offers does the same for /sale/offer-events (OfferEventReceived; the journal keeps 24 hours).

Listing and reading orders

Fulfillment and tracking numbers

Invoices

Offers

Wysyłam z Allegro

Other resources

Errors and rate limits

Situation Exception Useful methods
HTTP 400/422 validation ApiException errors() (code, message, details, path, userMessage), userMessage(), isValidationError()
HTTP 401 after one refresh and retry ApiException httpStatus(), OAuth error mapped to errors()[0]['code']
HTTP 404 ApiException isNotFound()
HTTP 409 (stale revision, reused commandId) ApiException isConflict()
HTTP 429 (9000 requests/min per Client ID, per-resource limits) ApiException isRateLimited(), retryAfter()
Connection failure ApiException getPrevious()
Failed WzA command, operation still running ApiException errors()
Missing token, revoked refresh token, denied device flow AuthenticationException requiresReauthorization(), error()
Missing configuration InvalidConfiguration

Every exception extends AllegroException. traceId() (and lastTraceId() on the client) returns the Trace-Id header that Allegro support asks for; set ALLEGRO_LOG_CHANNEL to log failed requests with it. The client never repeats a request automatically, except once after HTTP 401 (a rejected request was not processed). Back off on 429: exceeding the global limit blocks the Client ID for a minute.

Development

Author

Created and maintained by Kamil Ćwiertnia, beziworld.eu.

Need an Allegro or marketplace integration? Get in touch through beziworld.eu.

License

MIT. See LICENSE.md. This package is not affiliated with, endorsed or sponsored by Allegro.pl sp. z o.o.


All versions of laravel-allegro with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
ext-json Version *
guzzlehttp/guzzle Version ^7.8
illuminate/console Version ^12.0|^13.0
illuminate/contracts Version ^12.0|^13.0
illuminate/http Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0
psr/log Version ^2.0|^3.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 beziworld/laravel-allegro contains the following files

Loading the files please wait ...