https://github.com/magedin/econocargo-php
This is the official SDK (Software Development Kit) for econoCARGO API. This SDK is intended to help with PHP systems and econoCARGO API.
https://github.com/magedin/econocargo-php
composer development-kit econocargo-api econocargo-php frete integration php php7 sdk sdk-php shipping shipping-api shipping-rates
Last synced: about 1 month ago
JSON representation
This is the official SDK (Software Development Kit) for econoCARGO API. This SDK is intended to help with PHP systems and econoCARGO API.
- Host: GitHub
- URL: https://github.com/magedin/econocargo-php
- Owner: magedin
- License: mit
- Created: 2020-10-27T15:55:22.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-10-27T23:54:55.000Z (over 5 years ago)
- Last Synced: 2024-04-19T05:02:52.728Z (about 2 years ago)
- Topics: composer, development-kit, econocargo-api, econocargo-php, frete, integration, php, php7, sdk, sdk-php, shipping, shipping-api, shipping-rates
- Language: PHP
- Homepage:
- Size: 74.2 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# econoCARGO PHP SDK
[](https://travis-ci.com/magedin/econocargo-php)
[](https://www.codacy.com/gh/magedin/econocargo-php/dashboard?utm_source=github.com&utm_medium=referral&utm_content=magedin/econocargo-php&utm_campaign=Badge_Grade)
### About
This is the official SDK (Software Development Kit) for econoCARGO API. This SDK is intended to help with PHP systems and econoCARGO API.
### Installing
##### Installing with composer
To install using composer you'll need to have composer installed on your computer so you will be able to install this SDK into your project easily.
Once you have composer installed you just need to require this SDK:
```bash
> composer require magedin/econocargo-php
```
### Usage
To start using this SDK into your PHP system is really simple. Take a look in the example right below on how it's really easy to use:
```php
config()->service()->isTesting(true);
$quote = $api->shipping()->quote();
$quote->setCompanyCNPJ('05663266000219')
->setOrderNumber('123456')
->setDestinyId('9836')
->setDestinyUFName('SP')
->setDestinyIBGECode(0)
->setDestinyPostcode('04100-000')
->setSegmentId(5)
->setDestinyCNPJ("12345678901234")
->setDestinyCPF("01234567890")
->setDimensionsTotalValue(0.9)
->setWeightTotalValue(150)
->setInvoiceTotalValue(1500)
->setCheaperQuote(true)
->setResponseQuoteType(QuoteResponseType::TYPE_ALL)
;
$result = $quote->execute();
$shippingServices = $result->getShippingServices();
} catch (\Exception $e) {
echo "Some error has happened.";
}
```