GuiStracini.Mandae
1.2.24
Mandae API Client. Mandaê is an intermediate order delivery company. It mediates between e-commerce and various freight companies, offering the lowest price and providing an API to schedule pick-ups and track deliveries from the vendor's distribution center to delivery to the end consumer.
See the version list below for details.
Install-Package GuiStracini.Mandae -Version 1.2.24
dotnet add package GuiStracini.Mandae --version 1.2.24
<PackageReference Include="GuiStracini.Mandae" Version="1.2.24" />
paket add GuiStracini.Mandae --version 1.2.24
Mandaê API
The (unnoficial) Mandaê API client
This is an unnoficial client for the Mandaê API V2.
(https://dev.mandae.com.br/api/index.html)
NuGet package: https://www.nuget.org/packages/GuiStracini.Mandae
Install-Package GuiStracini.Mandae
Features
This client supports the following operations/features of the API:
- Register customer (collect location - distribution center)
- Get available vehicles for a collect location (pickup packages from collect location based on postal code)
- Get rates for a delivery (postal code and package dimensions)
- Get the available hours to pickup order(s) in a selected date
- Schedule a collect (register a collect in the customer distribution center with one or more packages. Each package can have one or more items/skus)
- Cancel the whole collect schedule (Cancel a previous collect scheduler)
- Cancel a schedule item (Cancel a item/package from a collect order)
- Get tracking data of a shipment (Get all tracking data available from one package - tracking code is supplied via WebHook)
- WebHooks schema ready (The web hooks models/schemas)
All operations supports sync and async!
Setup the MandaeClient
Initializes a new instance of MandaeClient class.
Example:
//Request your API token to ti@mandae.com.br
//Each environment has it's own API token!
var apiToken = "my API token";
//Call the constructor with the API token and de API environment (SANDBOX | PRODUCTION).
//var client = new MandaeClient(apiTOken); //<= Environment.SANDBOX is the default environment.
var client = new MandaeClient(apiToken, Environment.PRODUCTION);
Register a customer (pickup/collect location)
How to register a customer (pickup/collect location).
Example:
//The MandaeClient
var client = new MandaeClient("my API token")
//The CustomerModel
var model = new CustomerModel
{
Document = "00000000000191", //CPF or CNPJ
Email = "example@example.com",
FullName = "Guilherme Branco Stracini",
Phone = new Phone
{
AreaCode = "11",
Number = "33445566"
},
Store = new Store
{
Name = "Sample store",
Url = "https://example.com"
}
};
//The response id should be stored anywhere for future use (where the packages will be collected). This id is used in the RegisterOrder method
var customer = client.RegisterCustomer(model);
Get available vehicles
Get all available vehicles for a pickup in a source postal code (distribution center / origin location).
Example:
//The MandaeClient
var client = new MandaeClient("my API token");
var vehicles = client.GetVehicles("03137020");
if(vehicles.Any(v=>v.CAR))
{
//Car is available for the pickup in this postal code!
}
Get rates for a package/delivery
Get the rates (Rápido & Econômico) values and delivery time for a specified postal code and package dimensions.
Example:
//The MandaeClient
var client = new MandaeClient("my API token");
//The RatesModel
var delivery = new RatesModel {
PostalCode = "22041080",
...
}
var rates = client.GetRates(delivery);
var fast = rates.ShippingServices.Single(s => s.Name == "Rápido");
var economic = rates.ShippingServices.Single(s => s.Name == "Econômico");
var option = ShippingService.ECONOMICO;
if(fast.Price < economic.Price)
option = ShippingService.RAPIDO;
//The OrderModel (order collect request model)
var order = new OrderModel { ... };
order.Items = new [] {
new NewItem
{
....
ShippingService = option
}
};
var order = client.RegisterOrderCollectRequest(order);
Get available hours for pickup
Gets the available hours for pickup/collect packages in the distribuiton center for a specified date.
Example:
//The MandaeClient
var client = new MandaeClient("my API token");
//Check the available hours for tomorrow
var date= DateTime.Now.AddDays(1);
//The list os avaiable hours for pickup tomorrow
var avaiableHours = client.GetAvaiableHours(date);
Schedule a collect request
Schedule a collect request (pickup in distribution center / origin location).
Inform which type of Vehicle (GetVehicles), when (GetAvailableHours), which rate (Rapido | Economico) and the order items (a.k.a packages or clients orders).
Each package means a order/volume, that can have one or more items (SKUs).
Example: [TODO: Pending test result]
Get the latest order collect request status
Gets the last order collect request for a customer (by customerId).
Example:
//The MandaeClient
var client = new MandaeClient("my API token");
//The customerId
var customerId = "sampleCustomerId";
var status = client.GetLatestOrderCollectStatus(customerId);
//Tracking url for the order collect request
var url = status.Url;
Cancel a schedule collect request
Example: [TODO | Pending test result]
Cancel a schedule item (package) collect request
Example: [TODO | Pending test result]
Get tracking of a package
Example: [TODO | Pending test result]
Mandaê API
The (unnoficial) Mandaê API client
This is an unnoficial client for the Mandaê API V2.
(https://dev.mandae.com.br/api/index.html)
NuGet package: https://www.nuget.org/packages/GuiStracini.Mandae
Install-Package GuiStracini.Mandae
Features
This client supports the following operations/features of the API:
- Register customer (collect location - distribution center)
- Get available vehicles for a collect location (pickup packages from collect location based on postal code)
- Get rates for a delivery (postal code and package dimensions)
- Get the available hours to pickup order(s) in a selected date
- Schedule a collect (register a collect in the customer distribution center with one or more packages. Each package can have one or more items/skus)
- Cancel the whole collect schedule (Cancel a previous collect scheduler)
- Cancel a schedule item (Cancel a item/package from a collect order)
- Get tracking data of a shipment (Get all tracking data available from one package - tracking code is supplied via WebHook)
- WebHooks schema ready (The web hooks models/schemas)
All operations supports sync and async!
Setup the MandaeClient
Initializes a new instance of MandaeClient class.
Example:
//Request your API token to ti@mandae.com.br
//Each environment has it's own API token!
var apiToken = "my API token";
//Call the constructor with the API token and de API environment (SANDBOX | PRODUCTION).
//var client = new MandaeClient(apiTOken); //<= Environment.SANDBOX is the default environment.
var client = new MandaeClient(apiToken, Environment.PRODUCTION);
Register a customer (pickup/collect location)
How to register a customer (pickup/collect location).
Example:
//The MandaeClient
var client = new MandaeClient("my API token")
//The CustomerModel
var model = new CustomerModel
{
Document = "00000000000191", //CPF or CNPJ
Email = "example@example.com",
FullName = "Guilherme Branco Stracini",
Phone = new Phone
{
AreaCode = "11",
Number = "33445566"
},
Store = new Store
{
Name = "Sample store",
Url = "https://example.com"
}
};
//The response id should be stored anywhere for future use (where the packages will be collected). This id is used in the RegisterOrder method
var customer = client.RegisterCustomer(model);
Get available vehicles
Get all available vehicles for a pickup in a source postal code (distribution center / origin location).
Example:
//The MandaeClient
var client = new MandaeClient("my API token");
var vehicles = client.GetVehicles("03137020");
if(vehicles.Any(v=>v.CAR))
{
//Car is available for the pickup in this postal code!
}
Get rates for a package/delivery
Get the rates (Rápido & Econômico) values and delivery time for a specified postal code and package dimensions.
Example:
//The MandaeClient
var client = new MandaeClient("my API token");
//The RatesModel
var delivery = new RatesModel {
PostalCode = "22041080",
...
}
var rates = client.GetRates(delivery);
var fast = rates.ShippingServices.Single(s => s.Name == "Rápido");
var economic = rates.ShippingServices.Single(s => s.Name == "Econômico");
var option = ShippingService.ECONOMICO;
if(fast.Price < economic.Price)
option = ShippingService.RAPIDO;
//The OrderModel (order collect request model)
var order = new OrderModel { ... };
order.Items = new [] {
new NewItem
{
....
ShippingService = option
}
};
var order = client.RegisterOrderCollectRequest(order);
Get available hours for pickup
Gets the available hours for pickup/collect packages in the distribuiton center for a specified date.
Example:
//The MandaeClient
var client = new MandaeClient("my API token");
//Check the available hours for tomorrow
var date= DateTime.Now.AddDays(1);
//The list os avaiable hours for pickup tomorrow
var avaiableHours = client.GetAvaiableHours(date);
Schedule a collect request
Schedule a collect request (pickup in distribution center / origin location).
Inform which type of Vehicle (GetVehicles), when (GetAvailableHours), which rate (Rapido | Economico) and the order items (a.k.a packages or clients orders).
Each package means a order/volume, that can have one or more items (SKUs).
Example: [TODO: Pending test result]
Get the latest order collect request status
Gets the last order collect request for a customer (by customerId).
Example:
//The MandaeClient
var client = new MandaeClient("my API token");
//The customerId
var customerId = "sampleCustomerId";
var status = client.GetLatestOrderCollectStatus(customerId);
//Tracking url for the order collect request
var url = status.Url;
Cancel a schedule collect request
Example: [TODO | Pending test result]
Cancel a schedule item (package) collect request
Example: [TODO | Pending test result]
Get tracking of a package
Example: [TODO | Pending test result]
Dependencies
-
- Microsoft.AspNet.WebApi.Client (>= 5.2.3)
- Newtonsoft.Json (>= 10.0.3)
Used By
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version History
Version | Downloads | Last updated |
---|---|---|
6.0.17 | 289 | 4/24/2020 |
6.0.13 | 118 | 4/24/2020 |
6.0.12 | 123 | 4/18/2020 |
6.0.11 | 119 | 4/18/2020 |
6.0.10 | 157 | 4/18/2020 |
6.0.9 | 149 | 4/18/2020 |
6.0.8 | 177 | 9/24/2019 |
6.0.5 | 174 | 9/24/2019 |
5.0.37 | 217 | 6/18/2019 |
4.0.33 | 251 | 2/23/2019 |
4.0.30 | 234 | 2/23/2019 |
4.0.28 | 231 | 2/23/2019 |
4.0.27 | 230 | 2/14/2019 |
4.0.26 | 217 | 2/14/2019 |
4.0.25 | 217 | 2/14/2019 |
4.0.24 | 235 | 2/12/2019 |
4.0.23 | 234 | 1/29/2019 |
3.1.20 | 287 | 12/5/2018 |
3.1.17 | 308 | 9/8/2018 |
3.1.16 | 332 | 9/8/2018 |
3.1.15 | 284 | 9/8/2018 |
3.1.14 | 283 | 9/7/2018 |
3.1.13 | 296 | 9/7/2018 |
3.1.12 | 299 | 9/7/2018 |
3.1.11 | 300 | 8/23/2018 |
3.1.10 | 300 | 8/22/2018 |
3.1.8 | 313 | 8/16/2018 |
3.1.6 | 332 | 8/1/2018 |
3.1.5 | 314 | 8/1/2018 |
3.1.4 | 338 | 7/27/2018 |
3.1.3 | 317 | 7/27/2018 |
3.1.2 | 322 | 7/27/2018 |
3.1.1 | 331 | 7/26/2018 |
2.0.5 | 333 | 7/19/2018 |
2.0.4 | 421 | 5/24/2018 |
2.0.3 | 381 | 5/24/2018 |
2.0.1 | 444 | 5/9/2018 |
1.4.8 | 388 | 4/18/2018 |
1.4.7 | 378 | 4/18/2018 |
1.4.5 | 489 | 1/9/2018 |
1.4.1 | 483 | 1/9/2018 |
1.3.25 | 420 | 1/9/2018 |
1.3.19 | 403 | 12/20/2017 |
1.3.18 | 365 | 12/18/2017 |
1.3.17 | 427 | 12/15/2017 |
1.3.16 | 413 | 12/15/2017 |
1.3.14 | 425 | 12/15/2017 |
1.3.9 | 442 | 12/15/2017 |
1.3.8 | 464 | 12/15/2017 |
1.3.7 | 473 | 12/15/2017 |
1.3.5 | 454 | 12/15/2017 |
1.3.4 | 490 | 12/15/2017 |
1.3.3 | 466 | 12/15/2017 |
1.3.2 | 387 | 12/15/2017 |
1.3.1 | 401 | 11/30/2017 |
1.2.36 | 371 | 11/30/2017 |
1.2.34 | 369 | 11/29/2017 |
1.2.33 | 383 | 11/29/2017 |
1.2.31 | 365 | 11/29/2017 |
1.2.29 | 376 | 10/5/2017 |
1.2.28 | 347 | 10/4/2017 |
1.2.26 | 394 | 10/3/2017 |
1.2.25 | 388 | 10/3/2017 |
1.2.24 | 430 | 10/3/2017 |