rits-tecnologia / melhorenvio-php-sdk
Melhor Envio PHP SDK
Installs: 2 657
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: ^7.3
- guzzlehttp/guzzle: ^6.5
Requires (Dev)
- phpunit/phpunit: ^8.0
- symfony/dotenv: ^5.0
This package is auto-updated.
Last update: 2025-03-29 00:50:43 UTC
README
This package provides PHP SDK to the Melhor Envio API (https://docs.menv.io).
Installation
Install this package with composer.
composer require rits-tecnologia/melhorenvio-php-sdk
Usage
$melhorenvio = new MelhorEnvio(env('MELHORENVIO_TOKEN')); // repositories $melhorenvio->shipments(); $melhorenvio->carriers();
Examples
$response = $melhorenvio->shipments()->calculate([ 'from' => [ 'postal_code' => '59082000', ], 'to' => [ 'postal_code' => '59148485', ], 'options' => [ 'receipt' => false, 'own_hand' => false, ], 'services' => '1,2', 'products' => [ [ 'id' => 'x', 'width' => 11, 'height' => 17, 'length' => 11, 'weight' => 0.3, 'insurance_value' => 10.1, 'quantity' => 1, ], [ 'id' => 'x', 'width' => 20, 'height' => 10, 'length' => 11, 'weight' => 0.5, 'insurance_value' => 20.1, 'quantity' => 2, ], ], ]);