### Create Webhook Example Source: https://github.com/shipengine/shipengine-dotnet/blob/main/docs/apis/WebhooksApi.md Demonstrates how to create a new webhook using the ShipEngine SDK. This example shows the basic setup and error handling for the CreateWebhook method. Ensure you have your API key and the necessary request body object. ```csharp using System.Collections.Generic; using System.Diagnostics; using ShipEngineSDK; using ShipEngineSDK.Model; namespace Example { public class CreateWebhookExample { public static async Task Main() { var shipEngine = new ShipEngine("api_key"); var createWebhookRequestBody = new CreateWebhookRequestBody(); try { // Create a Webhook CreateWebhookResponseBody result = await shipEngine.CreateWebhook(createWebhookRequestBody); Debug.WriteLine(result); } catch (ShipEngineException e) { Debug.Print("Exception when calling WebhooksApi.CreateWebhook: " + e.Message); Debug.Print("Status Code: " + e.ErrorCode); Debug.Print(e.StackTrace); } } } } ``` -------------------------------- ### Install ShipEngine .NET SDK Source: https://github.com/shipengine/shipengine-dotnet/blob/main/README.md Install the ShipEngine .NET SDK using the .NET CLI. Ensure you have an API key for configuration. ```bash dotnet add package ShipEngine ``` -------------------------------- ### Create Manifest Example Source: https://github.com/shipengine/shipengine-dotnet/blob/main/docs/apis/ManifestsApi.md Demonstrates how to create a manifest using the ShipEngine SDK. Ensure you have your API key and provide the necessary request body. This example includes error handling for ShipEngine exceptions. ```csharp using System.Collections.Generic; using System.Diagnostics; using ShipEngineSDK; using ShipEngineSDK.Model; namespace Example { public class CreateManifestExample { public static async Task Main() { var shipEngine = new ShipEngine("api_key"); var createManifestRequestBody = new CreateManifestRequestBody(); try { // Create Manifest CreateManifestResponseBody result = await shipEngine.CreateManifest(createManifestRequestBody); Debug.WriteLine(result); } catch (ShipEngineException e) { Debug.Print("Exception when calling ManifestsApi.CreateManifest: " + e.Message); Debug.Print("Status Code: " + e.ErrorCode); Debug.Print(e.StackTrace); } } } } ``` -------------------------------- ### Estimate Shipping Rates Example Source: https://github.com/shipengine/shipengine-dotnet/blob/main/docs/apis/RatesApi.md Example demonstrating how to estimate shipping rates using the ShipEngine .NET SDK. Ensure you have your API key and the necessary models set up. ```csharp using System.Collections.Generic; using System.Diagnostics; using ShipEngineSDK; using ShipEngineSDK.Model; namespace Example { public class EstimateRatesExample { public static async Task Main() { var shipEngine = new ShipEngine("api_key"); var estimateRatesRequestBody = new EstimateRatesRequestBody(); try { // Estimate Rates List result = await shipEngine.EstimateRates(estimateRatesRequestBody); Debug.WriteLine(result); } catch (ShipEngineException e) { Debug.Print("Exception when calling RatesApi.EstimateRates: " + e.Message); Debug.Print("Status Code: " + e.ErrorCode); Debug.Print(e.StackTrace); } } } } ``` -------------------------------- ### Update Webhook Example Source: https://github.com/shipengine/shipengine-dotnet/blob/main/docs/apis/WebhooksApi.md Demonstrates how to update a webhook's URL using the ShipEngine .NET SDK. Ensure you have the ShipEngine SDK installed and your API key configured. ```csharp using System.Collections.Generic; using System.Diagnostics; using ShipEngineSDK; using ShipEngineSDK.Model; namespace Example { public class UpdateWebhookExample { public static async Task Main() { var shipEngine = new ShipEngine("api_key"); var updateWebhookRequestBody = new UpdateWebhookRequestBody(); var webhookId = "webhookId_example"; try { // Update a Webhook string result = await shipEngine.UpdateWebhook(updateWebhookRequestBody, webhookId); Debug.WriteLine(result); } catch (ShipEngineException e) { Debug.Print("Exception when calling WebhooksApi.UpdateWebhook: " + e.Message); Debug.Print("Status Code: " + e.ErrorCode); Debug.Print(e.StackTrace); } } } } ``` -------------------------------- ### Example: List Service Points Source: https://github.com/shipengine/shipengine-dotnet/blob/main/docs/apis/ServicePointsApi.md Demonstrates how to list carrier service points. This example uses the default GetServicePointsRequest, which can be further configured with specific criteria. Ensure the ShipEngine SDK is initialized. ```csharp using System.Collections.Generic; using System.Diagnostics; using ShipEngineSDK; using ShipEngineSDK.Model; namespace Example { public class ServicePointsListExample { public static async Task Main() { var shipEngine = new ShipEngine("api_key"); var getServicePointsRequest = new GetServicePointsRequest(); try { // List Service Points ListServicePointsResponseBody result = await shipEngine.ServicePointsList(getServicePointsRequest); Debug.WriteLine(result); } catch (ShipEngineException e) { Debug.Print("Exception when calling ServicePointsApi.ServicePointsList: " + e.Message); Debug.Print("Status Code: " + e.ErrorCode); Debug.Print(e.StackTrace); } } } } ``` -------------------------------- ### StartTracking Source: https://github.com/shipengine/shipengine-dotnet/blob/main/README.md Start Tracking a Package. ```APIDOC ## StartTracking ### Description Start Tracking a Package. ### Method POST ### Endpoint /tracking ### Parameters (No parameters provided in source) ### Request Example (No request body example provided in source) ### Response #### Success Response (200) (No response schema provided in source) #### Response Example (No response example provided in source) ``` -------------------------------- ### Parse Address Example Source: https://github.com/shipengine/shipengine-dotnet/blob/main/docs/apis/AddressesApi.md Demonstrates how to parse unstructured address text into a structured format using the ShipEngine SDK. This is useful for extracting address components from sources like emails or support tickets. Ensure you have the ShipEngine SDK installed and an API key. ```csharp using System.Collections.Generic; using System.Diagnostics; using ShipEngineSDK; using ShipEngineSDK.Model; namespace Example { public class ParseAddressExample { public static async Task Main() { var shipEngine = new ShipEngine("api_key"); var parseAddressRequestBody = new ParseAddressRequestBody(); try { // Parse an address ParseAddressResponseBody result = await shipEngine.ParseAddress(parseAddressRequestBody); Debug.WriteLine(result); } catch (ShipEngineException e) { Debug.Print("Exception when calling AddressesApi.ParseAddress: " + e.Message); Debug.Print("Status Code: " + e.ErrorCode); Debug.Print(e.StackTrace); } } } } ``` -------------------------------- ### Get Pickup By ID C# Example Source: https://github.com/shipengine/shipengine-dotnet/blob/main/docs/apis/PackagePickupsApi.md Use this method to retrieve details for a specific pickup using its ID. Ensure you have your API key configured. Handles potential ShipEngine exceptions. ```csharp using System.Collections.Generic; using System.Diagnostics; using ShipEngineSDK; using ShipEngineSDK.Model; namespace Example { public class GetPickupByIdExample { public static async Task Main() { var shipEngine = new ShipEngine("api_key"); var pickupId = "pickupId_example"; try { // Get Pickup By ID GetPickupByIdResponseBody result = await shipEngine.GetPickupById(pickupId); Debug.WriteLine(result); } catch (ShipEngineException e) { Debug.Print("Exception when calling PackagePickupsApi.GetPickupById: " + e.Message); Debug.Print("Status Code: " + e.ErrorCode); Debug.Print(e.StackTrace); } } } } ``` -------------------------------- ### Create Label From Rate Shopper Example Source: https://github.com/shipengine/shipengine-dotnet/blob/main/docs/apis/LabelsApi.md Demonstrates how to create a shipping label using the CreateLabelFromRateShopper method. Ensure you have your ShipEngine API key and properly configured request body. This example includes error handling for potential ShipEngine exceptions. ```csharp using System.Collections.Generic; using System.Diagnostics; using ShipEngineSDK; using ShipEngineSDK.Model; namespace Example { public class CreateLabelFromRateShopperExample { public static async Task Main() { var shipEngine = new ShipEngine("api_key"); var createLabelRateShopperRequestBody = new CreateLabelRateShopperRequestBody(); var rateShopperId = (RateAttributes) "best_value"; try { // Purchase Label from Rate Shopper CreateLabelRateShopperResponseBody result = await shipEngine.CreateLabelFromRateShopper(createLabelRateShopperRequestBody, rateShopperId); Debug.WriteLine(result); } catch (ShipEngineException e) { Debug.Print("Exception when calling LabelsApi.CreateLabelFromRateShopper: " + e.Message); Debug.Print("Status Code: " + e.ErrorCode); Debug.Print(e.StackTrace); } } } } ``` -------------------------------- ### Create Batch C# Example Source: https://github.com/shipengine/shipengine-dotnet/blob/main/docs/apis/BatchesApi.md Demonstrates how to create a new batch of shipments using the ShipEngine SDK. Includes error handling for API exceptions. ```csharp using System.Collections.Generic; using System.Diagnostics; using ShipEngineSDK; using ShipEngineSDK.Model; namespace Example { public class CreateBatchExample { public static async Task Main() { var shipEngine = new ShipEngine("api_key"); var createBatchRequest = new CreateBatchRequest(); try { // Create A Batch CreateBatchResponseBody result = await shipEngine.CreateBatch(createBatchRequest); Debug.WriteLine(result); } catch (ShipEngineException e) { Debug.Print("Exception when calling BatchesApi.CreateBatch: " + e.Message); Debug.Print("Status Code: " + e.ErrorCode); Debug.Print(e.StackTrace); } } } } ``` -------------------------------- ### Delete Batch Example Source: https://github.com/shipengine/shipengine-dotnet/blob/main/docs/apis/BatchesApi.md Example of how to delete a batch by its ID using the ShipEngine .NET SDK. Includes error handling for ShipEngine exceptions. ```csharp using System.Collections.Generic; using System.Diagnostics; using ShipEngineSDK; using ShipEngineSDK.Model; namespace Example { public class DeleteBatchExample { public static async Task Main() { var shipEngine = new ShipEngine("api_key"); var batchId = "batchId_example"; try { // Delete Batch By Id string result = await shipEngine.DeleteBatch(batchId); Debug.WriteLine(result); } catch (ShipEngineException e) { Debug.Print("Exception when calling BatchesApi.DeleteBatch: " + e.Message); Debug.Print("Status Code: " + e.ErrorCode); Debug.Print(e.StackTrace); } } } } ``` -------------------------------- ### Update Batch By Id Example Source: https://github.com/shipengine/shipengine-dotnet/blob/main/docs/apis/BatchesApi.md This C# example demonstrates how to update a batch by its ID using the ShipEngine .NET SDK. It includes error handling for ShipEngine exceptions. ```csharp using System.Collections.Generic; using System.Diagnostics; using ShipEngineSDK; using ShipEngineSDK.Model; namespace Example { public class UpdateBatchExample { public static async Task Main() { var shipEngine = new ShipEngine("api_key"); var batchId = "batchId_example"; try { // Update Batch By Id string result = await shipEngine.UpdateBatch(batchId); Debug.WriteLine(result); } catch (ShipEngineException e) { Debug.Print("Exception when calling BatchesApi.UpdateBatch: " + e.Message); Debug.Print("Status Code: " + e.ErrorCode); Debug.Print(e.StackTrace); } } } } ``` -------------------------------- ### Restore Dependencies with .NET CLI Source: https://github.com/shipengine/shipengine-dotnet/blob/main/README.md Run this command after cloning the repository to install all necessary project dependencies. ```bash dotnet restore ``` -------------------------------- ### Create Label From Shipment Example Source: https://github.com/shipengine/shipengine-dotnet/blob/main/docs/apis/LabelsApi.md Purchases a shipping label using a pre-existing shipment ID. Ensure you have your ShipEngine API key and the correct shipment ID. This example demonstrates basic usage and error handling. ```csharp using System.Collections.Generic; using System.Diagnostics; using ShipEngineSDK; using ShipEngineSDK.Model; namespace Example { public class CreateLabelFromShipmentExample { public static async Task Main() { var shipEngine = new ShipEngine("api_key"); var createLabelFromShipmentRequestBody = new CreateLabelFromShipmentRequestBody(); var shipmentId = "shipmentId_example"; try { // Purchase Label with Shipment ID CreateLabelFromShipmentResponseBody result = await shipEngine.CreateLabelFromShipment(createLabelFromShipmentRequestBody, shipmentId); Debug.WriteLine(result); } catch (ShipEngineException e) { Debug.Print("Exception when calling LabelsApi.CreateLabelFromShipment: " + e.Message); Debug.Print("Status Code: " + e.ErrorCode); Debug.Print(e.StackTrace); } } } } ``` -------------------------------- ### List Webhooks C# Example Source: https://github.com/shipengine/shipengine-dotnet/blob/main/docs/apis/WebhooksApi.md Lists all webhooks currently enabled for the account. Includes error handling for ShipEngine exceptions. ```csharp using System.Collections.Generic; using System.Diagnostics; using ShipEngineSDK; using ShipEngineSDK.Model; namespace Example { public class ListWebhooksExample { public static async Task Main() { var shipEngine = new ShipEngine("api_key"); try { // List Webhooks List result = await shipEngine.ListWebhooks(); Debug.WriteLine(result); } catch (ShipEngineException e) { Debug.Print("Exception when calling WebhooksApi.ListWebhooks: " + e.Message); Debug.Print("Status Code: " + e.ErrorCode); Debug.Print(e.StackTrace); } } } } ``` -------------------------------- ### ShipEngineSDK.Model.PickupWindow Source: https://github.com/shipengine/shipengine-dotnet/blob/main/ShipEngineSDK/PublicAPI.Unshipped.txt Represents a single pickup window with start and end times. ```APIDOC ## ShipEngineSDK.Model.PickupWindow ### Description Defines a time window during which a pickup can occur. ### Properties - **StartAt** (System.DateTime) - The start date and time of the pickup window. - **EndAt** (System.DateTime) - The end date and time of the pickup window. ``` -------------------------------- ### Example Usage of GetRateById Source: https://github.com/shipengine/shipengine-dotnet/blob/main/docs/apis/RatesApi.md Demonstrates how to instantiate the ShipEngine client and call the GetRateById method to retrieve a rate. Includes error handling for ShipEngine exceptions. ```csharp using System.Collections.Generic; using System.Diagnostics; using ShipEngineSDK; using ShipEngineSDK.Model; namespace Example { public class GetRateByIdExample { public static async Task Main() { var shipEngine = new ShipEngine("api_key"); var rateId = "rateId_example"; try { // Get Rate By ID GetRateByIdResponseBody result = await shipEngine.GetRateById(rateId); Debug.WriteLine(result); } catch (ShipEngineException e) { Debug.Print("Exception when calling RatesApi.GetRateById: " + e.Message); Debug.Print("Status Code: " + e.ErrorCode); Debug.Print(e.StackTrace); } } } } ``` -------------------------------- ### Validate Address C# Example Source: https://github.com/shipengine/shipengine-dotnet/blob/main/docs/apis/AddressesApi.md Demonstrates how to use the ValidateAddress method to validate a list of addresses. Includes error handling for ShipEngine exceptions. ```csharp using System.Collections.Generic; using System.Diagnostics; using ShipEngineSDK; using ShipEngineSDK.Model; namespace Example { public class ValidateAddressExample { public static async Task Main() { var shipEngine = new ShipEngine("api_key"); var addressToValidate = new List(); try { // Validate An Address List result = await shipEngine.ValidateAddress(addressToValidate); Debug.WriteLine(result); } catch (ShipEngineException e) { Debug.Print("Exception when calling AddressesApi.ValidateAddress: " + e.Message); Debug.Print("Status Code: " + e.ErrorCode); Debug.Print(e.StackTrace); } } } } ``` -------------------------------- ### Get Shipment By External ID C# Example Source: https://github.com/shipengine/shipengine-dotnet/blob/main/docs/apis/ShipmentsApi.md Demonstrates how to retrieve a shipment using its external ID. Ensure you have the ShipEngine SDK installed and your API key configured. Handles potential ShipEngine exceptions. ```csharp using System.Collections.Generic; using System.Diagnostics; using ShipEngineSDK; using ShipEngineSDK.Model; namespace Example { public class GetShipmentByExternalIdExample { public static async Task Main() { var shipEngine = new ShipEngine("api_key"); var externalShipmentId = "0bcb569d-1727-4ff9-ab49-b2fec0cee5ae"; try { // Get Shipment By External ID GetShipmentByExternalIdResponseBody result = await shipEngine.GetShipmentByExternalId(externalShipmentId); Debug.WriteLine(result); } catch (ShipEngineException e) { Debug.Print("Exception when calling ShipmentsApi.GetShipmentByExternalId: " + e.Message); Debug.Print("Status Code: " + e.ErrorCode); Debug.Print(e.StackTrace); } } } } ``` -------------------------------- ### Remove Tag from Shipment Example Source: https://github.com/shipengine/shipengine-dotnet/blob/main/docs/apis/ShipmentsApi.md Demonstrates how to remove an existing tag from a Shipment object using the ShipEngine SDK in C#. Ensure you have the ShipEngine SDK installed and your API key configured. ```csharp using System.Collections.Generic; using System.Diagnostics; using ShipEngineSDK; using ShipEngineSDK.Model; namespace Example { public class UntagShipmentExample { public static async Task Main() { var shipEngine = new ShipEngine("api_key"); var shipmentId = "shipmentId_example"; var tagName = "tagName_example"; try { // Remove Tag from Shipment string result = await shipEngine.UntagShipment(shipmentId, tagName); Debug.WriteLine(result); } catch (ShipEngineException e) { Debug.Print("Exception when calling ShipmentsApi.UntagShipment: " + e.Message); Debug.Print("Status Code: " + e.ErrorCode); Debug.Print(e.StackTrace); } } } } ``` -------------------------------- ### List Batches with Parameters Source: https://github.com/shipengine/shipengine-dotnet/blob/main/docs/apis/BatchesApi.md This example demonstrates how to list batches using various optional parameters such as status, sort order, date ranges, and pagination. It includes error handling for ShipEngine exceptions. ```csharp using System.Collections.Generic; using System.Diagnostics; using ShipEngineSDK; using ShipEngineSDK.Model; namespace Example { public class ListBatchesExample { public static async Task Main() { var shipEngine = new ShipEngine("api_key"); var status = (BatchStatus) "open"; var sortBy = (BatchesSortBy) "ship_date"; var createdAtStart = 2019-03-12T19:24:13.657Z; var createdAtEnd = 2019-03-12T19:24:13.657Z; var processedAtStart = 2019-03-12T19:24:13.657Z; var processedAtEnd = 2019-03-12T19:24:13.657Z; var sortDir = (SortDir) "asc"; var batchNumber = "batchNumber_example"; var page = 2; var pageSize = 50; try { // List Batches ListBatchesResponseBody result = await shipEngine.ListBatches(status, sortBy, createdAtStart, createdAtEnd, processedAtStart, processedAtEnd, sortDir, batchNumber, page, pageSize); Debug.WriteLine(result); } catch (ShipEngineException e) { Debug.Print("Exception when calling BatchesApi.ListBatches: " + e.Message); Debug.Print("Status Code: " + e.ErrorCode); Debug.Print(e.StackTrace); } } } } ``` -------------------------------- ### Example: Schedule a Package Pickup Source: https://github.com/shipengine/shipengine-dotnet/blob/main/docs/apis/PackagePickupsApi.md Demonstrates how to schedule a package pickup using the ShipEngine .NET SDK. Ensure you have your API key and a populated SchedulePickupRequestBody. Handles potential ShipEngine exceptions. ```csharp using System.Collections.Generic; using System.Diagnostics; using ShipEngineSDK; using ShipEngineSDK.Model; namespace Example { public class SchedulePickupExample { public static async Task Main() { var shipEngine = new ShipEngine("api_key"); var schedulePickupRequestBody = new SchedulePickupRequestBody(); try { // Schedule a Pickup SchedulePickupResponseBody result = await shipEngine.SchedulePickup(schedulePickupRequestBody); Debug.WriteLine(result); } catch (ShipEngineException e) { Debug.Print("Exception when calling PackagePickupsApi.SchedulePickup: " + e.Message); Debug.Print("Status Code: " + e.ErrorCode); Debug.Print(e.StackTrace); } } } } ``` -------------------------------- ### List Shipment Tags C# Example Source: https://github.com/shipengine/shipengine-dotnet/blob/main/docs/apis/ShipmentsApi.md Use this snippet to get shipment tags by providing the shipment ID. Ensure you have the ShipEngine SDK initialized with your API key. Handles potential ShipEngine exceptions. ```csharp using System.Collections.Generic; using System.Diagnostics; using ShipEngineSDK; using ShipEngineSDK.Model; namespace Example { public class ShipmentsListTagsExample { public static async Task Main() { var shipEngine = new ShipEngine("api_key"); var shipmentId = "shipmentId_example"; try { // Get Shipment Tags TagShipmentResponseBody result = await shipEngine.ShipmentsListTags(shipmentId); Debug.WriteLine(result); } catch (ShipEngineException e) { Debug.Print("Exception when calling ShipmentsApi.ShipmentsListTags: " + e.Message); Debug.Print("Status Code: " + e.ErrorCode); Debug.Print(e.StackTrace); } } } } ``` -------------------------------- ### Example: Get Service Point By ID Source: https://github.com/shipengine/shipengine-dotnet/blob/main/docs/apis/ServicePointsApi.md Demonstrates how to retrieve a carrier service point using its ID. Ensure you have the ShipEngine SDK initialized with your API key and provide valid carrier, country, and service point IDs. ```csharp using System.Collections.Generic; using System.Diagnostics; using ShipEngineSDK; using ShipEngineSDK.Model; namespace Example { public class ServicePointsGetByIdExample { public static async Task Main() { var shipEngine = new ShipEngine("api_key"); var carrierCode = stamps_com; var countryCode = CA; var servicePointId = 614940; try { // Get Service Point By ID GetServicePointByIdResponseBody result = await shipEngine.ServicePointsGetById(carrierCode, countryCode, servicePointId); Debug.WriteLine(result); } catch (ShipEngineException e) { Debug.Print("Exception when calling ServicePointsApi.ServicePointsGetById: " + e.Message); Debug.Print("Status Code: " + e.ErrorCode); Debug.Print(e.StackTrace); } } } } ``` -------------------------------- ### Create Warehouse C# Example Source: https://github.com/shipengine/shipengine-dotnet/blob/main/docs/apis/WarehousesApi.md Demonstrates how to create a new warehouse location using the ShipEngine SDK. If a return address is not provided, the origin address is used as the return address. ```csharp using System.Collections.Generic; using System.Diagnostics; using ShipEngineSDK; using ShipEngineSDK.Model; namespace Example { public class CreateWarehouseExample { public static async Task Main() { var shipEngine = new ShipEngine("api_key"); var createWarehouseRequestBody = new CreateWarehouseRequestBody(); try { // Create Warehouse CreateWarehouseResponseBody result = await shipEngine.CreateWarehouse(createWarehouseRequestBody); Debug.WriteLine(result); } catch (ShipEngineException e) { Debug.Print("Exception when calling WarehousesApi.CreateWarehouse: " + e.Message); Debug.Print("Status Code: " + e.ErrorCode); Debug.Print(e.StackTrace); } } } } ``` -------------------------------- ### List Account Images C# Example Source: https://github.com/shipengine/shipengine-dotnet/blob/main/docs/apis/AccountApi.md Demonstrates how to list all account images for the ShipEngine account. Ensure you have initialized the ShipEngine SDK with your API key. ```csharp using System.Collections.Generic; using System.Diagnostics; using ShipEngineSDK; using ShipEngineSDK.Model; namespace Example { public class ListAccountImagesExample { public static async Task Main() { var shipEngine = new ShipEngine("api_key"); try { // List Account Images ListAccountSettingsImagesResponseBody result = await shipEngine.ListAccountImages(); Debug.WriteLine(result); } catch (ShipEngineException e) { Debug.Print("Exception when calling AccountApi.ListAccountImages: " + e.Message); Debug.Print("Status Code: " + e.ErrorCode); Debug.Print(e.StackTrace); } } } } ``` -------------------------------- ### Example: List Custom Package Types Source: https://github.com/shipengine/shipengine-dotnet/blob/main/docs/apis/PackageTypesApi.md Demonstrates how to list custom package types using the ShipEngine SDK. Ensure you have your API key configured. ```csharp using System.Collections.Generic; using System.Diagnostics; using ShipEngineSDK; using ShipEngineSDK.Model; namespace Example { public class ListPackageTypesExample { public static async Task Main() { var shipEngine = new ShipEngine("api_key"); try { // List Custom Package Types ListPackageTypesResponseBody result = await shipEngine.ListPackageTypes(); Debug.WriteLine(result); } catch (ShipEngineException e) { Debug.Print("Exception when calling PackageTypesApi.ListPackageTypes: " + e.Message); Debug.Print("Status Code: " + e.ErrorCode); Debug.Print(e.StackTrace); } } } } ``` -------------------------------- ### Get Carrier Settings Source: https://github.com/shipengine/shipengine-dotnet/blob/main/ShipEngineSDK/PublicAPI.Unshipped.txt Retrieves specific carrier settings. The SDK provides methods to get settings for DHL Express, FedEx, and UPS. ```APIDOC ## Get Carrier Settings ### Description Retrieves specific carrier settings. The SDK provides methods to get settings for DHL Express, FedEx, and UPS. ### Methods - `GetDhlExpressSettingsResponseBody()` - `GetFedexSettingsResponseBody()` - `GetUpsSettingsResponseBody()` ### Returns - `ShipEngineSDK.Model.DhlExpressSettingsResponseBody` - `ShipEngineSDK.Model.FedexSettingsResponseBody` - `ShipEngineSDK.Model.UpsSettingsResponseBody` ``` -------------------------------- ### Get Specific Carrier Request Body Methods Source: https://github.com/shipengine/shipengine-dotnet/blob/main/ShipEngineSDK/PublicAPI.Unshipped.txt These static methods provide a convenient way to get pre-configured request body objects for various carriers. ```APIDOC ## Get Specific Carrier Request Body Methods ### Description These static methods return instances of specific carrier request body objects, ready to be used for connecting carriers. ### Methods - `GetConnectAccessWorldwideRequestBody()` - `GetConnectAmazonBuyShippingRequestBody()` - `GetConnectAmazonShippingUk()` - `GetConnectApcRequestBody()` - `GetConnectAsendiaRequestBody()` - `GetConnectAustraliaPostRequestBody()` - `GetConnectCanadaPostRequestBody()` - `GetConnectDhlEcommerceRequestBody()` - `GetConnectDhlExpressAuRequestBody()` - `GetConnectDhlExpressCaRequestBody()` - `GetConnectDhlExpressRequestBody()` - `GetConnectDhlExpressUkRequestBody()` - `GetConnectDpdRequestBody()` - `GetConnectEndiciaRequestBody()` - `GetConnectFedexRequestBody()` - `GetConnectFedexUkRequestBody()` - `GetConnectFirstmileRequestBody()` - `GetConnectImexRequestBody()` - `GetConnectLasershipRequestBody()` - `GetConnectNewgisticsRequestBody()` - `GetConnectOntracRequestBody()` - `GetConnectPurolatorRequestBody()` ### Returns - An instance of the specific carrier's request body object (e.g., `ConnectAccessWorldwideRequestBody`). ``` -------------------------------- ### Example: Update Account Settings Images By ID Source: https://github.com/shipengine/shipengine-dotnet/blob/main/docs/apis/AccountApi.md Demonstrates how to update an account image by its ID using the ShipEngine .NET SDK. Includes error handling for potential ShipEngine exceptions. ```csharp using System.Collections.Generic; using System.Diagnostics; using ShipEngineSDK; using ShipEngineSDK.Model; namespace Example { public class UpdateAccountSettingsImagesByIdExample { public static async Task Main() { var shipEngine = new ShipEngine("api_key"); var updateAccountSettingsImageRequestBody = new UpdateAccountSettingsImageRequestBody(); var labelImageId = "labelImageId_example"; try { // Update Account Image By ID string result = await shipEngine.UpdateAccountSettingsImagesById(updateAccountSettingsImageRequestBody, labelImageId); Debug.WriteLine(result); } catch (ShipEngineException e) { Debug.Print("Exception when calling AccountApi.UpdateAccountSettingsImagesById: " + e.Message); Debug.Print("Status Code: " + e.ErrorCode); Debug.Print(e.StackTrace); } } } } ``` -------------------------------- ### Download File using ShipEngine SDK Source: https://github.com/shipengine/shipengine-dotnet/blob/main/docs/apis/DownloadsApi.md Demonstrates how to download a file using the ShipEngine SDK. Includes error handling for ShipEngine exceptions. Ensure you have your API key and specify the correct directory, filename, and optional parameters. ```csharp using System.Collections.Generic; using System.Diagnostics; using ShipEngineSDK; using ShipEngineSDK.Model; namespace Example { public class DownloadFileExample { public static async Task Main() { var shipEngine = new ShipEngine("api_key"); var subdir = "subdir_example"; var filename = "filename_example"; var dir = "dir_example"; var rotation = 56; var download = "download_example"; try { // Download File System.IO.Stream result = await shipEngine.DownloadFile(subdir, filename, dir, rotation, download); Debug.WriteLine(result); } catch (ShipEngineException e) { Debug.Print("Exception when calling DownloadsApi.DownloadFile: " + e.Message); Debug.Print("Status Code: " + e.ErrorCode); Debug.Print(e.StackTrace); } } } } ``` -------------------------------- ### Create Return Label C# Example Source: https://github.com/shipengine/shipengine-dotnet/blob/main/docs/apis/LabelsApi.md Demonstrates how to create a return label for an existing outbound label using the ShipEngine .NET SDK. Includes error handling for ShipEngine exceptions. ```csharp using System.Collections.Generic; using System.Diagnostics; using ShipEngineSDK; using ShipEngineSDK.Model; namespace Example { public class CreateReturnLabelExample { public static async Task Main() { var shipEngine = new ShipEngine("api_key"); var createReturnLabelRequestBody = new CreateReturnLabelRequestBody(); var labelId = "labelId_example"; try { // Create a return label CreateReturnLabelResponseBody result = await shipEngine.CreateReturnLabel(createReturnLabelRequestBody, labelId); Debug.WriteLine(result); } catch (ShipEngineException e) { Debug.Print("Exception when calling LabelsApi.CreateReturnLabel: " + e.Message); Debug.Print("Status Code: " + e.ErrorCode); Debug.Print(e.StackTrace); } } } } ``` -------------------------------- ### ShipmentsListTags Source: https://github.com/shipengine/shipengine-dotnet/blob/main/README.md Get Shipment Tags. ```APIDOC ## ShipmentsListTags ### Description Get Shipment Tags. ### Method GET ### Endpoint /shipments/{shipment_id}/tags ### Parameters #### Path Parameters - **shipment_id** (string) - Required - The ID of the shipment for which to retrieve tags. ### Request Example (No request body example provided in source) ### Response #### Success Response (200) (No response schema provided in source) #### Response Example (No response example provided in source) ``` -------------------------------- ### List Carrier Services C# Example Source: https://github.com/shipengine/shipengine-dotnet/blob/main/docs/apis/CarriersApi.md Demonstrates how to list services for a given carrier ID using the ShipEngine SDK. Ensure you have your API key and the correct carrier ID. ```csharp using System.Collections.Generic; using System.Diagnostics; using ShipEngineSDK; using ShipEngineSDK.Model; namespace Example { public class ListCarrierServicesExample { public static async Task Main() { var shipEngine = new ShipEngine("api_key"); var carrierId = se-28529731; try { // List Carrier Services ListCarrierServicesResponseBody result = await shipEngine.ListCarrierServices(carrierId); Debug.WriteLine(result); } catch (ShipEngineException e) { Debug.Print("Exception when calling CarriersApi.ListCarrierServices: " + e.Message); Debug.Print("Status Code: " + e.ErrorCode); Debug.Print(e.StackTrace); } } } } ``` -------------------------------- ### ListShipmentRates Source: https://github.com/shipengine/shipengine-dotnet/blob/main/README.md Get Shipment Rates. ```APIDOC ## ListShipmentRates ### Description Get Shipment Rates. ### Method GET ### Endpoint /shipments/{shipment_id}/rates ### Parameters #### Path Parameters - **shipment_id** (string) - Required - The ID of the shipment for which to retrieve rates. ### Request Example (No request body example provided in source) ### Response #### Success Response (200) (No response schema provided in source) #### Response Example (No response example provided in source) ``` -------------------------------- ### Calculate Rates C# Example Source: https://github.com/shipengine/shipengine-dotnet/blob/main/docs/apis/RatesApi.md Demonstrates how to retrieve shipping rates for a shipment using the ShipEngine SDK. Ensure you have your API key and a properly configured request body. ```csharp using System.Collections.Generic; using System.Diagnostics; using ShipEngineSDK; using ShipEngineSDK.Model; namespace Example { public class CalculateRatesExample { public static async Task Main() { var shipEngine = new ShipEngine("api_key"); var calculateRatesRequestBody = new CalculateRatesRequestBody(); try { // Get Shipping Rates CalculateRatesResponseBody result = await shipEngine.CalculateRates(calculateRatesRequestBody); Debug.WriteLine(result); } catch (ShipEngineException e) { Debug.Print("Exception when calling RatesApi.CalculateRates: " + e.Message); Debug.Print("Status Code: " + e.ErrorCode); Debug.Print(e.StackTrace); } } } } ``` -------------------------------- ### GetShipmentById Source: https://github.com/shipengine/shipengine-dotnet/blob/main/README.md Get Shipment By ID. ```APIDOC ## GetShipmentById ### Description Get Shipment By ID. ### Method GET ### Endpoint /shipments/{shipment_id} ### Parameters #### Path Parameters - **shipment_id** (string) - Required - The ID of the shipment to retrieve. ### Request Example (No request body example provided in source) ### Response #### Success Response (200) (No response schema provided in source) #### Response Example (No response example provided in source) ``` -------------------------------- ### GetRateById Source: https://github.com/shipengine/shipengine-dotnet/blob/main/README.md Get Rate By ID. ```APIDOC ## GetRateById ### Description Get Rate By ID. ### Method GET ### Endpoint /rates/{rate_id} ### Parameters #### Path Parameters - **rate_id** (string) - Required - The ID of the rate to retrieve. ### Request Example (No request body example provided in source) ### Response #### Success Response (200) (No response schema provided in source) #### Response Example (No response example provided in source) ``` -------------------------------- ### CompareBulkRates Source: https://github.com/shipengine/shipengine-dotnet/blob/main/README.md Get Bulk Rates. ```APIDOC ## CompareBulkRates ### Description Get Bulk Rates. ### Method POST ### Endpoint /rates/bulk ### Parameters (No parameters provided in source) ### Request Example (No request body example provided in source) ### Response #### Success Response (200) (No response schema provided in source) #### Response Example (No response example provided in source) ``` -------------------------------- ### CalculateRates Source: https://github.com/shipengine/shipengine-dotnet/blob/main/README.md Get Shipping Rates. ```APIDOC ## CalculateRates ### Description Get Shipping Rates. ### Method POST ### Endpoint /rates ### Parameters (No parameters provided in source) ### Request Example (No request body example provided in source) ### Response #### Success Response (200) (No response schema provided in source) #### Response Example (No response example provided in source) ``` -------------------------------- ### LabelFormat Constructor Source: https://github.com/shipengine/shipengine-dotnet/blob/main/ShipEngineSDK/PublicAPI.Unshipped.txt Demonstrates the constructor for the `LabelFormat` class. ```APIDOC ## ShipEngineSDK.Model.LabelFormat Constructor ### Description Initializes a new instance of the `LabelFormat` class. ### Method `ShipEngineSDK.Model.Label.LabelFormat.set` ### Parameters #### Path Parameters - **value** (`string!`): The value for the label format. ``` -------------------------------- ### List Shipments with Various Filters Source: https://github.com/shipengine/shipengine-dotnet/blob/main/docs/apis/ShipmentsApi.md Demonstrates how to list shipments using multiple optional parameters for filtering and pagination. Ensure you have the ShipEngine SDK initialized with your API key. ```csharp using System.Collections.Generic; using System.Diagnostics; using ShipEngineSDK; using ShipEngineSDK.Model; namespace Example { public class ListShipmentsExample { public static async Task Main() { var shipEngine = new ShipEngine("api_key"); var createdAtStart = 2019-03-12T19:24:13.657Z; var createdAtEnd = 2019-03-12T19:24:13.657Z; var modifiedAtStart = 2019-03-12T19:24:13.657Z; var modifiedAtEnd = 2019-03-12T19:24:13.657Z; var shipmentStatus = (ShipmentStatus) "pending"; var sortBy = modified_at; var sortDir = (SortDir) "asc"; var batchId = "batchId_example"; var tag = Letters_to_santa; var salesOrderId = "salesOrderId_example"; var page = 2; var pageSize = 50; try { // List Shipments ListShipmentsResponseBody result = await shipEngine.ListShipments(createdAtStart, createdAtEnd, modifiedAtStart, modifiedAtEnd, shipmentStatus, sortBy, sortDir, batchId, tag, salesOrderId, page, pageSize); Debug.WriteLine(result); } catch (ShipEngineException e) { Debug.Print("Exception when calling ShipmentsApi.ListShipments: " + e.Message); Debug.Print("Status Code: " + e.ErrorCode); Debug.Print(e.StackTrace); } } } } ``` -------------------------------- ### List Labels with Filters Source: https://github.com/shipengine/shipengine-dotnet/blob/main/docs/apis/LabelsApi.md Demonstrates how to list labels using various optional filters such as date range, status, service code, carrier ID, tracking number, batch ID, rate ID, shipment ID, warehouse ID, pagination, and sorting. Includes error handling for ShipEngine exceptions. ```csharp using System.Collections.Generic; using System.Diagnostics; using ShipEngineSDK; using ShipEngineSDK.Model; namespace Example { public class ListLabelsExample { public static async Task Main() { var shipEngine = new ShipEngine("api_key"); var createdAtStart = 2019-03-12T19:24:13.657Z; var createdAtEnd = 2019-03-12T19:24:13.657Z; var labelStatus = (LabelStatus) "processing"; var sortDir = (SortDir) "asc"; var serviceCode = usps_first_class_mail; var carrierId = "carrierId_example"; var trackingNumber = 9405511899223197428490; var batchId = "batchId_example"; var rateId = "rateId_example"; var shipmentId = "shipmentId_example"; var warehouseId = "warehouseId_example"; var page = 2; var pageSize = 50; var sortBy = "modified_at"; try { // List labels ListLabelsResponseBody result = await shipEngine.ListLabels(createdAtStart, createdAtEnd, labelStatus, sortDir, serviceCode, carrierId, trackingNumber, batchId, rateId, shipmentId, warehouseId, page, pageSize, sortBy); Debug.WriteLine(result); } catch (ShipEngineException e) { Debug.Print("Exception when calling LabelsApi.ListLabels: " + e.Message); Debug.Print("Status Code: " + e.ErrorCode); Debug.Print(e.StackTrace); } } } } ``` -------------------------------- ### GetShipmentByExternalId Source: https://github.com/shipengine/shipengine-dotnet/blob/main/README.md Get Shipment By External ID. ```APIDOC ## GetShipmentByExternalId ### Description Get Shipment By External ID. ### Method GET ### Endpoint /shipments/external/{external_shipment_id} ### Parameters #### Path Parameters - **external_shipment_id** (string) - Required - The external ID of the shipment to retrieve. ### Request Example (No request body example provided in source) ### Response #### Success Response (200) (No response schema provided in source) #### Response Example (No response example provided in source) ``` -------------------------------- ### Initialize ShipEngine Client Source: https://github.com/shipengine/shipengine-dotnet/blob/main/README.md Initialize the ShipEngine client with your API key. This client is used to interact with ShipEngine services. ```csharp using ShipEngineSDK; var shipengine = new ShipEngine("___YOUR_API_KEY_HERE__"); ``` -------------------------------- ### ServicePointsGetById Source: https://github.com/shipengine/shipengine-dotnet/blob/main/README.md Get Service Point By ID. ```APIDOC ## ServicePointsGetById ### Description Get Service Point By ID. ### Method GET ### Endpoint /service_points/{service_point_id} ### Parameters #### Path Parameters - **service_point_id** (string) - Required - The ID of the service point to retrieve. ### Request Example (No request body example provided in source) ### Response #### Success Response (200) (No response schema provided in source) #### Response Example (No response example provided in source) ``` -------------------------------- ### Build ShipEngine .NET Code Source: https://github.com/shipengine/shipengine-dotnet/blob/main/README.md Compile the project to ensure all code builds successfully. ```bash dotnet build ``` -------------------------------- ### UpdateCarrierSettingsRequestBody.ActualInstance Source: https://github.com/shipengine/shipengine-dotnet/blob/main/ShipEngineSDK/PublicAPI.Unshipped.txt Gets or sets the actual instance of the UpdateCarrierSettingsRequestBody. ```APIDOC ## UpdateCarrierSettingsRequestBody.ActualInstance ### Description Gets or sets the actual instance of the UpdateCarrierSettingsRequestBody. This property is used to hold the specific carrier settings object. ### Property ```csharp object ActualInstance { get; set; } ``` ### Usage ```csharp var settings = new UpdateCarrierSettingsRequestBody(); settings.ActualInstance = carrierSpecificSettingsObject; object specificSettings = settings.ActualInstance; ``` ``` -------------------------------- ### List Carriers using ShipEngine SDK Source: https://github.com/shipengine/shipengine-dotnet/blob/main/docs/apis/CarriersApi.md This C# example demonstrates how to list all carriers associated with your ShipEngine account using the SDK. Ensure you have initialized the ShipEngine client with your API key. The method returns a GetCarriersResponseBody object containing carrier details. ```csharp using System.Collections.Generic; using System.Diagnostics; using ShipEngineSDK; using ShipEngineSDK.Model; namespace Example { public class ListCarriersExample { public static async Task Main() { var shipEngine = new ShipEngine("api_key"); try { // List Carriers GetCarriersResponseBody result = await shipEngine.ListCarriers(); Debug.WriteLine(result); } catch (ShipEngineException e) { Debug.Print("Exception when calling CarriersApi.ListCarriers: " + e.Message); Debug.Print("Status Code: " + e.ErrorCode); Debug.Print(e.StackTrace); } } } } ``` -------------------------------- ### GetPackageTypeById Source: https://github.com/shipengine/shipengine-dotnet/blob/main/docs/apis/PackageTypesApi.md Get a custom package type by its ID. ```APIDOC ## GetPackageTypeById ### Description Get a custom package type by its ID. ### Method GET ### Endpoint /v1/package-types/{package_type_id} ### Parameters #### Path Parameters - **package_type_id** (string) - Required - The ID of the custom package type to retrieve. ### Response #### Success Response (200) - **package_type_id** (string) - The unique identifier for the package type. - **name** (string) - The name of the custom package type. - **description** (string) - A description of the custom package type. - **dimensions** (object) - The dimensions of the package type. - **unit** (string) - The unit of measurement for the dimensions (e.g., "inch", "centimeter"). - **length** (number) - The length of the package. - **width** (number) - The width of the package. - **height** (number) - The height of the package. - **weight** (object) - The weight of the package type. - **unit** (string) - The unit of measurement for the weight (e.g., "pound", "kilogram"). - **value** (number) - The weight value. - **created_at** (string) - The timestamp when the package type was created. - **updated_at** (string) - The timestamp when the package type was last updated. #### Response Example ```json { "package_type_id": "pkg_12345abcde", "name": "My Custom Box", "description": "A custom box for specific items", "dimensions": { "unit": "inch", "length": 10, "width": 8, "height": 6 }, "weight": { "unit": "pound", "value": 5 }, "created_at": "2023-10-27T10:00:00Z", "updated_at": "2023-10-27T10:00:00Z" } ``` #### Error Response (404) - **error** (object) - Contains error details if the package type is not found. - **status_code** (integer) - The HTTP status code of the error. - **message** (string) - A message describing the error. - **description** (string) - A more detailed description of the error. ``` -------------------------------- ### Get Insurance Balance Source: https://github.com/shipengine/shipengine-dotnet/blob/main/ShipEngineSDK/PublicAPI.Unshipped.txt Retrieves the current insurance balance for the account. ```APIDOC ## Get Insurance Balance ### Description Retrieves the current insurance balance for the account. ### Response #### Success Response - **Amount** (double) - The amount of the insurance balance. - **Currency** (string) - The currency of the insurance balance. ``` -------------------------------- ### List Carrier Package Types C# Example Source: https://github.com/shipengine/shipengine-dotnet/blob/main/docs/apis/CarriersApi.md Demonstrates how to list package types associated with a specific carrier using the ShipEngine SDK. Ensure you have your API key and the correct carrier ID. ```csharp using System.Collections.Generic; using System.Diagnostics; using ShipEngineSDK; using ShipEngineSDK.Model; namespace Example { public class ListCarrierPackageTypesExample { public static async Task Main() { var shipEngine = new ShipEngine("api_key"); var carrierId = "se-28529731"; try { // List Carrier Package Types ListCarrierPackageTypesResponseBody result = await shipEngine.ListCarrierPackageTypes(carrierId); Debug.WriteLine(result); } catch (ShipEngineException e) { Debug.Print("Exception when calling CarriersApi.ListCarrierPackageTypes: " + e.Message); Debug.Print("Status Code: " + e.ErrorCode); Debug.Print(e.StackTrace); } } } } ``` -------------------------------- ### Get Carriers Source: https://github.com/shipengine/shipengine-dotnet/blob/main/ShipEngineSDK/PublicAPI.Unshipped.txt Retrieves a list of all available carriers that can be used with ShipEngine. ```APIDOC ## Get Carriers ### Description Retrieves a list of all available carriers that can be used with ShipEngine. ### Response #### Success Response - **RequestId** (System.Guid) - The unique identifier for the request. - **Carriers** (System.Collections.Generic.List) - A list of available carriers. - **Errors** (System.Collections.Generic.List) - A list of any errors encountered during the request. ```