https://github.com/andyts93/brt-api-wrapper
Simple PHP wrapper for Bartolini API
https://github.com/andyts93/brt-api-wrapper
bartolini brt php shipping-api wrapper-api
Last synced: 5 months ago
JSON representation
Simple PHP wrapper for Bartolini API
- Host: GitHub
- URL: https://github.com/andyts93/brt-api-wrapper
- Owner: andyts93
- License: mit
- Created: 2021-10-20T12:49:12.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-02-07T17:45:42.000Z (over 3 years ago)
- Last Synced: 2025-10-08T20:56:13.802Z (8 months ago)
- Topics: bartolini, brt, php, shipping-api, wrapper-api
- Language: PHP
- Homepage: https://packagist.org/packages/andyts93/brt-api-wrapper
- Size: 69.3 KB
- Stars: 2
- Watchers: 1
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
[](https://github.com/andyts93/brt-api-wrapper/actions/workflows/php.yml) [](https://codecov.io/gh/andyts93/brt-api-wrapper) [](https://www.codacy.com/gh/andyts93/brt-api-wrapper/dashboard?utm_source=github.com&utm_medium=referral&utm_content=andyts93/brt-api-wrapper&utm_campaign=Badge_Grade) 
# BRT API Wrapper
> BRT API made easy
This package is a simple PHP wrapper for Bartolini Restful API
## Installing
Install with composer
```shell
composer require andyts93/brt-api-wrapper
```
## Features
* Create shippings
* Confirm shippings
* Delete shippings
## Usage
### Create shipping
```php
$request = new Andyts93\BrtApiWrapper\CreateRequest();
$request->setDepartureDepot(123)
->setSenderCustomerCode(1234567)
->setDeliveryFreightTypeCode('DAP')
->setConsigneeCompanyName('Fake Company Inc.')
->setConsigneeAddress('Fake street')
->setConsigneeZIPCode('00000')
->setConsigneeCity('Fake city')
->setConsigneeCountryAbbreviationISOAlpha2('IT')
->setNumberOfParcels(1)
->setWeightKG(1)
->setNumericSenderReference(123456)
->setIsCODMandatory(0)
->setIsLabelRequired(1)
->setLabelParameters(new Andyts93\BrtApiWrapper\LabelParameter());
$response = $request->call();
if ($response->hasErrorrs()) {
echo $response->getExecutionMessage()->getMessage();
}
```
### Confirm shipping
```php
$request = new Andyts93\BrtApiWrapper\ConfirmRequest();
$request->setSenderCustomerCode(1234567)
->setNumericSenderReference(123456);
$response = $request->call();
if ($response->hasErrorrs()) {
echo $response->getExecutionMessage()->getMessage();
}
```
### Delete shipping
```php
$request = new Andyts93\BrtApiWrapper\DeleteRequest();
$request->setSenderCustomerCode(1234567)
->setNumericSenderReference(123456);
$response = $request->call();
if ($response->hasErrorrs()) {
echo $response->getExecutionMessage()->getMessage();
}
```
