jeroenboesten/shops-united-laravel

Laravel wrapper for the ShopsUnited API

v1.1.2 2020-04-04 10:34 UTC

This package is auto-updated.

Last update: 2024-05-04 19:08:14 UTC


README

Latest Version on Packagist Scrutinizer Code Quality StyleCI Total Downloads

This Laravel package functions as a wrapper for the Shops United API. To see more about the specific API visit: Shops United API Docs.

This package is not affiliated with, funded, or in any way associated with Shops United, but is maintained in spare time.

Installation

You can install the package via composer:

composer require jeroenboesten/shops-united-laravel

Environment variables

Add the UserId and API Key to your environment variables.

SHOP_UNITED_ACCOUNT_ID=
SHOP_UNITED_API_KEY=

Optionally you can set if the ssl certificate should be verified, by adding a environment variable. By default the ssll certificate is verified on production but NOT verified on local environments.

SHOPS_UNITED_VERIFY_SSL=true

Usage

After you installed the package you start using it by creating an instance. After that you can select one of the available modules (Shipments or Accounts) and use the methods in there.

    $shopsUnited = new \JeroenBoesten\ShopsUnitedLaravel\ShopsUnitedLaravel(); // Create a new ShopsUnitedLaravel instance.
    $shopsUnited->accounts()->validate(); // Validates the API Key and User ID.
    $shopsUnited->shipments()->types(); // List all types of shipments that are available for the account, can be used for creating a new shipment.
    $shopsUnited->shipments()->list(); // Lists last 50 shipments.

To create a new shipment over the api you can use the Shipments()->create() method with first the mandatory fields and after that a array with optional parameters (for a list of optional parameters visit the api docs).

$shopsUnited->shipments()->create("PostNL", "Standaard pakket", "Order Aanvraag: 1502", "Arno Niem", "Straatweg", "14", "1111AB", "Amsterdam", 1, 1, ['NietLeverenBijDeBuren' => true])

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email info@jeroenboesten.nl instead of using the issue tracker.

Credits

License

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