Download the PHP package daikazu/asi-smartlink without Composer

On this page you can find all versions of the php package daikazu/asi-smartlink. 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 asi-smartlink

ASI Smartlink for PHP

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

A typed PHP client for the ASI Smartlink REST API, built on Saloon. Search products, suppliers, and decorators; pull product detail, charges, and price matrices; resolve media URLs; and drive auto-complete and industry news — all through fluent query builders, immutable DTOs, and typed exceptions. Laravel integration (service provider, facade, publishable config) is included but optional; the client runs equally well in plain PHP.

[!WARNING] Work in progress — pre-release software. This package is under active development and has not yet reached a stable 1.0 release. The public API, DTO shapes, and method signatures may change without notice between 0.x releases. Pin an exact version and review the changelog before upgrading. Not yet recommended for production use.

Installation

You can install the package via composer:

You can publish the config file with:

Environment

Add your ASI-issued credentials to .env:

Authentication uses ASI's AsiMemberAuth scheme — a single Authorization header built from the client ID and secret. There is no OAuth/token exchange.

Usage

The same is available via the container, e.g. app(\Daikazu\AsiSmartlink\AsiSmartlink::class) or by injecting Daikazu\AsiSmartlink\Http\SmartLinkConnector.

Using it without Laravel

Laravel is optional. The package only requires saloonphp/saloon at runtime — the service provider, facade, and config helpers are conveniences that activate when Laravel is present. Outside Laravel (plain PHP, Symfony, a CLI script, …) just construct the connector directly:

The resources (->products(), ->suppliers(), ->decorators(), ->lists(), ->media()), DTOs, query builders, and typed exceptions all work identically — none of them touch the framework. Saloon's own MockClient ($connector->withMockClient(...)) handles testing without the Laravel Saloon::fake() facade.

Available resources

Authentication: most endpoints send the AsiMemberAuth credentials automatically. The auto-complete, industry-news, and media endpoints require no authentication, so the package deliberately omits the credentials on those requests.

Note on detail responses: ProductDetail, SupplierDetail, and DecoratorDetail type the documented identity/contact fields and expose the complete decoded payload via a raw array (and a get('Key') helper). The SmartLink PDF's "Raw Response" samples are embedded images, so the deeper nested structures carry TODO(confirm) notes pending verification against a live response — see the DTO docblocks.

Filtering product search

The product search q parameter supports dimension and boolean filters. Build them with ProductQuery instead of hand-writing the string — products()->search() accepts either a plain keyword string or a ProductQuery:

Covers all tier-1 dimensions (category, color, size, material, supplier, asi, priceBetween/costBetween/profitBetween, quantity, productionTime, supplierCountry, preferred), tier-2 dimensions (shape, theme, tradeName, supplierState, imprintMethod, lineName, supplierRating), the boolean filters (hasImage, hasPrice, hasRushService, isNew, isSoldBlank, isMadeInUsa, isConfirmedProduct, …), and a raw('filter:value') escape hatch. Per the ASI docs, combine a tier-2 filter with at least one tier-1 selection, and preferred:* slows the response.

Supplier search has its own builder, SupplierQuery, accepted by suppliers()->search():

The keyword is AND-ed with every filter. It matches against the supplier name, so pairing a specific keyword with a narrow location easily yields zero results (e.g. make('promotions')->city('Philadelphia') finds no supplier named "promotions" in Philadelphia). Use the keyword for name searches, or omit it and filter by location. supplierRating(n) matches suppliers rated n or higher.

Supports asi, zip, phone, city, state, email, supplierRating, canadianFriendly, canadian, and a raw('filter:value') escape hatch.

Decorator search has the equivalent DecoratorQuery (a smaller filter set: asi, zip, phone, city, state, email), accepted by decorators()->search():

state: expects the postal abbreviation (FL, PA), even though the address in responses contains the full state name.

Autocomplete → filter

The dimension filters (category, color, supplier, theme, …) match exact values, so use the auto-complete endpoint to discover valid values as the user types, then feed the chosen value straight into the query builder. Auto-complete needs no auth and isn't rate-limited, so it's safe to call on each keystroke.

The AutoCompleteDimension cases line up with the builder methods (Colorcolor(), Categorycategory(), Suppliersupplier(), Themetheme(), and so on). Supplier suggestions come back as "Hit Promotional Products (asi/61125)", so you can show the name and parse the ASI number for an asi: filter.

Error handling

Failed responses (4xx/5xx) throw a typed exception. ASI returns errors as {"Error": "message"}; that message is surfaced on the exception. All exceptions extend SmartLinkRequestException, so you can catch one or many:

Status Exception
401 / 403 AuthenticationException
404 ResourceNotFoundException
429 RateLimitExceededException
other 4xx/5xx SmartLinkRequestException

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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


All versions of asi-smartlink with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
saloonphp/saloon Version ^4.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 daikazu/asi-smartlink contains the following files

Loading the files please wait ...