mataluis2k / shipwire-api
Shipwire php integration
Requires
- guzzlehttp/guzzle: ^7.0.1
Requires (Dev)
- dev-master
- v0.2.14
- v0.2.13
- 0.2.12
- v0.2.11
- v0.2.10
- v0.2.9
- v0.2.8
- v0.2.7
- v0.2.6
- v0.2.5
- v0.2.4
- v0.2.3
- 0.2.2
- 0.2.1
- 0.2.0
- 0.1.1
- 0.1.0
- dev-bugfix/negotiate_body_and_status
- dev-hotfix/rethrow_when_data_null
- dev-feature/return-merchandise-authorization
- dev-feature/sw-api-version-select
- dev-feature/MLT-2370_shipping_address_validation
This package is auto-updated.
Last update: 2025-02-19 16:15:39 UTC
README
These library will help you with the usage of Shipwire API.
Installing via Composer
The recommended way to install Shipwire-API is through Composer.
# Install Composer curl -sS https://getcomposer.org/installer | php
Next, run the Composer command to install the latest stable version of Shipwire-API:
composer require mataluis2k/shipwire-api
After installing, you need to require Composer's autoloader:
require 'vendor/autoload.php';
Documentation
Initial configuration
To configure the library just call ShipwireConnector::init() function to and start using it.
To use it you only have to configure your username and password in The clientyour config-local file like this:
ShipwireConnector::init($config['username'], $config['password'], 'sandbox');
Stock
To check for Stock of a product:
$response = $stock->getStockBySKUs(['CAPTRACKERBLUE']);
If you have more than one SKU, just add them to the array like:
$response = $stock->getStockBySKUs(['CAPTRACKERBLUE', 'CAPTRACKERRED', 'ETCETERA']);
Extra parameters can be used. See \mataluis2k\shipwire\Stock for more information.
Rates
You can ask Shipwire API for a shipping rate using Rate class.
$rate = new Rate; $options = [ "currency" => "USD", "groupBy" => "all", "canSplit" => 1, "warehouseArea" => "US" ]; $address = Address::createFromArray([ "address1" => "6501 Railroad Avenue SE", "address2" => "Room 315", "address3" => "", "city" => "Snoqualmie", "postalCode" => "85283", "region" => "WA", "country" => "US", "isCommercial" => 0, "isPoBox" => 0 ]); $items = [ ['sku' => 'CAPTRACKERBLUE', 'quantity' => 3] ]; $shippingInfo = $rate->quote($address, $items, $options);
Orders
$order = new \mataluis2k\shipwire\Order();
TBD
##Issues and Feature Requests
If you have issues to report, or issues to request, use the issue tracker in Github.
##Contributing
Currently, the library isn't very feature rich or mature. If you'd like to offer improvements:
- Fork it
- Create your feature branch
git checkout -b feature-name
- Commit your changes
git commit -am 'Add feature'
* - Push the branch
git push origin feature-name
- Create a pull request
##Contact
Have a question? I'm on twitter: @cloudGuru_saas Also, checkout my blog at devops7.com
##License