Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shipengine/shipengine-dotnet
The official ShipEngine SDK for C# and the .NET Framework
https://github.com/shipengine/shipengine-dotnet
address-normalization address-validation csharp dhl-api fedex-api package-tracking rest-api sdk shipment-tracking shipping-api shipping-cost shipping-label shipping-rates ups-api usps-api
Last synced: about 2 months ago
JSON representation
The official ShipEngine SDK for C# and the .NET Framework
- Host: GitHub
- URL: https://github.com/shipengine/shipengine-dotnet
- Owner: ShipEngine
- License: apache-2.0
- Created: 2021-01-27T16:59:47.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-10-16T21:33:41.000Z (2 months ago)
- Last Synced: 2024-10-18T21:12:48.069Z (2 months ago)
- Topics: address-normalization, address-validation, csharp, dhl-api, fedex-api, package-tracking, rest-api, sdk, shipment-tracking, shipping-api, shipping-cost, shipping-label, shipping-rates, ups-api, usps-api
- Language: C#
- Homepage: https://www.shipengine.com/docs/
- Size: 1.45 MB
- Stars: 11
- Watchers: 19
- Forks: 11
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
[![ShipEngine](https://shipengine.github.io/img/shipengine-logo-wide.png)](https://shipengine.com)
# ShipEngine .NET SDK
### The official ShipEngine SDK for .NET
![Nuget (with prereleases)](https://img.shields.io/nuget/vpre/ShipEngine)
![GitHub](https://img.shields.io/github/license/ShipEngine/shipengine-dotnet)[![Build Status](https://github.com/ShipEngine/shipengine-dotnet/actions/workflows/ci-cd.yaml/badge.svg)](https://github.com/ShipEngine/shipengine-dotnet/actions/workflows/ci-cd.yaml)
[![Coverage Status](https://coveralls.io/repos/github/ShipEngine/shipengine-dotnet/badge.svg?branch=main)](https://coveralls.io/github/ShipEngine/shipengine-dotnet?branch=main)[![OS Compatibility](https://shipengine.github.io/img/badges/os-badges.svg)](https://github.com/ShipEngine/shipengine-dotnet/actions)
[Nuget Page](https://www.nuget.org/packages/ShipEngine/)
## Quick Start
Install ShipEngine .NET SDK via the [.NET CLI](https://docs.microsoft.com/en-us/dotnet/core/tools/).
```bash
dotnet add package ShipEngine
```The only configuration requirement is an [API key](https://www.shipengine.com/docs/auth/#api-keys).
```csharp
using ShipEngineSDK;var shipengine = new ShipEngine("___YOUR_API_KEY_HERE__");
```## Methods
- [`CreateLabelFromRate`](./docs/CreateLabelFromRate.md) - When retrieving rates for shipments using the `GetRatesWithShipmentDetails` method, the returned information contains a `RateId` property that can be used to purchase a label without having to refill in the shipment information repeatedly.
- [`CreateLabelFromShipmentDetails`](./docs/CreateLabelFromShipmentDetails.md) - Purchase and print a label for shipment.
- [`GetRatesWithShipmentDetails`](./docs/GetRatesWithShipmentDetails.md) - Given some shipment details and rate options, this method returns a list of rate quotes.
- [`ListCarriers`](./docs/ListCarriers.md) - Returns a list of carrier accounts that have been connected through
the [ShipEngine dashboard](https://www.shipengine.com/docs/carriers/setup/).
- [`TrackUsingLabelId`](./docs/TrackUsingLabelId.md) - Track a package by its associated label ID.
- [`TrackUsingCarrierCodeAndTrackingNumber`](./docs/TrackUsingCarrierCodeAndTrackingNumber.md) - Track a package for a given carrier and tracking number.
- [`ValidateAddresses`](./docs/ValidateAddresses.md) - Indicates whether the provided addresses are valid. If the addresses are valid, the method returns a normalized version based on the standards of the country in which the address resides. If an address cannot be normalized, an error is returned.
- [`VoidLabelWithLabelId`](./docs/VoidLabelWithLabelId.md) - Void a label with its Label ID.
- [`CreateManifests`](./docs/CreateManifest.md) - Create a shipment manifest.## Contributing
Contributions, enhancements, and bug-fixes are welcome! [Open an issue](https://github.com/ShipEngine/shipengine-dotnet/issues) on GitHub and [submit a pull request](https://github.com/ShipEngine/shipengine-dotnet/pulls).
### Building
To build the project locally on your computer:
1. **Clone this repo**
`git clone https://github.com/ShipEngine/shipengine-dotnet.git`2. **Install [.NET 5.x](https://dotnet.microsoft.com/download)**
3. **Install dependencies**
`dotnet restore`4. **Build the code**
`dotnet build`5. **Format the code**
`dotnet format`6. **Run the tests**
`dotnet test`
By default, the test project targets all supported frameworks, if your environment only supports a subset then you can specify in the CLI.
`dotnet test -f net5.0`### Generating from OpenAPI
To regenerate the SDK from the OpenAPI spec, you will first need to get the latest version of the spec. It can be downloaded from the [online documentation](https://shipengine.github.io/shipengine-openapi/)
and should be saved to `./generation/swagger.json`. Then run `npm run generate` from the command line. This will regenerate all the API calls and models, but not docs or tests.The templates for autogeneration were extracted using the command:
```bash
npx @openapitools/openapi-generator-cli author template -g csharp -o generation/templates
```## Release
Create a [fork](https://docs.github.com/en/get-started/quickstart/contributing-to-projects) for your changes.Update the [Changelog](./CHANGELOG.md) with any relevant new features or bug fixes and modify the `packageVersion` property in the `.openapitools.json` file to match the new version.
In the `ShipEngine.csproj` file, update to the desired version (using [semantic versioning](https://semver.org/)) and push to your fork.
Run `dotnet format`
Create a pull request.
Once a member of the ShipEngine team reviews your PR and it's merged to main, the build pipeline will handle all the necessary github tags and nuget packaging and publishing.