Skip to content

Repository files navigation

ShipEngine

ShipEngine .NET SDK

The official ShipEngine SDK for .NET

Nuget (with prereleases)GitHub

Build StatusCoverage Status

OS Compatibility

Nuget Page

Quick Start

Install ShipEngine .NET SDK via the .NET CLI.

dotnet add package ShipEngine

The only configuration requirement is an API key.

usingShipEngineSDK;varshipengine=newShipEngine("___YOUR_API_KEY_HERE__");

Overview

This C# SDK is automatically generated by the OpenAPI Generator project:

  • API version: 1.1.202603171403
  • SDK version: 3.2.1
  • Generator version: 7.7.0
  • Build package: org.openapitools.codegen.languages.CSharpClientCodegen For more information, please visit https://www.shipengine.com/contact/

Frameworks supported

  • .NET Standard >=2.0
  • .NET Core >=2.0
  • .NET Framework >=4.6.2

Methods

APIMethodDescription
AccountCreateAccountImageCreate an Account Image
AccountDeleteAccountImageByIdDelete Account Image By Id
AccountGetAccountSettingsImagesByIdGet Account Image By ID
AccountListAccountImagesList Account Images
AccountListAccountSettingsList Account Settings
AccountUpdateAccountSettingsImagesByIdUpdate Account Image By ID
AddressesParseAddressParse an address
AddressesValidateAddressValidate An Address
BatchesAddToBatchAdd to a Batch
BatchesCreateBatchCreate A Batch
BatchesDeleteBatchDelete Batch By Id
BatchesGetBatchByExternalIdGet Batch By External ID
BatchesGetBatchByIdGet Batch By ID
BatchesListBatchErrorsGet Batch Errors
BatchesListBatchesList Batches
BatchesProcessBatchProcess Batch ID Labels
BatchesRemoveFromBatchRemove From Batch
BatchesUpdateBatchUpdate Batch By Id
CarrierAccountsConnectCarrierConnect a carrier account
CarrierAccountsDisconnectCarrierDisconnect a carrier
CarrierAccountsGetCarrierSettingsGet carrier settings
CarrierAccountsUpdateCarrierSettingsUpdate carrier settings
CarriersAddFundsToCarrierAdd Funds To Carrier
CarriersDisconnectCarrierByIdDisconnect Carrier by ID
CarriersGetCarrierByIdGet Carrier By ID
CarriersGetCarrierOptionsGet Carrier Options
CarriersListCarrierPackageTypesList Carrier Package Types
CarriersListCarrierServicesList Carrier Services
CarriersListCarriersList Carriers
DownloadsDownloadFileDownload File
InsuranceAddFundsToInsuranceAdd Funds To Insurance
InsuranceConnectInsurerConnect a Shipsurance Account
InsuranceDisconnectInsurerDisconnect a Shipsurance Account
InsuranceGetInsuranceBalanceGet Insurance Funds Balance
LabelsCreateCombinedLabelDocumentCreated Combined Label Document
LabelsCreateLabelPurchase Label
LabelsCreateLabelFromRatePurchase Label with Rate ID
LabelsCreateLabelFromRateShopperPurchase Label from Rate Shopper
LabelsCreateLabelFromShipmentPurchase Label with Shipment ID
LabelsCreateReturnLabelCreate a return label
LabelsGetLabelByExternalShipmentIdGet Label By External Shipment ID
LabelsGetLabelByIdGet Label By ID
LabelsGetTrackingLogFromLabelGet Label Tracking Information
LabelsListLabelsList labels
LabelsVoidLabelVoid a Label By ID
ManifestsCreateManifestCreate Manifest
ManifestsGetManifestByIdGet Manifest By Id
ManifestsGetManifestRequestByIdGet Manifest Request By Id
ManifestsListManifestsList Manifests
PackagePickupsDeleteScheduledPickupDelete a Scheduled Pickup
PackagePickupsGetPickupByIdGet Pickup By ID
PackagePickupsListScheduledPickupsList Scheduled Pickups
PackagePickupsSchedulePickupSchedule a Pickup
PackageTypesCreatePackageTypeCreate Custom Package Type
PackageTypesDeletePackageTypeDelete A Custom Package By ID
PackageTypesGetPackageTypeByIdGet Custom Package Type By ID
PackageTypesListPackageTypesList Custom Package Types
PackageTypesUpdatePackageTypeUpdate Custom Package Type By ID
RatesCalculateRatesGet Shipping Rates
RatesCompareBulkRatesGet Bulk Rates
RatesEstimateRatesEstimate Rates
RatesGetRateByIdGet Rate By ID
ServicePointsServicePointsGetByIdGet Service Point By ID
ServicePointsServicePointsListList Service Points
ShipmentsCancelShipmentsCancel a Shipment
ShipmentsCreateShipmentsCreate Shipments
ShipmentsGetShipmentByExternalIdGet Shipment By External ID
ShipmentsGetShipmentByIdGet Shipment By ID
ShipmentsListShipmentRatesGet Shipment Rates
ShipmentsListShipmentsList Shipments
ShipmentsParseShipmentParse shipping info
ShipmentsShipmentsListTagsGet Shipment Tags
ShipmentsShipmentsUpdateTagsUpdate Shipments Tags
ShipmentsTagShipmentAdd Tag to Shipment
ShipmentsUntagShipmentRemove Tag from Shipment
ShipmentsUpdateShipmentUpdate Shipment By ID
TagsCreateTagCreate a New Tag
TagsCreateTag_0Create a New Tag
TagsDeleteTagDelete Tag
TagsListTagsGet Tags
TagsRenameTagUpdate Tag Name
TokensTokensGetEphemeralTokenGet Ephemeral Token
TrackingGetTrackingLogGet Tracking Information
TrackingStartTrackingStart Tracking a Package
TrackingStopTrackingStop Tracking a Package
WarehousesCreateWarehouseCreate Warehouse
WarehousesDeleteWarehouseDelete Warehouse By ID
WarehousesGetWarehouseByIdGet Warehouse By Id
WarehousesListWarehousesList Warehouses
WarehousesUpdateWarehouseUpdate Warehouse By Id
WarehousesUpdateWarehouseSettingsUpdate Warehouse Settings
WebhooksCreateWebhookCreate a Webhook
WebhooksDeleteWebhookDelete Webhook By ID
WebhooksGetWebhookByIdGet Webhook By ID
WebhooksListWebhooksList Webhooks
WebhooksUpdateWebhookUpdate a Webhook

Legacy Methods

These methods have been deprecated in favor of the methods listed above, but are still in the SDK.

  • CreateLabelFromRate - 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 - Purchase and print a label for shipment.
  • GetRatesWithShipmentDetails - Given some shipment details and rate options, this method returns a list of rate quotes.
  • ListCarriers - Returns a list of carrier accounts that have been connected through the ShipEngine dashboard.
  • TrackUsingLabelId - Track a package by its associated label ID.
  • TrackUsingCarrierCodeAndTrackingNumber - Track a package for a given carrier and tracking number.
  • ValidateAddresses - 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 - Void a label with its Label ID.
  • CreateManifests - Create a shipment manifest.

Contributing

Contributions, enhancements, and bug-fixes are welcome! Open an issue on GitHub and submit a pull request.

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 8.x

  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 net8.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 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:

npx @openapitools/openapi-generator-cli author template -g csharp -o generation/templates

Release

Create a fork for your changes.

Update the Changelog 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) 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.