diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..8e2423e
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,8 @@
+.idea/
+.vs/
+src/AfterShipTracking/Test/
+src/AfterShipTracking/AfterShipTracking/bin/
+src/AfterShipTracking/AfterShipTracking/obj/
+Tracking.sln.DotSettings.user
+.DS_Store
+.config/
\ No newline at end of file
diff --git a/LICENSE.txt b/LICENSE.txt
new file mode 100644
index 0000000..39025bd
--- /dev/null
+++ b/LICENSE.txt
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2025 AfterShip
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/README.md b/README.md
index 35686e8..41c686d 100644
--- a/README.md
+++ b/README.md
@@ -1 +1,344 @@
-# tracking-sdk-net
\ No newline at end of file
+# AfterShip Tracking API library for C#
+
+This library allows you to quickly and easily use the AfterShip Tracking API via C#.
+
+For updates to this library, see our [GitHub release page](https://github.com/AfterShip/tracking-sdk-net/releases).
+
+If you need support using AfterShip products, please contact support@aftership.com.
+
+## Table of Contents
+
+- [AfterShip Tracking API library for C#](#aftership-tracking-api-library-for-c)
+ - [Table of Contents](#table-of-contents)
+ - [Before you begin](#before-you-begin)
+ - [API and SDK Version](#api-and-sdk-version)
+ - [Quick Start](#quick-start)
+ - [Installation](#installation)
+ - [Constructor](#constructor)
+ - [Example](#example)
+ - [Rate Limiter](#rate-limiter)
+ - [Error Handling](#error-handling)
+ - [Error List](#error-list)
+ - [Endpoints](#endpoints)
+ - [/trackings](#trackings)
+ - [/couriers](#couriers)
+ - [/estimated-delivery-date](#estimated-delivery-date)
+ - [Help](#help)
+ - [License](#license)
+
+
+## Before you begin
+
+Before you begin to integrate:
+
+- [Create an AfterShip account](https://admin.aftership.com/).
+- [Create an API key](https://organization.automizely.com/api-keys).
+- [Install .Net](https://dotnet.microsoft.com/en-us/download/dotnet/6.0) version 6.0 or later.
+
+### API and SDK Version
+
+Each SDK version is designed to work with a specific API version. Please refer to the table below to identify the supported API versions for each SDK version, ensuring you select the appropriate SDK version for the API version you intend to use.
+
+| SDK Version | Supported API Version | Branch |
+| ----------- | --------------------- | ---------------------------------------------------------- |
+| 10.x.x | 2025-01 | https://github.com/AfterShip/tracking-sdk-net/tree/2025-01 |
+| 9.x.x | 2024-10 | https://github.com/AfterShip/tracking-sdk-net/tree/2024-10 |
+| 8.x.x | 2024-07 | https://github.com/AfterShip/tracking-sdk-net/tree/2024-07 |
+| 7.x.x | 2024-04 | https://github.com/AfterShip/tracking-sdk-net/tree/2024-04 |
+| <=6.x.x | Legacy API | https://github.com/AfterShip/aftership-sdk-net |
+
+## Quick Start
+
+### Installation
+Using the [.NET Core command-line interface (CLI) tools]:
+
+```sh
+dotnet add package AfterShipTracking
+```
+
+Using the [NuGet Command Line Interface (CLI)]:
+
+```sh
+nuget install AfterShipTracking
+```
+
+From within Visual Studio:
+
+1. Open the Solution Explorer.
+2. Right-click on a project within your solution.
+3. Click on *Manage NuGet Packages...*
+4. Click on the *Browse* tab and search for "AfterShipTracking".
+5. Click on the AfterShipTracking package, select the appropriate version in the
+ right-tab and click *Install*.
+
+For with Visual Studio Code:
+1. Open the Command Palette then type "NuGet Package Manager"
+2. In the opened window, search for "AfterShipTracking".
+3. Select the AfterShipTracking package and the package version.
+
+
+## Constructor
+
+Create AfterShip instance with options
+
+| Name | Type | Required | Description |
+| ---------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| api_key | string | ✔ | Your AfterShip API key |
+| auth_type | enum | | Default value: `AfterShipConfiguration.AUTHENTICATION_TYPE_API_KEY`
AES authentication: `AfterShipConfiguration.AUTHENTICATION_TYPE_AES`
RSA authentication: `AfterShipConfiguration.AUTHENTICATION_TYPE_RSA` |
+| api_secret | string | | Required if the authentication type is `AfterShipConfiguration.AUTHENTICATION_TYPE_AES` or `AfterShipConfiguration.AUTHENTICATION_TYPE_RSA` |
+| domain | string | | AfterShip API domain. Default value: https://api.aftership.com |
+| user_agent | string | | User-defined user-agent string, please follow [RFC9110](https://www.rfc-editor.org/rfc/rfc9110#field.user-agent) format standard. |
+| proxy | string | | HTTP proxy URL to use for requests.
Default value: `null`
Example: `http://192.168.0.100:8888` |
+| max_retry | number | | Number of retries for each request. Default value: 2. Min is 0, Max is 10. |
+| timeout | number | | Timeout for each request in milliseconds. |
+
+### Example
+
+```csharp
+using AfterShipTracking;
+
+class Program
+{
+ static void Main()
+ {
+ try
+ {
+ AfterShipClient client = new AfterShipClient(
+ apiKey: "YOUR_API_KEY",
+ apiSecret: "YOUR_AES_SECRET",
+ authenticationType: AfterShipConfiguration.AUTHENTICATION_TYPE_AES
+ );
+
+ CreateTrackingOptions options = new CreateTrackingOptions();
+ options.CreateTrackingRequest = new CreateTrackingRequest();
+ CreateTrackingRequest newTracking = new CreateTrackingRequest();
+ newTracking.TrackingNumber = "";
+ newTracking.Slug = "";
+ options.CreateTrackingRequest = newTracking;
+ Tracking tracking = client.Tracking.CreateTracking(options);
+ if (tracking != null)
+ {
+ Console.WriteLine(tracking.Id);
+ }
+ }catch (Exception e)
+ {
+ Console.WriteLine(e.Message);
+ }
+ }
+}
+```
+
+## Rate Limiter
+
+See the [Rate Limit](https://www.aftership.com/docs/tracking/2025-01/quickstart/rate-limit) to understand the AfterShip rate limit policy.
+
+## Error Handling
+
+The SDK will return an error object when there is any error during the request, with the following specification:
+
+| Name | Type | Description |
+| ------------- | ------ | ------------------------------ |
+| message | string | Detail message of the error |
+| code | enum | Error code enum for API Error. |
+| meta_code | number | API response meta code. |
+| status_code | number | HTTP status code. |
+| response_body | string | API response body. |
+
+
+### Error List
+
+| code | meta_code | status_code | message |
+| --------------------------------- | --------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| INVALID_REQUEST | 400 | 400 | The request was invalid or cannot be otherwise served. |
+| INVALID_JSON | 4001 | 400 | Invalid JSON data. |
+| TRACKING_ALREADY_EXIST | 4003 | 400 | Tracking already exists. |
+| TRACKING_DOES_NOT_EXIST | 4004 | 404 | Tracking does not exist. |
+| TRACKING_NUMBER_INVALID | 4005 | 400 | The value of tracking_number is invalid. |
+| TRACKING_REQUIRED | 4006 | 400 | tracking object is required. |
+| TRACKING_NUMBER_REQUIRED | 4007 | 400 | tracking_number is required. |
+| VALUE_INVALID | 4008 | 400 | The value of [field_name] is invalid. |
+| VALUE_REQUIRED | 4009 | 400 | [field_name] is required. |
+| SLUG_INVALID | 4010 | 400 | The value of slug is invalid. |
+| MISSING_OR_INVALID_REQUIRED_FIELD | 4011 | 400 | Missing or invalid value of the required fields for this courier. Besides tracking_number, also required: [field_name] |
+| BAD_COURIER | 4012 | 400 | The error message will be one of the following:
1. Unable to import shipment as the carrier is not on your approved list for carrier auto-detection. Add the carrier here: https://admin.aftership.com/settings/couriers
2. Unable to import shipment as we don’t recognize the carrier from this tracking number.
3. Unable to import shipment as the tracking number has an invalid format.
4. Unable to import shipment as this carrier is no longer supported.
5. Unable to import shipment as the tracking number does not belong to a carrier in that group. |
+| INACTIVE_RETRACK_NOT_ALLOWED | 4013 | 400 | Retrack is not allowed. You can only retrack an inactive tracking. |
+| NOTIFICATION_REUQIRED | 4014 | 400 | notification object is required. |
+| ID_INVALID | 4015 | 400 | The value of id is invalid. |
+| RETRACK_ONCE_ALLOWED | 4016 | 400 | Retrack is not allowed. You can only retrack each shipment once. |
+| TRACKING_NUMBER_FORMAT_INVALID | 4017 | 400 | The format of tracking_number is invalid. |
+| API_KEY_INVALID | 401 | 401 | The API key is invalid. |
+| REQUEST_NOT_ALLOWED | 403 | 403 | The request is understood, but it has been refused or access is not allowed. |
+| NOT_FOUND | 404 | 404 | The URI requested is invalid or the resource requested does not exist. |
+| TOO_MANY_REQUEST | 429 | 429 | You have exceeded the API call rate limit. The default limit is 10 requests per second. |
+| INTERNAL_ERROR | 500 502 503 504 | 500 502 503 504 | Something went wrong on AfterShip's end. |
+
+## Endpoints
+
+The AfterShip instance has the following properties which are exactly the same as the API endpoints:
+
+- courier - Get a list of our supported couriers.
+- tracking - Create trackings, update trackings, and get tracking results.
+- estimated-delivery-date - Get estimated delivery date for your order.
+
+
+### /trackings
+
+**POST** /trackings
+
+```csharp
+CreateTrackingOptions options = new CreateTrackingOptions();
+options.CreateTrackingRequest = new CreateTrackingRequest();
+CreateTrackingRequest newTracking = new CreateTrackingRequest();
+newTracking.TrackingNumber = "";
+newTracking.Slug = "";
+options.CreateTrackingRequest = newTracking;
+Tracking tracking = client.Tracking.CreateTracking(options);
+if (tracking != null)
+{
+ Console.WriteLine(tracking.Id);
+}
+```
+
+**DELETE** /trackings/:id
+
+```csharp
+DeleteTrackingByIdOptions deleteOptions = new DeleteTrackingByIdOptions();
+Tracking resp = client.Tracking.DeleteTrackingById("");
+
+if (resp != null)
+{
+ Console.WriteLine(resp.Id);
+}
+```
+
+**GET** /trackings
+
+```csharp
+GetTrackingsOptions options = new GetTrackingsOptions();
+options.Keyword = "test";
+GetTrackingsResponseTrackingListData trackingsData = client.Tracking.GetTrackings(options);
+if (trackingsData != null && trackingsData.Trackings != null)
+{
+ for (int i = 0; i < trackingsData.Trackings.Length; i++)
+ {
+ Console.WriteLine(trackingsData.Trackings[i].Id);
+ }
+}
+```
+
+**GET** /trackings/:id
+
+```csharp
+Tracking tracking = client.Tracking.GetTrackingById("");
+if (tracking != null)
+{
+ Console.WriteLine(tracking.TrackingNumber);
+}
+```
+
+**PUT** /trackings/:id
+
+```csharp
+UpdateTrackingByIdOptions updateOptions = new UpdateTrackingByIdOptions();
+updateOptions.UpdateTrackingByIdRequest = new UpdateTrackingByIdRequest();
+UpdateTrackingByIdRequest trackingToUpdate = new UpdateTrackingByIdRequest();
+trackingToUpdate.Title = "this is a test new title";
+trackingToUpdate.Note = "some note";
+updateOptions.UpdateTrackingByIdRequest = trackingToUpdate;
+Tracking tracking = client.Tracking.UpdateTrackingById("", updateOptions);
+
+if (tracking != null)
+{
+ Console.WriteLine(tracking.Title);
+ Console.WriteLine(tracking.Note);
+}
+```
+
+**POST** /trackings/:id/retrack
+
+```csharp
+RetrackTrackingByIdOptions options = new RetrackTrackingByIdOptions();
+Tracking tracking = client.Tracking.RetrackTrackingById("");
+Console.WriteLine(tracking.TrackingNumber);
+```
+
+**POST** /trackings/:id/mark-as-completed
+
+```csharp
+MarkTrackingCompletedByIdOptions options = new MarkTrackingCompletedByIdOptions();
+Tracking tracking = client.Tracking.RetrackTrackingById("");
+Console.WriteLine(tracking.TrackingNumber);
+```
+
+### /couriers
+**GET** /couriers
+
+```csharp
+GetUserCouriersOptions options = new GetUserCouriersOptions();
+GetUserCouriersResponse resp = client.Courier.GetUserCouriers(options);
+Console.WriteLine(resp.Total);
+```
+
+**GET** /couriers/all
+
+```csharp
+GetAllCouriersOptions options = new GetAllCouriersOptions();
+GetAllCouriersResponse resp = client.Courier.GetAllCouriers(options);
+Console.WriteLine(resp.Total);
+```
+
+**POST** /couriers/detect
+
+```csharp
+DetectCourierOptions options = new DetectCourierOptions();
+DetectCourierRequest tracking = new DetectCourierRequest();
+tracking.TrackingNumber = "";
+options.DetectCourierRequest = tracking;
+DetectCourierResponse resp = client.Courier.DetectCourier(options);
+Console.WriteLine(resp.Total);
+```
+
+### /estimated-delivery-date
+
+**POST** /estimated-delivery-date/predict-batch
+
+```csharp
+PredictBatchOptions options = new PredictBatchOptions();
+PredictBatchRequest request = new PredictBatchRequest();
+
+EstimatedDeliveryDateRequest estimatedDeliveryDateRequest = new EstimatedDeliveryDateRequest();
+
+DestinationAddressEstimatedDeliveryDateRequest dest = new DestinationAddressEstimatedDeliveryDateRequest();
+dest.CountryRegion = "";
+dest.State = "";
+estimatedDeliveryDateRequest.DestinationAddress = dest;
+
+OriginAddressEstimatedDeliveryDateRequest origin = new OriginAddressEstimatedDeliveryDateRequest();
+origin.CountryRegion = "";
+origin.State = "";
+estimatedDeliveryDateRequest.OriginAddress = origin;
+
+estimatedDeliveryDateRequest.Slug = "";
+estimatedDeliveryDateRequest.PickupTime = "2024-08-01 06:42:30";
+request.EstimatedDeliveryDates = new EstimatedDeliveryDateRequest[] { estimatedDeliveryDateRequest };
+
+options.PredictBatchRequest = request;
+
+EstimatedPickupEstimatedDeliveryDateRequest r2 = new EstimatedPickupEstimatedDeliveryDateRequest();
+r2.BusinessDays = new int?[] { 0 };
+
+PredictBatchResponse resp = client.EstimatedDeliveryDate.PredictBatch(options);
+Console.WriteLine(resp.EstimatedDeliveryDates[0].PickupTime);
+```
+
+## Help
+
+If you get stuck, we're here to help:
+
+- [Issue Tracker](https://github.com/AfterShip/tracking-sdk-net/issues) for questions, feature requests, bug reports and general discussion related to this package. Try searching before you create a new issue.
+- Contact AfterShip official support via support@aftership.com
+
+## License
+Copyright (c) 2024 AfterShip
+
+Licensed under the MIT license.
\ No newline at end of file
diff --git a/icon.png b/icon.png
new file mode 100755
index 0000000..b1b8e59
Binary files /dev/null and b/icon.png differ
diff --git a/src/.DS_Store b/src/.DS_Store
new file mode 100644
index 0000000..74e59f6
Binary files /dev/null and b/src/.DS_Store differ
diff --git a/src/AfterShipTracking/.DS_Store b/src/AfterShipTracking/.DS_Store
new file mode 100644
index 0000000..88878c3
Binary files /dev/null and b/src/AfterShipTracking/.DS_Store differ
diff --git a/src/AfterShipTracking/AfterShipTracking.sln b/src/AfterShipTracking/AfterShipTracking.sln
new file mode 100644
index 0000000..e407a72
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking.sln
@@ -0,0 +1,29 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 25.0.1706.9
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AfterShipTracking", "AfterShipTracking\AfterShipTracking.csproj", "{D3099A91-E005-4291-88AD-D7A3B85DDC1D}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {D3099A91-E005-4291-88AD-D7A3B85DDC1D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {D3099A91-E005-4291-88AD-D7A3B85DDC1D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {D3099A91-E005-4291-88AD-D7A3B85DDC1D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {D3099A91-E005-4291-88AD-D7A3B85DDC1D}.Release|Any CPU.Build.0 = Release|Any CPU
+ {D2C22390-8325-4493-B940-F89BD8BA19EA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {D2C22390-8325-4493-B940-F89BD8BA19EA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {D2C22390-8325-4493-B940-F89BD8BA19EA}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {D2C22390-8325-4493-B940-F89BD8BA19EA}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {5C216FDA-5980-4A44-A348-7C9B82282CE4}
+ EndGlobalSection
+EndGlobal
diff --git a/src/AfterShipTracking/AfterShipTracking/AfterShipTracking.csproj b/src/AfterShipTracking/AfterShipTracking/AfterShipTracking.csproj
new file mode 100644
index 0000000..cc1f4a9
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/AfterShipTracking.csproj
@@ -0,0 +1,55 @@
+
+
+
+ net6.0
+ bin/Release
+ enable
+ true
+ AfterShipTracking
+ The official AfterShip Tracking .net API library
+ Copyright © AfterShip
+ AfterShipTracking
+ en-US
+ 10.0.0
+
+
+ AfterShip
+ CS1587;CS1591;CS1570;CS1573;CS1572;CS8618;CS8603;CS8625;CS8604;CS8765
+ false
+ true
+ false
+ AfterShipTracking
+ aftership;tracking;track;fedex;ups;usps;dhl;shipping;fulfillment;couriers;carriers
+ https://www.aftership.com
+ https://github.com/aftership/tracking-sdk-net
+ git
+ True
+ README.md
+ LICENSE.txt
+ icon.png
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/AfterShipTracking/AfterShipTracking/AftershipClient.cs b/src/AfterShipTracking/AfterShipTracking/AftershipClient.cs
new file mode 100644
index 0000000..1ade2e0
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/AftershipClient.cs
@@ -0,0 +1,140 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System.Linq;
+
+namespace AfterShipTracking
+{
+ public class AfterShipClient
+ {
+ /// Gets the base URL for AfterShip's API.
+ /// The base URL for AfterShip's API.
+ public string ApiBase { get; set; }
+
+ ///
+ /// Custom API domain.
+ ///
+ public string Domain;
+
+ ///
+ /// Custom API domain.
+ ///
+ public int MaxRetry { get; set; }
+
+ ///
+ /// Max request timeout in milliseconds.
+ ///
+ public int Timeout { get; set; }
+
+ ///
+ /// Custom API domain.
+ ///
+ public string UserAgent { get; set; }
+
+ ///
+ /// Custom API domain. Only http, socks4, socks4a, socks5 are allowed.
+ ///
+ public string Proxy { get; set; }
+
+ ///
+ /// Custom API domain.
+ ///
+ public string ApiKey { get; set; }
+
+ ///
+ /// AfterShip API secret for AES or RSA authentication method.
+ ///
+ public string ApiSecret { get; set; }
+
+ ///
+ /// AfterShip API Authentication method. Allowed value: API_KEY , AES , RSA
+ ///
+ public string AuthenticationType { get; set; }
+
+ ///
+ /// AfterShip API version.
+ ///
+ public string Version { get; set; }
+
+ ///
+ /// AfterShip API Product
+ ///
+ public string Product { get; set; }
+
+ public IHttpClient HttpClient { get; }
+
+ public TrackingService Tracking { get; set; }
+ public CourierService Courier { get; set; }
+ public EstimatedDeliveryDateService EstimatedDeliveryDate { get; set; }
+ public AfterShipClient(
+ string domain = null,
+ string apiKey = null,
+ string apiSecret = null,
+ string authenticationType = null,
+ string userAgent = null,
+ string proxy = null,
+ int timeout = 0,
+ int maxRetry = 0,
+ IHttpClient httpClient = null
+ )
+ {
+ Domain = domain ?? AfterShipConfiguration.Domain;
+ ApiBase = Domain;
+ MaxRetry = maxRetry == 0 ? AfterShipConfiguration.MaxRetry : maxRetry;
+ Timeout = timeout == 0 ? AfterShipConfiguration.Timeout : timeout;
+ UserAgent = userAgent ?? AfterShipConfiguration.UserAgent;
+ Proxy = proxy ?? AfterShipConfiguration.Proxy;
+ ApiKey = apiKey ?? AfterShipConfiguration.ApiKey;
+ ApiSecret = apiSecret ?? AfterShipConfiguration.ApiSecret;
+ AuthenticationType = authenticationType ?? AfterShipConfiguration.AuthenticationType;
+
+ CheckConfig();
+
+ Authenticator authenticator = new Authenticator(ApiKey, ApiSecret, AuthenticationType);
+
+ HttpClient = httpClient ?? new SystemNetHttpClient(this.ApiBase, authenticator, this.MaxRetry, this.Timeout, this.UserAgent, this.Proxy);
+
+ Tracking = new TrackingService(HttpClient);
+ Courier = new CourierService(HttpClient);
+ EstimatedDeliveryDate = new EstimatedDeliveryDateService(HttpClient);
+ }
+
+ private void CheckConfig()
+ {
+ if (string.IsNullOrEmpty(ApiKey))
+ {
+ throw ErrorCode.GenSDKError(ErrorCode.INVALID_API_KEY, "apiKey cannot be empty");
+ }
+
+ if (this.Timeout < 0 || this.Timeout > 30000)
+ {
+ throw ErrorCode.GenSDKError(ErrorCode.INVALID_OPTION, "timeout invalid, timeout must between 0 and 30000 (milliseconds)");
+ }
+
+ if (this.MaxRetry < 0 || this.MaxRetry > 10)
+ {
+ throw ErrorCode.GenSDKError(ErrorCode.INVALID_OPTION, "max retry invalid, max retry must between 0 and 10");
+ }
+
+ string[] array = {
+ AfterShipConfiguration.AUTHENTICATION_TYPE_API_KEY,
+ AfterShipConfiguration.AUTHENTICATION_TYPE_AES,
+ AfterShipConfiguration.AUTHENTICATION_TYPE_RSA,
+ };
+ var authenticationType = AuthenticationType;
+ if (!array.Contains(authenticationType))
+ {
+ throw ErrorCode.GenSDKError(ErrorCode.INVALID_OPTION, "Invalid option: authenticationType should be one of API_KEY, AES, RSA");
+ }
+
+ if (authenticationType == AfterShipConfiguration.AUTHENTICATION_TYPE_AES || authenticationType == AfterShipConfiguration.AUTHENTICATION_TYPE_AES)
+ {
+ if (string.IsNullOrEmpty(ApiSecret))
+ {
+ throw ErrorCode.GenSDKError(ErrorCode.INVALID_API_KEY, "Invalid option: apiSecret cannot be empty");
+ }
+ }
+ }
+ }
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/Exception/AfterShipError.cs b/src/AfterShipTracking/AfterShipTracking/Exception/AfterShipError.cs
new file mode 100644
index 0000000..758ff35
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Exception/AfterShipError.cs
@@ -0,0 +1,54 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System;
+
+namespace AfterShipTracking
+{
+ public class AfterShipError : Exception
+ {
+ protected string errorCode;
+ protected int? metaCode;
+ protected int? statusCode;
+ protected string message;
+ protected object responseBody;
+ protected object responseHeader;
+
+ public AfterShipError(string message, string errorCode, int? statusCode, int? metaCode, object responseBody = null, object responseHeader = null)
+ : base(message)
+ {
+ this.metaCode = metaCode;
+ this.message = message;
+ this.errorCode = errorCode;
+ this.statusCode = statusCode;
+ this.responseBody = responseBody;
+ this.responseHeader = responseHeader;
+ }
+
+ public string ErrorCode
+ {
+ get { return errorCode; }
+ }
+
+ public int? MetaCode
+ {
+ get { return metaCode; }
+ }
+
+ public int? StatusCode
+ {
+ get { return statusCode; }
+ }
+
+ public object ResponseBody
+ {
+ get { return responseBody; }
+ }
+
+ public object ResponseHeader
+ {
+ get { return responseHeader; }
+ }
+ }
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/Exception/ErrorCode.cs b/src/AfterShipTracking/AfterShipTracking/Exception/ErrorCode.cs
new file mode 100644
index 0000000..77e798e
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Exception/ErrorCode.cs
@@ -0,0 +1,131 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System.Collections.Generic;
+
+namespace AfterShipTracking
+{
+ public class ErrorCode
+ {
+ public const string REQUEST_ERROR = "REQUEST_ERROR";
+
+ // Common AfterShipError
+ public const string INVALID_API_KEY = "INVALID_API_KEY";
+ public const string INVALID_OPTION = "INVALID_OPTION";
+ public const string RATE_LIMIT_EXCEEDED = "RATE_LIMIT_EXCEEDED";
+ public const string TIMED_OUT = "TIMED_OUT";
+
+ // API error
+ public const string INVALID_REQUEST = "INVALID_REQUEST";
+ public const string INVALID_JSON = "INVALID_JSON";
+ public const string TRACKING_ALREADY_EXIST = "TRACKING_ALREADY_EXIST";
+ public const string TRACKING_DOES_NOT_EXIST = "TRACKING_DOES_NOT_EXIST";
+ public const string TRACKING_NUMBER_INVALID = "TRACKING_NUMBER_INVALID";
+ public const string TRACKING_REQUIRED = "TRACKING_REQUIRED";
+ public const string TRACKING_NUMBER_REQUIRED = "TRACKING_NUMBER_REQUIRED";
+ public const string VALUE_INVALID = "VALUE_INVALID";
+ public const string VALUE_REQUIRED = "VALUE_REQUIRED";
+ public const string SLUG_INVALID = "SLUG_INVALID";
+ public const string MISSING_OR_INVALID_REQUIRED_FIELD = "MISSING_OR_INVALID_REQUIRED_FIELD";
+ public const string BAD_COURIER = "BAD_COURIER";
+ public const string INACTIVE_RETRACK_NOT_ALLOWED = "INACTIVE_RETRACK_NOT_ALLOWED";
+ public const string NOTIFICATION_REUQIRED = "NOTIFICATION_REUQIRED";
+ public const string ID_INVALID = "ID_INVALID";
+ public const string RETRACK_ONCE_ALLOWED = "RETRACK_ONCE_ALLOWED";
+ public const string TRACKING_NUMBER_FORMAT_INVALID = "TRACKING_NUMBER_FORMAT_INVALID";
+ public const string API_KEY_INVALID = "API_KEY_INVALID";
+ public const string REQUEST_NOT_ALLOWED = "REQUEST_NOT_ALLOWED";
+ public const string NOT_FOUND = "NOT_FOUND";
+ public const string TOO_MANY_REQUEST = "TOO_MANY_REQUEST";
+ public const string INTERNAL_ERROR = "INTERNAL_ERROR";
+
+ private static Dictionary errorMap = new Dictionary
+ {
+ { 400, INVALID_REQUEST },
+ { 4001, INVALID_JSON },
+ { 4003, TRACKING_ALREADY_EXIST },
+ { 4004, TRACKING_DOES_NOT_EXIST },
+ { 4005, TRACKING_NUMBER_INVALID },
+ { 4006, TRACKING_REQUIRED },
+ { 4007, TRACKING_NUMBER_REQUIRED },
+ { 4008, VALUE_INVALID },
+ { 4009, VALUE_REQUIRED },
+ { 4010, SLUG_INVALID },
+ { 4011, MISSING_OR_INVALID_REQUIRED_FIELD },
+ { 4012, BAD_COURIER },
+ { 4013, INACTIVE_RETRACK_NOT_ALLOWED },
+ { 4014, NOTIFICATION_REUQIRED },
+ { 4015, ID_INVALID },
+ { 4016, RETRACK_ONCE_ALLOWED },
+ { 4017, TRACKING_NUMBER_FORMAT_INVALID },
+ { 401, API_KEY_INVALID },
+ { 403, REQUEST_NOT_ALLOWED },
+ { 404, NOT_FOUND },
+ { 429, TOO_MANY_REQUEST },
+ { 500, INTERNAL_ERROR },
+ { 502, INTERNAL_ERROR },
+ { 503, INTERNAL_ERROR },
+ { 504, INTERNAL_ERROR },
+ };
+
+ private static Dictionary errorMessageMap = new Dictionary
+ {
+ { INVALID_API_KEY, "Invalid API key" },
+ { INVALID_OPTION, "Invalid option" },
+ { RATE_LIMIT_EXCEEDED, "You have exceeded the API call rate limit. The default limit is 10 requests per second." },
+ { TIMED_OUT, "Request timed out" },
+ { INVALID_REQUEST, "The request was invalid or cannot be otherwise served."},
+ { INVALID_JSON, "Invalid JSON data."},
+ { TRACKING_ALREADY_EXIST, "Tracking already exists."},
+ { TRACKING_DOES_NOT_EXIST, "Tracking does not exist."},
+ { TRACKING_NUMBER_INVALID, "The value of tracking_number is invalid."},
+ { TRACKING_REQUIRED, "tracking object is required."},
+ { TRACKING_NUMBER_REQUIRED, "tracking_number is required."},
+ { VALUE_INVALID, "The value of [field_name] is invalid."},
+ { VALUE_REQUIRED, "[field_name] is required."},
+ { SLUG_INVALID, "The value of slug is invalid."},
+ { MISSING_OR_INVALID_REQUIRED_FIELD, "Missing or invalid value of the required fields for this courier. Besides tracking_number, also required: [field_name]"},
+ { BAD_COURIER, "The error message will be one of the following:1. Unable to import shipment as the carrier is not on your approved list for carrier auto-detection. Add the carrier here: https://admin.aftership.com/settings/couriers2. Unable to import shipment as we don’t recognize the carrier from this tracking number.3. Unable to import shipment as the tracking number has an invalid format.4. Unable to import shipment as this carrier is no longer supported.5. Unable to import shipment as the tracking number does not belong to a carrier in that group."},
+ { INACTIVE_RETRACK_NOT_ALLOWED, "Retrack is not allowed. You can only retrack an inactive tracking."},
+ { NOTIFICATION_REUQIRED, "notification object is required."},
+ { ID_INVALID, "The value of id is invalid."},
+ { RETRACK_ONCE_ALLOWED, "Retrack is not allowed. You can only retrack each shipment once."},
+ { TRACKING_NUMBER_FORMAT_INVALID, "The format of tracking_number is invalid."},
+ { API_KEY_INVALID, "The API Key is invalid."},
+ { REQUEST_NOT_ALLOWED, "The request is understood, but it has been refused or access is not allowed."},
+ { NOT_FOUND, "The URI requested is invalid or the resource requested does not exist."},
+ { TOO_MANY_REQUEST, "You have exceeded the API call rate limit. The default limit is 10 requests per second."},
+ { INTERNAL_ERROR, "Something went wrong on AfterShip's end."},
+ };
+
+ public static AfterShipError GenAPIError(int statusCode, int metaCode, string responseBody = null, string message = null, object responseHeader = null)
+ {
+ string errorCode = LocateErrorCode(metaCode);
+ return GenError(errorCode, statusCode, metaCode, responseBody, message, responseHeader);
+ }
+
+ public static AfterShipError GenSDKError(string errorCode, string message = null)
+ {
+ return GenError(errorCode, null, null, null, message);
+ }
+
+ public static AfterShipError GenError(string errorCode, int? statusCode, int? metaCode, string responseBody = null, string message = null, object responseHeader = null)
+ {
+ if (string.IsNullOrEmpty(message))
+ {
+ message = errorMessageMap.GetValueOrDefault(errorCode) ?? "Unknown error";
+ }
+ return new AfterShipError(message, errorCode, statusCode, metaCode, responseBody, responseHeader);
+ }
+
+ private static string LocateErrorCode(int metaCode)
+ {
+ if (errorMap.ContainsKey(metaCode))
+ {
+ return errorMap[metaCode];
+ }
+ return INVALID_REQUEST;
+ }
+ }
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/Models/AdditionalFieldsV1.cs b/src/AfterShipTracking/AfterShipTracking/Models/AdditionalFieldsV1.cs
new file mode 100644
index 0000000..4c9ba59
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Models/AdditionalFieldsV1.cs
@@ -0,0 +1,32 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Converters;
+
+namespace AfterShipTracking
+{
+ ///
+ /// All available additional fields
+ ///
+ [JsonConverter(typeof(StringEnumConverter))]
+ public enum AdditionalFieldsV1
+ {
+ [EnumMember(Value = "tracking_account_number")]
+ TrackingAccountNumber,
+ [EnumMember(Value = "tracking_postal_code")]
+ TrackingPostalCode,
+ [EnumMember(Value = "tracking_ship_date")]
+ TrackingShipDate,
+ [EnumMember(Value = "tracking_key")]
+ TrackingKey,
+ [EnumMember(Value = "tracking_origin_country_region")]
+ TrackingOriginCountryRegion,
+ [EnumMember(Value = "tracking_destination_country_region")]
+ TrackingDestinationCountryRegion,
+ [EnumMember(Value = "tracking_state")]
+ TrackingState,
+ }
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/Models/Checkpoint.cs b/src/AfterShipTracking/AfterShipTracking/Models/Checkpoint.cs
new file mode 100644
index 0000000..9c139c7
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Models/Checkpoint.cs
@@ -0,0 +1,161 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System;
+using System.Collections.Generic;
+using Newtonsoft.Json;
+
+namespace AfterShipTracking
+{
+ ///
+ /// Object describes checkpoint information.
+ ///
+ public class Checkpoint
+ {
+ ///
+ /// CreatedAt The date and time of the checkpoint event was added to AfterShip. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0.
+ ///
+ [JsonProperty("created_at", NullValueHandling = NullValueHandling.Ignore)]
+ public string? CreatedAt { get; set; }
+ ///
+ /// Slug The unique code of courier for this checkpoint. Get courier slug
+ ///
+ [JsonProperty("slug", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Slug { get; set; }
+ ///
+ /// CheckpointTime The date and time of the checkpoint event, provided by the carrier. It uses the timezone of the checkpoint. The format may differ depending on how the carrier provides it:- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("checkpoint_time", NullValueHandling = NullValueHandling.Ignore)]
+ public string? CheckpointTime { get; set; }
+ ///
+ /// Location Location info provided by carrier
+ ///
+ [JsonProperty("location", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Location { get; set; }
+ ///
+ /// City City info provided by carrier
+ ///
+ [JsonProperty("city", NullValueHandling = NullValueHandling.Ignore)]
+ public string? City { get; set; }
+ ///
+ /// State State info provided by carrier
+ ///
+ [JsonProperty("state", NullValueHandling = NullValueHandling.Ignore)]
+ public string? State { get; set; }
+ ///
+ /// Zip Postal code info provided by carrier
+ ///
+ [JsonProperty("zip", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Zip { get; set; }
+ ///
+ /// Coordinate The latitude and longitude coordinates indicate the precise location of the shipments that are currently in transit.
+ ///
+ [JsonProperty("coordinate", NullValueHandling = NullValueHandling.Ignore)]
+ public CoordinateCheckpoint? Coordinate { get; set; }
+ ///
+ /// CountryRegion Country/Region ISO Alpha-3 (three letters) of the checkpoint
+ ///
+ [JsonProperty("country_region", NullValueHandling = NullValueHandling.Ignore)]
+ public string? CountryRegion { get; set; }
+ ///
+ /// CountryRegionName Country/Region name of the checkpoint, may also contain other location info.
+ ///
+ [JsonProperty("country_region_name", NullValueHandling = NullValueHandling.Ignore)]
+ public string? CountryRegionName { get; set; }
+ ///
+ /// Message Checkpoint message
+ ///
+ [JsonProperty("message", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Message { get; set; }
+ ///
+ /// Tag Current status of tracking. (
+ ///
+ [JsonProperty("tag", NullValueHandling = NullValueHandling.Ignore)]
+ public TagV1? Tag { get; set; }
+ ///
+ /// Subtag Current subtag of checkpoint. (
+ ///
+ [JsonProperty("subtag", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Subtag { get; set; }
+ ///
+ /// SubtagMessage Normalized checkpoint message. (
+ ///
+ [JsonProperty("subtag_message", NullValueHandling = NullValueHandling.Ignore)]
+ public string? SubtagMessage { get; set; }
+ ///
+ /// RawTag Checkpoint raw status provided by courier
+ ///
+ [JsonProperty("raw_tag", NullValueHandling = NullValueHandling.Ignore)]
+ public string? RawTag { get; set; }
+ ///
+ /// Events The array provides details about specific event(s) that occurred to a shipment, such as "returned_to_sender". You can find the full list of events and reasons - The events' value for the same checkpoint message is subject to change as we consistently strive to enhance the performance of this feature.
+ ///
+ [JsonProperty("events", NullValueHandling = NullValueHandling.Ignore)]
+ public EventsCheckpoint?[] Events { get; set; }
+ ///
+ /// Source The source of the checkpoint, which can either be from the carrier or when the user marks the tracking as completed.
+ ///
+ [JsonProperty("source", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Source { get; set; }
+ public Checkpoint()
+ {
+ }
+ }
+
+ ///
+ ///
+ ///
+ public class CoordinateCheckpoint
+ {
+ ///
+ /// Latitude Represents the latitude.
+ ///
+ [JsonProperty("latitude", NullValueHandling = NullValueHandling.Ignore)]
+ public double? Latitude { get; set; }
+ ///
+ /// Longitude Represents the longitude.
+ ///
+ [JsonProperty("longitude", NullValueHandling = NullValueHandling.Ignore)]
+ public double? Longitude { get; set; }
+
+ public CoordinateCheckpoint()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class ReasonEventsCheckpoint
+ {
+ ///
+ /// Code The code of the reason.
+ ///
+ [JsonProperty("code", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Code { get; set; }
+
+ public ReasonEventsCheckpoint()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class EventsCheckpoint
+ {
+ ///
+ /// Code Represents the event code.
+ ///
+ [JsonProperty("code", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Code { get; set; }
+ ///
+ /// Reason Describes the specific reason that led to the event.
+ ///
+ [JsonProperty("reason", NullValueHandling = NullValueHandling.Ignore)]
+ public ReasonEventsCheckpoint? Reason { get; set; }
+
+ public EventsCheckpoint()
+ {
+ }
+ }
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/Models/Courier.cs b/src/AfterShipTracking/AfterShipTracking/Models/Courier.cs
new file mode 100644
index 0000000..ae70514
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Models/Courier.cs
@@ -0,0 +1,71 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System;
+using System.Collections.Generic;
+using Newtonsoft.Json;
+
+namespace AfterShipTracking
+{
+ ///
+ /// Courier object
+ ///
+ public class Courier
+ {
+ ///
+ /// Slug Unique code of courier. Get the slugs from .
+ ///
+ [JsonProperty("slug", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Slug { get; set; }
+ ///
+ /// Name Name of courier
+ ///
+ [JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Name { get; set; }
+ ///
+ /// Phone Contact phone number of courier
+ ///
+ [JsonProperty("phone", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Phone { get; set; }
+ ///
+ /// OtherName Other name of courier
+ ///
+ [JsonProperty("other_name", NullValueHandling = NullValueHandling.Ignore)]
+ public string? OtherName { get; set; }
+ ///
+ /// WebUrl Website link of courier
+ ///
+ [JsonProperty("web_url", NullValueHandling = NullValueHandling.Ignore)]
+ public string? WebUrl { get; set; }
+ ///
+ /// RequiredFields The extra fields need for tracking, such as `tracking_account_number`, `tracking_postal_code`, `tracking_ship_date`, `tracking_key`, `tracking_destination_country_region`
+ ///
+ [JsonProperty("required_fields", NullValueHandling = NullValueHandling.Ignore)]
+ public string?[] RequiredFields { get; set; }
+ ///
+ /// OptionalFields The extra fields which are optional for tracking. Basically it's the same as required_fields, but the difference is that only some of the tracking numbers require these fields.
+ ///
+ [JsonProperty("optional_fields", NullValueHandling = NullValueHandling.Ignore)]
+ public string?[] OptionalFields { get; set; }
+ ///
+ /// DefaultLanguage Default language of tracking results
+ ///
+ [JsonProperty("default_language", NullValueHandling = NullValueHandling.Ignore)]
+ public string? DefaultLanguage { get; set; }
+ ///
+ /// SupportLanguages Other supported languages
+ ///
+ [JsonProperty("support_languages", NullValueHandling = NullValueHandling.Ignore)]
+ public string?[] SupportLanguages { get; set; }
+ ///
+ /// ServiceFromCountryRegions Country/Region code (ISO Alpha-3) where the courier provides service
+ ///
+ [JsonProperty("service_from_country_regions", NullValueHandling = NullValueHandling.Ignore)]
+ public string?[] ServiceFromCountryRegions { get; set; }
+ public Courier()
+ {
+ }
+ }
+
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/Models/CourierResponseV1.cs b/src/AfterShipTracking/AfterShipTracking/Models/CourierResponseV1.cs
new file mode 100644
index 0000000..a8def8c
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Models/CourierResponseV1.cs
@@ -0,0 +1,51 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System;
+using System.Collections.Generic;
+using Newtonsoft.Json;
+
+namespace AfterShipTracking
+{
+ ///
+ /// Model of all couriers endpoint response
+ ///
+ public class CourierResponseV1
+ {
+ ///
+ /// Meta Meta data
+ ///
+ [JsonProperty("meta")]
+ public MetaV1 Meta { get; set; }
+ ///
+ /// Data
+ ///
+ [JsonProperty("data")]
+ public DataCourierResponseV1 Data { get; set; }
+ public CourierResponseV1()
+ {
+ }
+ }
+
+ ///
+ ///
+ ///
+ public class DataCourierResponseV1
+ {
+ ///
+ /// Total Total count of courier objects
+ ///
+ [JsonProperty("total", NullValueHandling = NullValueHandling.Ignore)]
+ public int? Total { get; set; }
+ ///
+ /// Couriers Array of object.
+ ///
+ [JsonProperty("couriers", NullValueHandling = NullValueHandling.Ignore)]
+ public Courier?[] Couriers { get; set; }
+
+ public DataCourierResponseV1()
+ {
+ }
+ }
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/Models/CreateTrackingRequest.cs b/src/AfterShipTracking/AfterShipTracking/Models/CreateTrackingRequest.cs
new file mode 100644
index 0000000..abba1a9
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Models/CreateTrackingRequest.cs
@@ -0,0 +1,271 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System;
+using System.Collections.Generic;
+using Newtonsoft.Json;
+
+namespace AfterShipTracking
+{
+ ///
+ ///
+ ///
+ public class CreateTrackingRequest
+ {
+ ///
+ /// TrackingNumber Tracking number of a shipment.Duplicated tracking numbers, tracking numbers with invalid tracking number format will not be accepted.We only accept tracking numbers with length from 4 to 100We currently support the following characters in a tracking number:- A - Z- 0 - 9- `-` (Hyphen)- . (Period)- _ (Underscore)- / (Slash)
+ ///
+ [JsonProperty("tracking_number")]
+ public string TrackingNumber { get; set; }
+ ///
+ /// Slug Unique courier code. Get courier codes .
+ ///
+ [JsonProperty("slug", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Slug { get; set; }
+ ///
+ /// Title By default this field shows the `tracking_number`, but you can customize it as you wish with any info (e.g. the order number).
+ ///
+ [JsonProperty("title", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Title { get; set; }
+ ///
+ /// OrderId A globally-unique identifier for the order.
+ ///
+ [JsonProperty("order_id", NullValueHandling = NullValueHandling.Ignore)]
+ public string? OrderId { get; set; }
+ ///
+ /// OrderIdPath The URL for the order in your system or store.
+ ///
+ [JsonProperty("order_id_path", NullValueHandling = NullValueHandling.Ignore)]
+ public string? OrderIdPath { get; set; }
+ ///
+ /// CustomFields Custom fields that accept an object with string field. In order to protect the privacy of your customers, do not include any
+ ///
+ [JsonProperty("custom_fields", NullValueHandling = NullValueHandling.Ignore)]
+ public Dictionary? CustomFields { get; set; }
+ ///
+ /// Language The recipient’s language. If you set up AfterShip notifications in different languages, we use this to send the recipient tracking updates in their preferred language. Use an to specify the language.
+ ///
+ [JsonProperty("language", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Language { get; set; }
+ ///
+ /// OrderPromisedDeliveryDate The promised delivery date of the order. It uses the formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("order_promised_delivery_date", NullValueHandling = NullValueHandling.Ignore)]
+ public string? OrderPromisedDeliveryDate { get; set; }
+ ///
+ /// DeliveryType Shipment delivery type- pickup_at_store- pickup_at_courier- door_to_door
+ ///
+ [JsonProperty("delivery_type", NullValueHandling = NullValueHandling.Ignore)]
+ public string? DeliveryType { get; set; }
+ ///
+ /// PickupLocation Shipment pickup location for receiver
+ ///
+ [JsonProperty("pickup_location", NullValueHandling = NullValueHandling.Ignore)]
+ public string? PickupLocation { get; set; }
+ ///
+ /// PickupNote Shipment pickup note for receiver
+ ///
+ [JsonProperty("pickup_note", NullValueHandling = NullValueHandling.Ignore)]
+ public string? PickupNote { get; set; }
+ ///
+ /// TrackingAccountNumber Additional field required by some carriers to retrieve the tracking info. The shipper’s carrier account number. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_account_number", NullValueHandling = NullValueHandling.Ignore)]
+ public string? TrackingAccountNumber { get; set; }
+ ///
+ /// TrackingKey Additional field required by some carriers to retrieve the tracking info. A type of tracking credential required by some carriers. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_key", NullValueHandling = NullValueHandling.Ignore)]
+ public string? TrackingKey { get; set; }
+ ///
+ /// TrackingShipDate The date and time when the shipment is shipped by the merchant and ready for pickup by the carrier. The field supports the following formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZThe field serves two key purposes:- Calculate processing time metrics in the Order-to-delivery Analytics dashboard. To ensure accurate analytics, it's recommended to include timezone information when configuring this value- Required by certain carriers to retrieve tracking information as an additional tracking field.
+ ///
+ [JsonProperty("tracking_ship_date", NullValueHandling = NullValueHandling.Ignore)]
+ public string? TrackingShipDate { get; set; }
+ ///
+ /// OriginCountryRegion The for more details.
+ ///
+ [JsonProperty("origin_country_region", NullValueHandling = NullValueHandling.Ignore)]
+ public string? OriginCountryRegion { get; set; }
+ ///
+ /// OriginState The state of the sender’s address. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc.
+ ///
+ [JsonProperty("origin_state", NullValueHandling = NullValueHandling.Ignore)]
+ public string? OriginState { get; set; }
+ ///
+ /// OriginCity The city of the sender’s address. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc.
+ ///
+ [JsonProperty("origin_city", NullValueHandling = NullValueHandling.Ignore)]
+ public string? OriginCity { get; set; }
+ ///
+ /// OriginPostalCode The postal of the sender’s address. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc.
+ ///
+ [JsonProperty("origin_postal_code", NullValueHandling = NullValueHandling.Ignore)]
+ public string? OriginPostalCode { get; set; }
+ ///
+ /// OriginRawLocation The sender address that the shipment is shipping from. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc.
+ ///
+ [JsonProperty("origin_raw_location", NullValueHandling = NullValueHandling.Ignore)]
+ public string? OriginRawLocation { get; set; }
+ ///
+ /// DestinationCountryRegion The for more details.
+ ///
+ [JsonProperty("destination_country_region", NullValueHandling = NullValueHandling.Ignore)]
+ public string? DestinationCountryRegion { get; set; }
+ ///
+ /// DestinationState The state of the recipient’s address. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc. Also the additional field required by some carriers to retrieve the tracking info. The state/province of the recipient’s address. Refer to our article on for more details.
+ ///
+ [JsonProperty("destination_state", NullValueHandling = NullValueHandling.Ignore)]
+ public string? DestinationState { get; set; }
+ ///
+ /// DestinationCity The city of the recipient’s address. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc.
+ ///
+ [JsonProperty("destination_city", NullValueHandling = NullValueHandling.Ignore)]
+ public string? DestinationCity { get; set; }
+ ///
+ /// DestinationPostalCode The postal of the recipient’s address. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc. Also the additional field required by some carriers to retrieve the tracking info. The postal code of the recipient’s address. Refer to our article on for more details.
+ ///
+ [JsonProperty("destination_postal_code", NullValueHandling = NullValueHandling.Ignore)]
+ public string? DestinationPostalCode { get; set; }
+ ///
+ /// DestinationRawLocation The shipping address that the shipment is shipping to. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc.
+ ///
+ [JsonProperty("destination_raw_location", NullValueHandling = NullValueHandling.Ignore)]
+ public string? DestinationRawLocation { get; set; }
+ ///
+ /// Note Text field for the note
+ ///
+ [JsonProperty("note", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Note { get; set; }
+ ///
+ /// SlugGroup Slug group is a group of slugs which belong to same courier. For example, when you inpit "fedex-group" as slug_group, AfterShip will detect the tracking with "fedex-uk", "fedex-fims", and other slugs which belong to "fedex". It cannot be used with slug at the same time. (
+ ///
+ [JsonProperty("slug_group", NullValueHandling = NullValueHandling.Ignore)]
+ public SlugGroupV1? SlugGroup { get; set; }
+ ///
+ /// OrderDate Order date in YYYY-MM-DDTHH:mm:ssZ format. e.g. 2021-07-26T11:23:51-05:00
+ ///
+ [JsonProperty("order_date", NullValueHandling = NullValueHandling.Ignore)]
+ public string? OrderDate { get; set; }
+ ///
+ /// OrderNumber A unique, human-readable identifier for the order.
+ ///
+ [JsonProperty("order_number", NullValueHandling = NullValueHandling.Ignore)]
+ public string? OrderNumber { get; set; }
+ ///
+ /// ShipmentType The carrier service type for the shipment. If you provide info for this field, AfterShip will not update it with info from the carrier.
+ ///
+ [JsonProperty("shipment_type", NullValueHandling = NullValueHandling.Ignore)]
+ public string? ShipmentType { get; set; }
+ ///
+ /// ShipmentTags Used to add tags to your shipments to help categorize and filter them easily.
+ ///
+ [JsonProperty("shipment_tags", NullValueHandling = NullValueHandling.Ignore)]
+ public string?[] ShipmentTags { get; set; }
+ ///
+ /// CourierConnectionId If you’ve connected multiple accounts for a single carrier on AfterShip, you can now use the courier_connection_id field to tell AfterShip which carrier account you’ve used to handle a shipment so we can track it. (
+ ///
+ [JsonProperty("courier_connection_id", NullValueHandling = NullValueHandling.Ignore)]
+ public string? CourierConnectionId { get; set; }
+ ///
+ /// TrackingOriginCountryRegion (Legacy) Replaced by `origin_country_region`. Additional field required by some carriers to retrieve the tracking info. The origin country/region of the shipment. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_origin_country_region", NullValueHandling = NullValueHandling.Ignore)]
+ public string? TrackingOriginCountryRegion { get; set; }
+ ///
+ /// TrackingDestinationCountryRegion (Legacy) Replaced by `destination_country_region`. Additional field required by some carriers to retrieve the tracking info. The destination country/region of the shipment. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_destination_country_region", NullValueHandling = NullValueHandling.Ignore)]
+ public string? TrackingDestinationCountryRegion { get; set; }
+ ///
+ /// TrackingPostalCode (Legacy) Replaced by `destination_postal_code`. Additional field required by some carriers to retrieve the tracking info. The postal code of the recipient’s address. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_postal_code", NullValueHandling = NullValueHandling.Ignore)]
+ public string? TrackingPostalCode { get; set; }
+ ///
+ /// TrackingState (Legacy) Replaced by `destination_state`. Additional field required by some carriers to retrieve the tracking info. The state/province of the recipient’s address. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_state", NullValueHandling = NullValueHandling.Ignore)]
+ public string? TrackingState { get; set; }
+ ///
+ /// LocationId The location_id refers to the place where you fulfilled the items. - If you provide a location_id, the system will automatically use it as the tracking's origin address. However, passing both location_id and any origin address information simultaneously is not allowed.- Please make sure you add your locations .
+ ///
+ [JsonProperty("location_id", NullValueHandling = NullValueHandling.Ignore)]
+ public string? LocationId { get; set; }
+ ///
+ /// ShippingMethod The shipping_method string refers to the chosen method for delivering the package. Merchants typically offer various shipping methods to consumers during the checkout process, such as, Local Delivery, Free Express Worldwide Shipping, etc
+ ///
+ [JsonProperty("shipping_method", NullValueHandling = NullValueHandling.Ignore)]
+ public string? ShippingMethod { get; set; }
+ ///
+ /// LastMile This field contains information about the last leg of the shipment, starting from the carrier who hands it over to the last-mile carrier, all the way to delivery. Once AfterShip detects that the shipment involves multiple legs and identifies the last-mile carrier, we will populate the last-mile carrier information in this object. Alternatively, the user can provide this information in this field to specify the last-mile carrier, which is helpful if AfterShip is unable to detect it automatically.
+ ///
+ [JsonProperty("last_mile", NullValueHandling = NullValueHandling.Ignore)]
+ public LastMileCreateTrackingRequest? LastMile { get; set; }
+ ///
+ /// Customers The field contains the customer information associated with the tracking. A maximum of three customer objects are allowed.
+ ///
+ [JsonProperty("customers", NullValueHandling = NullValueHandling.Ignore)]
+ public CustomersCreateTrackingRequest?[] Customers { get; set; }
+ public CreateTrackingRequest()
+ {
+ }
+ }
+
+ ///
+ ///
+ ///
+ public class LastMileCreateTrackingRequest
+ {
+ ///
+ /// TrackingNumber The tracking number of the last-mile carrier.
+ ///
+ [JsonProperty("tracking_number")]
+ public string TrackingNumber { get; set; }
+ ///
+ /// Slug The unique code of the carrier responsible for the last-mile of the shipment. Find all the courier slugs .
+ ///
+ [JsonProperty("slug", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Slug { get; set; }
+
+ public LastMileCreateTrackingRequest()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class CustomersCreateTrackingRequest
+ {
+ ///
+ /// Role The role of the customer, indicating whether the customer is an individual or a company.
+ ///
+ [JsonProperty("role", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Role { get; set; }
+ ///
+ /// Name Customer name associated with the tracking.
+ ///
+ [JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Name { get; set; }
+ ///
+ /// PhoneNumber The phone number(s) to receive SMS notifications. Phone numbers should begin with a `+` sign and include the area code.
+ ///
+ [JsonProperty("phone_number", NullValueHandling = NullValueHandling.Ignore)]
+ public string? PhoneNumber { get; set; }
+ ///
+ /// Email Email address(es) to receive email notifications.
+ ///
+ [JsonProperty("email", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Email { get; set; }
+ ///
+ /// Language The preferred language of the customer. If you have set up AfterShip notifications in different languages, we use this to send the tracking updates to the customer in their preferred language.
+ ///
+ [JsonProperty("language", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Language { get; set; }
+
+ public CustomersCreateTrackingRequest()
+ {
+ }
+ }
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/Models/CreateTrackingResponse.cs b/src/AfterShipTracking/AfterShipTracking/Models/CreateTrackingResponse.cs
new file mode 100644
index 0000000..9fcbbf2
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Models/CreateTrackingResponse.cs
@@ -0,0 +1,721 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System;
+using System.Collections.Generic;
+using Newtonsoft.Json;
+
+namespace AfterShipTracking
+{
+ ///
+ /// Object describes the tracking information.
+ ///
+ public class CreateTrackingResponse
+ {
+ ///
+ /// Id Tracking ID.
+ ///
+ [JsonProperty("id")]
+ public string? Id { get; set; }
+ ///
+ /// LegacyId The length of the tracking ID has been increased from 24 characters to 32 characters. We will use the legacy_id field to store the original 24-character tracking ID to maintain compatibility with existing data. Therefore, all tracking endpoints will continue to work with the legacy_id field as before.
+ ///
+ [JsonProperty("legacy_id")]
+ public string? LegacyId { get; set; }
+ ///
+ /// CreatedAt The date and time the shipment was imported or added to AfterShip. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0.
+ ///
+ [JsonProperty("created_at")]
+ public string? CreatedAt { get; set; }
+ ///
+ /// UpdatedAt The date and time the shipment was updated. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0.
+ ///
+ [JsonProperty("updated_at")]
+ public string? UpdatedAt { get; set; }
+ ///
+ /// TrackingNumber Tracking number.
+ ///
+ [JsonProperty("tracking_number")]
+ public string? TrackingNumber { get; set; }
+ ///
+ /// Slug Unique courier code. When importing a shipment with no courier slug and the tracking number can’t be recognized, the courier will be marked as `unrecognized`. Get courier codes .
+ ///
+ [JsonProperty("slug")]
+ public string? Slug { get; set; }
+ ///
+ /// Active Whether or not AfterShip will continue tracking the shipments. Value is `false` when tag (status) is `Delivered`, `Expired`, or further updates for 30 days since last update.
+ ///
+ [JsonProperty("active")]
+ public bool? Active { get; set; }
+ ///
+ /// CustomFields Custom fields that accept an object with string field. In order to protect the privacy of your customers, do not include any in custom fields.
+ ///
+ [JsonProperty("custom_fields")]
+ public Dictionary? CustomFields { get; set; }
+ ///
+ /// TransitTime Total transit time in days.- For delivered shipments: Transit time (in days) = Delivered date - Pick-up date- For undelivered shipments: Transit time (in days) = Current date - Pick-up dateValue as `null` for the shipment without pick-up date.
+ ///
+ [JsonProperty("transit_time")]
+ public int? TransitTime { get; set; }
+ ///
+ /// OriginCountryRegion The for the origin country/region. E.g. USA for the United States.
+ ///
+ [JsonProperty("origin_country_region")]
+ public string? OriginCountryRegion { get; set; }
+ ///
+ /// OriginState The state of the sender’s address.
+ ///
+ [JsonProperty("origin_state")]
+ public string? OriginState { get; set; }
+ ///
+ /// OriginCity The city of the sender’s address.
+ ///
+ [JsonProperty("origin_city")]
+ public string? OriginCity { get; set; }
+ ///
+ /// OriginPostalCode The postal code of the sender’s address.
+ ///
+ [JsonProperty("origin_postal_code")]
+ public string? OriginPostalCode { get; set; }
+ ///
+ /// OriginRawLocation The sender address that the shipment is shipping from.
+ ///
+ [JsonProperty("origin_raw_location")]
+ public string? OriginRawLocation { get; set; }
+ ///
+ /// DestinationCountryRegion The for the destination country/region. E.g. USA for the United States.
+ ///
+ [JsonProperty("destination_country_region")]
+ public string? DestinationCountryRegion { get; set; }
+ ///
+ /// DestinationState The state of the recipient’s address.
+ ///
+ [JsonProperty("destination_state")]
+ public string? DestinationState { get; set; }
+ ///
+ /// DestinationCity The city of the recipient’s address.
+ ///
+ [JsonProperty("destination_city")]
+ public string? DestinationCity { get; set; }
+ ///
+ /// DestinationPostalCode The postal code of the recipient’s address.
+ ///
+ [JsonProperty("destination_postal_code")]
+ public string? DestinationPostalCode { get; set; }
+ ///
+ /// DestinationRawLocation The shipping address that the shipment is shipping to.
+ ///
+ [JsonProperty("destination_raw_location")]
+ public string? DestinationRawLocation { get; set; }
+ ///
+ /// CourierDestinationCountryRegion Destination country/region of the tracking detected from the courier. ISO Alpha-3 (three letters). Value will be `null` if the courier doesn't provide the destination country.
+ ///
+ [JsonProperty("courier_destination_country_region")]
+ public string? CourierDestinationCountryRegion { get; set; }
+ ///
+ /// CourierEstimatedDeliveryDate The field contains the estimated delivery date provided by the carrier.
+ ///
+ [JsonProperty("courier_estimated_delivery_date")]
+ public CourierEstimatedDeliveryDateCreateTrackingResponse? CourierEstimatedDeliveryDate { get; set; }
+ ///
+ /// Note Text field for the note.
+ ///
+ [JsonProperty("note")]
+ public string? Note { get; set; }
+ ///
+ /// OrderId A globally-unique identifier for the order.
+ ///
+ [JsonProperty("order_id")]
+ public string? OrderId { get; set; }
+ ///
+ /// OrderIdPath The URL for the order in your system or store.
+ ///
+ [JsonProperty("order_id_path")]
+ public string? OrderIdPath { get; set; }
+ ///
+ /// OrderDate The date and time the order was created in your system or store. It uses the format: `YYYY-MM-DDTHH:mm:ssZ` based on whichever timezone you provide.
+ ///
+ [JsonProperty("order_date")]
+ public string? OrderDate { get; set; }
+ ///
+ /// ShipmentPackageCount Number of packages under the tracking.
+ ///
+ [JsonProperty("shipment_package_count")]
+ public double? ShipmentPackageCount { get; set; }
+ ///
+ /// ShipmentPickupDate The date and time the shipment was picked up by the carrier. It uses the timezone where the pickup occured. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("shipment_pickup_date")]
+ public string? ShipmentPickupDate { get; set; }
+ ///
+ /// ShipmentDeliveryDate The date and time the shipment was delivered. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("shipment_delivery_date")]
+ public string? ShipmentDeliveryDate { get; set; }
+ ///
+ /// ShipmentType The carrier service type for the shipment.
+ ///
+ [JsonProperty("shipment_type")]
+ public string? ShipmentType { get; set; }
+ ///
+ /// ShipmentWeight The shipment_weight field represents the total weight of the shipment. In scenarios where the carrier does not provide this information, you can provide the weight to AfterShip. We will prioritize the data provided by the carrier, if available. The shipment weight will be included in the Response and accessed through the GET API, Webhook, and CSV export. It will also be displayed on the AfterShip Tracking admin. Additionally, it plays a significant role in error-free shipment handling and carbon emission calculations, ensuring accurate and informed decision-making
+ ///
+ [JsonProperty("shipment_weight")]
+ public ShipmentWeightCreateTrackingResponse? ShipmentWeight { get; set; }
+ ///
+ /// SignedBy Signed by information for delivered shipment.
+ ///
+ [JsonProperty("signed_by")]
+ public string? SignedBy { get; set; }
+ ///
+ /// Source Source of how this tracking is added.
+ ///
+ [JsonProperty("source")]
+ public string? Source { get; set; }
+ ///
+ /// Tag Current status of tracking. (
+ ///
+ [JsonProperty("tag")]
+ public TagV1? Tag { get; set; }
+ ///
+ /// Subtag Current subtag of tracking. (
+ ///
+ [JsonProperty("subtag")]
+ public string? Subtag { get; set; }
+ ///
+ /// SubtagMessage Normalized tracking message. (
+ ///
+ [JsonProperty("subtag_message")]
+ public string? SubtagMessage { get; set; }
+ ///
+ /// Title By default this field shows the `tracking_number`, but you can customize it as you wish with any info (e.g. the order number).
+ ///
+ [JsonProperty("title")]
+ public string? Title { get; set; }
+ ///
+ /// TrackedCount Number of attempts AfterShip tracks at courier's system.
+ ///
+ [JsonProperty("tracked_count")]
+ public double? TrackedCount { get; set; }
+ ///
+ /// LastMileTrackingSupported Indicates if the shipment is trackable till the final destination.Three possible values:- true- false- null
+ ///
+ [JsonProperty("last_mile_tracking_supported")]
+ public bool? LastMileTrackingSupported { get; set; }
+ ///
+ /// Language The recipient’s language. If you set up AfterShip notifications in different languages, we use this to send the recipient tracking updates in their preferred language.
+ ///
+ [JsonProperty("language")]
+ public string? Language { get; set; }
+ ///
+ /// UniqueToken Deprecated
+ ///
+ [JsonProperty("unique_token")]
+ public string? UniqueToken { get; set; }
+ ///
+ /// Checkpoints Array of checkpoint object describes the checkpoint information.
+ ///
+ [JsonProperty("checkpoints")]
+ public Checkpoint?[] Checkpoints { get; set; }
+ ///
+ /// SubscribedSmses Phone number(s) subscribed to receive sms notifications.
+ ///
+ [JsonProperty("subscribed_smses")]
+ public string?[] SubscribedSmses { get; set; }
+ ///
+ /// SubscribedEmails Email address(es) subscribed to receive email notifications.
+ ///
+ [JsonProperty("subscribed_emails")]
+ public string?[] SubscribedEmails { get; set; }
+ ///
+ /// ReturnToSender Whether or not the shipment is returned to sender. Value is `true` when any of its checkpoints has subtag `Exception_010` (returning to sender) or `Exception_011` (returned to sender). Otherwise value is `false`.
+ ///
+ [JsonProperty("return_to_sender")]
+ public bool? ReturnToSender { get; set; }
+ ///
+ /// OrderPromisedDeliveryDate The promised delivery date of the order. It uses the formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("order_promised_delivery_date")]
+ public string? OrderPromisedDeliveryDate { get; set; }
+ ///
+ /// DeliveryType Shipment delivery type- pickup_at_store- pickup_at_courier- door_to_door
+ ///
+ [JsonProperty("delivery_type")]
+ public string? DeliveryType { get; set; }
+ ///
+ /// PickupLocation Shipment pickup location for receiver
+ ///
+ [JsonProperty("pickup_location")]
+ public string? PickupLocation { get; set; }
+ ///
+ /// PickupNote Shipment pickup note for receiver
+ ///
+ [JsonProperty("pickup_note")]
+ public string? PickupNote { get; set; }
+ ///
+ /// CourierTrackingLink Official tracking URL of the courier (if any). The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default.
+ ///
+ [JsonProperty("courier_tracking_link")]
+ public string? CourierTrackingLink { get; set; }
+ ///
+ /// FirstAttemptedAt The date and time of the carrier’s first attempt to deliver the package to the recipient. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("first_attempted_at")]
+ public string? FirstAttemptedAt { get; set; }
+ ///
+ /// CourierRedirectLink Delivery instructions (delivery date or address) can be modified by visiting the link if supported by a carrier. The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default.
+ ///
+ [JsonProperty("courier_redirect_link")]
+ public string? CourierRedirectLink { get; set; }
+ ///
+ /// TrackingAccountNumber Additional field required by some carriers to retrieve the tracking info. The shipper’s carrier account number. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_account_number")]
+ public string? TrackingAccountNumber { get; set; }
+ ///
+ /// TrackingKey Additional field required by some carriers to retrieve the tracking info. A type of tracking credential required by some carriers. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_key")]
+ public string? TrackingKey { get; set; }
+ ///
+ /// TrackingShipDate The date and time when the shipment is shipped by the merchant and ready for pickup by the carrier. The field supports the following formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZThe field serves two key purposes:- Calculate processing time metrics in the Order-to-delivery Analytics dashboard. To ensure accurate analytics, it's recommended to include timezone information when configuring this value- Required by certain carriers to retrieve tracking information as an additional tracking field.
+ ///
+ [JsonProperty("tracking_ship_date")]
+ public string? TrackingShipDate { get; set; }
+ ///
+ /// OnTimeStatus Whether the tracking is delivered on time or not.
+ ///
+ [JsonProperty("on_time_status")]
+ public string? OnTimeStatus { get; set; }
+ ///
+ /// OnTimeDifference The difference days of the on time.
+ ///
+ [JsonProperty("on_time_difference")]
+ public double? OnTimeDifference { get; set; }
+ ///
+ /// OrderTags The tags of the order.
+ ///
+ [JsonProperty("order_tags")]
+ public string?[] OrderTags { get; set; }
+ ///
+ /// AftershipEstimatedDeliveryDate The estimated delivery date of the shipment provided by AfterShip’s AI and shown to the recipients. It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone.
+ ///
+ [JsonProperty("aftership_estimated_delivery_date")]
+ public AftershipEstimatedDeliveryDateCreateTrackingResponse? AftershipEstimatedDeliveryDate { get; set; }
+ ///
+ /// CustomEstimatedDeliveryDate Estimated delivery time of the shipment based on your . It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone.
+ ///
+ [JsonProperty("custom_estimated_delivery_date")]
+ public CustomEstimatedDeliveryDateCreateTrackingResponse? CustomEstimatedDeliveryDate { get; set; }
+ ///
+ /// OrderNumber A unique, human-readable identifier for the order.
+ ///
+ [JsonProperty("order_number")]
+ public string? OrderNumber { get; set; }
+ ///
+ /// FirstEstimatedDelivery The shipment’s original estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone.
+ ///
+ [JsonProperty("first_estimated_delivery")]
+ public FirstEstimatedDeliveryCreateTrackingResponse? FirstEstimatedDelivery { get; set; }
+ ///
+ /// LatestEstimatedDelivery The most recently calculated estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone.
+ ///
+ [JsonProperty("latest_estimated_delivery")]
+ public LatestEstimatedDeliveryCreateTrackingResponse? LatestEstimatedDelivery { get; set; }
+ ///
+ /// ShipmentTags Used to add tags to your shipments to help categorize and filter them easily.
+ ///
+ [JsonProperty("shipment_tags")]
+ public string?[] ShipmentTags { get; set; }
+ ///
+ /// CourierConnectionId If you have multiple accounts connected for a single carrier on AfterShip, we have introduced the courier_connection_id field to allow you to specify the carrier account associated with each shipment. By providing this information, you enable us to accurately track and monitor your shipments based on the correct carrier account.(In the event that you do not specify the courier_connection_id, we will handle your shipment using the connection that was created earliest among your connected accounts.
+ ///
+ [JsonProperty("courier_connection_id")]
+ public string? CourierConnectionId { get; set; }
+ ///
+ /// TrackingOriginCountryRegion (Legacy) Replaced by `origin_country_region`. Additional field required by some carriers to retrieve the tracking info. The origin country/region of the shipment. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_origin_country_region")]
+ public string? TrackingOriginCountryRegion { get; set; }
+ ///
+ /// TrackingDestinationCountryRegion (Legacy) Replaced by `destination_country_region`. Additional field required by some carriers to retrieve the tracking info. The destination country/region of the shipment. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_destination_country_region")]
+ public string? TrackingDestinationCountryRegion { get; set; }
+ ///
+ /// TrackingPostalCode (Legacy) Replaced by `destination_postal_code`. Additional field required by some carriers to retrieve the tracking info. The postal code of the recipient’s address. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_postal_code")]
+ public string? TrackingPostalCode { get; set; }
+ ///
+ /// TrackingState (Legacy) Replaced by `destination_state`. Additional field required by some carriers to retrieve the tracking info. The state/province of the recipient’s address. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_state")]
+ public string? TrackingState { get; set; }
+ ///
+ /// CarbonEmissions The model contains the total amount of carbon emissions generated by the shipment. - AfterShip will provide this data only when it is available, and its availability is contingent upon the location and weight information that AfterShip can obtain.- The values will be accessible solely for shipments that have been successfully delivered. However, in the event of a shipping update after the delivery status has been achieved, the value may change.- It’s a paid service and only for Tracking Enterprise users, please contact your customer success manager if you want to know more.
+ ///
+ [JsonProperty("carbon_emissions")]
+ public CarbonEmissionsCreateTrackingResponse? CarbonEmissions { get; set; }
+ ///
+ /// LocationId The location_id refers to the place where you fulfilled the items. - If you provide a location_id, the system will automatically use it as the tracking's origin address. However, passing both location_id and any origin address information simultaneously is not allowed.- Please make sure you add your locations .
+ ///
+ [JsonProperty("location_id")]
+ public string? LocationId { get; set; }
+ ///
+ /// ShippingMethod The shipping_method string refers to the chosen method for delivering the package. Merchants typically offer various shipping methods to consumers during the checkout process, such as, Local Delivery, Free Express Worldwide Shipping, etc.
+ ///
+ [JsonProperty("shipping_method")]
+ public string? ShippingMethod { get; set; }
+ ///
+ /// FailedDeliveryAttempts By dynamically tracking failed delivery attempts during shipment, this field allows you to pinpoint carriers accountable for the most failures. Analyzing the root cause of these failures enables you to improve carriers' delivery standard operating procedures (SOP), leading to an overall enhancement in delivery service quality.
+ ///
+ [JsonProperty("failed_delivery_attempts")]
+ public int? FailedDeliveryAttempts { get; set; }
+ ///
+ /// SignatureRequirement The signature_requirement field serves the purpose of validating the service option type, specifically proof of delivery. By collecting the recipient's signature upon delivery, it ensures the package reaches the intended recipient and prevents disputes related to non-delivery or lost packages.
+ ///
+ [JsonProperty("signature_requirement")]
+ public string? SignatureRequirement { get; set; }
+ ///
+ /// DeliveryLocationType The delivery location type represents the secure area where the carrier leaves the package, such as a safe place, locker, mailbox, front porch, etc. This information helps ensure the shipment reaches the intended recipient efficiently, minimizing the risk of theft or damage.
+ ///
+ [JsonProperty("delivery_location_type")]
+ public string? DeliveryLocationType { get; set; }
+ ///
+ /// AftershipTrackingUrl The tracking URL directs your customers to the shipment tracking page which can display either the default or a customized page based on segmentation rules.- The universal URL is used by default, but you can opt for a custom domain if you have one. Learn how to set up a custom domain .The field is not automatically enabled in API & Webhook. Please contact support if you’d like to enable it.
+ ///
+ [JsonProperty("aftership_tracking_url")]
+ public string? AftershipTrackingUrl { get; set; }
+ ///
+ /// AftershipTrackingOrderUrl The order URL directs your customers to the order tracking page, which includes all shipments. It can display either the default or a customized page based on segmentation rules.- The universal URL is used by default, but you can opt for a custom domain if you have one. Learn how to set up a custom domain .The field is not automatically enabled in API & Webhook. Please contact support if you’d like to enable it.
+ ///
+ [JsonProperty("aftership_tracking_order_url")]
+ public string? AftershipTrackingOrderUrl { get; set; }
+ ///
+ /// FirstMile The field contains information about the first leg of the shipping starting from the carrier picking up the shipment from the shipper to the point where they hand it over to the last-mile carrier. Once AfterShip detects the shipment is multi-leg, we will populate the first-mile information under this object.
+ ///
+ [JsonProperty("first_mile")]
+ public FirstMileCreateTrackingResponse? FirstMile { get; set; }
+ ///
+ /// LastMile This field contains information about the last leg of the shipment, starting from the carrier who hands it over to the last-mile carrier, all the way to delivery. Once AfterShip detects that the shipment involves multiple legs and identifies the last-mile carrier, we will populate the last-mile carrier information in this object. Alternatively, the user can provide this information in this field to specify the last-mile carrier, which is helpful if AfterShip is unable to detect it automatically.
+ ///
+ [JsonProperty("last_mile")]
+ public LastMileCreateTrackingResponse? LastMile { get; set; }
+ ///
+ /// Customers The field contains the customer information associated with the tracking. A maximum of three customer objects are allowed.
+ ///
+ [JsonProperty("customers")]
+ public CustomersCreateTrackingResponse?[] Customers { get; set; }
+ public CreateTrackingResponse()
+ {
+ }
+ }
+
+ ///
+ ///
+ ///
+ public class CourierEstimatedDeliveryDateCreateTrackingResponse
+ {
+ ///
+ /// EstimatedDeliveryDate The estimated arrival date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("estimated_delivery_date")]
+ public string? EstimatedDeliveryDate { get; set; }
+ ///
+ /// EstimatedDeliveryDateMin The earliest estimated delivery date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("estimated_delivery_date_min")]
+ public string? EstimatedDeliveryDateMin { get; set; }
+ ///
+ /// EstimatedDeliveryDateMax The Latest estimated delivery date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("estimated_delivery_date_max")]
+ public string? EstimatedDeliveryDateMax { get; set; }
+
+ public CourierEstimatedDeliveryDateCreateTrackingResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class ShipmentWeightCreateTrackingResponse
+ {
+ ///
+ /// Unit The unit in which the value field is expressed.
+ ///
+ [JsonProperty("unit")]
+ public string? Unit { get; set; }
+ ///
+ /// Value The total amount of shipment weight.
+ ///
+ [JsonProperty("value")]
+ public double? Value { get; set; }
+
+ public ShipmentWeightCreateTrackingResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class AftershipEstimatedDeliveryDateCreateTrackingResponse
+ {
+ ///
+ /// EstimatedDeliveryDate The estimated arrival date of the shipment.
+ ///
+ [JsonProperty("estimated_delivery_date")]
+ public string? EstimatedDeliveryDate { get; set; }
+ ///
+ /// ConfidenceCode Indicates the confidence level and associated reason for an AI EDD prediction request. For a comprehensive list of confidence codes, refer to .
+ ///
+ [JsonProperty("confidence_code")]
+ public double? ConfidenceCode { get; set; }
+ ///
+ /// EstimatedDeliveryDateMin Earliest estimated delivery date of the shipment.
+ ///
+ [JsonProperty("estimated_delivery_date_min")]
+ public string? EstimatedDeliveryDateMin { get; set; }
+ ///
+ /// EstimatedDeliveryDateMax Latest estimated delivery date of the shipment.
+ ///
+ [JsonProperty("estimated_delivery_date_max")]
+ public string? EstimatedDeliveryDateMax { get; set; }
+
+ public AftershipEstimatedDeliveryDateCreateTrackingResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class CustomEstimatedDeliveryDateCreateTrackingResponse
+ {
+ ///
+ /// Type The format of the EDD. Either a single date or a date range.
+ ///
+ [JsonProperty("type")]
+ public string? Type { get; set; }
+ ///
+ /// Datetime The specific EDD date.
+ ///
+ [JsonProperty("datetime")]
+ public string? Datetime { get; set; }
+ ///
+ /// DatetimeMin For a date range EDD format, the date for the lower end of the range.
+ ///
+ [JsonProperty("datetime_min")]
+ public string? DatetimeMin { get; set; }
+ ///
+ /// DatetimeMax For a date range EDD format, the date for the upper end of the range.
+ ///
+ [JsonProperty("datetime_max")]
+ public string? DatetimeMax { get; set; }
+
+ public CustomEstimatedDeliveryDateCreateTrackingResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class FirstEstimatedDeliveryCreateTrackingResponse
+ {
+ ///
+ /// Type The format of the EDD. Either a single date or a date range.
+ ///
+ [JsonProperty("type")]
+ public string? Type { get; set; }
+ ///
+ /// Source The source of the EDD. Either the carrier, AfterShip AI, or based on your custom EDD settings.
+ ///
+ [JsonProperty("source")]
+ public string? Source { get; set; }
+ ///
+ /// Datetime The latest EDD time.
+ ///
+ [JsonProperty("datetime")]
+ public string? Datetime { get; set; }
+ ///
+ /// DatetimeMin For a date range EDD format, the date and time for the lower end of the range.
+ ///
+ [JsonProperty("datetime_min")]
+ public string? DatetimeMin { get; set; }
+ ///
+ /// DatetimeMax For a date range EDD format, the date and time for the upper end of the range.
+ ///
+ [JsonProperty("datetime_max")]
+ public string? DatetimeMax { get; set; }
+
+ public FirstEstimatedDeliveryCreateTrackingResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class LatestEstimatedDeliveryCreateTrackingResponse
+ {
+ ///
+ /// Type The format of the EDD. Either a single date or a date range.
+ ///
+ [JsonProperty("type")]
+ public string? Type { get; set; }
+ ///
+ /// Source The source of the EDD. Either the carrier, AfterShip AI, or based on your custom EDD settings.
+ ///
+ [JsonProperty("source")]
+ public string? Source { get; set; }
+ ///
+ /// Datetime The latest EDD time.
+ ///
+ [JsonProperty("datetime")]
+ public string? Datetime { get; set; }
+ ///
+ /// DatetimeMin For a date range EDD format, the date and time for the lower end of the range.
+ ///
+ [JsonProperty("datetime_min")]
+ public string? DatetimeMin { get; set; }
+ ///
+ /// DatetimeMax For a date range EDD format, the date and time for the upper end of the range.
+ ///
+ [JsonProperty("datetime_max")]
+ public string? DatetimeMax { get; set; }
+
+ public LatestEstimatedDeliveryCreateTrackingResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class CarbonEmissionsCreateTrackingResponse
+ {
+ ///
+ /// Unit The unit in which the value field is expressed. Allowed values: kg
+ ///
+ [JsonProperty("unit")]
+ public string? Unit { get; set; }
+ ///
+ /// Value The total amount of carbon emissions
+ ///
+ [JsonProperty("value")]
+ public double? Value { get; set; }
+
+ public CarbonEmissionsCreateTrackingResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class FirstMileCreateTrackingResponse
+ {
+ ///
+ /// TrackingNumber The tracking number of the first-mile carrier.
+ ///
+ [JsonProperty("tracking_number")]
+ public string? TrackingNumber { get; set; }
+ ///
+ /// Slug The unique code of the carrier responsible for the first-mile of the shipment. Find all the courier slugs .
+ ///
+ [JsonProperty("slug")]
+ public string? Slug { get; set; }
+ ///
+ /// TransitTime The transit time for the first-mile of a shipment in days. This field is calculated based on whether the handed_over_to_last_mile_carrier or received_by_last_mile_carrier event is detected by AfterShip. The handover event date is used to calculate the first-mile transit time.- First mile transit time (in days) = Handover date - Pickup date
+ ///
+ [JsonProperty("transit_time")]
+ public string? TransitTime { get; set; }
+ ///
+ /// CourierRedirectLink The field provides the link for modifying delivery instructions (such as delivery date and shipping address), if supported by the first-mile carrier. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US".
+ ///
+ [JsonProperty("courier_redirect_link")]
+ public string? CourierRedirectLink { get; set; }
+ ///
+ /// CourierTrackingLink The field contains the official tracking URL of the first-mile carrier, if available. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US".
+ ///
+ [JsonProperty("courier_tracking_link")]
+ public string? CourierTrackingLink { get; set; }
+
+ public FirstMileCreateTrackingResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class LastMileCreateTrackingResponse
+ {
+ ///
+ /// TrackingNumber The tracking number of the last-mile carrier.
+ ///
+ [JsonProperty("tracking_number")]
+ public string? TrackingNumber { get; set; }
+ ///
+ /// Slug The unique code of the carrier responsible for the last-mile of the shipment. Find all the courier slugs .
+ ///
+ [JsonProperty("slug")]
+ public string? Slug { get; set; }
+ ///
+ /// TransitTime The transit time for the last-mile of a shipment in days. This field is calculated based on whether the handed_over_to_last_mile_carrier or the received_by_last_mile_carrier event is detected by AfterShip. The handover event date is used to calculate the last-mile transit time.- Last mile transit time (in days)= Delivered date - Handover date
+ ///
+ [JsonProperty("transit_time")]
+ public string? TransitTime { get; set; }
+ ///
+ /// CourierTrackingLink The field contains the official tracking URL of the last-mile carrier, if available. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US".
+ ///
+ [JsonProperty("courier_tracking_link")]
+ public string? CourierTrackingLink { get; set; }
+ ///
+ /// CourierRedirectLink The field provides the link for modifying delivery instructions (such as delivery date and shipping address), if supported by the last-mile carrier. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US".
+ ///
+ [JsonProperty("courier_redirect_link")]
+ public string? CourierRedirectLink { get; set; }
+ ///
+ /// Source The field indicates the source of last-mile carrier.
+ ///
+ [JsonProperty("source")]
+ public string? Source { get; set; }
+
+ public LastMileCreateTrackingResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class CustomersCreateTrackingResponse
+ {
+ ///
+ /// Role The role of the customer, indicating whether the customer is an individual or a company.
+ ///
+ [JsonProperty("role")]
+ public string? Role { get; set; }
+ ///
+ /// Name Customer name associated with the tracking.
+ ///
+ [JsonProperty("name")]
+ public string? Name { get; set; }
+ ///
+ /// PhoneNumber The phone number(s) to receive SMS notifications. Phone numbers should begin with a `+` sign and include the area code.
+ ///
+ [JsonProperty("phone_number")]
+ public string? PhoneNumber { get; set; }
+ ///
+ /// Email Email address(es) to receive email notifications.
+ ///
+ [JsonProperty("email")]
+ public string? Email { get; set; }
+ ///
+ /// Language The preferred language of the customer. If you have set up AfterShip notifications in different languages, we use this to send the tracking updates to the customer in their preferred language.
+ ///
+ [JsonProperty("language")]
+ public string? Language { get; set; }
+
+ public CustomersCreateTrackingResponse()
+ {
+ }
+ }
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/Models/DeleteTrackingByIdResponse.cs b/src/AfterShipTracking/AfterShipTracking/Models/DeleteTrackingByIdResponse.cs
new file mode 100644
index 0000000..a3c38d4
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Models/DeleteTrackingByIdResponse.cs
@@ -0,0 +1,721 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System;
+using System.Collections.Generic;
+using Newtonsoft.Json;
+
+namespace AfterShipTracking
+{
+ ///
+ /// Object describes the tracking information.
+ ///
+ public class DeleteTrackingByIdResponse
+ {
+ ///
+ /// Id Tracking ID.
+ ///
+ [JsonProperty("id")]
+ public string? Id { get; set; }
+ ///
+ /// LegacyId The length of the tracking ID has been increased from 24 characters to 32 characters. We will use the legacy_id field to store the original 24-character tracking ID to maintain compatibility with existing data. Therefore, all tracking endpoints will continue to work with the legacy_id field as before.
+ ///
+ [JsonProperty("legacy_id")]
+ public string? LegacyId { get; set; }
+ ///
+ /// CreatedAt The date and time the shipment was imported or added to AfterShip. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0.
+ ///
+ [JsonProperty("created_at")]
+ public string? CreatedAt { get; set; }
+ ///
+ /// UpdatedAt The date and time the shipment was updated. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0.
+ ///
+ [JsonProperty("updated_at")]
+ public string? UpdatedAt { get; set; }
+ ///
+ /// TrackingNumber Tracking number.
+ ///
+ [JsonProperty("tracking_number")]
+ public string? TrackingNumber { get; set; }
+ ///
+ /// Slug Unique courier code. When importing a shipment with no courier slug and the tracking number can’t be recognized, the courier will be marked as `unrecognized`. Get courier codes .
+ ///
+ [JsonProperty("slug")]
+ public string? Slug { get; set; }
+ ///
+ /// Active Whether or not AfterShip will continue tracking the shipments. Value is `false` when tag (status) is `Delivered`, `Expired`, or further updates for 30 days since last update.
+ ///
+ [JsonProperty("active")]
+ public bool? Active { get; set; }
+ ///
+ /// CustomFields Custom fields that accept an object with string field. In order to protect the privacy of your customers, do not include any in custom fields.
+ ///
+ [JsonProperty("custom_fields")]
+ public Dictionary? CustomFields { get; set; }
+ ///
+ /// TransitTime Total transit time in days.- For delivered shipments: Transit time (in days) = Delivered date - Pick-up date- For undelivered shipments: Transit time (in days) = Current date - Pick-up dateValue as `null` for the shipment without pick-up date.
+ ///
+ [JsonProperty("transit_time")]
+ public int? TransitTime { get; set; }
+ ///
+ /// OriginCountryRegion The for the origin country/region. E.g. USA for the United States.
+ ///
+ [JsonProperty("origin_country_region")]
+ public string? OriginCountryRegion { get; set; }
+ ///
+ /// OriginState The state of the sender’s address.
+ ///
+ [JsonProperty("origin_state")]
+ public string? OriginState { get; set; }
+ ///
+ /// OriginCity The city of the sender’s address.
+ ///
+ [JsonProperty("origin_city")]
+ public string? OriginCity { get; set; }
+ ///
+ /// OriginPostalCode The postal code of the sender’s address.
+ ///
+ [JsonProperty("origin_postal_code")]
+ public string? OriginPostalCode { get; set; }
+ ///
+ /// OriginRawLocation The sender address that the shipment is shipping from.
+ ///
+ [JsonProperty("origin_raw_location")]
+ public string? OriginRawLocation { get; set; }
+ ///
+ /// DestinationCountryRegion The for the destination country/region. E.g. USA for the United States.
+ ///
+ [JsonProperty("destination_country_region")]
+ public string? DestinationCountryRegion { get; set; }
+ ///
+ /// DestinationState The state of the recipient’s address.
+ ///
+ [JsonProperty("destination_state")]
+ public string? DestinationState { get; set; }
+ ///
+ /// DestinationCity The city of the recipient’s address.
+ ///
+ [JsonProperty("destination_city")]
+ public string? DestinationCity { get; set; }
+ ///
+ /// DestinationPostalCode The postal code of the recipient’s address.
+ ///
+ [JsonProperty("destination_postal_code")]
+ public string? DestinationPostalCode { get; set; }
+ ///
+ /// DestinationRawLocation The shipping address that the shipment is shipping to.
+ ///
+ [JsonProperty("destination_raw_location")]
+ public string? DestinationRawLocation { get; set; }
+ ///
+ /// CourierDestinationCountryRegion Destination country/region of the tracking detected from the courier. ISO Alpha-3 (three letters). Value will be `null` if the courier doesn't provide the destination country.
+ ///
+ [JsonProperty("courier_destination_country_region")]
+ public string? CourierDestinationCountryRegion { get; set; }
+ ///
+ /// CourierEstimatedDeliveryDate The field contains the estimated delivery date provided by the carrier.
+ ///
+ [JsonProperty("courier_estimated_delivery_date")]
+ public CourierEstimatedDeliveryDateDeleteTrackingByIdResponse? CourierEstimatedDeliveryDate { get; set; }
+ ///
+ /// Note Text field for the note.
+ ///
+ [JsonProperty("note")]
+ public string? Note { get; set; }
+ ///
+ /// OrderId A globally-unique identifier for the order.
+ ///
+ [JsonProperty("order_id")]
+ public string? OrderId { get; set; }
+ ///
+ /// OrderIdPath The URL for the order in your system or store.
+ ///
+ [JsonProperty("order_id_path")]
+ public string? OrderIdPath { get; set; }
+ ///
+ /// OrderDate The date and time the order was created in your system or store. It uses the format: `YYYY-MM-DDTHH:mm:ssZ` based on whichever timezone you provide.
+ ///
+ [JsonProperty("order_date")]
+ public string? OrderDate { get; set; }
+ ///
+ /// ShipmentPackageCount Number of packages under the tracking.
+ ///
+ [JsonProperty("shipment_package_count")]
+ public double? ShipmentPackageCount { get; set; }
+ ///
+ /// ShipmentPickupDate The date and time the shipment was picked up by the carrier. It uses the timezone where the pickup occured. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("shipment_pickup_date")]
+ public string? ShipmentPickupDate { get; set; }
+ ///
+ /// ShipmentDeliveryDate The date and time the shipment was delivered. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("shipment_delivery_date")]
+ public string? ShipmentDeliveryDate { get; set; }
+ ///
+ /// ShipmentType The carrier service type for the shipment.
+ ///
+ [JsonProperty("shipment_type")]
+ public string? ShipmentType { get; set; }
+ ///
+ /// ShipmentWeight The shipment_weight field represents the total weight of the shipment. In scenarios where the carrier does not provide this information, you can provide the weight to AfterShip. We will prioritize the data provided by the carrier, if available. The shipment weight will be included in the Response and accessed through the GET API, Webhook, and CSV export. It will also be displayed on the AfterShip Tracking admin. Additionally, it plays a significant role in error-free shipment handling and carbon emission calculations, ensuring accurate and informed decision-making
+ ///
+ [JsonProperty("shipment_weight")]
+ public ShipmentWeightDeleteTrackingByIdResponse? ShipmentWeight { get; set; }
+ ///
+ /// SignedBy Signed by information for delivered shipment.
+ ///
+ [JsonProperty("signed_by")]
+ public string? SignedBy { get; set; }
+ ///
+ /// Source Source of how this tracking is added.
+ ///
+ [JsonProperty("source")]
+ public string? Source { get; set; }
+ ///
+ /// Tag Current status of tracking. (
+ ///
+ [JsonProperty("tag")]
+ public TagV1? Tag { get; set; }
+ ///
+ /// Subtag Current subtag of tracking. (
+ ///
+ [JsonProperty("subtag")]
+ public string? Subtag { get; set; }
+ ///
+ /// SubtagMessage Normalized tracking message. (
+ ///
+ [JsonProperty("subtag_message")]
+ public string? SubtagMessage { get; set; }
+ ///
+ /// Title By default this field shows the `tracking_number`, but you can customize it as you wish with any info (e.g. the order number).
+ ///
+ [JsonProperty("title")]
+ public string? Title { get; set; }
+ ///
+ /// TrackedCount Number of attempts AfterShip tracks at courier's system.
+ ///
+ [JsonProperty("tracked_count")]
+ public double? TrackedCount { get; set; }
+ ///
+ /// LastMileTrackingSupported Indicates if the shipment is trackable till the final destination.Three possible values:- true- false- null
+ ///
+ [JsonProperty("last_mile_tracking_supported")]
+ public bool? LastMileTrackingSupported { get; set; }
+ ///
+ /// Language The recipient’s language. If you set up AfterShip notifications in different languages, we use this to send the recipient tracking updates in their preferred language.
+ ///
+ [JsonProperty("language")]
+ public string? Language { get; set; }
+ ///
+ /// UniqueToken Deprecated
+ ///
+ [JsonProperty("unique_token")]
+ public string? UniqueToken { get; set; }
+ ///
+ /// Checkpoints Array of checkpoint object describes the checkpoint information.
+ ///
+ [JsonProperty("checkpoints")]
+ public Checkpoint?[] Checkpoints { get; set; }
+ ///
+ /// SubscribedSmses Phone number(s) subscribed to receive sms notifications.
+ ///
+ [JsonProperty("subscribed_smses")]
+ public string?[] SubscribedSmses { get; set; }
+ ///
+ /// SubscribedEmails Email address(es) subscribed to receive email notifications.
+ ///
+ [JsonProperty("subscribed_emails")]
+ public string?[] SubscribedEmails { get; set; }
+ ///
+ /// ReturnToSender Whether or not the shipment is returned to sender. Value is `true` when any of its checkpoints has subtag `Exception_010` (returning to sender) or `Exception_011` (returned to sender). Otherwise value is `false`.
+ ///
+ [JsonProperty("return_to_sender")]
+ public bool? ReturnToSender { get; set; }
+ ///
+ /// OrderPromisedDeliveryDate The promised delivery date of the order. It uses the formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("order_promised_delivery_date")]
+ public string? OrderPromisedDeliveryDate { get; set; }
+ ///
+ /// DeliveryType Shipment delivery type- pickup_at_store- pickup_at_courier- door_to_door
+ ///
+ [JsonProperty("delivery_type")]
+ public string? DeliveryType { get; set; }
+ ///
+ /// PickupLocation Shipment pickup location for receiver
+ ///
+ [JsonProperty("pickup_location")]
+ public string? PickupLocation { get; set; }
+ ///
+ /// PickupNote Shipment pickup note for receiver
+ ///
+ [JsonProperty("pickup_note")]
+ public string? PickupNote { get; set; }
+ ///
+ /// CourierTrackingLink Official tracking URL of the courier (if any). The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default.
+ ///
+ [JsonProperty("courier_tracking_link")]
+ public string? CourierTrackingLink { get; set; }
+ ///
+ /// FirstAttemptedAt The date and time of the carrier’s first attempt to deliver the package to the recipient. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("first_attempted_at")]
+ public string? FirstAttemptedAt { get; set; }
+ ///
+ /// CourierRedirectLink Delivery instructions (delivery date or address) can be modified by visiting the link if supported by a carrier. The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default.
+ ///
+ [JsonProperty("courier_redirect_link")]
+ public string? CourierRedirectLink { get; set; }
+ ///
+ /// TrackingAccountNumber Additional field required by some carriers to retrieve the tracking info. The shipper’s carrier account number. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_account_number")]
+ public string? TrackingAccountNumber { get; set; }
+ ///
+ /// TrackingKey Additional field required by some carriers to retrieve the tracking info. A type of tracking credential required by some carriers. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_key")]
+ public string? TrackingKey { get; set; }
+ ///
+ /// TrackingShipDate The date and time when the shipment is shipped by the merchant and ready for pickup by the carrier. The field supports the following formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZThe field serves two key purposes:- Calculate processing time metrics in the Order-to-delivery Analytics dashboard. To ensure accurate analytics, it's recommended to include timezone information when configuring this value- Required by certain carriers to retrieve tracking information as an additional tracking field.
+ ///
+ [JsonProperty("tracking_ship_date")]
+ public string? TrackingShipDate { get; set; }
+ ///
+ /// OnTimeStatus Whether the tracking is delivered on time or not.
+ ///
+ [JsonProperty("on_time_status")]
+ public string? OnTimeStatus { get; set; }
+ ///
+ /// OnTimeDifference The difference days of the on time.
+ ///
+ [JsonProperty("on_time_difference")]
+ public double? OnTimeDifference { get; set; }
+ ///
+ /// OrderTags The tags of the order.
+ ///
+ [JsonProperty("order_tags")]
+ public string?[] OrderTags { get; set; }
+ ///
+ /// AftershipEstimatedDeliveryDate The estimated delivery date of the shipment provided by AfterShip’s AI and shown to the recipients. It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone.
+ ///
+ [JsonProperty("aftership_estimated_delivery_date")]
+ public AftershipEstimatedDeliveryDateDeleteTrackingByIdResponse? AftershipEstimatedDeliveryDate { get; set; }
+ ///
+ /// CustomEstimatedDeliveryDate Estimated delivery time of the shipment based on your . It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone.
+ ///
+ [JsonProperty("custom_estimated_delivery_date")]
+ public CustomEstimatedDeliveryDateDeleteTrackingByIdResponse? CustomEstimatedDeliveryDate { get; set; }
+ ///
+ /// OrderNumber A unique, human-readable identifier for the order.
+ ///
+ [JsonProperty("order_number")]
+ public string? OrderNumber { get; set; }
+ ///
+ /// FirstEstimatedDelivery The shipment’s original estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone.
+ ///
+ [JsonProperty("first_estimated_delivery")]
+ public FirstEstimatedDeliveryDeleteTrackingByIdResponse? FirstEstimatedDelivery { get; set; }
+ ///
+ /// LatestEstimatedDelivery The most recently calculated estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone.
+ ///
+ [JsonProperty("latest_estimated_delivery")]
+ public LatestEstimatedDeliveryDeleteTrackingByIdResponse? LatestEstimatedDelivery { get; set; }
+ ///
+ /// ShipmentTags Used to add tags to your shipments to help categorize and filter them easily.
+ ///
+ [JsonProperty("shipment_tags")]
+ public string?[] ShipmentTags { get; set; }
+ ///
+ /// CourierConnectionId If you have multiple accounts connected for a single carrier on AfterShip, we have introduced the courier_connection_id field to allow you to specify the carrier account associated with each shipment. By providing this information, you enable us to accurately track and monitor your shipments based on the correct carrier account.(In the event that you do not specify the courier_connection_id, we will handle your shipment using the connection that was created earliest among your connected accounts.
+ ///
+ [JsonProperty("courier_connection_id")]
+ public string? CourierConnectionId { get; set; }
+ ///
+ /// TrackingOriginCountryRegion (Legacy) Replaced by `origin_country_region`. Additional field required by some carriers to retrieve the tracking info. The origin country/region of the shipment. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_origin_country_region")]
+ public string? TrackingOriginCountryRegion { get; set; }
+ ///
+ /// TrackingDestinationCountryRegion (Legacy) Replaced by `destination_country_region`. Additional field required by some carriers to retrieve the tracking info. The destination country/region of the shipment. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_destination_country_region")]
+ public string? TrackingDestinationCountryRegion { get; set; }
+ ///
+ /// TrackingPostalCode (Legacy) Replaced by `destination_postal_code`. Additional field required by some carriers to retrieve the tracking info. The postal code of the recipient’s address. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_postal_code")]
+ public string? TrackingPostalCode { get; set; }
+ ///
+ /// TrackingState (Legacy) Replaced by `destination_state`. Additional field required by some carriers to retrieve the tracking info. The state/province of the recipient’s address. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_state")]
+ public string? TrackingState { get; set; }
+ ///
+ /// CarbonEmissions The model contains the total amount of carbon emissions generated by the shipment. - AfterShip will provide this data only when it is available, and its availability is contingent upon the location and weight information that AfterShip can obtain.- The values will be accessible solely for shipments that have been successfully delivered. However, in the event of a shipping update after the delivery status has been achieved, the value may change.- It’s a paid service and only for Tracking Enterprise users, please contact your customer success manager if you want to know more.
+ ///
+ [JsonProperty("carbon_emissions")]
+ public CarbonEmissionsDeleteTrackingByIdResponse? CarbonEmissions { get; set; }
+ ///
+ /// LocationId The location_id refers to the place where you fulfilled the items. - If you provide a location_id, the system will automatically use it as the tracking's origin address. However, passing both location_id and any origin address information simultaneously is not allowed.- Please make sure you add your locations .
+ ///
+ [JsonProperty("location_id")]
+ public string? LocationId { get; set; }
+ ///
+ /// ShippingMethod The shipping_method string refers to the chosen method for delivering the package. Merchants typically offer various shipping methods to consumers during the checkout process, such as, Local Delivery, Free Express Worldwide Shipping, etc.
+ ///
+ [JsonProperty("shipping_method")]
+ public string? ShippingMethod { get; set; }
+ ///
+ /// FailedDeliveryAttempts By dynamically tracking failed delivery attempts during shipment, this field allows you to pinpoint carriers accountable for the most failures. Analyzing the root cause of these failures enables you to improve carriers' delivery standard operating procedures (SOP), leading to an overall enhancement in delivery service quality.
+ ///
+ [JsonProperty("failed_delivery_attempts")]
+ public int? FailedDeliveryAttempts { get; set; }
+ ///
+ /// SignatureRequirement The signature_requirement field serves the purpose of validating the service option type, specifically proof of delivery. By collecting the recipient's signature upon delivery, it ensures the package reaches the intended recipient and prevents disputes related to non-delivery or lost packages.
+ ///
+ [JsonProperty("signature_requirement")]
+ public string? SignatureRequirement { get; set; }
+ ///
+ /// DeliveryLocationType The delivery location type represents the secure area where the carrier leaves the package, such as a safe place, locker, mailbox, front porch, etc. This information helps ensure the shipment reaches the intended recipient efficiently, minimizing the risk of theft or damage.
+ ///
+ [JsonProperty("delivery_location_type")]
+ public string? DeliveryLocationType { get; set; }
+ ///
+ /// AftershipTrackingUrl The tracking URL directs your customers to the shipment tracking page which can display either the default or a customized page based on segmentation rules.- The universal URL is used by default, but you can opt for a custom domain if you have one. Learn how to set up a custom domain .The field is not automatically enabled in API & Webhook. Please contact support if you’d like to enable it.
+ ///
+ [JsonProperty("aftership_tracking_url")]
+ public string? AftershipTrackingUrl { get; set; }
+ ///
+ /// AftershipTrackingOrderUrl The order URL directs your customers to the order tracking page, which includes all shipments. It can display either the default or a customized page based on segmentation rules.- The universal URL is used by default, but you can opt for a custom domain if you have one. Learn how to set up a custom domain .The field is not automatically enabled in API & Webhook. Please contact support if you’d like to enable it.
+ ///
+ [JsonProperty("aftership_tracking_order_url")]
+ public string? AftershipTrackingOrderUrl { get; set; }
+ ///
+ /// FirstMile The field contains information about the first leg of the shipping starting from the carrier picking up the shipment from the shipper to the point where they hand it over to the last-mile carrier. Once AfterShip detects the shipment is multi-leg, we will populate the first-mile information under this object.
+ ///
+ [JsonProperty("first_mile")]
+ public FirstMileDeleteTrackingByIdResponse? FirstMile { get; set; }
+ ///
+ /// LastMile This field contains information about the last leg of the shipment, starting from the carrier who hands it over to the last-mile carrier, all the way to delivery. Once AfterShip detects that the shipment involves multiple legs and identifies the last-mile carrier, we will populate the last-mile carrier information in this object. Alternatively, the user can provide this information in this field to specify the last-mile carrier, which is helpful if AfterShip is unable to detect it automatically.
+ ///
+ [JsonProperty("last_mile")]
+ public LastMileDeleteTrackingByIdResponse? LastMile { get; set; }
+ ///
+ /// Customers The field contains the customer information associated with the tracking. A maximum of three customer objects are allowed.
+ ///
+ [JsonProperty("customers")]
+ public CustomersDeleteTrackingByIdResponse?[] Customers { get; set; }
+ public DeleteTrackingByIdResponse()
+ {
+ }
+ }
+
+ ///
+ ///
+ ///
+ public class CourierEstimatedDeliveryDateDeleteTrackingByIdResponse
+ {
+ ///
+ /// EstimatedDeliveryDate The estimated arrival date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("estimated_delivery_date")]
+ public string? EstimatedDeliveryDate { get; set; }
+ ///
+ /// EstimatedDeliveryDateMin The earliest estimated delivery date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("estimated_delivery_date_min")]
+ public string? EstimatedDeliveryDateMin { get; set; }
+ ///
+ /// EstimatedDeliveryDateMax The Latest estimated delivery date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("estimated_delivery_date_max")]
+ public string? EstimatedDeliveryDateMax { get; set; }
+
+ public CourierEstimatedDeliveryDateDeleteTrackingByIdResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class ShipmentWeightDeleteTrackingByIdResponse
+ {
+ ///
+ /// Unit The unit in which the value field is expressed.
+ ///
+ [JsonProperty("unit")]
+ public string? Unit { get; set; }
+ ///
+ /// Value The total amount of shipment weight.
+ ///
+ [JsonProperty("value")]
+ public double? Value { get; set; }
+
+ public ShipmentWeightDeleteTrackingByIdResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class AftershipEstimatedDeliveryDateDeleteTrackingByIdResponse
+ {
+ ///
+ /// EstimatedDeliveryDate The estimated arrival date of the shipment.
+ ///
+ [JsonProperty("estimated_delivery_date")]
+ public string? EstimatedDeliveryDate { get; set; }
+ ///
+ /// ConfidenceCode Indicates the confidence level and associated reason for an AI EDD prediction request. For a comprehensive list of confidence codes, refer to .
+ ///
+ [JsonProperty("confidence_code")]
+ public double? ConfidenceCode { get; set; }
+ ///
+ /// EstimatedDeliveryDateMin Earliest estimated delivery date of the shipment.
+ ///
+ [JsonProperty("estimated_delivery_date_min")]
+ public string? EstimatedDeliveryDateMin { get; set; }
+ ///
+ /// EstimatedDeliveryDateMax Latest estimated delivery date of the shipment.
+ ///
+ [JsonProperty("estimated_delivery_date_max")]
+ public string? EstimatedDeliveryDateMax { get; set; }
+
+ public AftershipEstimatedDeliveryDateDeleteTrackingByIdResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class CustomEstimatedDeliveryDateDeleteTrackingByIdResponse
+ {
+ ///
+ /// Type The format of the EDD. Either a single date or a date range.
+ ///
+ [JsonProperty("type")]
+ public string? Type { get; set; }
+ ///
+ /// Datetime The specific EDD date.
+ ///
+ [JsonProperty("datetime")]
+ public string? Datetime { get; set; }
+ ///
+ /// DatetimeMin For a date range EDD format, the date for the lower end of the range.
+ ///
+ [JsonProperty("datetime_min")]
+ public string? DatetimeMin { get; set; }
+ ///
+ /// DatetimeMax For a date range EDD format, the date for the upper end of the range.
+ ///
+ [JsonProperty("datetime_max")]
+ public string? DatetimeMax { get; set; }
+
+ public CustomEstimatedDeliveryDateDeleteTrackingByIdResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class FirstEstimatedDeliveryDeleteTrackingByIdResponse
+ {
+ ///
+ /// Type The format of the EDD. Either a single date or a date range.
+ ///
+ [JsonProperty("type")]
+ public string? Type { get; set; }
+ ///
+ /// Source The source of the EDD. Either the carrier, AfterShip AI, or based on your custom EDD settings.
+ ///
+ [JsonProperty("source")]
+ public string? Source { get; set; }
+ ///
+ /// Datetime The latest EDD time.
+ ///
+ [JsonProperty("datetime")]
+ public string? Datetime { get; set; }
+ ///
+ /// DatetimeMin For a date range EDD format, the date and time for the lower end of the range.
+ ///
+ [JsonProperty("datetime_min")]
+ public string? DatetimeMin { get; set; }
+ ///
+ /// DatetimeMax For a date range EDD format, the date and time for the upper end of the range.
+ ///
+ [JsonProperty("datetime_max")]
+ public string? DatetimeMax { get; set; }
+
+ public FirstEstimatedDeliveryDeleteTrackingByIdResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class LatestEstimatedDeliveryDeleteTrackingByIdResponse
+ {
+ ///
+ /// Type The format of the EDD. Either a single date or a date range.
+ ///
+ [JsonProperty("type")]
+ public string? Type { get; set; }
+ ///
+ /// Source The source of the EDD. Either the carrier, AfterShip AI, or based on your custom EDD settings.
+ ///
+ [JsonProperty("source")]
+ public string? Source { get; set; }
+ ///
+ /// Datetime The latest EDD time.
+ ///
+ [JsonProperty("datetime")]
+ public string? Datetime { get; set; }
+ ///
+ /// DatetimeMin For a date range EDD format, the date and time for the lower end of the range.
+ ///
+ [JsonProperty("datetime_min")]
+ public string? DatetimeMin { get; set; }
+ ///
+ /// DatetimeMax For a date range EDD format, the date and time for the upper end of the range.
+ ///
+ [JsonProperty("datetime_max")]
+ public string? DatetimeMax { get; set; }
+
+ public LatestEstimatedDeliveryDeleteTrackingByIdResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class CarbonEmissionsDeleteTrackingByIdResponse
+ {
+ ///
+ /// Unit The unit in which the value field is expressed. Allowed values: kg
+ ///
+ [JsonProperty("unit")]
+ public string? Unit { get; set; }
+ ///
+ /// Value The total amount of carbon emissions
+ ///
+ [JsonProperty("value")]
+ public double? Value { get; set; }
+
+ public CarbonEmissionsDeleteTrackingByIdResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class FirstMileDeleteTrackingByIdResponse
+ {
+ ///
+ /// TrackingNumber The tracking number of the first-mile carrier.
+ ///
+ [JsonProperty("tracking_number")]
+ public string? TrackingNumber { get; set; }
+ ///
+ /// Slug The unique code of the carrier responsible for the first-mile of the shipment. Find all the courier slugs .
+ ///
+ [JsonProperty("slug")]
+ public string? Slug { get; set; }
+ ///
+ /// TransitTime The transit time for the first-mile of a shipment in days. This field is calculated based on whether the handed_over_to_last_mile_carrier or received_by_last_mile_carrier event is detected by AfterShip. The handover event date is used to calculate the first-mile transit time.- First mile transit time (in days) = Handover date - Pickup date
+ ///
+ [JsonProperty("transit_time")]
+ public string? TransitTime { get; set; }
+ ///
+ /// CourierRedirectLink The field provides the link for modifying delivery instructions (such as delivery date and shipping address), if supported by the first-mile carrier. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US".
+ ///
+ [JsonProperty("courier_redirect_link")]
+ public string? CourierRedirectLink { get; set; }
+ ///
+ /// CourierTrackingLink The field contains the official tracking URL of the first-mile carrier, if available. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US".
+ ///
+ [JsonProperty("courier_tracking_link")]
+ public string? CourierTrackingLink { get; set; }
+
+ public FirstMileDeleteTrackingByIdResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class LastMileDeleteTrackingByIdResponse
+ {
+ ///
+ /// TrackingNumber The tracking number of the last-mile carrier.
+ ///
+ [JsonProperty("tracking_number")]
+ public string? TrackingNumber { get; set; }
+ ///
+ /// Slug The unique code of the carrier responsible for the last-mile of the shipment. Find all the courier slugs .
+ ///
+ [JsonProperty("slug")]
+ public string? Slug { get; set; }
+ ///
+ /// TransitTime The transit time for the last-mile of a shipment in days. This field is calculated based on whether the handed_over_to_last_mile_carrier or the received_by_last_mile_carrier event is detected by AfterShip. The handover event date is used to calculate the last-mile transit time.- Last mile transit time (in days)= Delivered date - Handover date
+ ///
+ [JsonProperty("transit_time")]
+ public string? TransitTime { get; set; }
+ ///
+ /// CourierTrackingLink The field contains the official tracking URL of the last-mile carrier, if available. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US".
+ ///
+ [JsonProperty("courier_tracking_link")]
+ public string? CourierTrackingLink { get; set; }
+ ///
+ /// CourierRedirectLink The field provides the link for modifying delivery instructions (such as delivery date and shipping address), if supported by the last-mile carrier. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US".
+ ///
+ [JsonProperty("courier_redirect_link")]
+ public string? CourierRedirectLink { get; set; }
+ ///
+ /// Source The field indicates the source of last-mile carrier.
+ ///
+ [JsonProperty("source")]
+ public string? Source { get; set; }
+
+ public LastMileDeleteTrackingByIdResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class CustomersDeleteTrackingByIdResponse
+ {
+ ///
+ /// Role The role of the customer, indicating whether the customer is an individual or a company.
+ ///
+ [JsonProperty("role")]
+ public string? Role { get; set; }
+ ///
+ /// Name Customer name associated with the tracking.
+ ///
+ [JsonProperty("name")]
+ public string? Name { get; set; }
+ ///
+ /// PhoneNumber The phone number(s) to receive SMS notifications. Phone numbers should begin with a `+` sign and include the area code.
+ ///
+ [JsonProperty("phone_number")]
+ public string? PhoneNumber { get; set; }
+ ///
+ /// Email Email address(es) to receive email notifications.
+ ///
+ [JsonProperty("email")]
+ public string? Email { get; set; }
+ ///
+ /// Language The preferred language of the customer. If you have set up AfterShip notifications in different languages, we use this to send the tracking updates to the customer in their preferred language.
+ ///
+ [JsonProperty("language")]
+ public string? Language { get; set; }
+
+ public CustomersDeleteTrackingByIdResponse()
+ {
+ }
+ }
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/Models/DetectCourierRequest.cs b/src/AfterShipTracking/AfterShipTracking/Models/DetectCourierRequest.cs
new file mode 100644
index 0000000..0cd5bc4
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Models/DetectCourierRequest.cs
@@ -0,0 +1,81 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System;
+using System.Collections.Generic;
+using Newtonsoft.Json;
+
+namespace AfterShipTracking
+{
+ ///
+ ///
+ ///
+ public class DetectCourierRequest
+ {
+ ///
+ /// TrackingNumber Tracking number of a shipment.
+ ///
+ [JsonProperty("tracking_number")]
+ public string TrackingNumber { get; set; }
+ ///
+ /// Slug If not specified, Aftership will automatically detect the courier based on the tracking number format and your . Use array to input a list of couriers for auto detect. Cannot be used with slug_group at the same time.
+ ///
+ [JsonProperty("slug", NullValueHandling = NullValueHandling.Ignore)]
+ public string?[] Slug { get; set; }
+ ///
+ /// TrackingPostalCode The postal code of receiver's address. Required by some couriers. Refer to for more details
+ ///
+ [JsonProperty("tracking_postal_code", NullValueHandling = NullValueHandling.Ignore)]
+ public string? TrackingPostalCode { get; set; }
+ ///
+ /// TrackingShipDate Shipping date in `YYYYMMDD` format. Required by some couriers. Refer to for more details
+ ///
+ [JsonProperty("tracking_ship_date", NullValueHandling = NullValueHandling.Ignore)]
+ public string? TrackingShipDate { get; set; }
+ ///
+ /// TrackingAccountNumber Account number of the shipper for a specific courier. Required by some couriers. Refer to for more details
+ ///
+ [JsonProperty("tracking_account_number", NullValueHandling = NullValueHandling.Ignore)]
+ public string? TrackingAccountNumber { get; set; }
+ ///
+ /// TrackingKey Key of the shipment for a specific courier. Required by some couriers. Refer to for more details
+ ///
+ [JsonProperty("tracking_key", NullValueHandling = NullValueHandling.Ignore)]
+ public string? TrackingKey { get; set; }
+ ///
+ /// TrackingOriginCountryRegion Origin Country/Region of the shipment for a specific courier. Required by some couriers.
+ ///
+ [JsonProperty("tracking_origin_country_region", NullValueHandling = NullValueHandling.Ignore)]
+ public string? TrackingOriginCountryRegion { get; set; }
+ ///
+ /// TrackingDestinationCountryRegion Destination Country/Region of the shipment for a specific courier. Required by some couriers. Refer to for more details
+ ///
+ [JsonProperty("tracking_destination_country_region", NullValueHandling = NullValueHandling.Ignore)]
+ public string? TrackingDestinationCountryRegion { get; set; }
+ ///
+ /// TrackingState State of the destination shipping address of the shipment. Required by some couriers.
+ ///
+ [JsonProperty("tracking_state", NullValueHandling = NullValueHandling.Ignore)]
+ public string? TrackingState { get; set; }
+ ///
+ /// SlugGroup Slug group is a group of slugs which belong to same courier. For example, when you inpit "fedex-group" as slug_group, AfterShip will detect the tracking with "fedex-uk", "fedex-fims", and other slugs which belong to "fedex". It cannot be used with slug at the same time. (
+ ///
+ [JsonProperty("slug_group", NullValueHandling = NullValueHandling.Ignore)]
+ public SlugGroupV1? SlugGroup { get; set; }
+ ///
+ /// OriginCountryRegion Enter .
+ ///
+ [JsonProperty("origin_country_region", NullValueHandling = NullValueHandling.Ignore)]
+ public string? OriginCountryRegion { get; set; }
+ ///
+ /// DestinationCountryRegion Enter .
+ ///
+ [JsonProperty("destination_country_region", NullValueHandling = NullValueHandling.Ignore)]
+ public string? DestinationCountryRegion { get; set; }
+ public DetectCourierRequest()
+ {
+ }
+ }
+
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/Models/DetectCourierResponse.cs b/src/AfterShipTracking/AfterShipTracking/Models/DetectCourierResponse.cs
new file mode 100644
index 0000000..02f0629
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Models/DetectCourierResponse.cs
@@ -0,0 +1,31 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System;
+using System.Collections.Generic;
+using Newtonsoft.Json;
+
+namespace AfterShipTracking
+{
+ ///
+ ///
+ ///
+ public class DetectCourierResponse
+ {
+ ///
+ /// Total Total count of courier objects
+ ///
+ [JsonProperty("total")]
+ public int? Total { get; set; }
+ ///
+ /// Couriers Array of object.
+ ///
+ [JsonProperty("couriers")]
+ public Courier?[] Couriers { get; set; }
+ public DetectCourierResponse()
+ {
+ }
+ }
+
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateRequest.cs b/src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateRequest.cs
new file mode 100644
index 0000000..433cd9c
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateRequest.cs
@@ -0,0 +1,201 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System;
+using System.Collections.Generic;
+using Newtonsoft.Json;
+
+namespace AfterShipTracking
+{
+ ///
+ ///
+ ///
+ public class EstimatedDeliveryDateRequest
+ {
+ ///
+ /// Slug AfterShip's unique code of courier. Please refer to https://track.aftership.com/couriers/download.
+ ///
+ [JsonProperty("slug")]
+ public string Slug { get; set; }
+ ///
+ /// ServiceTypeName AfterShip’s unique code represents carrier’s shipping and delivery options. Refer to .
+ ///
+ [JsonProperty("service_type_name", NullValueHandling = NullValueHandling.Ignore)]
+ public string? ServiceTypeName { get; set; }
+ ///
+ /// OriginAddress The location from where the package is picked up by the carrier to be delivered to the final destination.
+ ///
+ [JsonProperty("origin_address")]
+ public OriginAddressEstimatedDeliveryDateRequest OriginAddress { get; set; }
+ ///
+ /// DestinationAddress The final destination of the customer where the delivery will be made.
+ ///
+ [JsonProperty("destination_address")]
+ public DestinationAddressEstimatedDeliveryDateRequest DestinationAddress { get; set; }
+ ///
+ /// Weight AfterShip uses this object to calculate the total weight of the order.
+ ///
+ [JsonProperty("weight", NullValueHandling = NullValueHandling.Ignore)]
+ public WeightEstimatedDeliveryDateRequest? Weight { get; set; }
+ ///
+ /// PackageCount The number of packages.
+ ///
+ [JsonProperty("package_count", NullValueHandling = NullValueHandling.Ignore)]
+ public int? PackageCount { get; set; }
+ ///
+ /// PickupTime The local pickup time in the origin address time zone of the package.Either `pickup_time` or `estimated_pickup` is required.
+ ///
+ [JsonProperty("pickup_time", NullValueHandling = NullValueHandling.Ignore)]
+ public string? PickupTime { get; set; }
+ ///
+ /// EstimatedPickup The local pickup time of the package.Either `pickup_time` or `estimated_pickup` is required.
+ ///
+ [JsonProperty("estimated_pickup", NullValueHandling = NullValueHandling.Ignore)]
+ public EstimatedPickupEstimatedDeliveryDateRequest? EstimatedPickup { get; set; }
+ public EstimatedDeliveryDateRequest()
+ {
+ }
+ }
+
+ ///
+ ///
+ ///
+ public class OriginAddressEstimatedDeliveryDateRequest
+ {
+ ///
+ /// CountryRegion The country/region of the origin location from where the package is picked up by the carrier to be delivered to the final destination. Use 3 letters of ISO 3166-1 country/region code.
+ ///
+ [JsonProperty("country_region")]
+ public string CountryRegion { get; set; }
+ ///
+ /// State State, province, or the equivalent location of the origin address. Use 3 letters of ISO 3166-1 country/region code for countries/regions without state. Either `origin_address.state` or `origin_address.postal_code` is required.
+ ///
+ [JsonProperty("state", NullValueHandling = NullValueHandling.Ignore)]
+ public string? State { get; set; }
+ ///
+ /// City City of the origin address. Use 3 letters of ISO 3166-1 country/region code for countries/regions without City.
+ ///
+ [JsonProperty("city", NullValueHandling = NullValueHandling.Ignore)]
+ public string? City { get; set; }
+ ///
+ /// PostalCode Postal code of the origin address. Use 3 letters of ISO 3166-1 country/region code for countries/regions without postal code. Either `origin_address.state` or `origin_address.postal_code` is required.
+ ///
+ [JsonProperty("postal_code", NullValueHandling = NullValueHandling.Ignore)]
+ public string? PostalCode { get; set; }
+ ///
+ /// RawLocation Raw location of the origin address. A raw address will help AI to identify the accurate location of the origin address.
+ ///
+ [JsonProperty("raw_location", NullValueHandling = NullValueHandling.Ignore)]
+ public string? RawLocation { get; set; }
+
+ public OriginAddressEstimatedDeliveryDateRequest()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class DestinationAddressEstimatedDeliveryDateRequest
+ {
+ ///
+ /// CountryRegion The country/region of the destination location where the package will be delivered. Use 3 letters of ISO 3166-1 country code.
+ ///
+ [JsonProperty("country_region")]
+ public string CountryRegion { get; set; }
+ ///
+ /// State State, province, or the equivalent location of the destination address where the package will be delivered.Either `destination_address.state` or `destination_address.postal_code` is required.
+ ///
+ [JsonProperty("state", NullValueHandling = NullValueHandling.Ignore)]
+ public string? State { get; set; }
+ ///
+ /// City City of the destination address where the package will be delivered.
+ ///
+ [JsonProperty("city", NullValueHandling = NullValueHandling.Ignore)]
+ public string? City { get; set; }
+ ///
+ /// PostalCode Postal code of the destination address.Either `destination_address.state` or `destination_address.postal_code` is required.
+ ///
+ [JsonProperty("postal_code", NullValueHandling = NullValueHandling.Ignore)]
+ public string? PostalCode { get; set; }
+ ///
+ /// RawLocation Raw location of the destination address. A raw address will help AI to identify the accurate location of the destination address.
+ ///
+ [JsonProperty("raw_location", NullValueHandling = NullValueHandling.Ignore)]
+ public string? RawLocation { get; set; }
+
+ public DestinationAddressEstimatedDeliveryDateRequest()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class WeightEstimatedDeliveryDateRequest
+ {
+ ///
+ /// Unit The weight unit of the package.
+ ///
+ [JsonProperty("unit")]
+ public string Unit { get; set; }
+ ///
+ /// Value The weight of the shipment.
+ ///
+ [JsonProperty("value")]
+ public double Value { get; set; }
+
+ public WeightEstimatedDeliveryDateRequest()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class EstimatedPickupEstimatedDeliveryDateRequest
+ {
+ ///
+ /// OrderTime The local order time in the origin address time zone of the package.
+ ///
+ [JsonProperty("order_time")]
+ public string OrderTime { get; set; }
+ ///
+ /// OrderCutoffTime Order cut off time in the origin address time zone. The default value set by AfterShip is 18:00:00.
+ ///
+ [JsonProperty("order_cutoff_time", NullValueHandling = NullValueHandling.Ignore)]
+ public string? OrderCutoffTime { get; set; }
+ ///
+ /// BusinessDays Operating days in a week. Number refers to the weekday.E.g., [1,2,3,4,5] means operating days are from Monday to Friday.AfterShip will set [1,2,3,4,5] as the default value.
+ ///
+ [JsonProperty("business_days", NullValueHandling = NullValueHandling.Ignore)]
+ public int?[] BusinessDays { get; set; }
+ ///
+ /// OrderProcessingTime
+ ///
+ [JsonProperty("order_processing_time", NullValueHandling = NullValueHandling.Ignore)]
+ public OrderProcessingTimeEstimatedPickupEstimatedDeliveryDateRequest? OrderProcessingTime { get; set; }
+
+ public EstimatedPickupEstimatedDeliveryDateRequest()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class OrderProcessingTimeEstimatedPickupEstimatedDeliveryDateRequest
+ {
+ ///
+ /// Unit Processing time of an order, from being placed to being picked up. Only support day as value now.AfterShip will set day as the default value.
+ ///
+ [JsonProperty("unit", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Unit { get; set; }
+ ///
+ /// Value Processing time of an order, from being placed to being picked up.AfterShip will set 0 as the default value.
+ ///
+ [JsonProperty("value", NullValueHandling = NullValueHandling.Ignore)]
+ public double? Value { get; set; }
+
+ public OrderProcessingTimeEstimatedPickupEstimatedDeliveryDateRequest()
+ {
+ }
+ }
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateResponse.cs b/src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateResponse.cs
new file mode 100644
index 0000000..ec033e4
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateResponse.cs
@@ -0,0 +1,231 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System;
+using System.Collections.Generic;
+using Newtonsoft.Json;
+
+namespace AfterShipTracking
+{
+ ///
+ ///
+ ///
+ public class EstimatedDeliveryDateResponse
+ {
+ ///
+ /// Id A string that acts as a unique identifier for the estimated delivery date value generated by AfterShip Predict API
+ ///
+ [JsonProperty("id")]
+ public string Id { get; set; }
+ ///
+ /// Slug AfterShip's unique code of courier. Please refer to https://track.aftership.com/couriers/download.
+ ///
+ [JsonProperty("slug")]
+ public string Slug { get; set; }
+ ///
+ /// ServiceTypeName AfterShip’s unique code represents carrier’s shipping and delivery options. Refer to .
+ ///
+ [JsonProperty("service_type_name", NullValueHandling = NullValueHandling.Ignore)]
+ public string? ServiceTypeName { get; set; }
+ ///
+ /// OriginAddress The location from where the package is picked up by the carrier to be delivered to the final destination.
+ ///
+ [JsonProperty("origin_address")]
+ public OriginAddressEstimatedDeliveryDateResponse OriginAddress { get; set; }
+ ///
+ /// DestinationAddress The final destination of the customer where the delivery will be made.
+ ///
+ [JsonProperty("destination_address")]
+ public DestinationAddressEstimatedDeliveryDateResponse DestinationAddress { get; set; }
+ ///
+ /// Weight AfterShip uses this object to calculate the total weight of the order.
+ ///
+ [JsonProperty("weight", NullValueHandling = NullValueHandling.Ignore)]
+ public WeightEstimatedDeliveryDateResponse? Weight { get; set; }
+ ///
+ /// PackageCount The number of packages.
+ ///
+ [JsonProperty("package_count", NullValueHandling = NullValueHandling.Ignore)]
+ public int? PackageCount { get; set; }
+ ///
+ /// PickupTime The local pickup time in the origin address time zone of the package.Either `pickup_time` or `estimated_pickup` is required.
+ ///
+ [JsonProperty("pickup_time", NullValueHandling = NullValueHandling.Ignore)]
+ public string? PickupTime { get; set; }
+ ///
+ /// EstimatedPickup The local pickup time of the package.Either `pickup_time` or `estimated_pickup` is required.
+ ///
+ [JsonProperty("estimated_pickup", NullValueHandling = NullValueHandling.Ignore)]
+ public EstimatedPickupEstimatedDeliveryDateResponse? EstimatedPickup { get; set; }
+ ///
+ /// EstimatedDeliveryDate The estimated arrival date of the shipment, provided by AfterShip.
+ ///
+ [JsonProperty("estimated_delivery_date", NullValueHandling = NullValueHandling.Ignore)]
+ public string? EstimatedDeliveryDate { get; set; }
+ ///
+ /// ConfidenceCode Indicates the confidence level and associated reason for an AI EDD prediction request. For a comprehensive list of confidence codes, refer to .
+ ///
+ [JsonProperty("confidence_code", NullValueHandling = NullValueHandling.Ignore)]
+ public double? ConfidenceCode { get; set; }
+ ///
+ /// EstimatedDeliveryDateMin The earliest estimated delivery date of the shipment, provided by AfterShip.
+ ///
+ [JsonProperty("estimated_delivery_date_min", NullValueHandling = NullValueHandling.Ignore)]
+ public string? EstimatedDeliveryDateMin { get; set; }
+ ///
+ /// EstimatedDeliveryDateMax The latest estimated delivery date of the shipment, provided by AfterShip.
+ ///
+ [JsonProperty("estimated_delivery_date_max", NullValueHandling = NullValueHandling.Ignore)]
+ public string? EstimatedDeliveryDateMax { get; set; }
+ public EstimatedDeliveryDateResponse()
+ {
+ }
+ }
+
+ ///
+ ///
+ ///
+ public class OriginAddressEstimatedDeliveryDateResponse
+ {
+ ///
+ /// CountryRegion The country/region of the origin location from where the package is picked up by the carrier to be delivered to the final destination. Use 3 letters of ISO 3166-1 country/region code.
+ ///
+ [JsonProperty("country_region")]
+ public string CountryRegion { get; set; }
+ ///
+ /// State State, province, or the equivalent location of the origin address. Use 3 letters of ISO 3166-1 country/region code for countries/regions without state. Either `origin_address.state` or `origin_address.postal_code` is required.
+ ///
+ [JsonProperty("state", NullValueHandling = NullValueHandling.Ignore)]
+ public string? State { get; set; }
+ ///
+ /// City City of the origin address. Use 3 letters of ISO 3166-1 country/region code for countries/regions without City.
+ ///
+ [JsonProperty("city", NullValueHandling = NullValueHandling.Ignore)]
+ public string? City { get; set; }
+ ///
+ /// PostalCode Postal code of the origin address. Use 3 letters of ISO 3166-1 country/region code for countries/regions without postal code. Either `origin_address.state` or `origin_address.postal_code` is required.
+ ///
+ [JsonProperty("postal_code", NullValueHandling = NullValueHandling.Ignore)]
+ public string? PostalCode { get; set; }
+ ///
+ /// RawLocation Raw location of the origin address. A raw address will help AI to identify the accurate location of the origin address.
+ ///
+ [JsonProperty("raw_location", NullValueHandling = NullValueHandling.Ignore)]
+ public string? RawLocation { get; set; }
+
+ public OriginAddressEstimatedDeliveryDateResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class DestinationAddressEstimatedDeliveryDateResponse
+ {
+ ///
+ /// CountryRegion The country/region of the destination location where the package will be delivered. Use 3 letters of ISO 3166-1 country code.
+ ///
+ [JsonProperty("country_region")]
+ public string CountryRegion { get; set; }
+ ///
+ /// State State, province, or the equivalent location of the destination address where the package will be delivered.Either `destination_address.state` or `destination_address.postal_code` is required.
+ ///
+ [JsonProperty("state", NullValueHandling = NullValueHandling.Ignore)]
+ public string? State { get; set; }
+ ///
+ /// City City of the destination address where the package will be delivered.
+ ///
+ [JsonProperty("city", NullValueHandling = NullValueHandling.Ignore)]
+ public string? City { get; set; }
+ ///
+ /// PostalCode Postal code of the destination address.Either `destination_address.state` or `destination_address.postal_code` is required.
+ ///
+ [JsonProperty("postal_code", NullValueHandling = NullValueHandling.Ignore)]
+ public string? PostalCode { get; set; }
+ ///
+ /// RawLocation Raw location of the destination address. A raw address will help AI to identify the accurate location of the destination address.
+ ///
+ [JsonProperty("raw_location", NullValueHandling = NullValueHandling.Ignore)]
+ public string? RawLocation { get; set; }
+
+ public DestinationAddressEstimatedDeliveryDateResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class WeightEstimatedDeliveryDateResponse
+ {
+ ///
+ /// Unit The weight unit of the package.
+ ///
+ [JsonProperty("unit")]
+ public string Unit { get; set; }
+ ///
+ /// Value The weight of the shipment.
+ ///
+ [JsonProperty("value")]
+ public double Value { get; set; }
+
+ public WeightEstimatedDeliveryDateResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class EstimatedPickupEstimatedDeliveryDateResponse
+ {
+ ///
+ /// OrderTime The local order time in the origin address time zone of the package.
+ ///
+ [JsonProperty("order_time")]
+ public string OrderTime { get; set; }
+ ///
+ /// OrderCutoffTime Order cut off time in the origin address time zone. The default value set by AfterShip is 18:00:00.
+ ///
+ [JsonProperty("order_cutoff_time", NullValueHandling = NullValueHandling.Ignore)]
+ public string? OrderCutoffTime { get; set; }
+ ///
+ /// BusinessDays Operating days in a week. Number refers to the weekday.E.g., [1,2,3,4,5] means operating days are from Monday to Friday.AfterShip will set [1,2,3,4,5] as the default value.
+ ///
+ [JsonProperty("business_days", NullValueHandling = NullValueHandling.Ignore)]
+ public int?[] BusinessDays { get; set; }
+ ///
+ /// OrderProcessingTime
+ ///
+ [JsonProperty("order_processing_time", NullValueHandling = NullValueHandling.Ignore)]
+ public OrderProcessingTimeEstimatedPickupEstimatedDeliveryDateResponse? OrderProcessingTime { get; set; }
+ ///
+ /// PickupTime The local pickup time of the package.
+ ///
+ [JsonProperty("pickup_time", NullValueHandling = NullValueHandling.Ignore)]
+ public string? PickupTime { get; set; }
+
+ public EstimatedPickupEstimatedDeliveryDateResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class OrderProcessingTimeEstimatedPickupEstimatedDeliveryDateResponse
+ {
+ ///
+ /// Unit Processing time of an order, from being placed to being picked up. Only support day as value now.AfterShip will set day as the default value.
+ ///
+ [JsonProperty("unit", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Unit { get; set; }
+ ///
+ /// Value Processing time of an order, from being placed to being picked up.AfterShip will set 0 as the default value.
+ ///
+ [JsonProperty("value", NullValueHandling = NullValueHandling.Ignore)]
+ public double? Value { get; set; }
+
+ public OrderProcessingTimeEstimatedPickupEstimatedDeliveryDateResponse()
+ {
+ }
+ }
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/Models/GetAllCouriersResponse.cs b/src/AfterShipTracking/AfterShipTracking/Models/GetAllCouriersResponse.cs
new file mode 100644
index 0000000..0ef5b45
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Models/GetAllCouriersResponse.cs
@@ -0,0 +1,31 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System;
+using System.Collections.Generic;
+using Newtonsoft.Json;
+
+namespace AfterShipTracking
+{
+ ///
+ ///
+ ///
+ public class GetAllCouriersResponse
+ {
+ ///
+ /// Total Total count of courier objects
+ ///
+ [JsonProperty("total")]
+ public int? Total { get; set; }
+ ///
+ /// Couriers Array of object.
+ ///
+ [JsonProperty("couriers")]
+ public Courier?[] Couriers { get; set; }
+ public GetAllCouriersResponse()
+ {
+ }
+ }
+
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/Models/GetTrackingByIdResponse.cs b/src/AfterShipTracking/AfterShipTracking/Models/GetTrackingByIdResponse.cs
new file mode 100644
index 0000000..aedeb4d
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Models/GetTrackingByIdResponse.cs
@@ -0,0 +1,721 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System;
+using System.Collections.Generic;
+using Newtonsoft.Json;
+
+namespace AfterShipTracking
+{
+ ///
+ /// Object describes the tracking information.
+ ///
+ public class GetTrackingByIdResponse
+ {
+ ///
+ /// Id Tracking ID.
+ ///
+ [JsonProperty("id")]
+ public string? Id { get; set; }
+ ///
+ /// LegacyId The length of the tracking ID has been increased from 24 characters to 32 characters. We will use the legacy_id field to store the original 24-character tracking ID to maintain compatibility with existing data. Therefore, all tracking endpoints will continue to work with the legacy_id field as before.
+ ///
+ [JsonProperty("legacy_id")]
+ public string? LegacyId { get; set; }
+ ///
+ /// CreatedAt The date and time the shipment was imported or added to AfterShip. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0.
+ ///
+ [JsonProperty("created_at")]
+ public string? CreatedAt { get; set; }
+ ///
+ /// UpdatedAt The date and time the shipment was updated. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0.
+ ///
+ [JsonProperty("updated_at")]
+ public string? UpdatedAt { get; set; }
+ ///
+ /// TrackingNumber Tracking number.
+ ///
+ [JsonProperty("tracking_number")]
+ public string? TrackingNumber { get; set; }
+ ///
+ /// Slug Unique courier code. When importing a shipment with no courier slug and the tracking number can’t be recognized, the courier will be marked as `unrecognized`. Get courier codes .
+ ///
+ [JsonProperty("slug")]
+ public string? Slug { get; set; }
+ ///
+ /// Active Whether or not AfterShip will continue tracking the shipments. Value is `false` when tag (status) is `Delivered`, `Expired`, or further updates for 30 days since last update.
+ ///
+ [JsonProperty("active")]
+ public bool? Active { get; set; }
+ ///
+ /// CustomFields Custom fields that accept an object with string field. In order to protect the privacy of your customers, do not include any in custom fields.
+ ///
+ [JsonProperty("custom_fields")]
+ public Dictionary? CustomFields { get; set; }
+ ///
+ /// TransitTime Total transit time in days.- For delivered shipments: Transit time (in days) = Delivered date - Pick-up date- For undelivered shipments: Transit time (in days) = Current date - Pick-up dateValue as `null` for the shipment without pick-up date.
+ ///
+ [JsonProperty("transit_time")]
+ public int? TransitTime { get; set; }
+ ///
+ /// OriginCountryRegion The for the origin country/region. E.g. USA for the United States.
+ ///
+ [JsonProperty("origin_country_region")]
+ public string? OriginCountryRegion { get; set; }
+ ///
+ /// OriginState The state of the sender’s address.
+ ///
+ [JsonProperty("origin_state")]
+ public string? OriginState { get; set; }
+ ///
+ /// OriginCity The city of the sender’s address.
+ ///
+ [JsonProperty("origin_city")]
+ public string? OriginCity { get; set; }
+ ///
+ /// OriginPostalCode The postal code of the sender’s address.
+ ///
+ [JsonProperty("origin_postal_code")]
+ public string? OriginPostalCode { get; set; }
+ ///
+ /// OriginRawLocation The sender address that the shipment is shipping from.
+ ///
+ [JsonProperty("origin_raw_location")]
+ public string? OriginRawLocation { get; set; }
+ ///
+ /// DestinationCountryRegion The for the destination country/region. E.g. USA for the United States.
+ ///
+ [JsonProperty("destination_country_region")]
+ public string? DestinationCountryRegion { get; set; }
+ ///
+ /// DestinationState The state of the recipient’s address.
+ ///
+ [JsonProperty("destination_state")]
+ public string? DestinationState { get; set; }
+ ///
+ /// DestinationCity The city of the recipient’s address.
+ ///
+ [JsonProperty("destination_city")]
+ public string? DestinationCity { get; set; }
+ ///
+ /// DestinationPostalCode The postal code of the recipient’s address.
+ ///
+ [JsonProperty("destination_postal_code")]
+ public string? DestinationPostalCode { get; set; }
+ ///
+ /// DestinationRawLocation The shipping address that the shipment is shipping to.
+ ///
+ [JsonProperty("destination_raw_location")]
+ public string? DestinationRawLocation { get; set; }
+ ///
+ /// CourierDestinationCountryRegion Destination country/region of the tracking detected from the courier. ISO Alpha-3 (three letters). Value will be `null` if the courier doesn't provide the destination country.
+ ///
+ [JsonProperty("courier_destination_country_region")]
+ public string? CourierDestinationCountryRegion { get; set; }
+ ///
+ /// CourierEstimatedDeliveryDate The field contains the estimated delivery date provided by the carrier.
+ ///
+ [JsonProperty("courier_estimated_delivery_date")]
+ public CourierEstimatedDeliveryDateGetTrackingByIdResponse? CourierEstimatedDeliveryDate { get; set; }
+ ///
+ /// Note Text field for the note.
+ ///
+ [JsonProperty("note")]
+ public string? Note { get; set; }
+ ///
+ /// OrderId A globally-unique identifier for the order.
+ ///
+ [JsonProperty("order_id")]
+ public string? OrderId { get; set; }
+ ///
+ /// OrderIdPath The URL for the order in your system or store.
+ ///
+ [JsonProperty("order_id_path")]
+ public string? OrderIdPath { get; set; }
+ ///
+ /// OrderDate The date and time the order was created in your system or store. It uses the format: `YYYY-MM-DDTHH:mm:ssZ` based on whichever timezone you provide.
+ ///
+ [JsonProperty("order_date")]
+ public string? OrderDate { get; set; }
+ ///
+ /// ShipmentPackageCount Number of packages under the tracking.
+ ///
+ [JsonProperty("shipment_package_count")]
+ public double? ShipmentPackageCount { get; set; }
+ ///
+ /// ShipmentPickupDate The date and time the shipment was picked up by the carrier. It uses the timezone where the pickup occured. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("shipment_pickup_date")]
+ public string? ShipmentPickupDate { get; set; }
+ ///
+ /// ShipmentDeliveryDate The date and time the shipment was delivered. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("shipment_delivery_date")]
+ public string? ShipmentDeliveryDate { get; set; }
+ ///
+ /// ShipmentType The carrier service type for the shipment.
+ ///
+ [JsonProperty("shipment_type")]
+ public string? ShipmentType { get; set; }
+ ///
+ /// ShipmentWeight The shipment_weight field represents the total weight of the shipment. In scenarios where the carrier does not provide this information, you can provide the weight to AfterShip. We will prioritize the data provided by the carrier, if available. The shipment weight will be included in the Response and accessed through the GET API, Webhook, and CSV export. It will also be displayed on the AfterShip Tracking admin. Additionally, it plays a significant role in error-free shipment handling and carbon emission calculations, ensuring accurate and informed decision-making
+ ///
+ [JsonProperty("shipment_weight")]
+ public ShipmentWeightGetTrackingByIdResponse? ShipmentWeight { get; set; }
+ ///
+ /// SignedBy Signed by information for delivered shipment.
+ ///
+ [JsonProperty("signed_by")]
+ public string? SignedBy { get; set; }
+ ///
+ /// Source Source of how this tracking is added.
+ ///
+ [JsonProperty("source")]
+ public string? Source { get; set; }
+ ///
+ /// Tag Current status of tracking. (
+ ///
+ [JsonProperty("tag")]
+ public TagV1? Tag { get; set; }
+ ///
+ /// Subtag Current subtag of tracking. (
+ ///
+ [JsonProperty("subtag")]
+ public string? Subtag { get; set; }
+ ///
+ /// SubtagMessage Normalized tracking message. (
+ ///
+ [JsonProperty("subtag_message")]
+ public string? SubtagMessage { get; set; }
+ ///
+ /// Title By default this field shows the `tracking_number`, but you can customize it as you wish with any info (e.g. the order number).
+ ///
+ [JsonProperty("title")]
+ public string? Title { get; set; }
+ ///
+ /// TrackedCount Number of attempts AfterShip tracks at courier's system.
+ ///
+ [JsonProperty("tracked_count")]
+ public double? TrackedCount { get; set; }
+ ///
+ /// LastMileTrackingSupported Indicates if the shipment is trackable till the final destination.Three possible values:- true- false- null
+ ///
+ [JsonProperty("last_mile_tracking_supported")]
+ public bool? LastMileTrackingSupported { get; set; }
+ ///
+ /// Language The recipient’s language. If you set up AfterShip notifications in different languages, we use this to send the recipient tracking updates in their preferred language.
+ ///
+ [JsonProperty("language")]
+ public string? Language { get; set; }
+ ///
+ /// UniqueToken Deprecated
+ ///
+ [JsonProperty("unique_token")]
+ public string? UniqueToken { get; set; }
+ ///
+ /// Checkpoints Array of checkpoint object describes the checkpoint information.
+ ///
+ [JsonProperty("checkpoints")]
+ public Checkpoint?[] Checkpoints { get; set; }
+ ///
+ /// SubscribedSmses Phone number(s) subscribed to receive sms notifications.
+ ///
+ [JsonProperty("subscribed_smses")]
+ public string?[] SubscribedSmses { get; set; }
+ ///
+ /// SubscribedEmails Email address(es) subscribed to receive email notifications.
+ ///
+ [JsonProperty("subscribed_emails")]
+ public string?[] SubscribedEmails { get; set; }
+ ///
+ /// ReturnToSender Whether or not the shipment is returned to sender. Value is `true` when any of its checkpoints has subtag `Exception_010` (returning to sender) or `Exception_011` (returned to sender). Otherwise value is `false`.
+ ///
+ [JsonProperty("return_to_sender")]
+ public bool? ReturnToSender { get; set; }
+ ///
+ /// OrderPromisedDeliveryDate The promised delivery date of the order. It uses the formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("order_promised_delivery_date")]
+ public string? OrderPromisedDeliveryDate { get; set; }
+ ///
+ /// DeliveryType Shipment delivery type- pickup_at_store- pickup_at_courier- door_to_door
+ ///
+ [JsonProperty("delivery_type")]
+ public string? DeliveryType { get; set; }
+ ///
+ /// PickupLocation Shipment pickup location for receiver
+ ///
+ [JsonProperty("pickup_location")]
+ public string? PickupLocation { get; set; }
+ ///
+ /// PickupNote Shipment pickup note for receiver
+ ///
+ [JsonProperty("pickup_note")]
+ public string? PickupNote { get; set; }
+ ///
+ /// CourierTrackingLink Official tracking URL of the courier (if any). The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default.
+ ///
+ [JsonProperty("courier_tracking_link")]
+ public string? CourierTrackingLink { get; set; }
+ ///
+ /// FirstAttemptedAt The date and time of the carrier’s first attempt to deliver the package to the recipient. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("first_attempted_at")]
+ public string? FirstAttemptedAt { get; set; }
+ ///
+ /// CourierRedirectLink Delivery instructions (delivery date or address) can be modified by visiting the link if supported by a carrier. The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default.
+ ///
+ [JsonProperty("courier_redirect_link")]
+ public string? CourierRedirectLink { get; set; }
+ ///
+ /// TrackingAccountNumber Additional field required by some carriers to retrieve the tracking info. The shipper’s carrier account number. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_account_number")]
+ public string? TrackingAccountNumber { get; set; }
+ ///
+ /// TrackingKey Additional field required by some carriers to retrieve the tracking info. A type of tracking credential required by some carriers. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_key")]
+ public string? TrackingKey { get; set; }
+ ///
+ /// TrackingShipDate The date and time when the shipment is shipped by the merchant and ready for pickup by the carrier. The field supports the following formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZThe field serves two key purposes:- Calculate processing time metrics in the Order-to-delivery Analytics dashboard. To ensure accurate analytics, it's recommended to include timezone information when configuring this value- Required by certain carriers to retrieve tracking information as an additional tracking field.
+ ///
+ [JsonProperty("tracking_ship_date")]
+ public string? TrackingShipDate { get; set; }
+ ///
+ /// OnTimeStatus Whether the tracking is delivered on time or not.
+ ///
+ [JsonProperty("on_time_status")]
+ public string? OnTimeStatus { get; set; }
+ ///
+ /// OnTimeDifference The difference days of the on time.
+ ///
+ [JsonProperty("on_time_difference")]
+ public double? OnTimeDifference { get; set; }
+ ///
+ /// OrderTags The tags of the order.
+ ///
+ [JsonProperty("order_tags")]
+ public string?[] OrderTags { get; set; }
+ ///
+ /// AftershipEstimatedDeliveryDate The estimated delivery date of the shipment provided by AfterShip’s AI and shown to the recipients. It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone.
+ ///
+ [JsonProperty("aftership_estimated_delivery_date")]
+ public AftershipEstimatedDeliveryDateGetTrackingByIdResponse? AftershipEstimatedDeliveryDate { get; set; }
+ ///
+ /// CustomEstimatedDeliveryDate Estimated delivery time of the shipment based on your . It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone.
+ ///
+ [JsonProperty("custom_estimated_delivery_date")]
+ public CustomEstimatedDeliveryDateGetTrackingByIdResponse? CustomEstimatedDeliveryDate { get; set; }
+ ///
+ /// OrderNumber A unique, human-readable identifier for the order.
+ ///
+ [JsonProperty("order_number")]
+ public string? OrderNumber { get; set; }
+ ///
+ /// FirstEstimatedDelivery The shipment’s original estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone.
+ ///
+ [JsonProperty("first_estimated_delivery")]
+ public FirstEstimatedDeliveryGetTrackingByIdResponse? FirstEstimatedDelivery { get; set; }
+ ///
+ /// LatestEstimatedDelivery The most recently calculated estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone.
+ ///
+ [JsonProperty("latest_estimated_delivery")]
+ public LatestEstimatedDeliveryGetTrackingByIdResponse? LatestEstimatedDelivery { get; set; }
+ ///
+ /// ShipmentTags Used to add tags to your shipments to help categorize and filter them easily.
+ ///
+ [JsonProperty("shipment_tags")]
+ public string?[] ShipmentTags { get; set; }
+ ///
+ /// CourierConnectionId If you have multiple accounts connected for a single carrier on AfterShip, we have introduced the courier_connection_id field to allow you to specify the carrier account associated with each shipment. By providing this information, you enable us to accurately track and monitor your shipments based on the correct carrier account.(In the event that you do not specify the courier_connection_id, we will handle your shipment using the connection that was created earliest among your connected accounts.
+ ///
+ [JsonProperty("courier_connection_id")]
+ public string? CourierConnectionId { get; set; }
+ ///
+ /// TrackingOriginCountryRegion (Legacy) Replaced by `origin_country_region`. Additional field required by some carriers to retrieve the tracking info. The origin country/region of the shipment. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_origin_country_region")]
+ public string? TrackingOriginCountryRegion { get; set; }
+ ///
+ /// TrackingDestinationCountryRegion (Legacy) Replaced by `destination_country_region`. Additional field required by some carriers to retrieve the tracking info. The destination country/region of the shipment. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_destination_country_region")]
+ public string? TrackingDestinationCountryRegion { get; set; }
+ ///
+ /// TrackingPostalCode (Legacy) Replaced by `destination_postal_code`. Additional field required by some carriers to retrieve the tracking info. The postal code of the recipient’s address. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_postal_code")]
+ public string? TrackingPostalCode { get; set; }
+ ///
+ /// TrackingState (Legacy) Replaced by `destination_state`. Additional field required by some carriers to retrieve the tracking info. The state/province of the recipient’s address. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_state")]
+ public string? TrackingState { get; set; }
+ ///
+ /// CarbonEmissions The model contains the total amount of carbon emissions generated by the shipment. - AfterShip will provide this data only when it is available, and its availability is contingent upon the location and weight information that AfterShip can obtain.- The values will be accessible solely for shipments that have been successfully delivered. However, in the event of a shipping update after the delivery status has been achieved, the value may change.- It’s a paid service and only for Tracking Enterprise users, please contact your customer success manager if you want to know more.
+ ///
+ [JsonProperty("carbon_emissions")]
+ public CarbonEmissionsGetTrackingByIdResponse? CarbonEmissions { get; set; }
+ ///
+ /// LocationId The location_id refers to the place where you fulfilled the items. - If you provide a location_id, the system will automatically use it as the tracking's origin address. However, passing both location_id and any origin address information simultaneously is not allowed.- Please make sure you add your locations .
+ ///
+ [JsonProperty("location_id")]
+ public string? LocationId { get; set; }
+ ///
+ /// ShippingMethod The shipping_method string refers to the chosen method for delivering the package. Merchants typically offer various shipping methods to consumers during the checkout process, such as, Local Delivery, Free Express Worldwide Shipping, etc.
+ ///
+ [JsonProperty("shipping_method")]
+ public string? ShippingMethod { get; set; }
+ ///
+ /// FailedDeliveryAttempts By dynamically tracking failed delivery attempts during shipment, this field allows you to pinpoint carriers accountable for the most failures. Analyzing the root cause of these failures enables you to improve carriers' delivery standard operating procedures (SOP), leading to an overall enhancement in delivery service quality.
+ ///
+ [JsonProperty("failed_delivery_attempts")]
+ public int? FailedDeliveryAttempts { get; set; }
+ ///
+ /// SignatureRequirement The signature_requirement field serves the purpose of validating the service option type, specifically proof of delivery. By collecting the recipient's signature upon delivery, it ensures the package reaches the intended recipient and prevents disputes related to non-delivery or lost packages.
+ ///
+ [JsonProperty("signature_requirement")]
+ public string? SignatureRequirement { get; set; }
+ ///
+ /// DeliveryLocationType The delivery location type represents the secure area where the carrier leaves the package, such as a safe place, locker, mailbox, front porch, etc. This information helps ensure the shipment reaches the intended recipient efficiently, minimizing the risk of theft or damage.
+ ///
+ [JsonProperty("delivery_location_type")]
+ public string? DeliveryLocationType { get; set; }
+ ///
+ /// AftershipTrackingUrl The tracking URL directs your customers to the shipment tracking page which can display either the default or a customized page based on segmentation rules.- The universal URL is used by default, but you can opt for a custom domain if you have one. Learn how to set up a custom domain .The field is not automatically enabled in API & Webhook. Please contact support if you’d like to enable it.
+ ///
+ [JsonProperty("aftership_tracking_url")]
+ public string? AftershipTrackingUrl { get; set; }
+ ///
+ /// AftershipTrackingOrderUrl The order URL directs your customers to the order tracking page, which includes all shipments. It can display either the default or a customized page based on segmentation rules.- The universal URL is used by default, but you can opt for a custom domain if you have one. Learn how to set up a custom domain .The field is not automatically enabled in API & Webhook. Please contact support if you’d like to enable it.
+ ///
+ [JsonProperty("aftership_tracking_order_url")]
+ public string? AftershipTrackingOrderUrl { get; set; }
+ ///
+ /// FirstMile The field contains information about the first leg of the shipping starting from the carrier picking up the shipment from the shipper to the point where they hand it over to the last-mile carrier. Once AfterShip detects the shipment is multi-leg, we will populate the first-mile information under this object.
+ ///
+ [JsonProperty("first_mile")]
+ public FirstMileGetTrackingByIdResponse? FirstMile { get; set; }
+ ///
+ /// LastMile This field contains information about the last leg of the shipment, starting from the carrier who hands it over to the last-mile carrier, all the way to delivery. Once AfterShip detects that the shipment involves multiple legs and identifies the last-mile carrier, we will populate the last-mile carrier information in this object. Alternatively, the user can provide this information in this field to specify the last-mile carrier, which is helpful if AfterShip is unable to detect it automatically.
+ ///
+ [JsonProperty("last_mile")]
+ public LastMileGetTrackingByIdResponse? LastMile { get; set; }
+ ///
+ /// Customers The field contains the customer information associated with the tracking. A maximum of three customer objects are allowed.
+ ///
+ [JsonProperty("customers")]
+ public CustomersGetTrackingByIdResponse?[] Customers { get; set; }
+ public GetTrackingByIdResponse()
+ {
+ }
+ }
+
+ ///
+ ///
+ ///
+ public class CourierEstimatedDeliveryDateGetTrackingByIdResponse
+ {
+ ///
+ /// EstimatedDeliveryDate The estimated arrival date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("estimated_delivery_date")]
+ public string? EstimatedDeliveryDate { get; set; }
+ ///
+ /// EstimatedDeliveryDateMin The earliest estimated delivery date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("estimated_delivery_date_min")]
+ public string? EstimatedDeliveryDateMin { get; set; }
+ ///
+ /// EstimatedDeliveryDateMax The Latest estimated delivery date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("estimated_delivery_date_max")]
+ public string? EstimatedDeliveryDateMax { get; set; }
+
+ public CourierEstimatedDeliveryDateGetTrackingByIdResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class ShipmentWeightGetTrackingByIdResponse
+ {
+ ///
+ /// Unit The unit in which the value field is expressed.
+ ///
+ [JsonProperty("unit")]
+ public string? Unit { get; set; }
+ ///
+ /// Value The total amount of shipment weight.
+ ///
+ [JsonProperty("value")]
+ public double? Value { get; set; }
+
+ public ShipmentWeightGetTrackingByIdResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class AftershipEstimatedDeliveryDateGetTrackingByIdResponse
+ {
+ ///
+ /// EstimatedDeliveryDate The estimated arrival date of the shipment.
+ ///
+ [JsonProperty("estimated_delivery_date")]
+ public string? EstimatedDeliveryDate { get; set; }
+ ///
+ /// ConfidenceCode Indicates the confidence level and associated reason for an AI EDD prediction request. For a comprehensive list of confidence codes, refer to .
+ ///
+ [JsonProperty("confidence_code")]
+ public double? ConfidenceCode { get; set; }
+ ///
+ /// EstimatedDeliveryDateMin Earliest estimated delivery date of the shipment.
+ ///
+ [JsonProperty("estimated_delivery_date_min")]
+ public string? EstimatedDeliveryDateMin { get; set; }
+ ///
+ /// EstimatedDeliveryDateMax Latest estimated delivery date of the shipment.
+ ///
+ [JsonProperty("estimated_delivery_date_max")]
+ public string? EstimatedDeliveryDateMax { get; set; }
+
+ public AftershipEstimatedDeliveryDateGetTrackingByIdResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class CustomEstimatedDeliveryDateGetTrackingByIdResponse
+ {
+ ///
+ /// Type The format of the EDD. Either a single date or a date range.
+ ///
+ [JsonProperty("type")]
+ public string? Type { get; set; }
+ ///
+ /// Datetime The specific EDD date.
+ ///
+ [JsonProperty("datetime")]
+ public string? Datetime { get; set; }
+ ///
+ /// DatetimeMin For a date range EDD format, the date for the lower end of the range.
+ ///
+ [JsonProperty("datetime_min")]
+ public string? DatetimeMin { get; set; }
+ ///
+ /// DatetimeMax For a date range EDD format, the date for the upper end of the range.
+ ///
+ [JsonProperty("datetime_max")]
+ public string? DatetimeMax { get; set; }
+
+ public CustomEstimatedDeliveryDateGetTrackingByIdResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class FirstEstimatedDeliveryGetTrackingByIdResponse
+ {
+ ///
+ /// Type The format of the EDD. Either a single date or a date range.
+ ///
+ [JsonProperty("type")]
+ public string? Type { get; set; }
+ ///
+ /// Source The source of the EDD. Either the carrier, AfterShip AI, or based on your custom EDD settings.
+ ///
+ [JsonProperty("source")]
+ public string? Source { get; set; }
+ ///
+ /// Datetime The latest EDD time.
+ ///
+ [JsonProperty("datetime")]
+ public string? Datetime { get; set; }
+ ///
+ /// DatetimeMin For a date range EDD format, the date and time for the lower end of the range.
+ ///
+ [JsonProperty("datetime_min")]
+ public string? DatetimeMin { get; set; }
+ ///
+ /// DatetimeMax For a date range EDD format, the date and time for the upper end of the range.
+ ///
+ [JsonProperty("datetime_max")]
+ public string? DatetimeMax { get; set; }
+
+ public FirstEstimatedDeliveryGetTrackingByIdResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class LatestEstimatedDeliveryGetTrackingByIdResponse
+ {
+ ///
+ /// Type The format of the EDD. Either a single date or a date range.
+ ///
+ [JsonProperty("type")]
+ public string? Type { get; set; }
+ ///
+ /// Source The source of the EDD. Either the carrier, AfterShip AI, or based on your custom EDD settings.
+ ///
+ [JsonProperty("source")]
+ public string? Source { get; set; }
+ ///
+ /// Datetime The latest EDD time.
+ ///
+ [JsonProperty("datetime")]
+ public string? Datetime { get; set; }
+ ///
+ /// DatetimeMin For a date range EDD format, the date and time for the lower end of the range.
+ ///
+ [JsonProperty("datetime_min")]
+ public string? DatetimeMin { get; set; }
+ ///
+ /// DatetimeMax For a date range EDD format, the date and time for the upper end of the range.
+ ///
+ [JsonProperty("datetime_max")]
+ public string? DatetimeMax { get; set; }
+
+ public LatestEstimatedDeliveryGetTrackingByIdResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class CarbonEmissionsGetTrackingByIdResponse
+ {
+ ///
+ /// Unit The unit in which the value field is expressed. Allowed values: kg
+ ///
+ [JsonProperty("unit")]
+ public string? Unit { get; set; }
+ ///
+ /// Value The total amount of carbon emissions
+ ///
+ [JsonProperty("value")]
+ public double? Value { get; set; }
+
+ public CarbonEmissionsGetTrackingByIdResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class FirstMileGetTrackingByIdResponse
+ {
+ ///
+ /// TrackingNumber The tracking number of the first-mile carrier.
+ ///
+ [JsonProperty("tracking_number")]
+ public string? TrackingNumber { get; set; }
+ ///
+ /// Slug The unique code of the carrier responsible for the first-mile of the shipment. Find all the courier slugs .
+ ///
+ [JsonProperty("slug")]
+ public string? Slug { get; set; }
+ ///
+ /// TransitTime The transit time for the first-mile of a shipment in days. This field is calculated based on whether the handed_over_to_last_mile_carrier or received_by_last_mile_carrier event is detected by AfterShip. The handover event date is used to calculate the first-mile transit time.- First mile transit time (in days) = Handover date - Pickup date
+ ///
+ [JsonProperty("transit_time")]
+ public string? TransitTime { get; set; }
+ ///
+ /// CourierRedirectLink The field provides the link for modifying delivery instructions (such as delivery date and shipping address), if supported by the first-mile carrier. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US".
+ ///
+ [JsonProperty("courier_redirect_link")]
+ public string? CourierRedirectLink { get; set; }
+ ///
+ /// CourierTrackingLink The field contains the official tracking URL of the first-mile carrier, if available. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US".
+ ///
+ [JsonProperty("courier_tracking_link")]
+ public string? CourierTrackingLink { get; set; }
+
+ public FirstMileGetTrackingByIdResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class LastMileGetTrackingByIdResponse
+ {
+ ///
+ /// TrackingNumber The tracking number of the last-mile carrier.
+ ///
+ [JsonProperty("tracking_number")]
+ public string? TrackingNumber { get; set; }
+ ///
+ /// Slug The unique code of the carrier responsible for the last-mile of the shipment. Find all the courier slugs .
+ ///
+ [JsonProperty("slug")]
+ public string? Slug { get; set; }
+ ///
+ /// TransitTime The transit time for the last-mile of a shipment in days. This field is calculated based on whether the handed_over_to_last_mile_carrier or the received_by_last_mile_carrier event is detected by AfterShip. The handover event date is used to calculate the last-mile transit time.- Last mile transit time (in days)= Delivered date - Handover date
+ ///
+ [JsonProperty("transit_time")]
+ public string? TransitTime { get; set; }
+ ///
+ /// CourierTrackingLink The field contains the official tracking URL of the last-mile carrier, if available. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US".
+ ///
+ [JsonProperty("courier_tracking_link")]
+ public string? CourierTrackingLink { get; set; }
+ ///
+ /// CourierRedirectLink The field provides the link for modifying delivery instructions (such as delivery date and shipping address), if supported by the last-mile carrier. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US".
+ ///
+ [JsonProperty("courier_redirect_link")]
+ public string? CourierRedirectLink { get; set; }
+ ///
+ /// Source The field indicates the source of last-mile carrier.
+ ///
+ [JsonProperty("source")]
+ public string? Source { get; set; }
+
+ public LastMileGetTrackingByIdResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class CustomersGetTrackingByIdResponse
+ {
+ ///
+ /// Role The role of the customer, indicating whether the customer is an individual or a company.
+ ///
+ [JsonProperty("role")]
+ public string? Role { get; set; }
+ ///
+ /// Name Customer name associated with the tracking.
+ ///
+ [JsonProperty("name")]
+ public string? Name { get; set; }
+ ///
+ /// PhoneNumber The phone number(s) to receive SMS notifications. Phone numbers should begin with a `+` sign and include the area code.
+ ///
+ [JsonProperty("phone_number")]
+ public string? PhoneNumber { get; set; }
+ ///
+ /// Email Email address(es) to receive email notifications.
+ ///
+ [JsonProperty("email")]
+ public string? Email { get; set; }
+ ///
+ /// Language The preferred language of the customer. If you have set up AfterShip notifications in different languages, we use this to send the tracking updates to the customer in their preferred language.
+ ///
+ [JsonProperty("language")]
+ public string? Language { get; set; }
+
+ public CustomersGetTrackingByIdResponse()
+ {
+ }
+ }
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/Models/GetTrackingsResponse.cs b/src/AfterShipTracking/AfterShipTracking/Models/GetTrackingsResponse.cs
new file mode 100644
index 0000000..d066502
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Models/GetTrackingsResponse.cs
@@ -0,0 +1,71 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System;
+using System.Collections.Generic;
+using Newtonsoft.Json;
+
+namespace AfterShipTracking
+{
+ ///
+ ///
+ ///
+ public class GetTrackingsResponse
+ {
+ ///
+ /// Pagination The Pagination holds the information for the pagination when the response contains multiple objects.
+ ///
+ [JsonProperty("pagination")]
+ public PaginationGetTrackingsResponse? Pagination { get; set; }
+ ///
+ /// Trackings Array of
+ ///
+ [JsonProperty("trackings")]
+ public Tracking?[] Trackings { get; set; }
+ ///
+ /// Page
+ ///
+ [JsonProperty("page")]
+ public int? Page { get; set; }
+ ///
+ /// Limit
+ ///
+ [JsonProperty("limit")]
+ public int? Limit { get; set; }
+ ///
+ /// Count
+ ///
+ [JsonProperty("total")]
+ public int? Count { get; set; }
+ public GetTrackingsResponse()
+ {
+ }
+ }
+
+ ///
+ ///
+ ///
+ public class PaginationGetTrackingsResponse
+ {
+ ///
+ /// Total The total number of trackings.
+ ///
+ [JsonProperty("total")]
+ public int? Total { get; set; }
+ ///
+ /// NextCursor A string representing the cursor value for the next page of results.
+ ///
+ [JsonProperty("next_cursor")]
+ public string? NextCursor { get; set; }
+ ///
+ /// HasNextPage To indicate if next page is available.
+ ///
+ [JsonProperty("has_next_page")]
+ public bool? HasNextPage { get; set; }
+
+ public PaginationGetTrackingsResponse()
+ {
+ }
+ }
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/Models/GetUserCouriersResponse.cs b/src/AfterShipTracking/AfterShipTracking/Models/GetUserCouriersResponse.cs
new file mode 100644
index 0000000..d8f5c7d
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Models/GetUserCouriersResponse.cs
@@ -0,0 +1,31 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System;
+using System.Collections.Generic;
+using Newtonsoft.Json;
+
+namespace AfterShipTracking
+{
+ ///
+ ///
+ ///
+ public class GetUserCouriersResponse
+ {
+ ///
+ /// Total Total count of courier objects
+ ///
+ [JsonProperty("total")]
+ public int? Total { get; set; }
+ ///
+ /// Couriers Array of object.
+ ///
+ [JsonProperty("couriers")]
+ public Courier?[] Couriers { get; set; }
+ public GetUserCouriersResponse()
+ {
+ }
+ }
+
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/Models/MarkTrackingCompletedByIdRequest.cs b/src/AfterShipTracking/AfterShipTracking/Models/MarkTrackingCompletedByIdRequest.cs
new file mode 100644
index 0000000..c1f8e93
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Models/MarkTrackingCompletedByIdRequest.cs
@@ -0,0 +1,26 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System;
+using System.Collections.Generic;
+using Newtonsoft.Json;
+
+namespace AfterShipTracking
+{
+ ///
+ ///
+ ///
+ public class MarkTrackingCompletedByIdRequest
+ {
+ ///
+ /// Reason One of `DELIVERED`, `LOST` or `RETURNED_TO_SENDER`.- Mark the tracking as completed with `DELIVERED`. The tag of the tracking will be updated to `Delivered` and the subtag will be updated to `Delivered_001`.- Mark the tracking as completed with `LOST`. The tag of the tracking will be updated to `Exception` and the subtag will be updated to `Exception_013`.- Mark the tracking as completed with `RETURNED_TO_SENDER`. The tag of the tracking will be updated to `Exception` and the subtag will be updated to `Exception_011`.
+ ///
+ [JsonProperty("reason")]
+ public string Reason { get; set; }
+ public MarkTrackingCompletedByIdRequest()
+ {
+ }
+ }
+
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/Models/MarkTrackingCompletedByIdResponse.cs b/src/AfterShipTracking/AfterShipTracking/Models/MarkTrackingCompletedByIdResponse.cs
new file mode 100644
index 0000000..7545a14
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Models/MarkTrackingCompletedByIdResponse.cs
@@ -0,0 +1,721 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System;
+using System.Collections.Generic;
+using Newtonsoft.Json;
+
+namespace AfterShipTracking
+{
+ ///
+ /// Object describes the tracking information.
+ ///
+ public class MarkTrackingCompletedByIdResponse
+ {
+ ///
+ /// Id Tracking ID.
+ ///
+ [JsonProperty("id")]
+ public string? Id { get; set; }
+ ///
+ /// LegacyId The length of the tracking ID has been increased from 24 characters to 32 characters. We will use the legacy_id field to store the original 24-character tracking ID to maintain compatibility with existing data. Therefore, all tracking endpoints will continue to work with the legacy_id field as before.
+ ///
+ [JsonProperty("legacy_id")]
+ public string? LegacyId { get; set; }
+ ///
+ /// CreatedAt The date and time the shipment was imported or added to AfterShip. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0.
+ ///
+ [JsonProperty("created_at")]
+ public string? CreatedAt { get; set; }
+ ///
+ /// UpdatedAt The date and time the shipment was updated. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0.
+ ///
+ [JsonProperty("updated_at")]
+ public string? UpdatedAt { get; set; }
+ ///
+ /// TrackingNumber Tracking number.
+ ///
+ [JsonProperty("tracking_number")]
+ public string? TrackingNumber { get; set; }
+ ///
+ /// Slug Unique courier code. When importing a shipment with no courier slug and the tracking number can’t be recognized, the courier will be marked as `unrecognized`. Get courier codes .
+ ///
+ [JsonProperty("slug")]
+ public string? Slug { get; set; }
+ ///
+ /// Active Whether or not AfterShip will continue tracking the shipments. Value is `false` when tag (status) is `Delivered`, `Expired`, or further updates for 30 days since last update.
+ ///
+ [JsonProperty("active")]
+ public bool? Active { get; set; }
+ ///
+ /// CustomFields Custom fields that accept an object with string field. In order to protect the privacy of your customers, do not include any in custom fields.
+ ///
+ [JsonProperty("custom_fields")]
+ public Dictionary? CustomFields { get; set; }
+ ///
+ /// TransitTime Total transit time in days.- For delivered shipments: Transit time (in days) = Delivered date - Pick-up date- For undelivered shipments: Transit time (in days) = Current date - Pick-up dateValue as `null` for the shipment without pick-up date.
+ ///
+ [JsonProperty("transit_time")]
+ public int? TransitTime { get; set; }
+ ///
+ /// OriginCountryRegion The for the origin country/region. E.g. USA for the United States.
+ ///
+ [JsonProperty("origin_country_region")]
+ public string? OriginCountryRegion { get; set; }
+ ///
+ /// OriginState The state of the sender’s address.
+ ///
+ [JsonProperty("origin_state")]
+ public string? OriginState { get; set; }
+ ///
+ /// OriginCity The city of the sender’s address.
+ ///
+ [JsonProperty("origin_city")]
+ public string? OriginCity { get; set; }
+ ///
+ /// OriginPostalCode The postal code of the sender’s address.
+ ///
+ [JsonProperty("origin_postal_code")]
+ public string? OriginPostalCode { get; set; }
+ ///
+ /// OriginRawLocation The sender address that the shipment is shipping from.
+ ///
+ [JsonProperty("origin_raw_location")]
+ public string? OriginRawLocation { get; set; }
+ ///
+ /// DestinationCountryRegion The for the destination country/region. E.g. USA for the United States.
+ ///
+ [JsonProperty("destination_country_region")]
+ public string? DestinationCountryRegion { get; set; }
+ ///
+ /// DestinationState The state of the recipient’s address.
+ ///
+ [JsonProperty("destination_state")]
+ public string? DestinationState { get; set; }
+ ///
+ /// DestinationCity The city of the recipient’s address.
+ ///
+ [JsonProperty("destination_city")]
+ public string? DestinationCity { get; set; }
+ ///
+ /// DestinationPostalCode The postal code of the recipient’s address.
+ ///
+ [JsonProperty("destination_postal_code")]
+ public string? DestinationPostalCode { get; set; }
+ ///
+ /// DestinationRawLocation The shipping address that the shipment is shipping to.
+ ///
+ [JsonProperty("destination_raw_location")]
+ public string? DestinationRawLocation { get; set; }
+ ///
+ /// CourierDestinationCountryRegion Destination country/region of the tracking detected from the courier. ISO Alpha-3 (three letters). Value will be `null` if the courier doesn't provide the destination country.
+ ///
+ [JsonProperty("courier_destination_country_region")]
+ public string? CourierDestinationCountryRegion { get; set; }
+ ///
+ /// CourierEstimatedDeliveryDate The field contains the estimated delivery date provided by the carrier.
+ ///
+ [JsonProperty("courier_estimated_delivery_date")]
+ public CourierEstimatedDeliveryDateMarkTrackingCompletedByIdResponse? CourierEstimatedDeliveryDate { get; set; }
+ ///
+ /// Note Text field for the note.
+ ///
+ [JsonProperty("note")]
+ public string? Note { get; set; }
+ ///
+ /// OrderId A globally-unique identifier for the order.
+ ///
+ [JsonProperty("order_id")]
+ public string? OrderId { get; set; }
+ ///
+ /// OrderIdPath The URL for the order in your system or store.
+ ///
+ [JsonProperty("order_id_path")]
+ public string? OrderIdPath { get; set; }
+ ///
+ /// OrderDate The date and time the order was created in your system or store. It uses the format: `YYYY-MM-DDTHH:mm:ssZ` based on whichever timezone you provide.
+ ///
+ [JsonProperty("order_date")]
+ public string? OrderDate { get; set; }
+ ///
+ /// ShipmentPackageCount Number of packages under the tracking.
+ ///
+ [JsonProperty("shipment_package_count")]
+ public double? ShipmentPackageCount { get; set; }
+ ///
+ /// ShipmentPickupDate The date and time the shipment was picked up by the carrier. It uses the timezone where the pickup occured. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("shipment_pickup_date")]
+ public string? ShipmentPickupDate { get; set; }
+ ///
+ /// ShipmentDeliveryDate The date and time the shipment was delivered. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("shipment_delivery_date")]
+ public string? ShipmentDeliveryDate { get; set; }
+ ///
+ /// ShipmentType The carrier service type for the shipment.
+ ///
+ [JsonProperty("shipment_type")]
+ public string? ShipmentType { get; set; }
+ ///
+ /// ShipmentWeight The shipment_weight field represents the total weight of the shipment. In scenarios where the carrier does not provide this information, you can provide the weight to AfterShip. We will prioritize the data provided by the carrier, if available. The shipment weight will be included in the Response and accessed through the GET API, Webhook, and CSV export. It will also be displayed on the AfterShip Tracking admin. Additionally, it plays a significant role in error-free shipment handling and carbon emission calculations, ensuring accurate and informed decision-making
+ ///
+ [JsonProperty("shipment_weight")]
+ public ShipmentWeightMarkTrackingCompletedByIdResponse? ShipmentWeight { get; set; }
+ ///
+ /// SignedBy Signed by information for delivered shipment.
+ ///
+ [JsonProperty("signed_by")]
+ public string? SignedBy { get; set; }
+ ///
+ /// Source Source of how this tracking is added.
+ ///
+ [JsonProperty("source")]
+ public string? Source { get; set; }
+ ///
+ /// Tag Current status of tracking. (
+ ///
+ [JsonProperty("tag")]
+ public TagV1? Tag { get; set; }
+ ///
+ /// Subtag Current subtag of tracking. (
+ ///
+ [JsonProperty("subtag")]
+ public string? Subtag { get; set; }
+ ///
+ /// SubtagMessage Normalized tracking message. (
+ ///
+ [JsonProperty("subtag_message")]
+ public string? SubtagMessage { get; set; }
+ ///
+ /// Title By default this field shows the `tracking_number`, but you can customize it as you wish with any info (e.g. the order number).
+ ///
+ [JsonProperty("title")]
+ public string? Title { get; set; }
+ ///
+ /// TrackedCount Number of attempts AfterShip tracks at courier's system.
+ ///
+ [JsonProperty("tracked_count")]
+ public double? TrackedCount { get; set; }
+ ///
+ /// LastMileTrackingSupported Indicates if the shipment is trackable till the final destination.Three possible values:- true- false- null
+ ///
+ [JsonProperty("last_mile_tracking_supported")]
+ public bool? LastMileTrackingSupported { get; set; }
+ ///
+ /// Language The recipient’s language. If you set up AfterShip notifications in different languages, we use this to send the recipient tracking updates in their preferred language.
+ ///
+ [JsonProperty("language")]
+ public string? Language { get; set; }
+ ///
+ /// UniqueToken Deprecated
+ ///
+ [JsonProperty("unique_token")]
+ public string? UniqueToken { get; set; }
+ ///
+ /// Checkpoints Array of checkpoint object describes the checkpoint information.
+ ///
+ [JsonProperty("checkpoints")]
+ public Checkpoint?[] Checkpoints { get; set; }
+ ///
+ /// SubscribedSmses Phone number(s) subscribed to receive sms notifications.
+ ///
+ [JsonProperty("subscribed_smses")]
+ public string?[] SubscribedSmses { get; set; }
+ ///
+ /// SubscribedEmails Email address(es) subscribed to receive email notifications.
+ ///
+ [JsonProperty("subscribed_emails")]
+ public string?[] SubscribedEmails { get; set; }
+ ///
+ /// ReturnToSender Whether or not the shipment is returned to sender. Value is `true` when any of its checkpoints has subtag `Exception_010` (returning to sender) or `Exception_011` (returned to sender). Otherwise value is `false`.
+ ///
+ [JsonProperty("return_to_sender")]
+ public bool? ReturnToSender { get; set; }
+ ///
+ /// OrderPromisedDeliveryDate The promised delivery date of the order. It uses the formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("order_promised_delivery_date")]
+ public string? OrderPromisedDeliveryDate { get; set; }
+ ///
+ /// DeliveryType Shipment delivery type- pickup_at_store- pickup_at_courier- door_to_door
+ ///
+ [JsonProperty("delivery_type")]
+ public string? DeliveryType { get; set; }
+ ///
+ /// PickupLocation Shipment pickup location for receiver
+ ///
+ [JsonProperty("pickup_location")]
+ public string? PickupLocation { get; set; }
+ ///
+ /// PickupNote Shipment pickup note for receiver
+ ///
+ [JsonProperty("pickup_note")]
+ public string? PickupNote { get; set; }
+ ///
+ /// CourierTrackingLink Official tracking URL of the courier (if any). The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default.
+ ///
+ [JsonProperty("courier_tracking_link")]
+ public string? CourierTrackingLink { get; set; }
+ ///
+ /// FirstAttemptedAt The date and time of the carrier’s first attempt to deliver the package to the recipient. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("first_attempted_at")]
+ public string? FirstAttemptedAt { get; set; }
+ ///
+ /// CourierRedirectLink Delivery instructions (delivery date or address) can be modified by visiting the link if supported by a carrier. The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default.
+ ///
+ [JsonProperty("courier_redirect_link")]
+ public string? CourierRedirectLink { get; set; }
+ ///
+ /// TrackingAccountNumber Additional field required by some carriers to retrieve the tracking info. The shipper’s carrier account number. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_account_number")]
+ public string? TrackingAccountNumber { get; set; }
+ ///
+ /// TrackingKey Additional field required by some carriers to retrieve the tracking info. A type of tracking credential required by some carriers. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_key")]
+ public string? TrackingKey { get; set; }
+ ///
+ /// TrackingShipDate The date and time when the shipment is shipped by the merchant and ready for pickup by the carrier. The field supports the following formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZThe field serves two key purposes:- Calculate processing time metrics in the Order-to-delivery Analytics dashboard. To ensure accurate analytics, it's recommended to include timezone information when configuring this value- Required by certain carriers to retrieve tracking information as an additional tracking field.
+ ///
+ [JsonProperty("tracking_ship_date")]
+ public string? TrackingShipDate { get; set; }
+ ///
+ /// OnTimeStatus Whether the tracking is delivered on time or not.
+ ///
+ [JsonProperty("on_time_status")]
+ public string? OnTimeStatus { get; set; }
+ ///
+ /// OnTimeDifference The difference days of the on time.
+ ///
+ [JsonProperty("on_time_difference")]
+ public double? OnTimeDifference { get; set; }
+ ///
+ /// OrderTags The tags of the order.
+ ///
+ [JsonProperty("order_tags")]
+ public string?[] OrderTags { get; set; }
+ ///
+ /// AftershipEstimatedDeliveryDate The estimated delivery date of the shipment provided by AfterShip’s AI and shown to the recipients. It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone.
+ ///
+ [JsonProperty("aftership_estimated_delivery_date")]
+ public AftershipEstimatedDeliveryDateMarkTrackingCompletedByIdResponse? AftershipEstimatedDeliveryDate { get; set; }
+ ///
+ /// CustomEstimatedDeliveryDate Estimated delivery time of the shipment based on your . It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone.
+ ///
+ [JsonProperty("custom_estimated_delivery_date")]
+ public CustomEstimatedDeliveryDateMarkTrackingCompletedByIdResponse? CustomEstimatedDeliveryDate { get; set; }
+ ///
+ /// OrderNumber A unique, human-readable identifier for the order.
+ ///
+ [JsonProperty("order_number")]
+ public string? OrderNumber { get; set; }
+ ///
+ /// FirstEstimatedDelivery The shipment’s original estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone.
+ ///
+ [JsonProperty("first_estimated_delivery")]
+ public FirstEstimatedDeliveryMarkTrackingCompletedByIdResponse? FirstEstimatedDelivery { get; set; }
+ ///
+ /// LatestEstimatedDelivery The most recently calculated estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone.
+ ///
+ [JsonProperty("latest_estimated_delivery")]
+ public LatestEstimatedDeliveryMarkTrackingCompletedByIdResponse? LatestEstimatedDelivery { get; set; }
+ ///
+ /// ShipmentTags Used to add tags to your shipments to help categorize and filter them easily.
+ ///
+ [JsonProperty("shipment_tags")]
+ public string?[] ShipmentTags { get; set; }
+ ///
+ /// CourierConnectionId If you have multiple accounts connected for a single carrier on AfterShip, we have introduced the courier_connection_id field to allow you to specify the carrier account associated with each shipment. By providing this information, you enable us to accurately track and monitor your shipments based on the correct carrier account.(In the event that you do not specify the courier_connection_id, we will handle your shipment using the connection that was created earliest among your connected accounts.
+ ///
+ [JsonProperty("courier_connection_id")]
+ public string? CourierConnectionId { get; set; }
+ ///
+ /// TrackingOriginCountryRegion (Legacy) Replaced by `origin_country_region`. Additional field required by some carriers to retrieve the tracking info. The origin country/region of the shipment. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_origin_country_region")]
+ public string? TrackingOriginCountryRegion { get; set; }
+ ///
+ /// TrackingDestinationCountryRegion (Legacy) Replaced by `destination_country_region`. Additional field required by some carriers to retrieve the tracking info. The destination country/region of the shipment. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_destination_country_region")]
+ public string? TrackingDestinationCountryRegion { get; set; }
+ ///
+ /// TrackingPostalCode (Legacy) Replaced by `destination_postal_code`. Additional field required by some carriers to retrieve the tracking info. The postal code of the recipient’s address. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_postal_code")]
+ public string? TrackingPostalCode { get; set; }
+ ///
+ /// TrackingState (Legacy) Replaced by `destination_state`. Additional field required by some carriers to retrieve the tracking info. The state/province of the recipient’s address. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_state")]
+ public string? TrackingState { get; set; }
+ ///
+ /// CarbonEmissions The model contains the total amount of carbon emissions generated by the shipment. - AfterShip will provide this data only when it is available, and its availability is contingent upon the location and weight information that AfterShip can obtain.- The values will be accessible solely for shipments that have been successfully delivered. However, in the event of a shipping update after the delivery status has been achieved, the value may change.- It’s a paid service and only for Tracking Enterprise users, please contact your customer success manager if you want to know more.
+ ///
+ [JsonProperty("carbon_emissions")]
+ public CarbonEmissionsMarkTrackingCompletedByIdResponse? CarbonEmissions { get; set; }
+ ///
+ /// LocationId The location_id refers to the place where you fulfilled the items. - If you provide a location_id, the system will automatically use it as the tracking's origin address. However, passing both location_id and any origin address information simultaneously is not allowed.- Please make sure you add your locations .
+ ///
+ [JsonProperty("location_id")]
+ public string? LocationId { get; set; }
+ ///
+ /// ShippingMethod The shipping_method string refers to the chosen method for delivering the package. Merchants typically offer various shipping methods to consumers during the checkout process, such as, Local Delivery, Free Express Worldwide Shipping, etc.
+ ///
+ [JsonProperty("shipping_method")]
+ public string? ShippingMethod { get; set; }
+ ///
+ /// FailedDeliveryAttempts By dynamically tracking failed delivery attempts during shipment, this field allows you to pinpoint carriers accountable for the most failures. Analyzing the root cause of these failures enables you to improve carriers' delivery standard operating procedures (SOP), leading to an overall enhancement in delivery service quality.
+ ///
+ [JsonProperty("failed_delivery_attempts")]
+ public int? FailedDeliveryAttempts { get; set; }
+ ///
+ /// SignatureRequirement The signature_requirement field serves the purpose of validating the service option type, specifically proof of delivery. By collecting the recipient's signature upon delivery, it ensures the package reaches the intended recipient and prevents disputes related to non-delivery or lost packages.
+ ///
+ [JsonProperty("signature_requirement")]
+ public string? SignatureRequirement { get; set; }
+ ///
+ /// DeliveryLocationType The delivery location type represents the secure area where the carrier leaves the package, such as a safe place, locker, mailbox, front porch, etc. This information helps ensure the shipment reaches the intended recipient efficiently, minimizing the risk of theft or damage.
+ ///
+ [JsonProperty("delivery_location_type")]
+ public string? DeliveryLocationType { get; set; }
+ ///
+ /// AftershipTrackingUrl The tracking URL directs your customers to the shipment tracking page which can display either the default or a customized page based on segmentation rules.- The universal URL is used by default, but you can opt for a custom domain if you have one. Learn how to set up a custom domain .The field is not automatically enabled in API & Webhook. Please contact support if you’d like to enable it.
+ ///
+ [JsonProperty("aftership_tracking_url")]
+ public string? AftershipTrackingUrl { get; set; }
+ ///
+ /// AftershipTrackingOrderUrl The order URL directs your customers to the order tracking page, which includes all shipments. It can display either the default or a customized page based on segmentation rules.- The universal URL is used by default, but you can opt for a custom domain if you have one. Learn how to set up a custom domain .The field is not automatically enabled in API & Webhook. Please contact support if you’d like to enable it.
+ ///
+ [JsonProperty("aftership_tracking_order_url")]
+ public string? AftershipTrackingOrderUrl { get; set; }
+ ///
+ /// FirstMile The field contains information about the first leg of the shipping starting from the carrier picking up the shipment from the shipper to the point where they hand it over to the last-mile carrier. Once AfterShip detects the shipment is multi-leg, we will populate the first-mile information under this object.
+ ///
+ [JsonProperty("first_mile")]
+ public FirstMileMarkTrackingCompletedByIdResponse? FirstMile { get; set; }
+ ///
+ /// LastMile This field contains information about the last leg of the shipment, starting from the carrier who hands it over to the last-mile carrier, all the way to delivery. Once AfterShip detects that the shipment involves multiple legs and identifies the last-mile carrier, we will populate the last-mile carrier information in this object. Alternatively, the user can provide this information in this field to specify the last-mile carrier, which is helpful if AfterShip is unable to detect it automatically.
+ ///
+ [JsonProperty("last_mile")]
+ public LastMileMarkTrackingCompletedByIdResponse? LastMile { get; set; }
+ ///
+ /// Customers The field contains the customer information associated with the tracking. A maximum of three customer objects are allowed.
+ ///
+ [JsonProperty("customers")]
+ public CustomersMarkTrackingCompletedByIdResponse?[] Customers { get; set; }
+ public MarkTrackingCompletedByIdResponse()
+ {
+ }
+ }
+
+ ///
+ ///
+ ///
+ public class CourierEstimatedDeliveryDateMarkTrackingCompletedByIdResponse
+ {
+ ///
+ /// EstimatedDeliveryDate The estimated arrival date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("estimated_delivery_date")]
+ public string? EstimatedDeliveryDate { get; set; }
+ ///
+ /// EstimatedDeliveryDateMin The earliest estimated delivery date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("estimated_delivery_date_min")]
+ public string? EstimatedDeliveryDateMin { get; set; }
+ ///
+ /// EstimatedDeliveryDateMax The Latest estimated delivery date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("estimated_delivery_date_max")]
+ public string? EstimatedDeliveryDateMax { get; set; }
+
+ public CourierEstimatedDeliveryDateMarkTrackingCompletedByIdResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class ShipmentWeightMarkTrackingCompletedByIdResponse
+ {
+ ///
+ /// Unit The unit in which the value field is expressed.
+ ///
+ [JsonProperty("unit")]
+ public string? Unit { get; set; }
+ ///
+ /// Value The total amount of shipment weight.
+ ///
+ [JsonProperty("value")]
+ public double? Value { get; set; }
+
+ public ShipmentWeightMarkTrackingCompletedByIdResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class AftershipEstimatedDeliveryDateMarkTrackingCompletedByIdResponse
+ {
+ ///
+ /// EstimatedDeliveryDate The estimated arrival date of the shipment.
+ ///
+ [JsonProperty("estimated_delivery_date")]
+ public string? EstimatedDeliveryDate { get; set; }
+ ///
+ /// ConfidenceCode Indicates the confidence level and associated reason for an AI EDD prediction request. For a comprehensive list of confidence codes, refer to .
+ ///
+ [JsonProperty("confidence_code")]
+ public double? ConfidenceCode { get; set; }
+ ///
+ /// EstimatedDeliveryDateMin Earliest estimated delivery date of the shipment.
+ ///
+ [JsonProperty("estimated_delivery_date_min")]
+ public string? EstimatedDeliveryDateMin { get; set; }
+ ///
+ /// EstimatedDeliveryDateMax Latest estimated delivery date of the shipment.
+ ///
+ [JsonProperty("estimated_delivery_date_max")]
+ public string? EstimatedDeliveryDateMax { get; set; }
+
+ public AftershipEstimatedDeliveryDateMarkTrackingCompletedByIdResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class CustomEstimatedDeliveryDateMarkTrackingCompletedByIdResponse
+ {
+ ///
+ /// Type The format of the EDD. Either a single date or a date range.
+ ///
+ [JsonProperty("type")]
+ public string? Type { get; set; }
+ ///
+ /// Datetime The specific EDD date.
+ ///
+ [JsonProperty("datetime")]
+ public string? Datetime { get; set; }
+ ///
+ /// DatetimeMin For a date range EDD format, the date for the lower end of the range.
+ ///
+ [JsonProperty("datetime_min")]
+ public string? DatetimeMin { get; set; }
+ ///
+ /// DatetimeMax For a date range EDD format, the date for the upper end of the range.
+ ///
+ [JsonProperty("datetime_max")]
+ public string? DatetimeMax { get; set; }
+
+ public CustomEstimatedDeliveryDateMarkTrackingCompletedByIdResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class FirstEstimatedDeliveryMarkTrackingCompletedByIdResponse
+ {
+ ///
+ /// Type The format of the EDD. Either a single date or a date range.
+ ///
+ [JsonProperty("type")]
+ public string? Type { get; set; }
+ ///
+ /// Source The source of the EDD. Either the carrier, AfterShip AI, or based on your custom EDD settings.
+ ///
+ [JsonProperty("source")]
+ public string? Source { get; set; }
+ ///
+ /// Datetime The latest EDD time.
+ ///
+ [JsonProperty("datetime")]
+ public string? Datetime { get; set; }
+ ///
+ /// DatetimeMin For a date range EDD format, the date and time for the lower end of the range.
+ ///
+ [JsonProperty("datetime_min")]
+ public string? DatetimeMin { get; set; }
+ ///
+ /// DatetimeMax For a date range EDD format, the date and time for the upper end of the range.
+ ///
+ [JsonProperty("datetime_max")]
+ public string? DatetimeMax { get; set; }
+
+ public FirstEstimatedDeliveryMarkTrackingCompletedByIdResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class LatestEstimatedDeliveryMarkTrackingCompletedByIdResponse
+ {
+ ///
+ /// Type The format of the EDD. Either a single date or a date range.
+ ///
+ [JsonProperty("type")]
+ public string? Type { get; set; }
+ ///
+ /// Source The source of the EDD. Either the carrier, AfterShip AI, or based on your custom EDD settings.
+ ///
+ [JsonProperty("source")]
+ public string? Source { get; set; }
+ ///
+ /// Datetime The latest EDD time.
+ ///
+ [JsonProperty("datetime")]
+ public string? Datetime { get; set; }
+ ///
+ /// DatetimeMin For a date range EDD format, the date and time for the lower end of the range.
+ ///
+ [JsonProperty("datetime_min")]
+ public string? DatetimeMin { get; set; }
+ ///
+ /// DatetimeMax For a date range EDD format, the date and time for the upper end of the range.
+ ///
+ [JsonProperty("datetime_max")]
+ public string? DatetimeMax { get; set; }
+
+ public LatestEstimatedDeliveryMarkTrackingCompletedByIdResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class CarbonEmissionsMarkTrackingCompletedByIdResponse
+ {
+ ///
+ /// Unit The unit in which the value field is expressed. Allowed values: kg
+ ///
+ [JsonProperty("unit")]
+ public string? Unit { get; set; }
+ ///
+ /// Value The total amount of carbon emissions
+ ///
+ [JsonProperty("value")]
+ public double? Value { get; set; }
+
+ public CarbonEmissionsMarkTrackingCompletedByIdResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class FirstMileMarkTrackingCompletedByIdResponse
+ {
+ ///
+ /// TrackingNumber The tracking number of the first-mile carrier.
+ ///
+ [JsonProperty("tracking_number")]
+ public string? TrackingNumber { get; set; }
+ ///
+ /// Slug The unique code of the carrier responsible for the first-mile of the shipment. Find all the courier slugs .
+ ///
+ [JsonProperty("slug")]
+ public string? Slug { get; set; }
+ ///
+ /// TransitTime The transit time for the first-mile of a shipment in days. This field is calculated based on whether the handed_over_to_last_mile_carrier or received_by_last_mile_carrier event is detected by AfterShip. The handover event date is used to calculate the first-mile transit time.- First mile transit time (in days) = Handover date - Pickup date
+ ///
+ [JsonProperty("transit_time")]
+ public string? TransitTime { get; set; }
+ ///
+ /// CourierRedirectLink The field provides the link for modifying delivery instructions (such as delivery date and shipping address), if supported by the first-mile carrier. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US".
+ ///
+ [JsonProperty("courier_redirect_link")]
+ public string? CourierRedirectLink { get; set; }
+ ///
+ /// CourierTrackingLink The field contains the official tracking URL of the first-mile carrier, if available. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US".
+ ///
+ [JsonProperty("courier_tracking_link")]
+ public string? CourierTrackingLink { get; set; }
+
+ public FirstMileMarkTrackingCompletedByIdResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class LastMileMarkTrackingCompletedByIdResponse
+ {
+ ///
+ /// TrackingNumber The tracking number of the last-mile carrier.
+ ///
+ [JsonProperty("tracking_number")]
+ public string? TrackingNumber { get; set; }
+ ///
+ /// Slug The unique code of the carrier responsible for the last-mile of the shipment. Find all the courier slugs .
+ ///
+ [JsonProperty("slug")]
+ public string? Slug { get; set; }
+ ///
+ /// TransitTime The transit time for the last-mile of a shipment in days. This field is calculated based on whether the handed_over_to_last_mile_carrier or the received_by_last_mile_carrier event is detected by AfterShip. The handover event date is used to calculate the last-mile transit time.- Last mile transit time (in days)= Delivered date - Handover date
+ ///
+ [JsonProperty("transit_time")]
+ public string? TransitTime { get; set; }
+ ///
+ /// CourierTrackingLink The field contains the official tracking URL of the last-mile carrier, if available. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US".
+ ///
+ [JsonProperty("courier_tracking_link")]
+ public string? CourierTrackingLink { get; set; }
+ ///
+ /// CourierRedirectLink The field provides the link for modifying delivery instructions (such as delivery date and shipping address), if supported by the last-mile carrier. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US".
+ ///
+ [JsonProperty("courier_redirect_link")]
+ public string? CourierRedirectLink { get; set; }
+ ///
+ /// Source The field indicates the source of last-mile carrier.
+ ///
+ [JsonProperty("source")]
+ public string? Source { get; set; }
+
+ public LastMileMarkTrackingCompletedByIdResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class CustomersMarkTrackingCompletedByIdResponse
+ {
+ ///
+ /// Role The role of the customer, indicating whether the customer is an individual or a company.
+ ///
+ [JsonProperty("role")]
+ public string? Role { get; set; }
+ ///
+ /// Name Customer name associated with the tracking.
+ ///
+ [JsonProperty("name")]
+ public string? Name { get; set; }
+ ///
+ /// PhoneNumber The phone number(s) to receive SMS notifications. Phone numbers should begin with a `+` sign and include the area code.
+ ///
+ [JsonProperty("phone_number")]
+ public string? PhoneNumber { get; set; }
+ ///
+ /// Email Email address(es) to receive email notifications.
+ ///
+ [JsonProperty("email")]
+ public string? Email { get; set; }
+ ///
+ /// Language The preferred language of the customer. If you have set up AfterShip notifications in different languages, we use this to send the tracking updates to the customer in their preferred language.
+ ///
+ [JsonProperty("language")]
+ public string? Language { get; set; }
+
+ public CustomersMarkTrackingCompletedByIdResponse()
+ {
+ }
+ }
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/Models/MetaV1.cs b/src/AfterShipTracking/AfterShipTracking/Models/MetaV1.cs
new file mode 100644
index 0000000..32fde3f
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Models/MetaV1.cs
@@ -0,0 +1,36 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System;
+using System.Collections.Generic;
+using Newtonsoft.Json;
+
+namespace AfterShipTracking
+{
+ ///
+ /// Meta data
+ ///
+ public class MetaV1
+ {
+ ///
+ /// Code meta code
+ ///
+ [JsonProperty("code")]
+ public int Code { get; set; }
+ ///
+ /// Message error message, only exist if the response status is not 2xx
+ ///
+ [JsonProperty("message", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Message { get; set; }
+ ///
+ /// Type error type, only exist if the response status is not 2xx
+ ///
+ [JsonProperty("type", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Type { get; set; }
+ public MetaV1()
+ {
+ }
+ }
+
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/Models/PredictBatchRequest.cs b/src/AfterShipTracking/AfterShipTracking/Models/PredictBatchRequest.cs
new file mode 100644
index 0000000..39ddd60
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Models/PredictBatchRequest.cs
@@ -0,0 +1,26 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System;
+using System.Collections.Generic;
+using Newtonsoft.Json;
+
+namespace AfterShipTracking
+{
+ ///
+ ///
+ ///
+ public class PredictBatchRequest
+ {
+ ///
+ /// EstimatedDeliveryDates
+ ///
+ [JsonProperty("estimated_delivery_dates")]
+ public EstimatedDeliveryDateRequest[] EstimatedDeliveryDates { get; set; }
+ public PredictBatchRequest()
+ {
+ }
+ }
+
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/Models/PredictBatchResponse.cs b/src/AfterShipTracking/AfterShipTracking/Models/PredictBatchResponse.cs
new file mode 100644
index 0000000..b08311d
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Models/PredictBatchResponse.cs
@@ -0,0 +1,26 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System;
+using System.Collections.Generic;
+using Newtonsoft.Json;
+
+namespace AfterShipTracking
+{
+ ///
+ ///
+ ///
+ public class PredictBatchResponse
+ {
+ ///
+ /// EstimatedDeliveryDates
+ ///
+ [JsonProperty("estimated_delivery_dates")]
+ public EstimatedDeliveryDateResponse[] EstimatedDeliveryDates { get; set; }
+ public PredictBatchResponse()
+ {
+ }
+ }
+
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/Models/PredictRequest.cs b/src/AfterShipTracking/AfterShipTracking/Models/PredictRequest.cs
new file mode 100644
index 0000000..d7585b0
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Models/PredictRequest.cs
@@ -0,0 +1,201 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System;
+using System.Collections.Generic;
+using Newtonsoft.Json;
+
+namespace AfterShipTracking
+{
+ ///
+ ///
+ ///
+ public class PredictRequest
+ {
+ ///
+ /// Slug AfterShip's unique code of courier. Please refer to https://track.aftership.com/couriers/download.
+ ///
+ [JsonProperty("slug")]
+ public string Slug { get; set; }
+ ///
+ /// ServiceTypeName AfterShip’s unique code represents carrier’s shipping and delivery options. Refer to .
+ ///
+ [JsonProperty("service_type_name", NullValueHandling = NullValueHandling.Ignore)]
+ public string? ServiceTypeName { get; set; }
+ ///
+ /// OriginAddress The location from where the package is picked up by the carrier to be delivered to the final destination.
+ ///
+ [JsonProperty("origin_address")]
+ public OriginAddressPredictRequest OriginAddress { get; set; }
+ ///
+ /// DestinationAddress The final destination of the customer where the delivery will be made.
+ ///
+ [JsonProperty("destination_address")]
+ public DestinationAddressPredictRequest DestinationAddress { get; set; }
+ ///
+ /// Weight AfterShip uses this object to calculate the total weight of the order.
+ ///
+ [JsonProperty("weight", NullValueHandling = NullValueHandling.Ignore)]
+ public WeightPredictRequest? Weight { get; set; }
+ ///
+ /// PackageCount The number of packages.
+ ///
+ [JsonProperty("package_count", NullValueHandling = NullValueHandling.Ignore)]
+ public int? PackageCount { get; set; }
+ ///
+ /// PickupTime The local pickup time in the origin address time zone of the package.Either `pickup_time` or `estimated_pickup` is required.
+ ///
+ [JsonProperty("pickup_time", NullValueHandling = NullValueHandling.Ignore)]
+ public string? PickupTime { get; set; }
+ ///
+ /// EstimatedPickup The local pickup time of the package.Either `pickup_time` or `estimated_pickup` is required.
+ ///
+ [JsonProperty("estimated_pickup", NullValueHandling = NullValueHandling.Ignore)]
+ public EstimatedPickupPredictRequest? EstimatedPickup { get; set; }
+ public PredictRequest()
+ {
+ }
+ }
+
+ ///
+ ///
+ ///
+ public class OriginAddressPredictRequest
+ {
+ ///
+ /// CountryRegion The country/region of the origin location from where the package is picked up by the carrier to be delivered to the final destination. Use 3 letters of ISO 3166-1 country/region code.
+ ///
+ [JsonProperty("country_region")]
+ public string CountryRegion { get; set; }
+ ///
+ /// State State, province, or the equivalent location of the origin address. Use 3 letters of ISO 3166-1 country/region code for countries/regions without state. Either `origin_address.state` or `origin_address.postal_code` is required.
+ ///
+ [JsonProperty("state", NullValueHandling = NullValueHandling.Ignore)]
+ public string? State { get; set; }
+ ///
+ /// City City of the origin address. Use 3 letters of ISO 3166-1 country/region code for countries/regions without City.
+ ///
+ [JsonProperty("city", NullValueHandling = NullValueHandling.Ignore)]
+ public string? City { get; set; }
+ ///
+ /// PostalCode Postal code of the origin address. Use 3 letters of ISO 3166-1 country/region code for countries/regions without postal code. Either `origin_address.state` or `origin_address.postal_code` is required.
+ ///
+ [JsonProperty("postal_code", NullValueHandling = NullValueHandling.Ignore)]
+ public string? PostalCode { get; set; }
+ ///
+ /// RawLocation Raw location of the origin address. A raw address will help AI to identify the accurate location of the origin address.
+ ///
+ [JsonProperty("raw_location", NullValueHandling = NullValueHandling.Ignore)]
+ public string? RawLocation { get; set; }
+
+ public OriginAddressPredictRequest()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class DestinationAddressPredictRequest
+ {
+ ///
+ /// CountryRegion The country/region of the destination location where the package will be delivered. Use 3 letters of ISO 3166-1 country code.
+ ///
+ [JsonProperty("country_region")]
+ public string CountryRegion { get; set; }
+ ///
+ /// State State, province, or the equivalent location of the destination address where the package will be delivered.Either `destination_address.state` or `destination_address.postal_code` is required.
+ ///
+ [JsonProperty("state", NullValueHandling = NullValueHandling.Ignore)]
+ public string? State { get; set; }
+ ///
+ /// City City of the destination address where the package will be delivered.
+ ///
+ [JsonProperty("city", NullValueHandling = NullValueHandling.Ignore)]
+ public string? City { get; set; }
+ ///
+ /// PostalCode Postal code of the destination address.Either `destination_address.state` or `destination_address.postal_code` is required.
+ ///
+ [JsonProperty("postal_code", NullValueHandling = NullValueHandling.Ignore)]
+ public string? PostalCode { get; set; }
+ ///
+ /// RawLocation Raw location of the destination address. A raw address will help AI to identify the accurate location of the destination address.
+ ///
+ [JsonProperty("raw_location", NullValueHandling = NullValueHandling.Ignore)]
+ public string? RawLocation { get; set; }
+
+ public DestinationAddressPredictRequest()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class WeightPredictRequest
+ {
+ ///
+ /// Unit The weight unit of the package.
+ ///
+ [JsonProperty("unit")]
+ public string Unit { get; set; }
+ ///
+ /// Value The weight of the shipment.
+ ///
+ [JsonProperty("value")]
+ public double Value { get; set; }
+
+ public WeightPredictRequest()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class EstimatedPickupPredictRequest
+ {
+ ///
+ /// OrderTime The local order time in the origin address time zone of the package.
+ ///
+ [JsonProperty("order_time")]
+ public string OrderTime { get; set; }
+ ///
+ /// OrderCutoffTime Order cut off time in the origin address time zone. The default value set by AfterShip is 18:00:00.
+ ///
+ [JsonProperty("order_cutoff_time", NullValueHandling = NullValueHandling.Ignore)]
+ public string? OrderCutoffTime { get; set; }
+ ///
+ /// BusinessDays Operating days in a week. Number refers to the weekday.E.g., [1,2,3,4,5] means operating days are from Monday to Friday.AfterShip will set [1,2,3,4,5] as the default value.
+ ///
+ [JsonProperty("business_days", NullValueHandling = NullValueHandling.Ignore)]
+ public int?[] BusinessDays { get; set; }
+ ///
+ /// OrderProcessingTime
+ ///
+ [JsonProperty("order_processing_time", NullValueHandling = NullValueHandling.Ignore)]
+ public OrderProcessingTimeEstimatedPickupPredictRequest? OrderProcessingTime { get; set; }
+
+ public EstimatedPickupPredictRequest()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class OrderProcessingTimeEstimatedPickupPredictRequest
+ {
+ ///
+ /// Unit Processing time of an order, from being placed to being picked up. Only support day as value now.AfterShip will set day as the default value.
+ ///
+ [JsonProperty("unit", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Unit { get; set; }
+ ///
+ /// Value Processing time of an order, from being placed to being picked up.AfterShip will set 0 as the default value.
+ ///
+ [JsonProperty("value", NullValueHandling = NullValueHandling.Ignore)]
+ public double? Value { get; set; }
+
+ public OrderProcessingTimeEstimatedPickupPredictRequest()
+ {
+ }
+ }
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/Models/PredictResponse.cs b/src/AfterShipTracking/AfterShipTracking/Models/PredictResponse.cs
new file mode 100644
index 0000000..4e955ec
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Models/PredictResponse.cs
@@ -0,0 +1,231 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System;
+using System.Collections.Generic;
+using Newtonsoft.Json;
+
+namespace AfterShipTracking
+{
+ ///
+ ///
+ ///
+ public class PredictResponse
+ {
+ ///
+ /// Id A string that acts as a unique identifier for the estimated delivery date value generated by AfterShip Predict API
+ ///
+ [JsonProperty("id")]
+ public string Id { get; set; }
+ ///
+ /// Slug AfterShip's unique code of courier. Please refer to https://track.aftership.com/couriers/download.
+ ///
+ [JsonProperty("slug")]
+ public string Slug { get; set; }
+ ///
+ /// ServiceTypeName AfterShip’s unique code represents carrier’s shipping and delivery options. Refer to .
+ ///
+ [JsonProperty("service_type_name")]
+ public string? ServiceTypeName { get; set; }
+ ///
+ /// OriginAddress The location from where the package is picked up by the carrier to be delivered to the final destination.
+ ///
+ [JsonProperty("origin_address")]
+ public OriginAddressPredictResponse OriginAddress { get; set; }
+ ///
+ /// DestinationAddress The final destination of the customer where the delivery will be made.
+ ///
+ [JsonProperty("destination_address")]
+ public DestinationAddressPredictResponse DestinationAddress { get; set; }
+ ///
+ /// Weight AfterShip uses this object to calculate the total weight of the order.
+ ///
+ [JsonProperty("weight")]
+ public WeightPredictResponse? Weight { get; set; }
+ ///
+ /// PackageCount The number of packages.
+ ///
+ [JsonProperty("package_count")]
+ public int? PackageCount { get; set; }
+ ///
+ /// PickupTime The local pickup time in the origin address time zone of the package.Either `pickup_time` or `estimated_pickup` is required.
+ ///
+ [JsonProperty("pickup_time")]
+ public string? PickupTime { get; set; }
+ ///
+ /// EstimatedPickup The local pickup time of the package.Either `pickup_time` or `estimated_pickup` is required.
+ ///
+ [JsonProperty("estimated_pickup")]
+ public EstimatedPickupPredictResponse? EstimatedPickup { get; set; }
+ ///
+ /// EstimatedDeliveryDate The estimated arrival date of the shipment, provided by AfterShip.
+ ///
+ [JsonProperty("estimated_delivery_date")]
+ public string? EstimatedDeliveryDate { get; set; }
+ ///
+ /// ConfidenceCode Indicates the confidence level and associated reason for an AI EDD prediction request. For a comprehensive list of confidence codes, refer to .
+ ///
+ [JsonProperty("confidence_code")]
+ public double? ConfidenceCode { get; set; }
+ ///
+ /// EstimatedDeliveryDateMin The earliest estimated delivery date of the shipment, provided by AfterShip.
+ ///
+ [JsonProperty("estimated_delivery_date_min")]
+ public string? EstimatedDeliveryDateMin { get; set; }
+ ///
+ /// EstimatedDeliveryDateMax The latest estimated delivery date of the shipment, provided by AfterShip.
+ ///
+ [JsonProperty("estimated_delivery_date_max")]
+ public string? EstimatedDeliveryDateMax { get; set; }
+ public PredictResponse()
+ {
+ }
+ }
+
+ ///
+ ///
+ ///
+ public class OriginAddressPredictResponse
+ {
+ ///
+ /// CountryRegion The country/region of the origin location from where the package is picked up by the carrier to be delivered to the final destination. Use 3 letters of ISO 3166-1 country/region code.
+ ///
+ [JsonProperty("country_region")]
+ public string CountryRegion { get; set; }
+ ///
+ /// State State, province, or the equivalent location of the origin address. Use 3 letters of ISO 3166-1 country/region code for countries/regions without state. Either `origin_address.state` or `origin_address.postal_code` is required.
+ ///
+ [JsonProperty("state")]
+ public string? State { get; set; }
+ ///
+ /// City City of the origin address. Use 3 letters of ISO 3166-1 country/region code for countries/regions without City.
+ ///
+ [JsonProperty("city")]
+ public string? City { get; set; }
+ ///
+ /// PostalCode Postal code of the origin address. Use 3 letters of ISO 3166-1 country/region code for countries/regions without postal code. Either `origin_address.state` or `origin_address.postal_code` is required.
+ ///
+ [JsonProperty("postal_code")]
+ public string? PostalCode { get; set; }
+ ///
+ /// RawLocation Raw location of the origin address. A raw address will help AI to identify the accurate location of the origin address.
+ ///
+ [JsonProperty("raw_location")]
+ public string? RawLocation { get; set; }
+
+ public OriginAddressPredictResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class DestinationAddressPredictResponse
+ {
+ ///
+ /// CountryRegion The country/region of the destination location where the package will be delivered. Use 3 letters of ISO 3166-1 country code.
+ ///
+ [JsonProperty("country_region")]
+ public string CountryRegion { get; set; }
+ ///
+ /// State State, province, or the equivalent location of the destination address where the package will be delivered.Either `destination_address.state` or `destination_address.postal_code` is required.
+ ///
+ [JsonProperty("state")]
+ public string? State { get; set; }
+ ///
+ /// City City of the destination address where the package will be delivered.
+ ///
+ [JsonProperty("city")]
+ public string? City { get; set; }
+ ///
+ /// PostalCode Postal code of the destination address.Either `destination_address.state` or `destination_address.postal_code` is required.
+ ///
+ [JsonProperty("postal_code")]
+ public string? PostalCode { get; set; }
+ ///
+ /// RawLocation Raw location of the destination address. A raw address will help AI to identify the accurate location of the destination address.
+ ///
+ [JsonProperty("raw_location")]
+ public string? RawLocation { get; set; }
+
+ public DestinationAddressPredictResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class WeightPredictResponse
+ {
+ ///
+ /// Unit The weight unit of the package.
+ ///
+ [JsonProperty("unit")]
+ public string Unit { get; set; }
+ ///
+ /// Value The weight of the shipment.
+ ///
+ [JsonProperty("value")]
+ public double Value { get; set; }
+
+ public WeightPredictResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class EstimatedPickupPredictResponse
+ {
+ ///
+ /// OrderTime The local order time in the origin address time zone of the package.
+ ///
+ [JsonProperty("order_time")]
+ public string OrderTime { get; set; }
+ ///
+ /// OrderCutoffTime Order cut off time in the origin address time zone. The default value set by AfterShip is 18:00:00.
+ ///
+ [JsonProperty("order_cutoff_time")]
+ public string? OrderCutoffTime { get; set; }
+ ///
+ /// BusinessDays Operating days in a week. Number refers to the weekday.E.g., [1,2,3,4,5] means operating days are from Monday to Friday.AfterShip will set [1,2,3,4,5] as the default value.
+ ///
+ [JsonProperty("business_days")]
+ public int?[] BusinessDays { get; set; }
+ ///
+ /// OrderProcessingTime
+ ///
+ [JsonProperty("order_processing_time")]
+ public OrderProcessingTimeEstimatedPickupPredictResponse? OrderProcessingTime { get; set; }
+ ///
+ /// PickupTime The local pickup time of the package.
+ ///
+ [JsonProperty("pickup_time")]
+ public string? PickupTime { get; set; }
+
+ public EstimatedPickupPredictResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class OrderProcessingTimeEstimatedPickupPredictResponse
+ {
+ ///
+ /// Unit Processing time of an order, from being placed to being picked up. Only support day as value now.AfterShip will set day as the default value.
+ ///
+ [JsonProperty("unit")]
+ public string? Unit { get; set; }
+ ///
+ /// Value Processing time of an order, from being placed to being picked up.AfterShip will set 0 as the default value.
+ ///
+ [JsonProperty("value")]
+ public double? Value { get; set; }
+
+ public OrderProcessingTimeEstimatedPickupPredictResponse()
+ {
+ }
+ }
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/Models/RetrackTrackingByIdResponse.cs b/src/AfterShipTracking/AfterShipTracking/Models/RetrackTrackingByIdResponse.cs
new file mode 100644
index 0000000..7caf15b
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Models/RetrackTrackingByIdResponse.cs
@@ -0,0 +1,721 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System;
+using System.Collections.Generic;
+using Newtonsoft.Json;
+
+namespace AfterShipTracking
+{
+ ///
+ /// Object describes the tracking information.
+ ///
+ public class RetrackTrackingByIdResponse
+ {
+ ///
+ /// Id Tracking ID.
+ ///
+ [JsonProperty("id")]
+ public string? Id { get; set; }
+ ///
+ /// LegacyId The length of the tracking ID has been increased from 24 characters to 32 characters. We will use the legacy_id field to store the original 24-character tracking ID to maintain compatibility with existing data. Therefore, all tracking endpoints will continue to work with the legacy_id field as before.
+ ///
+ [JsonProperty("legacy_id")]
+ public string? LegacyId { get; set; }
+ ///
+ /// CreatedAt The date and time the shipment was imported or added to AfterShip. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0.
+ ///
+ [JsonProperty("created_at")]
+ public string? CreatedAt { get; set; }
+ ///
+ /// UpdatedAt The date and time the shipment was updated. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0.
+ ///
+ [JsonProperty("updated_at")]
+ public string? UpdatedAt { get; set; }
+ ///
+ /// TrackingNumber Tracking number.
+ ///
+ [JsonProperty("tracking_number")]
+ public string? TrackingNumber { get; set; }
+ ///
+ /// Slug Unique courier code. When importing a shipment with no courier slug and the tracking number can’t be recognized, the courier will be marked as `unrecognized`. Get courier codes .
+ ///
+ [JsonProperty("slug")]
+ public string? Slug { get; set; }
+ ///
+ /// Active Whether or not AfterShip will continue tracking the shipments. Value is `false` when tag (status) is `Delivered`, `Expired`, or further updates for 30 days since last update.
+ ///
+ [JsonProperty("active")]
+ public bool? Active { get; set; }
+ ///
+ /// CustomFields Custom fields that accept an object with string field. In order to protect the privacy of your customers, do not include any in custom fields.
+ ///
+ [JsonProperty("custom_fields")]
+ public Dictionary? CustomFields { get; set; }
+ ///
+ /// TransitTime Total transit time in days.- For delivered shipments: Transit time (in days) = Delivered date - Pick-up date- For undelivered shipments: Transit time (in days) = Current date - Pick-up dateValue as `null` for the shipment without pick-up date.
+ ///
+ [JsonProperty("transit_time")]
+ public int? TransitTime { get; set; }
+ ///
+ /// OriginCountryRegion The for the origin country/region. E.g. USA for the United States.
+ ///
+ [JsonProperty("origin_country_region")]
+ public string? OriginCountryRegion { get; set; }
+ ///
+ /// OriginState The state of the sender’s address.
+ ///
+ [JsonProperty("origin_state")]
+ public string? OriginState { get; set; }
+ ///
+ /// OriginCity The city of the sender’s address.
+ ///
+ [JsonProperty("origin_city")]
+ public string? OriginCity { get; set; }
+ ///
+ /// OriginPostalCode The postal code of the sender’s address.
+ ///
+ [JsonProperty("origin_postal_code")]
+ public string? OriginPostalCode { get; set; }
+ ///
+ /// OriginRawLocation The sender address that the shipment is shipping from.
+ ///
+ [JsonProperty("origin_raw_location")]
+ public string? OriginRawLocation { get; set; }
+ ///
+ /// DestinationCountryRegion The for the destination country/region. E.g. USA for the United States.
+ ///
+ [JsonProperty("destination_country_region")]
+ public string? DestinationCountryRegion { get; set; }
+ ///
+ /// DestinationState The state of the recipient’s address.
+ ///
+ [JsonProperty("destination_state")]
+ public string? DestinationState { get; set; }
+ ///
+ /// DestinationCity The city of the recipient’s address.
+ ///
+ [JsonProperty("destination_city")]
+ public string? DestinationCity { get; set; }
+ ///
+ /// DestinationPostalCode The postal code of the recipient’s address.
+ ///
+ [JsonProperty("destination_postal_code")]
+ public string? DestinationPostalCode { get; set; }
+ ///
+ /// DestinationRawLocation The shipping address that the shipment is shipping to.
+ ///
+ [JsonProperty("destination_raw_location")]
+ public string? DestinationRawLocation { get; set; }
+ ///
+ /// CourierDestinationCountryRegion Destination country/region of the tracking detected from the courier. ISO Alpha-3 (three letters). Value will be `null` if the courier doesn't provide the destination country.
+ ///
+ [JsonProperty("courier_destination_country_region")]
+ public string? CourierDestinationCountryRegion { get; set; }
+ ///
+ /// CourierEstimatedDeliveryDate The field contains the estimated delivery date provided by the carrier.
+ ///
+ [JsonProperty("courier_estimated_delivery_date")]
+ public CourierEstimatedDeliveryDateRetrackTrackingByIdResponse? CourierEstimatedDeliveryDate { get; set; }
+ ///
+ /// Note Text field for the note.
+ ///
+ [JsonProperty("note")]
+ public string? Note { get; set; }
+ ///
+ /// OrderId A globally-unique identifier for the order.
+ ///
+ [JsonProperty("order_id")]
+ public string? OrderId { get; set; }
+ ///
+ /// OrderIdPath The URL for the order in your system or store.
+ ///
+ [JsonProperty("order_id_path")]
+ public string? OrderIdPath { get; set; }
+ ///
+ /// OrderDate The date and time the order was created in your system or store. It uses the format: `YYYY-MM-DDTHH:mm:ssZ` based on whichever timezone you provide.
+ ///
+ [JsonProperty("order_date")]
+ public string? OrderDate { get; set; }
+ ///
+ /// ShipmentPackageCount Number of packages under the tracking.
+ ///
+ [JsonProperty("shipment_package_count")]
+ public double? ShipmentPackageCount { get; set; }
+ ///
+ /// ShipmentPickupDate The date and time the shipment was picked up by the carrier. It uses the timezone where the pickup occured. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("shipment_pickup_date")]
+ public string? ShipmentPickupDate { get; set; }
+ ///
+ /// ShipmentDeliveryDate The date and time the shipment was delivered. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("shipment_delivery_date")]
+ public string? ShipmentDeliveryDate { get; set; }
+ ///
+ /// ShipmentType The carrier service type for the shipment.
+ ///
+ [JsonProperty("shipment_type")]
+ public string? ShipmentType { get; set; }
+ ///
+ /// ShipmentWeight The shipment_weight field represents the total weight of the shipment. In scenarios where the carrier does not provide this information, you can provide the weight to AfterShip. We will prioritize the data provided by the carrier, if available. The shipment weight will be included in the Response and accessed through the GET API, Webhook, and CSV export. It will also be displayed on the AfterShip Tracking admin. Additionally, it plays a significant role in error-free shipment handling and carbon emission calculations, ensuring accurate and informed decision-making
+ ///
+ [JsonProperty("shipment_weight")]
+ public ShipmentWeightRetrackTrackingByIdResponse? ShipmentWeight { get; set; }
+ ///
+ /// SignedBy Signed by information for delivered shipment.
+ ///
+ [JsonProperty("signed_by")]
+ public string? SignedBy { get; set; }
+ ///
+ /// Source Source of how this tracking is added.
+ ///
+ [JsonProperty("source")]
+ public string? Source { get; set; }
+ ///
+ /// Tag Current status of tracking. (
+ ///
+ [JsonProperty("tag")]
+ public TagV1? Tag { get; set; }
+ ///
+ /// Subtag Current subtag of tracking. (
+ ///
+ [JsonProperty("subtag")]
+ public string? Subtag { get; set; }
+ ///
+ /// SubtagMessage Normalized tracking message. (
+ ///
+ [JsonProperty("subtag_message")]
+ public string? SubtagMessage { get; set; }
+ ///
+ /// Title By default this field shows the `tracking_number`, but you can customize it as you wish with any info (e.g. the order number).
+ ///
+ [JsonProperty("title")]
+ public string? Title { get; set; }
+ ///
+ /// TrackedCount Number of attempts AfterShip tracks at courier's system.
+ ///
+ [JsonProperty("tracked_count")]
+ public double? TrackedCount { get; set; }
+ ///
+ /// LastMileTrackingSupported Indicates if the shipment is trackable till the final destination.Three possible values:- true- false- null
+ ///
+ [JsonProperty("last_mile_tracking_supported")]
+ public bool? LastMileTrackingSupported { get; set; }
+ ///
+ /// Language The recipient’s language. If you set up AfterShip notifications in different languages, we use this to send the recipient tracking updates in their preferred language.
+ ///
+ [JsonProperty("language")]
+ public string? Language { get; set; }
+ ///
+ /// UniqueToken Deprecated
+ ///
+ [JsonProperty("unique_token")]
+ public string? UniqueToken { get; set; }
+ ///
+ /// Checkpoints Array of checkpoint object describes the checkpoint information.
+ ///
+ [JsonProperty("checkpoints")]
+ public Checkpoint?[] Checkpoints { get; set; }
+ ///
+ /// SubscribedSmses Phone number(s) subscribed to receive sms notifications.
+ ///
+ [JsonProperty("subscribed_smses")]
+ public string?[] SubscribedSmses { get; set; }
+ ///
+ /// SubscribedEmails Email address(es) subscribed to receive email notifications.
+ ///
+ [JsonProperty("subscribed_emails")]
+ public string?[] SubscribedEmails { get; set; }
+ ///
+ /// ReturnToSender Whether or not the shipment is returned to sender. Value is `true` when any of its checkpoints has subtag `Exception_010` (returning to sender) or `Exception_011` (returned to sender). Otherwise value is `false`.
+ ///
+ [JsonProperty("return_to_sender")]
+ public bool? ReturnToSender { get; set; }
+ ///
+ /// OrderPromisedDeliveryDate The promised delivery date of the order. It uses the formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("order_promised_delivery_date")]
+ public string? OrderPromisedDeliveryDate { get; set; }
+ ///
+ /// DeliveryType Shipment delivery type- pickup_at_store- pickup_at_courier- door_to_door
+ ///
+ [JsonProperty("delivery_type")]
+ public string? DeliveryType { get; set; }
+ ///
+ /// PickupLocation Shipment pickup location for receiver
+ ///
+ [JsonProperty("pickup_location")]
+ public string? PickupLocation { get; set; }
+ ///
+ /// PickupNote Shipment pickup note for receiver
+ ///
+ [JsonProperty("pickup_note")]
+ public string? PickupNote { get; set; }
+ ///
+ /// CourierTrackingLink Official tracking URL of the courier (if any). The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default.
+ ///
+ [JsonProperty("courier_tracking_link")]
+ public string? CourierTrackingLink { get; set; }
+ ///
+ /// FirstAttemptedAt The date and time of the carrier’s first attempt to deliver the package to the recipient. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("first_attempted_at")]
+ public string? FirstAttemptedAt { get; set; }
+ ///
+ /// CourierRedirectLink Delivery instructions (delivery date or address) can be modified by visiting the link if supported by a carrier. The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default.
+ ///
+ [JsonProperty("courier_redirect_link")]
+ public string? CourierRedirectLink { get; set; }
+ ///
+ /// TrackingAccountNumber Additional field required by some carriers to retrieve the tracking info. The shipper’s carrier account number. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_account_number")]
+ public string? TrackingAccountNumber { get; set; }
+ ///
+ /// TrackingKey Additional field required by some carriers to retrieve the tracking info. A type of tracking credential required by some carriers. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_key")]
+ public string? TrackingKey { get; set; }
+ ///
+ /// TrackingShipDate The date and time when the shipment is shipped by the merchant and ready for pickup by the carrier. The field supports the following formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZThe field serves two key purposes:- Calculate processing time metrics in the Order-to-delivery Analytics dashboard. To ensure accurate analytics, it's recommended to include timezone information when configuring this value- Required by certain carriers to retrieve tracking information as an additional tracking field.
+ ///
+ [JsonProperty("tracking_ship_date")]
+ public string? TrackingShipDate { get; set; }
+ ///
+ /// OnTimeStatus Whether the tracking is delivered on time or not.
+ ///
+ [JsonProperty("on_time_status")]
+ public string? OnTimeStatus { get; set; }
+ ///
+ /// OnTimeDifference The difference days of the on time.
+ ///
+ [JsonProperty("on_time_difference")]
+ public double? OnTimeDifference { get; set; }
+ ///
+ /// OrderTags The tags of the order.
+ ///
+ [JsonProperty("order_tags")]
+ public string?[] OrderTags { get; set; }
+ ///
+ /// AftershipEstimatedDeliveryDate The estimated delivery date of the shipment provided by AfterShip’s AI and shown to the recipients. It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone.
+ ///
+ [JsonProperty("aftership_estimated_delivery_date")]
+ public AftershipEstimatedDeliveryDateRetrackTrackingByIdResponse? AftershipEstimatedDeliveryDate { get; set; }
+ ///
+ /// CustomEstimatedDeliveryDate Estimated delivery time of the shipment based on your . It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone.
+ ///
+ [JsonProperty("custom_estimated_delivery_date")]
+ public CustomEstimatedDeliveryDateRetrackTrackingByIdResponse? CustomEstimatedDeliveryDate { get; set; }
+ ///
+ /// OrderNumber A unique, human-readable identifier for the order.
+ ///
+ [JsonProperty("order_number")]
+ public string? OrderNumber { get; set; }
+ ///
+ /// FirstEstimatedDelivery The shipment’s original estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone.
+ ///
+ [JsonProperty("first_estimated_delivery")]
+ public FirstEstimatedDeliveryRetrackTrackingByIdResponse? FirstEstimatedDelivery { get; set; }
+ ///
+ /// LatestEstimatedDelivery The most recently calculated estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone.
+ ///
+ [JsonProperty("latest_estimated_delivery")]
+ public LatestEstimatedDeliveryRetrackTrackingByIdResponse? LatestEstimatedDelivery { get; set; }
+ ///
+ /// ShipmentTags Used to add tags to your shipments to help categorize and filter them easily.
+ ///
+ [JsonProperty("shipment_tags")]
+ public string?[] ShipmentTags { get; set; }
+ ///
+ /// CourierConnectionId If you have multiple accounts connected for a single carrier on AfterShip, we have introduced the courier_connection_id field to allow you to specify the carrier account associated with each shipment. By providing this information, you enable us to accurately track and monitor your shipments based on the correct carrier account.(In the event that you do not specify the courier_connection_id, we will handle your shipment using the connection that was created earliest among your connected accounts.
+ ///
+ [JsonProperty("courier_connection_id")]
+ public string? CourierConnectionId { get; set; }
+ ///
+ /// TrackingOriginCountryRegion (Legacy) Replaced by `origin_country_region`. Additional field required by some carriers to retrieve the tracking info. The origin country/region of the shipment. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_origin_country_region")]
+ public string? TrackingOriginCountryRegion { get; set; }
+ ///
+ /// TrackingDestinationCountryRegion (Legacy) Replaced by `destination_country_region`. Additional field required by some carriers to retrieve the tracking info. The destination country/region of the shipment. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_destination_country_region")]
+ public string? TrackingDestinationCountryRegion { get; set; }
+ ///
+ /// TrackingPostalCode (Legacy) Replaced by `destination_postal_code`. Additional field required by some carriers to retrieve the tracking info. The postal code of the recipient’s address. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_postal_code")]
+ public string? TrackingPostalCode { get; set; }
+ ///
+ /// TrackingState (Legacy) Replaced by `destination_state`. Additional field required by some carriers to retrieve the tracking info. The state/province of the recipient’s address. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_state")]
+ public string? TrackingState { get; set; }
+ ///
+ /// CarbonEmissions The model contains the total amount of carbon emissions generated by the shipment. - AfterShip will provide this data only when it is available, and its availability is contingent upon the location and weight information that AfterShip can obtain.- The values will be accessible solely for shipments that have been successfully delivered. However, in the event of a shipping update after the delivery status has been achieved, the value may change.- It’s a paid service and only for Tracking Enterprise users, please contact your customer success manager if you want to know more.
+ ///
+ [JsonProperty("carbon_emissions")]
+ public CarbonEmissionsRetrackTrackingByIdResponse? CarbonEmissions { get; set; }
+ ///
+ /// LocationId The location_id refers to the place where you fulfilled the items. - If you provide a location_id, the system will automatically use it as the tracking's origin address. However, passing both location_id and any origin address information simultaneously is not allowed.- Please make sure you add your locations .
+ ///
+ [JsonProperty("location_id")]
+ public string? LocationId { get; set; }
+ ///
+ /// ShippingMethod The shipping_method string refers to the chosen method for delivering the package. Merchants typically offer various shipping methods to consumers during the checkout process, such as, Local Delivery, Free Express Worldwide Shipping, etc.
+ ///
+ [JsonProperty("shipping_method")]
+ public string? ShippingMethod { get; set; }
+ ///
+ /// FailedDeliveryAttempts By dynamically tracking failed delivery attempts during shipment, this field allows you to pinpoint carriers accountable for the most failures. Analyzing the root cause of these failures enables you to improve carriers' delivery standard operating procedures (SOP), leading to an overall enhancement in delivery service quality.
+ ///
+ [JsonProperty("failed_delivery_attempts")]
+ public int? FailedDeliveryAttempts { get; set; }
+ ///
+ /// SignatureRequirement The signature_requirement field serves the purpose of validating the service option type, specifically proof of delivery. By collecting the recipient's signature upon delivery, it ensures the package reaches the intended recipient and prevents disputes related to non-delivery or lost packages.
+ ///
+ [JsonProperty("signature_requirement")]
+ public string? SignatureRequirement { get; set; }
+ ///
+ /// DeliveryLocationType The delivery location type represents the secure area where the carrier leaves the package, such as a safe place, locker, mailbox, front porch, etc. This information helps ensure the shipment reaches the intended recipient efficiently, minimizing the risk of theft or damage.
+ ///
+ [JsonProperty("delivery_location_type")]
+ public string? DeliveryLocationType { get; set; }
+ ///
+ /// AftershipTrackingUrl The tracking URL directs your customers to the shipment tracking page which can display either the default or a customized page based on segmentation rules.- The universal URL is used by default, but you can opt for a custom domain if you have one. Learn how to set up a custom domain .The field is not automatically enabled in API & Webhook. Please contact support if you’d like to enable it.
+ ///
+ [JsonProperty("aftership_tracking_url")]
+ public string? AftershipTrackingUrl { get; set; }
+ ///
+ /// AftershipTrackingOrderUrl The order URL directs your customers to the order tracking page, which includes all shipments. It can display either the default or a customized page based on segmentation rules.- The universal URL is used by default, but you can opt for a custom domain if you have one. Learn how to set up a custom domain .The field is not automatically enabled in API & Webhook. Please contact support if you’d like to enable it.
+ ///
+ [JsonProperty("aftership_tracking_order_url")]
+ public string? AftershipTrackingOrderUrl { get; set; }
+ ///
+ /// FirstMile The field contains information about the first leg of the shipping starting from the carrier picking up the shipment from the shipper to the point where they hand it over to the last-mile carrier. Once AfterShip detects the shipment is multi-leg, we will populate the first-mile information under this object.
+ ///
+ [JsonProperty("first_mile")]
+ public FirstMileRetrackTrackingByIdResponse? FirstMile { get; set; }
+ ///
+ /// LastMile This field contains information about the last leg of the shipment, starting from the carrier who hands it over to the last-mile carrier, all the way to delivery. Once AfterShip detects that the shipment involves multiple legs and identifies the last-mile carrier, we will populate the last-mile carrier information in this object. Alternatively, the user can provide this information in this field to specify the last-mile carrier, which is helpful if AfterShip is unable to detect it automatically.
+ ///
+ [JsonProperty("last_mile")]
+ public LastMileRetrackTrackingByIdResponse? LastMile { get; set; }
+ ///
+ /// Customers The field contains the customer information associated with the tracking. A maximum of three customer objects are allowed.
+ ///
+ [JsonProperty("customers")]
+ public CustomersRetrackTrackingByIdResponse?[] Customers { get; set; }
+ public RetrackTrackingByIdResponse()
+ {
+ }
+ }
+
+ ///
+ ///
+ ///
+ public class CourierEstimatedDeliveryDateRetrackTrackingByIdResponse
+ {
+ ///
+ /// EstimatedDeliveryDate The estimated arrival date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("estimated_delivery_date")]
+ public string? EstimatedDeliveryDate { get; set; }
+ ///
+ /// EstimatedDeliveryDateMin The earliest estimated delivery date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("estimated_delivery_date_min")]
+ public string? EstimatedDeliveryDateMin { get; set; }
+ ///
+ /// EstimatedDeliveryDateMax The Latest estimated delivery date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("estimated_delivery_date_max")]
+ public string? EstimatedDeliveryDateMax { get; set; }
+
+ public CourierEstimatedDeliveryDateRetrackTrackingByIdResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class ShipmentWeightRetrackTrackingByIdResponse
+ {
+ ///
+ /// Unit The unit in which the value field is expressed.
+ ///
+ [JsonProperty("unit")]
+ public string? Unit { get; set; }
+ ///
+ /// Value The total amount of shipment weight.
+ ///
+ [JsonProperty("value")]
+ public double? Value { get; set; }
+
+ public ShipmentWeightRetrackTrackingByIdResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class AftershipEstimatedDeliveryDateRetrackTrackingByIdResponse
+ {
+ ///
+ /// EstimatedDeliveryDate The estimated arrival date of the shipment.
+ ///
+ [JsonProperty("estimated_delivery_date")]
+ public string? EstimatedDeliveryDate { get; set; }
+ ///
+ /// ConfidenceCode Indicates the confidence level and associated reason for an AI EDD prediction request. For a comprehensive list of confidence codes, refer to .
+ ///
+ [JsonProperty("confidence_code")]
+ public double? ConfidenceCode { get; set; }
+ ///
+ /// EstimatedDeliveryDateMin Earliest estimated delivery date of the shipment.
+ ///
+ [JsonProperty("estimated_delivery_date_min")]
+ public string? EstimatedDeliveryDateMin { get; set; }
+ ///
+ /// EstimatedDeliveryDateMax Latest estimated delivery date of the shipment.
+ ///
+ [JsonProperty("estimated_delivery_date_max")]
+ public string? EstimatedDeliveryDateMax { get; set; }
+
+ public AftershipEstimatedDeliveryDateRetrackTrackingByIdResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class CustomEstimatedDeliveryDateRetrackTrackingByIdResponse
+ {
+ ///
+ /// Type The format of the EDD. Either a single date or a date range.
+ ///
+ [JsonProperty("type")]
+ public string? Type { get; set; }
+ ///
+ /// Datetime The specific EDD date.
+ ///
+ [JsonProperty("datetime")]
+ public string? Datetime { get; set; }
+ ///
+ /// DatetimeMin For a date range EDD format, the date for the lower end of the range.
+ ///
+ [JsonProperty("datetime_min")]
+ public string? DatetimeMin { get; set; }
+ ///
+ /// DatetimeMax For a date range EDD format, the date for the upper end of the range.
+ ///
+ [JsonProperty("datetime_max")]
+ public string? DatetimeMax { get; set; }
+
+ public CustomEstimatedDeliveryDateRetrackTrackingByIdResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class FirstEstimatedDeliveryRetrackTrackingByIdResponse
+ {
+ ///
+ /// Type The format of the EDD. Either a single date or a date range.
+ ///
+ [JsonProperty("type")]
+ public string? Type { get; set; }
+ ///
+ /// Source The source of the EDD. Either the carrier, AfterShip AI, or based on your custom EDD settings.
+ ///
+ [JsonProperty("source")]
+ public string? Source { get; set; }
+ ///
+ /// Datetime The latest EDD time.
+ ///
+ [JsonProperty("datetime")]
+ public string? Datetime { get; set; }
+ ///
+ /// DatetimeMin For a date range EDD format, the date and time for the lower end of the range.
+ ///
+ [JsonProperty("datetime_min")]
+ public string? DatetimeMin { get; set; }
+ ///
+ /// DatetimeMax For a date range EDD format, the date and time for the upper end of the range.
+ ///
+ [JsonProperty("datetime_max")]
+ public string? DatetimeMax { get; set; }
+
+ public FirstEstimatedDeliveryRetrackTrackingByIdResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class LatestEstimatedDeliveryRetrackTrackingByIdResponse
+ {
+ ///
+ /// Type The format of the EDD. Either a single date or a date range.
+ ///
+ [JsonProperty("type")]
+ public string? Type { get; set; }
+ ///
+ /// Source The source of the EDD. Either the carrier, AfterShip AI, or based on your custom EDD settings.
+ ///
+ [JsonProperty("source")]
+ public string? Source { get; set; }
+ ///
+ /// Datetime The latest EDD time.
+ ///
+ [JsonProperty("datetime")]
+ public string? Datetime { get; set; }
+ ///
+ /// DatetimeMin For a date range EDD format, the date and time for the lower end of the range.
+ ///
+ [JsonProperty("datetime_min")]
+ public string? DatetimeMin { get; set; }
+ ///
+ /// DatetimeMax For a date range EDD format, the date and time for the upper end of the range.
+ ///
+ [JsonProperty("datetime_max")]
+ public string? DatetimeMax { get; set; }
+
+ public LatestEstimatedDeliveryRetrackTrackingByIdResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class CarbonEmissionsRetrackTrackingByIdResponse
+ {
+ ///
+ /// Unit The unit in which the value field is expressed. Allowed values: kg
+ ///
+ [JsonProperty("unit")]
+ public string? Unit { get; set; }
+ ///
+ /// Value The total amount of carbon emissions
+ ///
+ [JsonProperty("value")]
+ public double? Value { get; set; }
+
+ public CarbonEmissionsRetrackTrackingByIdResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class FirstMileRetrackTrackingByIdResponse
+ {
+ ///
+ /// TrackingNumber The tracking number of the first-mile carrier.
+ ///
+ [JsonProperty("tracking_number")]
+ public string? TrackingNumber { get; set; }
+ ///
+ /// Slug The unique code of the carrier responsible for the first-mile of the shipment. Find all the courier slugs .
+ ///
+ [JsonProperty("slug")]
+ public string? Slug { get; set; }
+ ///
+ /// TransitTime The transit time for the first-mile of a shipment in days. This field is calculated based on whether the handed_over_to_last_mile_carrier or received_by_last_mile_carrier event is detected by AfterShip. The handover event date is used to calculate the first-mile transit time.- First mile transit time (in days) = Handover date - Pickup date
+ ///
+ [JsonProperty("transit_time")]
+ public string? TransitTime { get; set; }
+ ///
+ /// CourierRedirectLink The field provides the link for modifying delivery instructions (such as delivery date and shipping address), if supported by the first-mile carrier. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US".
+ ///
+ [JsonProperty("courier_redirect_link")]
+ public string? CourierRedirectLink { get; set; }
+ ///
+ /// CourierTrackingLink The field contains the official tracking URL of the first-mile carrier, if available. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US".
+ ///
+ [JsonProperty("courier_tracking_link")]
+ public string? CourierTrackingLink { get; set; }
+
+ public FirstMileRetrackTrackingByIdResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class LastMileRetrackTrackingByIdResponse
+ {
+ ///
+ /// TrackingNumber The tracking number of the last-mile carrier.
+ ///
+ [JsonProperty("tracking_number")]
+ public string? TrackingNumber { get; set; }
+ ///
+ /// Slug The unique code of the carrier responsible for the last-mile of the shipment. Find all the courier slugs .
+ ///
+ [JsonProperty("slug")]
+ public string? Slug { get; set; }
+ ///
+ /// TransitTime The transit time for the last-mile of a shipment in days. This field is calculated based on whether the handed_over_to_last_mile_carrier or the received_by_last_mile_carrier event is detected by AfterShip. The handover event date is used to calculate the last-mile transit time.- Last mile transit time (in days)= Delivered date - Handover date
+ ///
+ [JsonProperty("transit_time")]
+ public string? TransitTime { get; set; }
+ ///
+ /// CourierTrackingLink The field contains the official tracking URL of the last-mile carrier, if available. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US".
+ ///
+ [JsonProperty("courier_tracking_link")]
+ public string? CourierTrackingLink { get; set; }
+ ///
+ /// CourierRedirectLink The field provides the link for modifying delivery instructions (such as delivery date and shipping address), if supported by the last-mile carrier. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US".
+ ///
+ [JsonProperty("courier_redirect_link")]
+ public string? CourierRedirectLink { get; set; }
+ ///
+ /// Source The field indicates the source of last-mile carrier.
+ ///
+ [JsonProperty("source")]
+ public string? Source { get; set; }
+
+ public LastMileRetrackTrackingByIdResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class CustomersRetrackTrackingByIdResponse
+ {
+ ///
+ /// Role The role of the customer, indicating whether the customer is an individual or a company.
+ ///
+ [JsonProperty("role")]
+ public string? Role { get; set; }
+ ///
+ /// Name Customer name associated with the tracking.
+ ///
+ [JsonProperty("name")]
+ public string? Name { get; set; }
+ ///
+ /// PhoneNumber The phone number(s) to receive SMS notifications. Phone numbers should begin with a `+` sign and include the area code.
+ ///
+ [JsonProperty("phone_number")]
+ public string? PhoneNumber { get; set; }
+ ///
+ /// Email Email address(es) to receive email notifications.
+ ///
+ [JsonProperty("email")]
+ public string? Email { get; set; }
+ ///
+ /// Language The preferred language of the customer. If you have set up AfterShip notifications in different languages, we use this to send the tracking updates to the customer in their preferred language.
+ ///
+ [JsonProperty("language")]
+ public string? Language { get; set; }
+
+ public CustomersRetrackTrackingByIdResponse()
+ {
+ }
+ }
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/Models/SlugGroupV1.cs b/src/AfterShipTracking/AfterShipTracking/Models/SlugGroupV1.cs
new file mode 100644
index 0000000..3065c47
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Models/SlugGroupV1.cs
@@ -0,0 +1,42 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Converters;
+
+namespace AfterShipTracking
+{
+ ///
+ /// Slug group is a group of slugs which belong to same courier. For example, when you inpit "fedex-group" as slug_group, AfterShip will detect the tracking with "fedex-uk", "fedex-fims", and other slugs which belong to "fedex". It cannot be used with slug at the same time. (
+ ///
+ [JsonConverter(typeof(StringEnumConverter))]
+ public enum SlugGroupV1
+ {
+ [EnumMember(Value = "amazon-group")]
+ AmazonGroup,
+ [EnumMember(Value = "fedex-group")]
+ FedexGroup,
+ [EnumMember(Value = "toll-group")]
+ TollGroup,
+ [EnumMember(Value = "taqbin-group")]
+ TaqbinGroup,
+ [EnumMember(Value = "tnt-group")]
+ TntGroup,
+ [EnumMember(Value = "cj-group")]
+ CjGroup,
+ [EnumMember(Value = "hermes-group")]
+ HermesGroup,
+ [EnumMember(Value = "dpd-group")]
+ DpdGroup,
+ [EnumMember(Value = "gls-group")]
+ GlsGroup,
+ [EnumMember(Value = "dhl-group")]
+ DhlGroup,
+ [EnumMember(Value = "fastway-group")]
+ FastwayGroup,
+ [EnumMember(Value = "asendia-group")]
+ AsendiaGroup,
+ }
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/Models/TagV1.cs b/src/AfterShipTracking/AfterShipTracking/Models/TagV1.cs
new file mode 100644
index 0000000..6931b91
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Models/TagV1.cs
@@ -0,0 +1,36 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Converters;
+
+namespace AfterShipTracking
+{
+ ///
+ /// Current status of tracking. (
+ ///
+ [JsonConverter(typeof(StringEnumConverter))]
+ public enum TagV1
+ {
+ [EnumMember(Value = "Pending")]
+ Pending,
+ [EnumMember(Value = "InfoReceived")]
+ Inforeceived,
+ [EnumMember(Value = "InTransit")]
+ Intransit,
+ [EnumMember(Value = "OutForDelivery")]
+ Outfordelivery,
+ [EnumMember(Value = "AttemptFail")]
+ Attemptfail,
+ [EnumMember(Value = "Delivered")]
+ Delivered,
+ [EnumMember(Value = "AvailableForPickup")]
+ Availableforpickup,
+ [EnumMember(Value = "Exception")]
+ Exception,
+ [EnumMember(Value = "Expired")]
+ Expired,
+ }
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/Models/Tracking.cs b/src/AfterShipTracking/AfterShipTracking/Models/Tracking.cs
new file mode 100644
index 0000000..f0f5880
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Models/Tracking.cs
@@ -0,0 +1,721 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System;
+using System.Collections.Generic;
+using Newtonsoft.Json;
+
+namespace AfterShipTracking
+{
+ ///
+ /// Object describes the tracking information.
+ ///
+ public class Tracking
+ {
+ ///
+ /// Id Tracking ID.
+ ///
+ [JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Id { get; set; }
+ ///
+ /// LegacyId The length of the tracking ID has been increased from 24 characters to 32 characters. We will use the legacy_id field to store the original 24-character tracking ID to maintain compatibility with existing data. Therefore, all tracking endpoints will continue to work with the legacy_id field as before.
+ ///
+ [JsonProperty("legacy_id", NullValueHandling = NullValueHandling.Ignore)]
+ public string? LegacyId { get; set; }
+ ///
+ /// CreatedAt The date and time the shipment was imported or added to AfterShip. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0.
+ ///
+ [JsonProperty("created_at", NullValueHandling = NullValueHandling.Ignore)]
+ public string? CreatedAt { get; set; }
+ ///
+ /// UpdatedAt The date and time the shipment was updated. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0.
+ ///
+ [JsonProperty("updated_at", NullValueHandling = NullValueHandling.Ignore)]
+ public string? UpdatedAt { get; set; }
+ ///
+ /// TrackingNumber Tracking number.
+ ///
+ [JsonProperty("tracking_number", NullValueHandling = NullValueHandling.Ignore)]
+ public string? TrackingNumber { get; set; }
+ ///
+ /// Slug Unique courier code. When importing a shipment with no courier slug and the tracking number can’t be recognized, the courier will be marked as `unrecognized`. Get courier codes .
+ ///
+ [JsonProperty("slug", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Slug { get; set; }
+ ///
+ /// Active Whether or not AfterShip will continue tracking the shipments. Value is `false` when tag (status) is `Delivered`, `Expired`, or further updates for 30 days since last update.
+ ///
+ [JsonProperty("active", NullValueHandling = NullValueHandling.Ignore)]
+ public bool? Active { get; set; }
+ ///
+ /// CustomFields Custom fields that accept an object with string field. In order to protect the privacy of your customers, do not include any in custom fields.
+ ///
+ [JsonProperty("custom_fields", NullValueHandling = NullValueHandling.Ignore)]
+ public Dictionary? CustomFields { get; set; }
+ ///
+ /// TransitTime Total transit time in days.- For delivered shipments: Transit time (in days) = Delivered date - Pick-up date- For undelivered shipments: Transit time (in days) = Current date - Pick-up dateValue as `null` for the shipment without pick-up date.
+ ///
+ [JsonProperty("transit_time", NullValueHandling = NullValueHandling.Ignore)]
+ public int? TransitTime { get; set; }
+ ///
+ /// OriginCountryRegion The for the origin country/region. E.g. USA for the United States.
+ ///
+ [JsonProperty("origin_country_region", NullValueHandling = NullValueHandling.Ignore)]
+ public string? OriginCountryRegion { get; set; }
+ ///
+ /// OriginState The state of the sender’s address.
+ ///
+ [JsonProperty("origin_state", NullValueHandling = NullValueHandling.Ignore)]
+ public string? OriginState { get; set; }
+ ///
+ /// OriginCity The city of the sender’s address.
+ ///
+ [JsonProperty("origin_city", NullValueHandling = NullValueHandling.Ignore)]
+ public string? OriginCity { get; set; }
+ ///
+ /// OriginPostalCode The postal code of the sender’s address.
+ ///
+ [JsonProperty("origin_postal_code", NullValueHandling = NullValueHandling.Ignore)]
+ public string? OriginPostalCode { get; set; }
+ ///
+ /// OriginRawLocation The sender address that the shipment is shipping from.
+ ///
+ [JsonProperty("origin_raw_location", NullValueHandling = NullValueHandling.Ignore)]
+ public string? OriginRawLocation { get; set; }
+ ///
+ /// DestinationCountryRegion The for the destination country/region. E.g. USA for the United States.
+ ///
+ [JsonProperty("destination_country_region", NullValueHandling = NullValueHandling.Ignore)]
+ public string? DestinationCountryRegion { get; set; }
+ ///
+ /// DestinationState The state of the recipient’s address.
+ ///
+ [JsonProperty("destination_state", NullValueHandling = NullValueHandling.Ignore)]
+ public string? DestinationState { get; set; }
+ ///
+ /// DestinationCity The city of the recipient’s address.
+ ///
+ [JsonProperty("destination_city", NullValueHandling = NullValueHandling.Ignore)]
+ public string? DestinationCity { get; set; }
+ ///
+ /// DestinationPostalCode The postal code of the recipient’s address.
+ ///
+ [JsonProperty("destination_postal_code", NullValueHandling = NullValueHandling.Ignore)]
+ public string? DestinationPostalCode { get; set; }
+ ///
+ /// DestinationRawLocation The shipping address that the shipment is shipping to.
+ ///
+ [JsonProperty("destination_raw_location", NullValueHandling = NullValueHandling.Ignore)]
+ public string? DestinationRawLocation { get; set; }
+ ///
+ /// CourierDestinationCountryRegion Destination country/region of the tracking detected from the courier. ISO Alpha-3 (three letters). Value will be `null` if the courier doesn't provide the destination country.
+ ///
+ [JsonProperty("courier_destination_country_region", NullValueHandling = NullValueHandling.Ignore)]
+ public string? CourierDestinationCountryRegion { get; set; }
+ ///
+ /// CourierEstimatedDeliveryDate The field contains the estimated delivery date provided by the carrier.
+ ///
+ [JsonProperty("courier_estimated_delivery_date", NullValueHandling = NullValueHandling.Ignore)]
+ public CourierEstimatedDeliveryDateTracking? CourierEstimatedDeliveryDate { get; set; }
+ ///
+ /// Note Text field for the note.
+ ///
+ [JsonProperty("note", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Note { get; set; }
+ ///
+ /// OrderId A globally-unique identifier for the order.
+ ///
+ [JsonProperty("order_id", NullValueHandling = NullValueHandling.Ignore)]
+ public string? OrderId { get; set; }
+ ///
+ /// OrderIdPath The URL for the order in your system or store.
+ ///
+ [JsonProperty("order_id_path", NullValueHandling = NullValueHandling.Ignore)]
+ public string? OrderIdPath { get; set; }
+ ///
+ /// OrderDate The date and time the order was created in your system or store. It uses the format: `YYYY-MM-DDTHH:mm:ssZ` based on whichever timezone you provide.
+ ///
+ [JsonProperty("order_date", NullValueHandling = NullValueHandling.Ignore)]
+ public string? OrderDate { get; set; }
+ ///
+ /// ShipmentPackageCount Number of packages under the tracking.
+ ///
+ [JsonProperty("shipment_package_count", NullValueHandling = NullValueHandling.Ignore)]
+ public double? ShipmentPackageCount { get; set; }
+ ///
+ /// ShipmentPickupDate The date and time the shipment was picked up by the carrier. It uses the timezone where the pickup occured. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("shipment_pickup_date", NullValueHandling = NullValueHandling.Ignore)]
+ public string? ShipmentPickupDate { get; set; }
+ ///
+ /// ShipmentDeliveryDate The date and time the shipment was delivered. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("shipment_delivery_date", NullValueHandling = NullValueHandling.Ignore)]
+ public string? ShipmentDeliveryDate { get; set; }
+ ///
+ /// ShipmentType The carrier service type for the shipment.
+ ///
+ [JsonProperty("shipment_type", NullValueHandling = NullValueHandling.Ignore)]
+ public string? ShipmentType { get; set; }
+ ///
+ /// ShipmentWeight The shipment_weight field represents the total weight of the shipment. In scenarios where the carrier does not provide this information, you can provide the weight to AfterShip. We will prioritize the data provided by the carrier, if available. The shipment weight will be included in the Response and accessed through the GET API, Webhook, and CSV export. It will also be displayed on the AfterShip Tracking admin. Additionally, it plays a significant role in error-free shipment handling and carbon emission calculations, ensuring accurate and informed decision-making
+ ///
+ [JsonProperty("shipment_weight", NullValueHandling = NullValueHandling.Ignore)]
+ public ShipmentWeightTracking? ShipmentWeight { get; set; }
+ ///
+ /// SignedBy Signed by information for delivered shipment.
+ ///
+ [JsonProperty("signed_by", NullValueHandling = NullValueHandling.Ignore)]
+ public string? SignedBy { get; set; }
+ ///
+ /// Source Source of how this tracking is added.
+ ///
+ [JsonProperty("source", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Source { get; set; }
+ ///
+ /// Tag Current status of tracking. (
+ ///
+ [JsonProperty("tag", NullValueHandling = NullValueHandling.Ignore)]
+ public TagV1? Tag { get; set; }
+ ///
+ /// Subtag Current subtag of tracking. (
+ ///
+ [JsonProperty("subtag", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Subtag { get; set; }
+ ///
+ /// SubtagMessage Normalized tracking message. (
+ ///
+ [JsonProperty("subtag_message", NullValueHandling = NullValueHandling.Ignore)]
+ public string? SubtagMessage { get; set; }
+ ///
+ /// Title By default this field shows the `tracking_number`, but you can customize it as you wish with any info (e.g. the order number).
+ ///
+ [JsonProperty("title", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Title { get; set; }
+ ///
+ /// TrackedCount Number of attempts AfterShip tracks at courier's system.
+ ///
+ [JsonProperty("tracked_count", NullValueHandling = NullValueHandling.Ignore)]
+ public double? TrackedCount { get; set; }
+ ///
+ /// LastMileTrackingSupported Indicates if the shipment is trackable till the final destination.Three possible values:- true- false- null
+ ///
+ [JsonProperty("last_mile_tracking_supported", NullValueHandling = NullValueHandling.Ignore)]
+ public bool? LastMileTrackingSupported { get; set; }
+ ///
+ /// Language The recipient’s language. If you set up AfterShip notifications in different languages, we use this to send the recipient tracking updates in their preferred language.
+ ///
+ [JsonProperty("language", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Language { get; set; }
+ ///
+ /// UniqueToken Deprecated
+ ///
+ [JsonProperty("unique_token", NullValueHandling = NullValueHandling.Ignore)]
+ public string? UniqueToken { get; set; }
+ ///
+ /// Checkpoints Array of checkpoint object describes the checkpoint information.
+ ///
+ [JsonProperty("checkpoints", NullValueHandling = NullValueHandling.Ignore)]
+ public Checkpoint?[] Checkpoints { get; set; }
+ ///
+ /// SubscribedSmses Phone number(s) subscribed to receive sms notifications.
+ ///
+ [JsonProperty("subscribed_smses", NullValueHandling = NullValueHandling.Ignore)]
+ public string?[] SubscribedSmses { get; set; }
+ ///
+ /// SubscribedEmails Email address(es) subscribed to receive email notifications.
+ ///
+ [JsonProperty("subscribed_emails", NullValueHandling = NullValueHandling.Ignore)]
+ public string?[] SubscribedEmails { get; set; }
+ ///
+ /// ReturnToSender Whether or not the shipment is returned to sender. Value is `true` when any of its checkpoints has subtag `Exception_010` (returning to sender) or `Exception_011` (returned to sender). Otherwise value is `false`.
+ ///
+ [JsonProperty("return_to_sender", NullValueHandling = NullValueHandling.Ignore)]
+ public bool? ReturnToSender { get; set; }
+ ///
+ /// OrderPromisedDeliveryDate The promised delivery date of the order. It uses the formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("order_promised_delivery_date", NullValueHandling = NullValueHandling.Ignore)]
+ public string? OrderPromisedDeliveryDate { get; set; }
+ ///
+ /// DeliveryType Shipment delivery type- pickup_at_store- pickup_at_courier- door_to_door
+ ///
+ [JsonProperty("delivery_type", NullValueHandling = NullValueHandling.Ignore)]
+ public string? DeliveryType { get; set; }
+ ///
+ /// PickupLocation Shipment pickup location for receiver
+ ///
+ [JsonProperty("pickup_location", NullValueHandling = NullValueHandling.Ignore)]
+ public string? PickupLocation { get; set; }
+ ///
+ /// PickupNote Shipment pickup note for receiver
+ ///
+ [JsonProperty("pickup_note", NullValueHandling = NullValueHandling.Ignore)]
+ public string? PickupNote { get; set; }
+ ///
+ /// CourierTrackingLink Official tracking URL of the courier (if any). The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default.
+ ///
+ [JsonProperty("courier_tracking_link", NullValueHandling = NullValueHandling.Ignore)]
+ public string? CourierTrackingLink { get; set; }
+ ///
+ /// FirstAttemptedAt The date and time of the carrier’s first attempt to deliver the package to the recipient. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("first_attempted_at", NullValueHandling = NullValueHandling.Ignore)]
+ public string? FirstAttemptedAt { get; set; }
+ ///
+ /// CourierRedirectLink Delivery instructions (delivery date or address) can be modified by visiting the link if supported by a carrier. The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default.
+ ///
+ [JsonProperty("courier_redirect_link", NullValueHandling = NullValueHandling.Ignore)]
+ public string? CourierRedirectLink { get; set; }
+ ///
+ /// TrackingAccountNumber Additional field required by some carriers to retrieve the tracking info. The shipper’s carrier account number. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_account_number", NullValueHandling = NullValueHandling.Ignore)]
+ public string? TrackingAccountNumber { get; set; }
+ ///
+ /// TrackingKey Additional field required by some carriers to retrieve the tracking info. A type of tracking credential required by some carriers. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_key", NullValueHandling = NullValueHandling.Ignore)]
+ public string? TrackingKey { get; set; }
+ ///
+ /// TrackingShipDate The date and time when the shipment is shipped by the merchant and ready for pickup by the carrier. The field supports the following formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZThe field serves two key purposes:- Calculate processing time metrics in the Order-to-delivery Analytics dashboard. To ensure accurate analytics, it's recommended to include timezone information when configuring this value- Required by certain carriers to retrieve tracking information as an additional tracking field.
+ ///
+ [JsonProperty("tracking_ship_date", NullValueHandling = NullValueHandling.Ignore)]
+ public string? TrackingShipDate { get; set; }
+ ///
+ /// OnTimeStatus Whether the tracking is delivered on time or not.
+ ///
+ [JsonProperty("on_time_status", NullValueHandling = NullValueHandling.Ignore)]
+ public string? OnTimeStatus { get; set; }
+ ///
+ /// OnTimeDifference The difference days of the on time.
+ ///
+ [JsonProperty("on_time_difference", NullValueHandling = NullValueHandling.Ignore)]
+ public double? OnTimeDifference { get; set; }
+ ///
+ /// OrderTags The tags of the order.
+ ///
+ [JsonProperty("order_tags", NullValueHandling = NullValueHandling.Ignore)]
+ public string?[] OrderTags { get; set; }
+ ///
+ /// AftershipEstimatedDeliveryDate The estimated delivery date of the shipment provided by AfterShip’s AI and shown to the recipients. It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone.
+ ///
+ [JsonProperty("aftership_estimated_delivery_date", NullValueHandling = NullValueHandling.Ignore)]
+ public AftershipEstimatedDeliveryDateTracking? AftershipEstimatedDeliveryDate { get; set; }
+ ///
+ /// CustomEstimatedDeliveryDate Estimated delivery time of the shipment based on your . It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone.
+ ///
+ [JsonProperty("custom_estimated_delivery_date", NullValueHandling = NullValueHandling.Ignore)]
+ public CustomEstimatedDeliveryDateTracking? CustomEstimatedDeliveryDate { get; set; }
+ ///
+ /// OrderNumber A unique, human-readable identifier for the order.
+ ///
+ [JsonProperty("order_number", NullValueHandling = NullValueHandling.Ignore)]
+ public string? OrderNumber { get; set; }
+ ///
+ /// FirstEstimatedDelivery The shipment’s original estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone.
+ ///
+ [JsonProperty("first_estimated_delivery", NullValueHandling = NullValueHandling.Ignore)]
+ public FirstEstimatedDeliveryTracking? FirstEstimatedDelivery { get; set; }
+ ///
+ /// LatestEstimatedDelivery The most recently calculated estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone.
+ ///
+ [JsonProperty("latest_estimated_delivery", NullValueHandling = NullValueHandling.Ignore)]
+ public LatestEstimatedDeliveryTracking? LatestEstimatedDelivery { get; set; }
+ ///
+ /// ShipmentTags Used to add tags to your shipments to help categorize and filter them easily.
+ ///
+ [JsonProperty("shipment_tags", NullValueHandling = NullValueHandling.Ignore)]
+ public string?[] ShipmentTags { get; set; }
+ ///
+ /// CourierConnectionId If you have multiple accounts connected for a single carrier on AfterShip, we have introduced the courier_connection_id field to allow you to specify the carrier account associated with each shipment. By providing this information, you enable us to accurately track and monitor your shipments based on the correct carrier account.(In the event that you do not specify the courier_connection_id, we will handle your shipment using the connection that was created earliest among your connected accounts.
+ ///
+ [JsonProperty("courier_connection_id", NullValueHandling = NullValueHandling.Ignore)]
+ public string? CourierConnectionId { get; set; }
+ ///
+ /// TrackingOriginCountryRegion (Legacy) Replaced by `origin_country_region`. Additional field required by some carriers to retrieve the tracking info. The origin country/region of the shipment. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_origin_country_region", NullValueHandling = NullValueHandling.Ignore)]
+ public string? TrackingOriginCountryRegion { get; set; }
+ ///
+ /// TrackingDestinationCountryRegion (Legacy) Replaced by `destination_country_region`. Additional field required by some carriers to retrieve the tracking info. The destination country/region of the shipment. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_destination_country_region", NullValueHandling = NullValueHandling.Ignore)]
+ public string? TrackingDestinationCountryRegion { get; set; }
+ ///
+ /// TrackingPostalCode (Legacy) Replaced by `destination_postal_code`. Additional field required by some carriers to retrieve the tracking info. The postal code of the recipient’s address. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_postal_code", NullValueHandling = NullValueHandling.Ignore)]
+ public string? TrackingPostalCode { get; set; }
+ ///
+ /// TrackingState (Legacy) Replaced by `destination_state`. Additional field required by some carriers to retrieve the tracking info. The state/province of the recipient’s address. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_state", NullValueHandling = NullValueHandling.Ignore)]
+ public string? TrackingState { get; set; }
+ ///
+ /// CarbonEmissions The model contains the total amount of carbon emissions generated by the shipment. - AfterShip will provide this data only when it is available, and its availability is contingent upon the location and weight information that AfterShip can obtain.- The values will be accessible solely for shipments that have been successfully delivered. However, in the event of a shipping update after the delivery status has been achieved, the value may change.- It’s a paid service and only for Tracking Enterprise users, please contact your customer success manager if you want to know more.
+ ///
+ [JsonProperty("carbon_emissions", NullValueHandling = NullValueHandling.Ignore)]
+ public CarbonEmissionsTracking? CarbonEmissions { get; set; }
+ ///
+ /// LocationId The location_id refers to the place where you fulfilled the items. - If you provide a location_id, the system will automatically use it as the tracking's origin address. However, passing both location_id and any origin address information simultaneously is not allowed.- Please make sure you add your locations .
+ ///
+ [JsonProperty("location_id", NullValueHandling = NullValueHandling.Ignore)]
+ public string? LocationId { get; set; }
+ ///
+ /// ShippingMethod The shipping_method string refers to the chosen method for delivering the package. Merchants typically offer various shipping methods to consumers during the checkout process, such as, Local Delivery, Free Express Worldwide Shipping, etc.
+ ///
+ [JsonProperty("shipping_method", NullValueHandling = NullValueHandling.Ignore)]
+ public string? ShippingMethod { get; set; }
+ ///
+ /// FailedDeliveryAttempts By dynamically tracking failed delivery attempts during shipment, this field allows you to pinpoint carriers accountable for the most failures. Analyzing the root cause of these failures enables you to improve carriers' delivery standard operating procedures (SOP), leading to an overall enhancement in delivery service quality.
+ ///
+ [JsonProperty("failed_delivery_attempts", NullValueHandling = NullValueHandling.Ignore)]
+ public int? FailedDeliveryAttempts { get; set; }
+ ///
+ /// SignatureRequirement The signature_requirement field serves the purpose of validating the service option type, specifically proof of delivery. By collecting the recipient's signature upon delivery, it ensures the package reaches the intended recipient and prevents disputes related to non-delivery or lost packages.
+ ///
+ [JsonProperty("signature_requirement", NullValueHandling = NullValueHandling.Ignore)]
+ public string? SignatureRequirement { get; set; }
+ ///
+ /// DeliveryLocationType The delivery location type represents the secure area where the carrier leaves the package, such as a safe place, locker, mailbox, front porch, etc. This information helps ensure the shipment reaches the intended recipient efficiently, minimizing the risk of theft or damage.
+ ///
+ [JsonProperty("delivery_location_type", NullValueHandling = NullValueHandling.Ignore)]
+ public string? DeliveryLocationType { get; set; }
+ ///
+ /// AftershipTrackingUrl The tracking URL directs your customers to the shipment tracking page which can display either the default or a customized page based on segmentation rules.- The universal URL is used by default, but you can opt for a custom domain if you have one. Learn how to set up a custom domain .The field is not automatically enabled in API & Webhook. Please contact support if you’d like to enable it.
+ ///
+ [JsonProperty("aftership_tracking_url", NullValueHandling = NullValueHandling.Ignore)]
+ public string? AftershipTrackingUrl { get; set; }
+ ///
+ /// AftershipTrackingOrderUrl The order URL directs your customers to the order tracking page, which includes all shipments. It can display either the default or a customized page based on segmentation rules.- The universal URL is used by default, but you can opt for a custom domain if you have one. Learn how to set up a custom domain .The field is not automatically enabled in API & Webhook. Please contact support if you’d like to enable it.
+ ///
+ [JsonProperty("aftership_tracking_order_url", NullValueHandling = NullValueHandling.Ignore)]
+ public string? AftershipTrackingOrderUrl { get; set; }
+ ///
+ /// FirstMile The field contains information about the first leg of the shipping starting from the carrier picking up the shipment from the shipper to the point where they hand it over to the last-mile carrier. Once AfterShip detects the shipment is multi-leg, we will populate the first-mile information under this object.
+ ///
+ [JsonProperty("first_mile", NullValueHandling = NullValueHandling.Ignore)]
+ public FirstMileTracking? FirstMile { get; set; }
+ ///
+ /// LastMile This field contains information about the last leg of the shipment, starting from the carrier who hands it over to the last-mile carrier, all the way to delivery. Once AfterShip detects that the shipment involves multiple legs and identifies the last-mile carrier, we will populate the last-mile carrier information in this object. Alternatively, the user can provide this information in this field to specify the last-mile carrier, which is helpful if AfterShip is unable to detect it automatically.
+ ///
+ [JsonProperty("last_mile", NullValueHandling = NullValueHandling.Ignore)]
+ public LastMileTracking? LastMile { get; set; }
+ ///
+ /// Customers The field contains the customer information associated with the tracking. A maximum of three customer objects are allowed.
+ ///
+ [JsonProperty("customers", NullValueHandling = NullValueHandling.Ignore)]
+ public CustomersTracking?[] Customers { get; set; }
+ public Tracking()
+ {
+ }
+ }
+
+ ///
+ ///
+ ///
+ public class CourierEstimatedDeliveryDateTracking
+ {
+ ///
+ /// EstimatedDeliveryDate The estimated arrival date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("estimated_delivery_date", NullValueHandling = NullValueHandling.Ignore)]
+ public string? EstimatedDeliveryDate { get; set; }
+ ///
+ /// EstimatedDeliveryDateMin The earliest estimated delivery date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("estimated_delivery_date_min", NullValueHandling = NullValueHandling.Ignore)]
+ public string? EstimatedDeliveryDateMin { get; set; }
+ ///
+ /// EstimatedDeliveryDateMax The Latest estimated delivery date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("estimated_delivery_date_max", NullValueHandling = NullValueHandling.Ignore)]
+ public string? EstimatedDeliveryDateMax { get; set; }
+
+ public CourierEstimatedDeliveryDateTracking()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class ShipmentWeightTracking
+ {
+ ///
+ /// Unit The unit in which the value field is expressed.
+ ///
+ [JsonProperty("unit", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Unit { get; set; }
+ ///
+ /// Value The total amount of shipment weight.
+ ///
+ [JsonProperty("value", NullValueHandling = NullValueHandling.Ignore)]
+ public double? Value { get; set; }
+
+ public ShipmentWeightTracking()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class AftershipEstimatedDeliveryDateTracking
+ {
+ ///
+ /// EstimatedDeliveryDate The estimated arrival date of the shipment.
+ ///
+ [JsonProperty("estimated_delivery_date", NullValueHandling = NullValueHandling.Ignore)]
+ public string? EstimatedDeliveryDate { get; set; }
+ ///
+ /// ConfidenceCode Indicates the confidence level and associated reason for an AI EDD prediction request. For a comprehensive list of confidence codes, refer to .
+ ///
+ [JsonProperty("confidence_code", NullValueHandling = NullValueHandling.Ignore)]
+ public double? ConfidenceCode { get; set; }
+ ///
+ /// EstimatedDeliveryDateMin Earliest estimated delivery date of the shipment.
+ ///
+ [JsonProperty("estimated_delivery_date_min", NullValueHandling = NullValueHandling.Ignore)]
+ public string? EstimatedDeliveryDateMin { get; set; }
+ ///
+ /// EstimatedDeliveryDateMax Latest estimated delivery date of the shipment.
+ ///
+ [JsonProperty("estimated_delivery_date_max", NullValueHandling = NullValueHandling.Ignore)]
+ public string? EstimatedDeliveryDateMax { get; set; }
+
+ public AftershipEstimatedDeliveryDateTracking()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class CustomEstimatedDeliveryDateTracking
+ {
+ ///
+ /// Type The format of the EDD. Either a single date or a date range.
+ ///
+ [JsonProperty("type", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Type { get; set; }
+ ///
+ /// Datetime The specific EDD date.
+ ///
+ [JsonProperty("datetime", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Datetime { get; set; }
+ ///
+ /// DatetimeMin For a date range EDD format, the date for the lower end of the range.
+ ///
+ [JsonProperty("datetime_min", NullValueHandling = NullValueHandling.Ignore)]
+ public string? DatetimeMin { get; set; }
+ ///
+ /// DatetimeMax For a date range EDD format, the date for the upper end of the range.
+ ///
+ [JsonProperty("datetime_max", NullValueHandling = NullValueHandling.Ignore)]
+ public string? DatetimeMax { get; set; }
+
+ public CustomEstimatedDeliveryDateTracking()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class FirstEstimatedDeliveryTracking
+ {
+ ///
+ /// Type The format of the EDD. Either a single date or a date range.
+ ///
+ [JsonProperty("type", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Type { get; set; }
+ ///
+ /// Source The source of the EDD. Either the carrier, AfterShip AI, or based on your custom EDD settings.
+ ///
+ [JsonProperty("source", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Source { get; set; }
+ ///
+ /// Datetime The latest EDD time.
+ ///
+ [JsonProperty("datetime", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Datetime { get; set; }
+ ///
+ /// DatetimeMin For a date range EDD format, the date and time for the lower end of the range.
+ ///
+ [JsonProperty("datetime_min", NullValueHandling = NullValueHandling.Ignore)]
+ public string? DatetimeMin { get; set; }
+ ///
+ /// DatetimeMax For a date range EDD format, the date and time for the upper end of the range.
+ ///
+ [JsonProperty("datetime_max", NullValueHandling = NullValueHandling.Ignore)]
+ public string? DatetimeMax { get; set; }
+
+ public FirstEstimatedDeliveryTracking()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class LatestEstimatedDeliveryTracking
+ {
+ ///
+ /// Type The format of the EDD. Either a single date or a date range.
+ ///
+ [JsonProperty("type", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Type { get; set; }
+ ///
+ /// Source The source of the EDD. Either the carrier, AfterShip AI, or based on your custom EDD settings.
+ ///
+ [JsonProperty("source", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Source { get; set; }
+ ///
+ /// Datetime The latest EDD time.
+ ///
+ [JsonProperty("datetime", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Datetime { get; set; }
+ ///
+ /// DatetimeMin For a date range EDD format, the date and time for the lower end of the range.
+ ///
+ [JsonProperty("datetime_min", NullValueHandling = NullValueHandling.Ignore)]
+ public string? DatetimeMin { get; set; }
+ ///
+ /// DatetimeMax For a date range EDD format, the date and time for the upper end of the range.
+ ///
+ [JsonProperty("datetime_max", NullValueHandling = NullValueHandling.Ignore)]
+ public string? DatetimeMax { get; set; }
+
+ public LatestEstimatedDeliveryTracking()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class CarbonEmissionsTracking
+ {
+ ///
+ /// Unit The unit in which the value field is expressed. Allowed values: kg
+ ///
+ [JsonProperty("unit", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Unit { get; set; }
+ ///
+ /// Value The total amount of carbon emissions
+ ///
+ [JsonProperty("value", NullValueHandling = NullValueHandling.Ignore)]
+ public double? Value { get; set; }
+
+ public CarbonEmissionsTracking()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class FirstMileTracking
+ {
+ ///
+ /// TrackingNumber The tracking number of the first-mile carrier.
+ ///
+ [JsonProperty("tracking_number", NullValueHandling = NullValueHandling.Ignore)]
+ public string? TrackingNumber { get; set; }
+ ///
+ /// Slug The unique code of the carrier responsible for the first-mile of the shipment. Find all the courier slugs .
+ ///
+ [JsonProperty("slug", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Slug { get; set; }
+ ///
+ /// TransitTime The transit time for the first-mile of a shipment in days. This field is calculated based on whether the handed_over_to_last_mile_carrier or received_by_last_mile_carrier event is detected by AfterShip. The handover event date is used to calculate the first-mile transit time.- First mile transit time (in days) = Handover date - Pickup date
+ ///
+ [JsonProperty("transit_time", NullValueHandling = NullValueHandling.Ignore)]
+ public string? TransitTime { get; set; }
+ ///
+ /// CourierRedirectLink The field provides the link for modifying delivery instructions (such as delivery date and shipping address), if supported by the first-mile carrier. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US".
+ ///
+ [JsonProperty("courier_redirect_link", NullValueHandling = NullValueHandling.Ignore)]
+ public string? CourierRedirectLink { get; set; }
+ ///
+ /// CourierTrackingLink The field contains the official tracking URL of the first-mile carrier, if available. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US".
+ ///
+ [JsonProperty("courier_tracking_link", NullValueHandling = NullValueHandling.Ignore)]
+ public string? CourierTrackingLink { get; set; }
+
+ public FirstMileTracking()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class LastMileTracking
+ {
+ ///
+ /// TrackingNumber The tracking number of the last-mile carrier.
+ ///
+ [JsonProperty("tracking_number", NullValueHandling = NullValueHandling.Ignore)]
+ public string? TrackingNumber { get; set; }
+ ///
+ /// Slug The unique code of the carrier responsible for the last-mile of the shipment. Find all the courier slugs .
+ ///
+ [JsonProperty("slug", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Slug { get; set; }
+ ///
+ /// TransitTime The transit time for the last-mile of a shipment in days. This field is calculated based on whether the handed_over_to_last_mile_carrier or the received_by_last_mile_carrier event is detected by AfterShip. The handover event date is used to calculate the last-mile transit time.- Last mile transit time (in days)= Delivered date - Handover date
+ ///
+ [JsonProperty("transit_time", NullValueHandling = NullValueHandling.Ignore)]
+ public string? TransitTime { get; set; }
+ ///
+ /// CourierTrackingLink The field contains the official tracking URL of the last-mile carrier, if available. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US".
+ ///
+ [JsonProperty("courier_tracking_link", NullValueHandling = NullValueHandling.Ignore)]
+ public string? CourierTrackingLink { get; set; }
+ ///
+ /// CourierRedirectLink The field provides the link for modifying delivery instructions (such as delivery date and shipping address), if supported by the last-mile carrier. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US".
+ ///
+ [JsonProperty("courier_redirect_link", NullValueHandling = NullValueHandling.Ignore)]
+ public string? CourierRedirectLink { get; set; }
+ ///
+ /// Source The field indicates the source of last-mile carrier.
+ ///
+ [JsonProperty("source", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Source { get; set; }
+
+ public LastMileTracking()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class CustomersTracking
+ {
+ ///
+ /// Role The role of the customer, indicating whether the customer is an individual or a company.
+ ///
+ [JsonProperty("role", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Role { get; set; }
+ ///
+ /// Name Customer name associated with the tracking.
+ ///
+ [JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Name { get; set; }
+ ///
+ /// PhoneNumber The phone number(s) to receive SMS notifications. Phone numbers should begin with a `+` sign and include the area code.
+ ///
+ [JsonProperty("phone_number", NullValueHandling = NullValueHandling.Ignore)]
+ public string? PhoneNumber { get; set; }
+ ///
+ /// Email Email address(es) to receive email notifications.
+ ///
+ [JsonProperty("email", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Email { get; set; }
+ ///
+ /// Language The preferred language of the customer. If you have set up AfterShip notifications in different languages, we use this to send the tracking updates to the customer in their preferred language.
+ ///
+ [JsonProperty("language", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Language { get; set; }
+
+ public CustomersTracking()
+ {
+ }
+ }
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/Models/TrackingResponseGetMultipleV1.cs b/src/AfterShipTracking/AfterShipTracking/Models/TrackingResponseGetMultipleV1.cs
new file mode 100644
index 0000000..9c777f0
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Models/TrackingResponseGetMultipleV1.cs
@@ -0,0 +1,76 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System;
+using System.Collections.Generic;
+using Newtonsoft.Json;
+
+namespace AfterShipTracking
+{
+ ///
+ /// Tracking response for getting tracking
+ ///
+ public class TrackingResponseGetMultipleV1
+ {
+ ///
+ /// Meta Meta data
+ ///
+ [JsonProperty("meta")]
+ public MetaV1 Meta { get; set; }
+ ///
+ /// Data
+ ///
+ [JsonProperty("data", NullValueHandling = NullValueHandling.Ignore)]
+ public DataTrackingResponseGetMultipleV1? Data { get; set; }
+ public TrackingResponseGetMultipleV1()
+ {
+ }
+ }
+
+ ///
+ ///
+ ///
+ public class DataTrackingResponseGetMultipleV1
+ {
+ ///
+ /// Pagination The Pagination holds the information for the pagination when the response contains multiple objects.
+ ///
+ [JsonProperty("pagination", NullValueHandling = NullValueHandling.Ignore)]
+ public PaginationDataTrackingResponseGetMultipleV1? Pagination { get; set; }
+ ///
+ /// Trackings Array of
+ ///
+ [JsonProperty("trackings", NullValueHandling = NullValueHandling.Ignore)]
+ public Tracking?[] Trackings { get; set; }
+
+ public DataTrackingResponseGetMultipleV1()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class PaginationDataTrackingResponseGetMultipleV1
+ {
+ ///
+ /// Total The total number of trackings.
+ ///
+ [JsonProperty("total", NullValueHandling = NullValueHandling.Ignore)]
+ public int? Total { get; set; }
+ ///
+ /// NextCursor A string representing the cursor value for the next page of results.
+ ///
+ [JsonProperty("next_cursor", NullValueHandling = NullValueHandling.Ignore)]
+ public string? NextCursor { get; set; }
+ ///
+ /// HasNextPage To indicate if next page is available.
+ ///
+ [JsonProperty("has_next_page", NullValueHandling = NullValueHandling.Ignore)]
+ public bool? HasNextPage { get; set; }
+
+ public PaginationDataTrackingResponseGetMultipleV1()
+ {
+ }
+ }
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/Models/TrackingResponseV1.cs b/src/AfterShipTracking/AfterShipTracking/Models/TrackingResponseV1.cs
new file mode 100644
index 0000000..a8ce610
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Models/TrackingResponseV1.cs
@@ -0,0 +1,31 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System;
+using System.Collections.Generic;
+using Newtonsoft.Json;
+
+namespace AfterShipTracking
+{
+ ///
+ /// Tracking response for returning single tracking
+ ///
+ public class TrackingResponseV1
+ {
+ ///
+ /// Meta Meta data
+ ///
+ [JsonProperty("meta")]
+ public MetaV1 Meta { get; set; }
+ ///
+ /// Data Object describes the tracking information.
+ ///
+ [JsonProperty("data")]
+ public Tracking Data { get; set; }
+ public TrackingResponseV1()
+ {
+ }
+ }
+
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/Models/UpdateTrackingByIdRequest.cs b/src/AfterShipTracking/AfterShipTracking/Models/UpdateTrackingByIdRequest.cs
new file mode 100644
index 0000000..8afc63f
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Models/UpdateTrackingByIdRequest.cs
@@ -0,0 +1,226 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System;
+using System.Collections.Generic;
+using Newtonsoft.Json;
+
+namespace AfterShipTracking
+{
+ ///
+ ///
+ ///
+ public class UpdateTrackingByIdRequest
+ {
+ ///
+ /// Title By default this field shows the `tracking_number`, but you can customize it as you wish with any info (e.g. the order number).
+ ///
+ [JsonProperty("title", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Title { get; set; }
+ ///
+ /// OrderId A globally-unique identifier for the order.
+ ///
+ [JsonProperty("order_id", NullValueHandling = NullValueHandling.Ignore)]
+ public string? OrderId { get; set; }
+ ///
+ /// OrderIdPath The URL for the order in your system or store.
+ ///
+ [JsonProperty("order_id_path", NullValueHandling = NullValueHandling.Ignore)]
+ public string? OrderIdPath { get; set; }
+ ///
+ /// CustomFields Custom fields that accept an object with string field. In order to protect the privacy of your customers, do not include any
+ ///
+ [JsonProperty("custom_fields", NullValueHandling = NullValueHandling.Ignore)]
+ public Dictionary? CustomFields { get; set; }
+ ///
+ /// Note Text field for the note.Input `""` to clear the value of this field.
+ ///
+ [JsonProperty("note", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Note { get; set; }
+ ///
+ /// Language The recipient’s language. If you set up AfterShip notifications in different languages, we use this to send the recipient tracking updates in their preferred language. Use an to specify the language.
+ ///
+ [JsonProperty("language", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Language { get; set; }
+ ///
+ /// OrderPromisedDeliveryDate The promised delivery date of the order. It uses the formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("order_promised_delivery_date", NullValueHandling = NullValueHandling.Ignore)]
+ public string? OrderPromisedDeliveryDate { get; set; }
+ ///
+ /// DeliveryType Shipment delivery type- `pickup_at_store`- `pickup_at_courier`- `door_to_door`
+ ///
+ [JsonProperty("delivery_type", NullValueHandling = NullValueHandling.Ignore)]
+ public string? DeliveryType { get; set; }
+ ///
+ /// PickupLocation Shipment pickup location for receiver
+ ///
+ [JsonProperty("pickup_location", NullValueHandling = NullValueHandling.Ignore)]
+ public string? PickupLocation { get; set; }
+ ///
+ /// PickupNote Shipment pickup note for receiver
+ ///
+ [JsonProperty("pickup_note", NullValueHandling = NullValueHandling.Ignore)]
+ public string? PickupNote { get; set; }
+ ///
+ /// Slug Unique code of each courier. Provide a single courier.(https://admin.aftership.com/settings/couriers). Get a list of courier slug using
+ ///
+ [JsonProperty("slug", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Slug { get; set; }
+ ///
+ /// TrackingAccountNumber Additional field required by some carriers to retrieve the tracking info. The shipper’s carrier account number. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_account_number", NullValueHandling = NullValueHandling.Ignore)]
+ public string? TrackingAccountNumber { get; set; }
+ ///
+ /// TrackingKey Additional field required by some carriers to retrieve the tracking info. A type of tracking credential required by some carriers. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_key", NullValueHandling = NullValueHandling.Ignore)]
+ public string? TrackingKey { get; set; }
+ ///
+ /// TrackingShipDate The date and time when the shipment is shipped by the merchant and ready for pickup by the carrier. The field supports the following formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZThe field serves two key purposes:- Calculate processing time metrics in the Order-to-delivery Analytics dashboard. To ensure accurate analytics, it's recommended to include timezone information when configuring this value- Required by certain carriers to retrieve tracking information as an additional tracking field.
+ ///
+ [JsonProperty("tracking_ship_date", NullValueHandling = NullValueHandling.Ignore)]
+ public string? TrackingShipDate { get; set; }
+ ///
+ /// OrderNumber A unique, human-readable identifier for the order.
+ ///
+ [JsonProperty("order_number", NullValueHandling = NullValueHandling.Ignore)]
+ public string? OrderNumber { get; set; }
+ ///
+ /// OrderDate Order date in YYYY-MM-DDTHH:mm:ssZ format. e.g. 2021-07-26T11:23:51-05:00
+ ///
+ [JsonProperty("order_date", NullValueHandling = NullValueHandling.Ignore)]
+ public string? OrderDate { get; set; }
+ ///
+ /// ShipmentType The carrier service type for the shipment. If you provide info for this field, AfterShip will not update it with info from the carrier.
+ ///
+ [JsonProperty("shipment_type", NullValueHandling = NullValueHandling.Ignore)]
+ public string? ShipmentType { get; set; }
+ ///
+ /// OriginCountryRegion The for more details.
+ ///
+ [JsonProperty("origin_country_region", NullValueHandling = NullValueHandling.Ignore)]
+ public string? OriginCountryRegion { get; set; }
+ ///
+ /// OriginState The state of the sender’s address. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc.
+ ///
+ [JsonProperty("origin_state", NullValueHandling = NullValueHandling.Ignore)]
+ public string? OriginState { get; set; }
+ ///
+ /// OriginCity The city of the sender’s address. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc.
+ ///
+ [JsonProperty("origin_city", NullValueHandling = NullValueHandling.Ignore)]
+ public string? OriginCity { get; set; }
+ ///
+ /// OriginPostalCode The postal of the sender’s address. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc.
+ ///
+ [JsonProperty("origin_postal_code", NullValueHandling = NullValueHandling.Ignore)]
+ public string? OriginPostalCode { get; set; }
+ ///
+ /// OriginRawLocation The sender address that the shipment is shipping from. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc.
+ ///
+ [JsonProperty("origin_raw_location", NullValueHandling = NullValueHandling.Ignore)]
+ public string? OriginRawLocation { get; set; }
+ ///
+ /// DestinationCountryRegion The for more details.
+ ///
+ [JsonProperty("destination_country_region", NullValueHandling = NullValueHandling.Ignore)]
+ public string? DestinationCountryRegion { get; set; }
+ ///
+ /// DestinationState The state of the recipient’s address. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc. Also the additional field required by some carriers to retrieve the tracking info. The state/province of the recipient’s address. Refer to our article on for more details.
+ ///
+ [JsonProperty("destination_state", NullValueHandling = NullValueHandling.Ignore)]
+ public string? DestinationState { get; set; }
+ ///
+ /// DestinationCity The city of the recipient’s address. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc.
+ ///
+ [JsonProperty("destination_city", NullValueHandling = NullValueHandling.Ignore)]
+ public string? DestinationCity { get; set; }
+ ///
+ /// DestinationPostalCode The postal of the recipient’s address. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc. Also the additional field required by some carriers to retrieve the tracking info. The postal code of the recipient’s address. Refer to our article on for more details.
+ ///
+ [JsonProperty("destination_postal_code", NullValueHandling = NullValueHandling.Ignore)]
+ public string? DestinationPostalCode { get; set; }
+ ///
+ /// DestinationRawLocation The shipping address that the shipment is shipping to. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc.
+ ///
+ [JsonProperty("destination_raw_location", NullValueHandling = NullValueHandling.Ignore)]
+ public string? DestinationRawLocation { get; set; }
+ ///
+ /// TrackingOriginCountryRegion (Legacy) Replaced by `origin_country_region`. Additional field required by some carriers to retrieve the tracking info. The origin country/region of the shipment. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_origin_country_region", NullValueHandling = NullValueHandling.Ignore)]
+ public string? TrackingOriginCountryRegion { get; set; }
+ ///
+ /// TrackingDestinationCountryRegion (Legacy) Replaced by `destination_country_region`. Additional field required by some carriers to retrieve the tracking info. The destination country/region of the shipment. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_destination_country_region", NullValueHandling = NullValueHandling.Ignore)]
+ public string? TrackingDestinationCountryRegion { get; set; }
+ ///
+ /// TrackingPostalCode (Legacy) Replaced by `destination_postal_code`. Additional field required by some carriers to retrieve the tracking info. The postal code of the recipient’s address. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_postal_code", NullValueHandling = NullValueHandling.Ignore)]
+ public string? TrackingPostalCode { get; set; }
+ ///
+ /// TrackingState (Legacy) Replaced by `destination_state`. Additional field required by some carriers to retrieve the tracking info. The state/province of the recipient’s address. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_state", NullValueHandling = NullValueHandling.Ignore)]
+ public string? TrackingState { get; set; }
+ ///
+ /// LocationId The location_id refers to the place where you fulfilled the items. - If you provide a location_id, the system will automatically use it as the tracking's origin address. However, passing both location_id and any origin address information simultaneously is not allowed.- Please make sure you add your locations .
+ ///
+ [JsonProperty("location_id", NullValueHandling = NullValueHandling.Ignore)]
+ public string? LocationId { get; set; }
+ ///
+ /// ShippingMethod The shipping_method string refers to the chosen method for delivering the package. Merchants typically offer various shipping methods to consumers during the checkout process, such as, Local Delivery, Free Express Worldwide Shipping, etc.
+ ///
+ [JsonProperty("shipping_method", NullValueHandling = NullValueHandling.Ignore)]
+ public string? ShippingMethod { get; set; }
+ ///
+ /// Customers The field contains the customer information associated with the tracking. A maximum of three customer objects are allowed.
+ ///
+ [JsonProperty("customers", NullValueHandling = NullValueHandling.Ignore)]
+ public CustomersUpdateTrackingByIdRequest?[] Customers { get; set; }
+ public UpdateTrackingByIdRequest()
+ {
+ }
+ }
+
+ ///
+ ///
+ ///
+ public class CustomersUpdateTrackingByIdRequest
+ {
+ ///
+ /// Role The role of the customer, indicating whether the customer is an individual or a company.
+ ///
+ [JsonProperty("role", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Role { get; set; }
+ ///
+ /// Name Customer name associated with the tracking.
+ ///
+ [JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Name { get; set; }
+ ///
+ /// PhoneNumber The phone number(s) to receive SMS notifications. Phone numbers should begin with a `+` sign and include the area code.
+ ///
+ [JsonProperty("phone_number", NullValueHandling = NullValueHandling.Ignore)]
+ public string? PhoneNumber { get; set; }
+ ///
+ /// Email Email address(es) to receive email notifications.
+ ///
+ [JsonProperty("email", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Email { get; set; }
+ ///
+ /// Language The preferred language of the customer. If you have set up AfterShip notifications in different languages, we use this to send the tracking updates to the customer in their preferred language.
+ ///
+ [JsonProperty("language", NullValueHandling = NullValueHandling.Ignore)]
+ public string? Language { get; set; }
+
+ public CustomersUpdateTrackingByIdRequest()
+ {
+ }
+ }
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/Models/UpdateTrackingByIdResponse.cs b/src/AfterShipTracking/AfterShipTracking/Models/UpdateTrackingByIdResponse.cs
new file mode 100644
index 0000000..b0167b9
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Models/UpdateTrackingByIdResponse.cs
@@ -0,0 +1,721 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System;
+using System.Collections.Generic;
+using Newtonsoft.Json;
+
+namespace AfterShipTracking
+{
+ ///
+ /// Object describes the tracking information.
+ ///
+ public class UpdateTrackingByIdResponse
+ {
+ ///
+ /// Id Tracking ID.
+ ///
+ [JsonProperty("id")]
+ public string? Id { get; set; }
+ ///
+ /// LegacyId The length of the tracking ID has been increased from 24 characters to 32 characters. We will use the legacy_id field to store the original 24-character tracking ID to maintain compatibility with existing data. Therefore, all tracking endpoints will continue to work with the legacy_id field as before.
+ ///
+ [JsonProperty("legacy_id")]
+ public string? LegacyId { get; set; }
+ ///
+ /// CreatedAt The date and time the shipment was imported or added to AfterShip. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0.
+ ///
+ [JsonProperty("created_at")]
+ public string? CreatedAt { get; set; }
+ ///
+ /// UpdatedAt The date and time the shipment was updated. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0.
+ ///
+ [JsonProperty("updated_at")]
+ public string? UpdatedAt { get; set; }
+ ///
+ /// TrackingNumber Tracking number.
+ ///
+ [JsonProperty("tracking_number")]
+ public string? TrackingNumber { get; set; }
+ ///
+ /// Slug Unique courier code. When importing a shipment with no courier slug and the tracking number can’t be recognized, the courier will be marked as `unrecognized`. Get courier codes .
+ ///
+ [JsonProperty("slug")]
+ public string? Slug { get; set; }
+ ///
+ /// Active Whether or not AfterShip will continue tracking the shipments. Value is `false` when tag (status) is `Delivered`, `Expired`, or further updates for 30 days since last update.
+ ///
+ [JsonProperty("active")]
+ public bool? Active { get; set; }
+ ///
+ /// CustomFields Custom fields that accept an object with string field. In order to protect the privacy of your customers, do not include any in custom fields.
+ ///
+ [JsonProperty("custom_fields")]
+ public Dictionary? CustomFields { get; set; }
+ ///
+ /// TransitTime Total transit time in days.- For delivered shipments: Transit time (in days) = Delivered date - Pick-up date- For undelivered shipments: Transit time (in days) = Current date - Pick-up dateValue as `null` for the shipment without pick-up date.
+ ///
+ [JsonProperty("transit_time")]
+ public int? TransitTime { get; set; }
+ ///
+ /// OriginCountryRegion The for the origin country/region. E.g. USA for the United States.
+ ///
+ [JsonProperty("origin_country_region")]
+ public string? OriginCountryRegion { get; set; }
+ ///
+ /// OriginState The state of the sender’s address.
+ ///
+ [JsonProperty("origin_state")]
+ public string? OriginState { get; set; }
+ ///
+ /// OriginCity The city of the sender’s address.
+ ///
+ [JsonProperty("origin_city")]
+ public string? OriginCity { get; set; }
+ ///
+ /// OriginPostalCode The postal code of the sender’s address.
+ ///
+ [JsonProperty("origin_postal_code")]
+ public string? OriginPostalCode { get; set; }
+ ///
+ /// OriginRawLocation The sender address that the shipment is shipping from.
+ ///
+ [JsonProperty("origin_raw_location")]
+ public string? OriginRawLocation { get; set; }
+ ///
+ /// DestinationCountryRegion The for the destination country/region. E.g. USA for the United States.
+ ///
+ [JsonProperty("destination_country_region")]
+ public string? DestinationCountryRegion { get; set; }
+ ///
+ /// DestinationState The state of the recipient’s address.
+ ///
+ [JsonProperty("destination_state")]
+ public string? DestinationState { get; set; }
+ ///
+ /// DestinationCity The city of the recipient’s address.
+ ///
+ [JsonProperty("destination_city")]
+ public string? DestinationCity { get; set; }
+ ///
+ /// DestinationPostalCode The postal code of the recipient’s address.
+ ///
+ [JsonProperty("destination_postal_code")]
+ public string? DestinationPostalCode { get; set; }
+ ///
+ /// DestinationRawLocation The shipping address that the shipment is shipping to.
+ ///
+ [JsonProperty("destination_raw_location")]
+ public string? DestinationRawLocation { get; set; }
+ ///
+ /// CourierDestinationCountryRegion Destination country/region of the tracking detected from the courier. ISO Alpha-3 (three letters). Value will be `null` if the courier doesn't provide the destination country.
+ ///
+ [JsonProperty("courier_destination_country_region")]
+ public string? CourierDestinationCountryRegion { get; set; }
+ ///
+ /// CourierEstimatedDeliveryDate The field contains the estimated delivery date provided by the carrier.
+ ///
+ [JsonProperty("courier_estimated_delivery_date")]
+ public CourierEstimatedDeliveryDateUpdateTrackingByIdResponse? CourierEstimatedDeliveryDate { get; set; }
+ ///
+ /// Note Text field for the note.
+ ///
+ [JsonProperty("note")]
+ public string? Note { get; set; }
+ ///
+ /// OrderId A globally-unique identifier for the order.
+ ///
+ [JsonProperty("order_id")]
+ public string? OrderId { get; set; }
+ ///
+ /// OrderIdPath The URL for the order in your system or store.
+ ///
+ [JsonProperty("order_id_path")]
+ public string? OrderIdPath { get; set; }
+ ///
+ /// OrderDate The date and time the order was created in your system or store. It uses the format: `YYYY-MM-DDTHH:mm:ssZ` based on whichever timezone you provide.
+ ///
+ [JsonProperty("order_date")]
+ public string? OrderDate { get; set; }
+ ///
+ /// ShipmentPackageCount Number of packages under the tracking.
+ ///
+ [JsonProperty("shipment_package_count")]
+ public double? ShipmentPackageCount { get; set; }
+ ///
+ /// ShipmentPickupDate The date and time the shipment was picked up by the carrier. It uses the timezone where the pickup occured. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("shipment_pickup_date")]
+ public string? ShipmentPickupDate { get; set; }
+ ///
+ /// ShipmentDeliveryDate The date and time the shipment was delivered. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("shipment_delivery_date")]
+ public string? ShipmentDeliveryDate { get; set; }
+ ///
+ /// ShipmentType The carrier service type for the shipment.
+ ///
+ [JsonProperty("shipment_type")]
+ public string? ShipmentType { get; set; }
+ ///
+ /// ShipmentWeight The shipment_weight field represents the total weight of the shipment. In scenarios where the carrier does not provide this information, you can provide the weight to AfterShip. We will prioritize the data provided by the carrier, if available. The shipment weight will be included in the Response and accessed through the GET API, Webhook, and CSV export. It will also be displayed on the AfterShip Tracking admin. Additionally, it plays a significant role in error-free shipment handling and carbon emission calculations, ensuring accurate and informed decision-making
+ ///
+ [JsonProperty("shipment_weight")]
+ public ShipmentWeightUpdateTrackingByIdResponse? ShipmentWeight { get; set; }
+ ///
+ /// SignedBy Signed by information for delivered shipment.
+ ///
+ [JsonProperty("signed_by")]
+ public string? SignedBy { get; set; }
+ ///
+ /// Source Source of how this tracking is added.
+ ///
+ [JsonProperty("source")]
+ public string? Source { get; set; }
+ ///
+ /// Tag Current status of tracking. (
+ ///
+ [JsonProperty("tag")]
+ public TagV1? Tag { get; set; }
+ ///
+ /// Subtag Current subtag of tracking. (
+ ///
+ [JsonProperty("subtag")]
+ public string? Subtag { get; set; }
+ ///
+ /// SubtagMessage Normalized tracking message. (
+ ///
+ [JsonProperty("subtag_message")]
+ public string? SubtagMessage { get; set; }
+ ///
+ /// Title By default this field shows the `tracking_number`, but you can customize it as you wish with any info (e.g. the order number).
+ ///
+ [JsonProperty("title")]
+ public string? Title { get; set; }
+ ///
+ /// TrackedCount Number of attempts AfterShip tracks at courier's system.
+ ///
+ [JsonProperty("tracked_count")]
+ public double? TrackedCount { get; set; }
+ ///
+ /// LastMileTrackingSupported Indicates if the shipment is trackable till the final destination.Three possible values:- true- false- null
+ ///
+ [JsonProperty("last_mile_tracking_supported")]
+ public bool? LastMileTrackingSupported { get; set; }
+ ///
+ /// Language The recipient’s language. If you set up AfterShip notifications in different languages, we use this to send the recipient tracking updates in their preferred language.
+ ///
+ [JsonProperty("language")]
+ public string? Language { get; set; }
+ ///
+ /// UniqueToken Deprecated
+ ///
+ [JsonProperty("unique_token")]
+ public string? UniqueToken { get; set; }
+ ///
+ /// Checkpoints Array of checkpoint object describes the checkpoint information.
+ ///
+ [JsonProperty("checkpoints")]
+ public Checkpoint?[] Checkpoints { get; set; }
+ ///
+ /// SubscribedSmses Phone number(s) subscribed to receive sms notifications.
+ ///
+ [JsonProperty("subscribed_smses")]
+ public string?[] SubscribedSmses { get; set; }
+ ///
+ /// SubscribedEmails Email address(es) subscribed to receive email notifications.
+ ///
+ [JsonProperty("subscribed_emails")]
+ public string?[] SubscribedEmails { get; set; }
+ ///
+ /// ReturnToSender Whether or not the shipment is returned to sender. Value is `true` when any of its checkpoints has subtag `Exception_010` (returning to sender) or `Exception_011` (returned to sender). Otherwise value is `false`.
+ ///
+ [JsonProperty("return_to_sender")]
+ public bool? ReturnToSender { get; set; }
+ ///
+ /// OrderPromisedDeliveryDate The promised delivery date of the order. It uses the formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("order_promised_delivery_date")]
+ public string? OrderPromisedDeliveryDate { get; set; }
+ ///
+ /// DeliveryType Shipment delivery type- pickup_at_store- pickup_at_courier- door_to_door
+ ///
+ [JsonProperty("delivery_type")]
+ public string? DeliveryType { get; set; }
+ ///
+ /// PickupLocation Shipment pickup location for receiver
+ ///
+ [JsonProperty("pickup_location")]
+ public string? PickupLocation { get; set; }
+ ///
+ /// PickupNote Shipment pickup note for receiver
+ ///
+ [JsonProperty("pickup_note")]
+ public string? PickupNote { get; set; }
+ ///
+ /// CourierTrackingLink Official tracking URL of the courier (if any). The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default.
+ ///
+ [JsonProperty("courier_tracking_link")]
+ public string? CourierTrackingLink { get; set; }
+ ///
+ /// FirstAttemptedAt The date and time of the carrier’s first attempt to deliver the package to the recipient. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("first_attempted_at")]
+ public string? FirstAttemptedAt { get; set; }
+ ///
+ /// CourierRedirectLink Delivery instructions (delivery date or address) can be modified by visiting the link if supported by a carrier. The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default.
+ ///
+ [JsonProperty("courier_redirect_link")]
+ public string? CourierRedirectLink { get; set; }
+ ///
+ /// TrackingAccountNumber Additional field required by some carriers to retrieve the tracking info. The shipper’s carrier account number. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_account_number")]
+ public string? TrackingAccountNumber { get; set; }
+ ///
+ /// TrackingKey Additional field required by some carriers to retrieve the tracking info. A type of tracking credential required by some carriers. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_key")]
+ public string? TrackingKey { get; set; }
+ ///
+ /// TrackingShipDate The date and time when the shipment is shipped by the merchant and ready for pickup by the carrier. The field supports the following formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZThe field serves two key purposes:- Calculate processing time metrics in the Order-to-delivery Analytics dashboard. To ensure accurate analytics, it's recommended to include timezone information when configuring this value- Required by certain carriers to retrieve tracking information as an additional tracking field.
+ ///
+ [JsonProperty("tracking_ship_date")]
+ public string? TrackingShipDate { get; set; }
+ ///
+ /// OnTimeStatus Whether the tracking is delivered on time or not.
+ ///
+ [JsonProperty("on_time_status")]
+ public string? OnTimeStatus { get; set; }
+ ///
+ /// OnTimeDifference The difference days of the on time.
+ ///
+ [JsonProperty("on_time_difference")]
+ public double? OnTimeDifference { get; set; }
+ ///
+ /// OrderTags The tags of the order.
+ ///
+ [JsonProperty("order_tags")]
+ public string?[] OrderTags { get; set; }
+ ///
+ /// AftershipEstimatedDeliveryDate The estimated delivery date of the shipment provided by AfterShip’s AI and shown to the recipients. It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone.
+ ///
+ [JsonProperty("aftership_estimated_delivery_date")]
+ public AftershipEstimatedDeliveryDateUpdateTrackingByIdResponse? AftershipEstimatedDeliveryDate { get; set; }
+ ///
+ /// CustomEstimatedDeliveryDate Estimated delivery time of the shipment based on your . It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone.
+ ///
+ [JsonProperty("custom_estimated_delivery_date")]
+ public CustomEstimatedDeliveryDateUpdateTrackingByIdResponse? CustomEstimatedDeliveryDate { get; set; }
+ ///
+ /// OrderNumber A unique, human-readable identifier for the order.
+ ///
+ [JsonProperty("order_number")]
+ public string? OrderNumber { get; set; }
+ ///
+ /// FirstEstimatedDelivery The shipment’s original estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone.
+ ///
+ [JsonProperty("first_estimated_delivery")]
+ public FirstEstimatedDeliveryUpdateTrackingByIdResponse? FirstEstimatedDelivery { get; set; }
+ ///
+ /// LatestEstimatedDelivery The most recently calculated estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone.
+ ///
+ [JsonProperty("latest_estimated_delivery")]
+ public LatestEstimatedDeliveryUpdateTrackingByIdResponse? LatestEstimatedDelivery { get; set; }
+ ///
+ /// ShipmentTags Used to add tags to your shipments to help categorize and filter them easily.
+ ///
+ [JsonProperty("shipment_tags")]
+ public string?[] ShipmentTags { get; set; }
+ ///
+ /// CourierConnectionId If you have multiple accounts connected for a single carrier on AfterShip, we have introduced the courier_connection_id field to allow you to specify the carrier account associated with each shipment. By providing this information, you enable us to accurately track and monitor your shipments based on the correct carrier account.(In the event that you do not specify the courier_connection_id, we will handle your shipment using the connection that was created earliest among your connected accounts.
+ ///
+ [JsonProperty("courier_connection_id")]
+ public string? CourierConnectionId { get; set; }
+ ///
+ /// TrackingOriginCountryRegion (Legacy) Replaced by `origin_country_region`. Additional field required by some carriers to retrieve the tracking info. The origin country/region of the shipment. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_origin_country_region")]
+ public string? TrackingOriginCountryRegion { get; set; }
+ ///
+ /// TrackingDestinationCountryRegion (Legacy) Replaced by `destination_country_region`. Additional field required by some carriers to retrieve the tracking info. The destination country/region of the shipment. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_destination_country_region")]
+ public string? TrackingDestinationCountryRegion { get; set; }
+ ///
+ /// TrackingPostalCode (Legacy) Replaced by `destination_postal_code`. Additional field required by some carriers to retrieve the tracking info. The postal code of the recipient’s address. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_postal_code")]
+ public string? TrackingPostalCode { get; set; }
+ ///
+ /// TrackingState (Legacy) Replaced by `destination_state`. Additional field required by some carriers to retrieve the tracking info. The state/province of the recipient’s address. Refer to our article on for more details.
+ ///
+ [JsonProperty("tracking_state")]
+ public string? TrackingState { get; set; }
+ ///
+ /// CarbonEmissions The model contains the total amount of carbon emissions generated by the shipment. - AfterShip will provide this data only when it is available, and its availability is contingent upon the location and weight information that AfterShip can obtain.- The values will be accessible solely for shipments that have been successfully delivered. However, in the event of a shipping update after the delivery status has been achieved, the value may change.- It’s a paid service and only for Tracking Enterprise users, please contact your customer success manager if you want to know more.
+ ///
+ [JsonProperty("carbon_emissions")]
+ public CarbonEmissionsUpdateTrackingByIdResponse? CarbonEmissions { get; set; }
+ ///
+ /// LocationId The location_id refers to the place where you fulfilled the items. - If you provide a location_id, the system will automatically use it as the tracking's origin address. However, passing both location_id and any origin address information simultaneously is not allowed.- Please make sure you add your locations .
+ ///
+ [JsonProperty("location_id")]
+ public string? LocationId { get; set; }
+ ///
+ /// ShippingMethod The shipping_method string refers to the chosen method for delivering the package. Merchants typically offer various shipping methods to consumers during the checkout process, such as, Local Delivery, Free Express Worldwide Shipping, etc.
+ ///
+ [JsonProperty("shipping_method")]
+ public string? ShippingMethod { get; set; }
+ ///
+ /// FailedDeliveryAttempts By dynamically tracking failed delivery attempts during shipment, this field allows you to pinpoint carriers accountable for the most failures. Analyzing the root cause of these failures enables you to improve carriers' delivery standard operating procedures (SOP), leading to an overall enhancement in delivery service quality.
+ ///
+ [JsonProperty("failed_delivery_attempts")]
+ public int? FailedDeliveryAttempts { get; set; }
+ ///
+ /// SignatureRequirement The signature_requirement field serves the purpose of validating the service option type, specifically proof of delivery. By collecting the recipient's signature upon delivery, it ensures the package reaches the intended recipient and prevents disputes related to non-delivery or lost packages.
+ ///
+ [JsonProperty("signature_requirement")]
+ public string? SignatureRequirement { get; set; }
+ ///
+ /// DeliveryLocationType The delivery location type represents the secure area where the carrier leaves the package, such as a safe place, locker, mailbox, front porch, etc. This information helps ensure the shipment reaches the intended recipient efficiently, minimizing the risk of theft or damage.
+ ///
+ [JsonProperty("delivery_location_type")]
+ public string? DeliveryLocationType { get; set; }
+ ///
+ /// AftershipTrackingUrl The tracking URL directs your customers to the shipment tracking page which can display either the default or a customized page based on segmentation rules.- The universal URL is used by default, but you can opt for a custom domain if you have one. Learn how to set up a custom domain .The field is not automatically enabled in API & Webhook. Please contact support if you’d like to enable it.
+ ///
+ [JsonProperty("aftership_tracking_url")]
+ public string? AftershipTrackingUrl { get; set; }
+ ///
+ /// AftershipTrackingOrderUrl The order URL directs your customers to the order tracking page, which includes all shipments. It can display either the default or a customized page based on segmentation rules.- The universal URL is used by default, but you can opt for a custom domain if you have one. Learn how to set up a custom domain .The field is not automatically enabled in API & Webhook. Please contact support if you’d like to enable it.
+ ///
+ [JsonProperty("aftership_tracking_order_url")]
+ public string? AftershipTrackingOrderUrl { get; set; }
+ ///
+ /// FirstMile The field contains information about the first leg of the shipping starting from the carrier picking up the shipment from the shipper to the point where they hand it over to the last-mile carrier. Once AfterShip detects the shipment is multi-leg, we will populate the first-mile information under this object.
+ ///
+ [JsonProperty("first_mile")]
+ public FirstMileUpdateTrackingByIdResponse? FirstMile { get; set; }
+ ///
+ /// LastMile This field contains information about the last leg of the shipment, starting from the carrier who hands it over to the last-mile carrier, all the way to delivery. Once AfterShip detects that the shipment involves multiple legs and identifies the last-mile carrier, we will populate the last-mile carrier information in this object. Alternatively, the user can provide this information in this field to specify the last-mile carrier, which is helpful if AfterShip is unable to detect it automatically.
+ ///
+ [JsonProperty("last_mile")]
+ public LastMileUpdateTrackingByIdResponse? LastMile { get; set; }
+ ///
+ /// Customers The field contains the customer information associated with the tracking. A maximum of three customer objects are allowed.
+ ///
+ [JsonProperty("customers")]
+ public CustomersUpdateTrackingByIdResponse?[] Customers { get; set; }
+ public UpdateTrackingByIdResponse()
+ {
+ }
+ }
+
+ ///
+ ///
+ ///
+ public class CourierEstimatedDeliveryDateUpdateTrackingByIdResponse
+ {
+ ///
+ /// EstimatedDeliveryDate The estimated arrival date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("estimated_delivery_date")]
+ public string? EstimatedDeliveryDate { get; set; }
+ ///
+ /// EstimatedDeliveryDateMin The earliest estimated delivery date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("estimated_delivery_date_min")]
+ public string? EstimatedDeliveryDateMin { get; set; }
+ ///
+ /// EstimatedDeliveryDateMax The Latest estimated delivery date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
+ ///
+ [JsonProperty("estimated_delivery_date_max")]
+ public string? EstimatedDeliveryDateMax { get; set; }
+
+ public CourierEstimatedDeliveryDateUpdateTrackingByIdResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class ShipmentWeightUpdateTrackingByIdResponse
+ {
+ ///
+ /// Unit The unit in which the value field is expressed.
+ ///
+ [JsonProperty("unit")]
+ public string? Unit { get; set; }
+ ///
+ /// Value The total amount of shipment weight.
+ ///
+ [JsonProperty("value")]
+ public double? Value { get; set; }
+
+ public ShipmentWeightUpdateTrackingByIdResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class AftershipEstimatedDeliveryDateUpdateTrackingByIdResponse
+ {
+ ///
+ /// EstimatedDeliveryDate The estimated arrival date of the shipment.
+ ///
+ [JsonProperty("estimated_delivery_date")]
+ public string? EstimatedDeliveryDate { get; set; }
+ ///
+ /// ConfidenceCode Indicates the confidence level and associated reason for an AI EDD prediction request. For a comprehensive list of confidence codes, refer to .
+ ///
+ [JsonProperty("confidence_code")]
+ public double? ConfidenceCode { get; set; }
+ ///
+ /// EstimatedDeliveryDateMin Earliest estimated delivery date of the shipment.
+ ///
+ [JsonProperty("estimated_delivery_date_min")]
+ public string? EstimatedDeliveryDateMin { get; set; }
+ ///
+ /// EstimatedDeliveryDateMax Latest estimated delivery date of the shipment.
+ ///
+ [JsonProperty("estimated_delivery_date_max")]
+ public string? EstimatedDeliveryDateMax { get; set; }
+
+ public AftershipEstimatedDeliveryDateUpdateTrackingByIdResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class CustomEstimatedDeliveryDateUpdateTrackingByIdResponse
+ {
+ ///
+ /// Type The format of the EDD. Either a single date or a date range.
+ ///
+ [JsonProperty("type")]
+ public string? Type { get; set; }
+ ///
+ /// Datetime The specific EDD date.
+ ///
+ [JsonProperty("datetime")]
+ public string? Datetime { get; set; }
+ ///
+ /// DatetimeMin For a date range EDD format, the date for the lower end of the range.
+ ///
+ [JsonProperty("datetime_min")]
+ public string? DatetimeMin { get; set; }
+ ///
+ /// DatetimeMax For a date range EDD format, the date for the upper end of the range.
+ ///
+ [JsonProperty("datetime_max")]
+ public string? DatetimeMax { get; set; }
+
+ public CustomEstimatedDeliveryDateUpdateTrackingByIdResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class FirstEstimatedDeliveryUpdateTrackingByIdResponse
+ {
+ ///
+ /// Type The format of the EDD. Either a single date or a date range.
+ ///
+ [JsonProperty("type")]
+ public string? Type { get; set; }
+ ///
+ /// Source The source of the EDD. Either the carrier, AfterShip AI, or based on your custom EDD settings.
+ ///
+ [JsonProperty("source")]
+ public string? Source { get; set; }
+ ///
+ /// Datetime The latest EDD time.
+ ///
+ [JsonProperty("datetime")]
+ public string? Datetime { get; set; }
+ ///
+ /// DatetimeMin For a date range EDD format, the date and time for the lower end of the range.
+ ///
+ [JsonProperty("datetime_min")]
+ public string? DatetimeMin { get; set; }
+ ///
+ /// DatetimeMax For a date range EDD format, the date and time for the upper end of the range.
+ ///
+ [JsonProperty("datetime_max")]
+ public string? DatetimeMax { get; set; }
+
+ public FirstEstimatedDeliveryUpdateTrackingByIdResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class LatestEstimatedDeliveryUpdateTrackingByIdResponse
+ {
+ ///
+ /// Type The format of the EDD. Either a single date or a date range.
+ ///
+ [JsonProperty("type")]
+ public string? Type { get; set; }
+ ///
+ /// Source The source of the EDD. Either the carrier, AfterShip AI, or based on your custom EDD settings.
+ ///
+ [JsonProperty("source")]
+ public string? Source { get; set; }
+ ///
+ /// Datetime The latest EDD time.
+ ///
+ [JsonProperty("datetime")]
+ public string? Datetime { get; set; }
+ ///
+ /// DatetimeMin For a date range EDD format, the date and time for the lower end of the range.
+ ///
+ [JsonProperty("datetime_min")]
+ public string? DatetimeMin { get; set; }
+ ///
+ /// DatetimeMax For a date range EDD format, the date and time for the upper end of the range.
+ ///
+ [JsonProperty("datetime_max")]
+ public string? DatetimeMax { get; set; }
+
+ public LatestEstimatedDeliveryUpdateTrackingByIdResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class CarbonEmissionsUpdateTrackingByIdResponse
+ {
+ ///
+ /// Unit The unit in which the value field is expressed. Allowed values: kg
+ ///
+ [JsonProperty("unit")]
+ public string? Unit { get; set; }
+ ///
+ /// Value The total amount of carbon emissions
+ ///
+ [JsonProperty("value")]
+ public double? Value { get; set; }
+
+ public CarbonEmissionsUpdateTrackingByIdResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class FirstMileUpdateTrackingByIdResponse
+ {
+ ///
+ /// TrackingNumber The tracking number of the first-mile carrier.
+ ///
+ [JsonProperty("tracking_number")]
+ public string? TrackingNumber { get; set; }
+ ///
+ /// Slug The unique code of the carrier responsible for the first-mile of the shipment. Find all the courier slugs .
+ ///
+ [JsonProperty("slug")]
+ public string? Slug { get; set; }
+ ///
+ /// TransitTime The transit time for the first-mile of a shipment in days. This field is calculated based on whether the handed_over_to_last_mile_carrier or received_by_last_mile_carrier event is detected by AfterShip. The handover event date is used to calculate the first-mile transit time.- First mile transit time (in days) = Handover date - Pickup date
+ ///
+ [JsonProperty("transit_time")]
+ public string? TransitTime { get; set; }
+ ///
+ /// CourierRedirectLink The field provides the link for modifying delivery instructions (such as delivery date and shipping address), if supported by the first-mile carrier. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US".
+ ///
+ [JsonProperty("courier_redirect_link")]
+ public string? CourierRedirectLink { get; set; }
+ ///
+ /// CourierTrackingLink The field contains the official tracking URL of the first-mile carrier, if available. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US".
+ ///
+ [JsonProperty("courier_tracking_link")]
+ public string? CourierTrackingLink { get; set; }
+
+ public FirstMileUpdateTrackingByIdResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class LastMileUpdateTrackingByIdResponse
+ {
+ ///
+ /// TrackingNumber The tracking number of the last-mile carrier.
+ ///
+ [JsonProperty("tracking_number")]
+ public string? TrackingNumber { get; set; }
+ ///
+ /// Slug The unique code of the carrier responsible for the last-mile of the shipment. Find all the courier slugs .
+ ///
+ [JsonProperty("slug")]
+ public string? Slug { get; set; }
+ ///
+ /// TransitTime The transit time for the last-mile of a shipment in days. This field is calculated based on whether the handed_over_to_last_mile_carrier or the received_by_last_mile_carrier event is detected by AfterShip. The handover event date is used to calculate the last-mile transit time.- Last mile transit time (in days)= Delivered date - Handover date
+ ///
+ [JsonProperty("transit_time")]
+ public string? TransitTime { get; set; }
+ ///
+ /// CourierTrackingLink The field contains the official tracking URL of the last-mile carrier, if available. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US".
+ ///
+ [JsonProperty("courier_tracking_link")]
+ public string? CourierTrackingLink { get; set; }
+ ///
+ /// CourierRedirectLink The field provides the link for modifying delivery instructions (such as delivery date and shipping address), if supported by the last-mile carrier. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US".
+ ///
+ [JsonProperty("courier_redirect_link")]
+ public string? CourierRedirectLink { get; set; }
+ ///
+ /// Source The field indicates the source of last-mile carrier.
+ ///
+ [JsonProperty("source")]
+ public string? Source { get; set; }
+
+ public LastMileUpdateTrackingByIdResponse()
+ {
+ }
+ }
+ ///
+ ///
+ ///
+ public class CustomersUpdateTrackingByIdResponse
+ {
+ ///
+ /// Role The role of the customer, indicating whether the customer is an individual or a company.
+ ///
+ [JsonProperty("role")]
+ public string? Role { get; set; }
+ ///
+ /// Name Customer name associated with the tracking.
+ ///
+ [JsonProperty("name")]
+ public string? Name { get; set; }
+ ///
+ /// PhoneNumber The phone number(s) to receive SMS notifications. Phone numbers should begin with a `+` sign and include the area code.
+ ///
+ [JsonProperty("phone_number")]
+ public string? PhoneNumber { get; set; }
+ ///
+ /// Email Email address(es) to receive email notifications.
+ ///
+ [JsonProperty("email")]
+ public string? Email { get; set; }
+ ///
+ /// Language The preferred language of the customer. If you have set up AfterShip notifications in different languages, we use this to send the tracking updates to the customer in their preferred language.
+ ///
+ [JsonProperty("language")]
+ public string? Language { get; set; }
+
+ public CustomersUpdateTrackingByIdResponse()
+ {
+ }
+ }
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/Properties/AssemblyInfo.cs b/src/AfterShipTracking/AfterShipTracking/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..8b3efbc
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Properties/AssemblyInfo.cs
@@ -0,0 +1,16 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+
+// Information about this assembly is defined by the following attributes.
+// Change them to the values specific to your project.
+
+// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
+// The form "{Major}.{Minor}.*" will automatically update the build and revision,
+// and "{Major}.{Minor}.{Build}.*" will update just the revision.
+
+internal class AssemblyInformation
+{
+ public const string AssemblyInformationalVersion = "10.0.0";
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/Public/AfterShipConfiguration.cs b/src/AfterShipTracking/AfterShipTracking/Public/AfterShipConfiguration.cs
new file mode 100644
index 0000000..1ae5221
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Public/AfterShipConfiguration.cs
@@ -0,0 +1,199 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System;
+
+namespace AfterShipTracking
+{
+ public static class AfterShipConfiguration
+ {
+ public const string AUTHENTICATION_TYPE_API_KEY = "API_KEY";
+ public const string AUTHENTICATION_TYPE_AES = "AES";
+ public const string AUTHENTICATION_TYPE_RSA = "RSA";
+
+ public const string SDK_PREFIX = "AFTERSHIP_TRACKING_SDK";
+ public const int DEFAULT_MAX_RETRY = 2;
+ public const int DEFAULT_TIMEOUT = 10000;
+ public const string DEFAULT_USER_AGENT = "tracking-sdk-net/10.0.0 (https://www.aftership.com) System.Net.Http.HttpClient/0.0.0";
+ public const string DEFAULT_DOMAIN = "https://api.aftership.com";
+
+ private static string domain;
+ private static int timeout;
+ private static int maxRetry;
+ private static string userAgent;
+ private static string proxy;
+ private static string apiKey;
+ private static string apiSecret;
+ private static string authenticationType;
+
+ ///
+ /// Custom API domain.
+ ///
+ public static string Domain
+ {
+ get
+ {
+ if (!string.IsNullOrEmpty(domain))
+ {
+ return domain;
+ }
+ return Environment.GetEnvironmentVariable(SDK_PREFIX + "_DOMAIN") ?? DEFAULT_DOMAIN;
+ }
+
+ set
+ {
+
+ domain = value;
+ }
+ }
+
+ ///
+ /// Custom API domain.
+ ///
+ public static int MaxRetry
+ {
+ get
+ {
+ if (maxRetry > 0)
+ {
+ return maxRetry;
+ }
+ if (int.TryParse(Environment.GetEnvironmentVariable(SDK_PREFIX + "_MAX_RETRY"), out int n) && n > 0)
+ {
+ return n;
+ }
+ return DEFAULT_MAX_RETRY;
+ }
+ set
+ {
+ maxRetry = value;
+ }
+ }
+
+ ///
+ /// Max request timeout in milliseconds.
+ ///
+ public static int Timeout
+ {
+ get
+ {
+ if (timeout > 0)
+ {
+ return timeout;
+ }
+ if (int.TryParse(Environment.GetEnvironmentVariable(SDK_PREFIX + "_TIMEOUT"), out int n) && n > 0)
+ {
+ return n;
+ }
+ return DEFAULT_TIMEOUT;
+ }
+
+ set
+ {
+ timeout = value;
+ }
+ }
+
+ ///
+ /// Custom API userAgent.
+ ///
+ public static string UserAgent
+ {
+ get
+ {
+ if (!string.IsNullOrEmpty(userAgent))
+ {
+ return userAgent;
+ }
+ return Environment.GetEnvironmentVariable(SDK_PREFIX + "_USER_AGENT") ?? null;
+ }
+
+ set
+ {
+ userAgent = value;
+
+ }
+ }
+
+ ///
+ /// Custom API Proxy.
+ ///
+ public static string Proxy
+ {
+ get
+ {
+ if (!string.IsNullOrEmpty(proxy))
+ {
+ return proxy;
+ }
+ return Environment.GetEnvironmentVariable(SDK_PREFIX + "_PROXY") ?? "";
+ }
+
+ set
+ {
+ proxy = value;
+ }
+ }
+
+ ///
+ /// Custom API API key.
+ ///
+ public static string ApiKey
+ {
+ get
+ {
+ if (!string.IsNullOrEmpty(apiKey))
+ {
+ return apiKey;
+ }
+ return Environment.GetEnvironmentVariable(SDK_PREFIX + "_API_KEY") ?? "";
+ }
+
+ set
+ {
+ apiKey = value;
+ }
+ }
+
+ ///
+ /// AfterShip API secret for AES or RSA authentication method.
+ ///
+ public static string ApiSecret
+ {
+ get
+ {
+ if (!string.IsNullOrEmpty(apiSecret))
+ {
+ return apiSecret;
+ }
+ return Environment.GetEnvironmentVariable(SDK_PREFIX + "_API_SECRET") ?? "";
+ }
+
+ set
+ {
+ apiSecret = value;
+ }
+ }
+
+ ///
+ /// AfterShip API Authentication method. Allowed value: API_KEY , AES , RSA
+ ///
+ public static string AuthenticationType
+ {
+ get
+ {
+ if (!string.IsNullOrEmpty(authenticationType))
+ {
+ return authenticationType;
+ }
+ return Environment.GetEnvironmentVariable(SDK_PREFIX + "_AUTHENTICATION_TYPE") ?? AUTHENTICATION_TYPE_API_KEY;
+ }
+
+ set
+ {
+ authenticationType = value;
+ }
+ }
+ }
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/Public/Authenticator.cs b/src/AfterShipTracking/AfterShipTracking/Public/Authenticator.cs
new file mode 100644
index 0000000..d0752a9
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Public/Authenticator.cs
@@ -0,0 +1,172 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Net.Http;
+using System.Net.Http.Headers;
+using System.Text;
+using System.Web;
+
+namespace AfterShipTracking
+{
+ ///
+ /// Authenticator
+ ///
+ public class Authenticator
+ {
+ public static readonly string API_KEY = "API_KEY";
+ public static readonly string AUTH_TYPE_AES = "AES";
+ public static readonly string AUTH_TYPE_RSA = "RSA";
+
+ ///
+ /// API key
+ ///
+ public string ApiKey { get; set; }
+
+ ///
+ /// API secret
+ ///
+ public string ApiSecret { get; set; }
+
+ ///
+ /// Authentication type
+ ///
+ public string AuthenticationType { get; set; }
+
+ ///
+ /// Create a new Authenticator
+ ///
+ ///
+ ///
+ ///
+ public Authenticator(string apiKey, string apiSecret, string authenticationType)
+ {
+ this.ApiKey = apiKey;
+ this.ApiSecret = apiSecret;
+ this.AuthenticationType = authenticationType;
+ }
+
+ public void Sign(HttpRequestMessage request)
+ {
+ if (this.AuthenticationType != API_KEY)
+ {
+ HttpHeaders tmpHeaders = request.Headers;
+ string h = CanonicalHeader(tmpHeaders);
+ string rs;
+ try
+ {
+ rs = CanonicalResource(request);
+ }
+ catch (Exception e)
+ {
+ throw ErrorCode.GenSDKError(ErrorCode.INVALID_REQUEST, e.Message);
+ }
+
+ byte[] bodyBytes;
+ using (MemoryStream ms = new MemoryStream())
+ {
+ if (request.Content != null)
+ {
+ request.Content.CopyToAsync(ms).Wait();
+ }
+ bodyBytes = ms.ToArray();
+ }
+ string bodyString = Encoding.UTF8.GetString(bodyBytes);
+ string s = SignString(request.Method.ToString(), bodyString, request.Headers.GetValues("date").First(), h, rs);
+ if (this.AuthenticationType == AUTH_TYPE_AES)
+ {
+ string aesSign = Encryption.HmacSha256Encrypt(s, this.ApiSecret);
+ tmpHeaders.TryAddWithoutValidation("as-signature-hmac-sha256", aesSign);
+ }
+ else if (this.AuthenticationType == AUTH_TYPE_RSA)
+ {
+ string rsaSign;
+ try
+ {
+ rsaSign = Encryption.RsaPssSha256Encrypt(s, this.ApiSecret);
+ }
+ catch (Exception e)
+ {
+ throw ErrorCode.GenSDKError(ErrorCode.INVALID_API_KEY, e.Message);
+ }
+
+ tmpHeaders.TryAddWithoutValidation("as-signature-rsa-sha256", rsaSign);
+ }
+ }
+ }
+
+ public static string CanonicalHeader(HttpHeaders headers)
+ {
+ // Filter and sort headers with the "as-" prefix
+ var filteredHeaders = headers.Where(h => h.Key.StartsWith("as-", StringComparison.OrdinalIgnoreCase))
+ .OrderBy(h => h.Key, StringComparer.OrdinalIgnoreCase);
+
+ // Build the canonicalized headers string
+ string canonicalizedHeaders = string.Join("\n", filteredHeaders.Select(h =>
+ {
+ string key = h.Key.Trim();
+ string value = string.Join(",", h.Value).Trim();
+ return $"{key.ToLowerInvariant()}:{value}";
+ }));
+
+ return canonicalizedHeaders;
+ }
+
+ public static string CanonicalResource(HttpRequestMessage request)
+ {
+ Uri? uri = request.RequestUri;
+ if (uri == null)
+ {
+ return "";
+ }
+ string path = uri.AbsolutePath;
+
+ // Get query parameters and sort them by key in ascending order
+ var queryParams = HttpUtility.ParseQueryString(uri.Query);
+ var sortedParams = new SortedDictionary(StringComparer.Ordinal);
+
+ foreach (string? key in queryParams.Keys)
+ {
+ string? value = queryParams[key];
+ if (key != null && value != null)
+ {
+ sortedParams[key] = value;
+ }
+ }
+ // Build the canonicalized resource string
+ string canonicalizedResource = path;
+
+ if (sortedParams.Count > 0)
+ {
+ canonicalizedResource += "?" + string.Join("&", sortedParams.Select(p => $"{p.Key}={p.Value}"));
+ }
+
+
+ return canonicalizedResource;
+ }
+
+ public static string SignString(String menthod, string body, string date, string canonicalHeader, string canonicalResource)
+ {
+
+ StringBuilder sb = new StringBuilder();
+ string newBody = "";
+ string contentType = "";
+ if (!string.IsNullOrEmpty(body))
+ {
+ newBody = Encryption.MD5Encode(body);
+ contentType = "application/json";
+ }
+ sb.Append(menthod).AppendLine();
+ sb.Append(newBody).AppendLine();
+ sb.Append(contentType).AppendLine();
+ sb.Append(date).AppendLine();
+ sb.Append(canonicalHeader).AppendLine();
+ sb.Append(canonicalResource);
+ return sb.ToString();
+ }
+ }
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/Public/Base/BaseOptions.cs b/src/AfterShipTracking/AfterShipTracking/Public/Base/BaseOptions.cs
new file mode 100644
index 0000000..d12334b
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Public/Base/BaseOptions.cs
@@ -0,0 +1,125 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System.Collections.Generic;
+
+namespace AfterShipTracking
+{
+ public class BaseOptions
+ {
+ private List> queryParams;
+ private List> headerParams;
+ private string body;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public BaseOptions()
+ {
+ queryParams = new List>();
+ headerParams = new List>();
+ body = null;
+ }
+
+ ///
+ /// Initializes a new instance of the class with specified parameters.
+ ///
+ /// The initial query parameters.
+ /// The initial header parameters.
+ /// The initial body content.
+ public BaseOptions(List> queryParams, List> headerParams, string body)
+ {
+ this.queryParams = queryParams;
+ this.headerParams = headerParams;
+ this.body = body;
+ }
+
+ ///
+ /// Gets the query parameters.
+ ///
+ public List> QueryParams
+ {
+ get
+ {
+ return queryParams;
+ }
+ set
+ {
+ queryParams = value;
+ }
+ }
+
+ ///
+ /// Gets the header parameters.
+ ///
+ public List> HeaderParams
+ {
+ get
+ {
+ return headerParams;
+ }
+ set
+ {
+ headerParams = value;
+ }
+ }
+
+ ///
+ /// Gets or sets the body content.
+ ///
+ public string Body
+ {
+ get => body;
+ set => body = value;
+ }
+
+ ///
+ /// Adds a query parameter.
+ ///
+ /// The key of the query parameter.
+ /// The value of the query parameter.
+ public void AddQueryParam(string key, string value)
+ {
+ queryParams.Add(new KeyValuePair(key, value));
+ }
+
+ ///
+ /// Adds a header parameter.
+ ///
+ /// The key of the header parameter.
+ /// The value of the header parameter.
+ public void AddHeaderParam(string key, string value)
+ {
+ headerParams.Add(new KeyValuePair(key, value));
+ }
+
+ ///
+ /// Gets the query parameters.
+ ///
+ /// A list of query parameters.
+ public virtual List> GetQueryParams()
+ {
+ return QueryParams;
+ }
+
+ ///
+ /// Gets the header parameters.
+ ///
+ /// A list of header parameters.
+ public virtual List> GetHeaderParams()
+ {
+ return HeaderParams;
+ }
+
+ ///
+ /// Gets the body content.
+ ///
+ /// The body content.
+ public virtual string GetBody()
+ {
+ return Body;
+ }
+ }
+}
+
diff --git a/src/AfterShipTracking/AfterShipTracking/Public/Base/BaseResourceService.cs b/src/AfterShipTracking/AfterShipTracking/Public/Base/BaseResourceService.cs
new file mode 100644
index 0000000..c492539
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Public/Base/BaseResourceService.cs
@@ -0,0 +1,128 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using Newtonsoft.Json.Linq;
+using System.Net;
+using Newtonsoft.Json;
+
+namespace AfterShipTracking
+{
+ public class BaseResourceService
+ {
+ private static JsonSerializerSettings settings = new JsonSerializerSettings
+ {
+ DateParseHandling = DateParseHandling.None,
+ DateTimeZoneHandling = DateTimeZoneHandling.RoundtripKind
+ };
+
+ public static T ProcessResponse(Response response)
+ {
+ if (response.StatusCode != HttpStatusCode.OK)
+ {
+ throw BuildAfterShipException(response);
+ }
+
+ T obj;
+ try
+ {
+ obj = FromJson(response.Content);
+ }
+ catch (Newtonsoft.Json.JsonException)
+ {
+ throw ErrorCode.GenSDKError(ErrorCode.INVALID_JSON, "Invalid response content:" + response.Content);
+ }
+
+ return obj;
+ }
+
+ public static T ProcessData(Response response)
+ {
+ if (response.StatusCode < HttpStatusCode.OK || response.StatusCode >= HttpStatusCode.MultipleChoices)
+ {
+ throw BuildAfterShipException(response);
+ }
+
+ T obj;
+ try
+ {
+ string dataJson = ToJson(FromJson(response.Content).Data);
+ obj = FromJson(dataJson);
+ }
+ catch (Newtonsoft.Json.JsonException)
+ {
+ throw ErrorCode.GenSDKError(ErrorCode.INVALID_JSON, "Invalid response content:" + response.Content);
+ }
+
+ return obj;
+ }
+
+ public static T ProcessResponseData(Response response, IAdapter adapter = null)
+ {
+ if (adapter == null)
+ {
+ return ProcessData(response);
+ }
+
+ T obj;
+ try
+ {
+ S source = ProcessData(response);
+ obj = Converter.Convert(source, adapter);
+ }
+ catch (Newtonsoft.Json.JsonException)
+ {
+ throw ErrorCode.GenSDKError(ErrorCode.INVALID_JSON, "Invalid response content:" + response.Content);
+ }
+
+ return obj;
+ }
+
+ private static AfterShipError BuildAfterShipException(Response response)
+ {
+ JObject jObject;
+ try
+ {
+ jObject = JObject.Parse(response.Content);
+ }
+ catch (Newtonsoft.Json.JsonException)
+ {
+ return ErrorCode.GenSDKError(ErrorCode.INVALID_JSON, "Invalid response content:" + response.Content);
+ }
+
+ var meta = jObject["meta"];
+ if (meta == null)
+ {
+ return ErrorCode.GenSDKError(ErrorCode.INVALID_JSON, "Invalid response content:" + response.Content);
+ }
+
+ int.TryParse(meta["code"]?.ToString(), out int code);
+ var message = meta["message"]?.ToString();
+ return ErrorCode.GenAPIError((int)response.StatusCode, code, response.Content, message, response.Headers);
+ }
+
+ public static string ToJson(object model)
+ {
+ try
+ {
+ return JsonConvert.SerializeObject(model, settings);
+ }
+ catch (JsonException e)
+ {
+ throw ErrorCode.GenSDKError(ErrorCode.INVALID_JSON, e.Message);
+ }
+ }
+
+ public static T FromJson(string value)
+ {
+ try
+ {
+ return JsonConvert.DeserializeObject(value, settings);
+ }
+ catch (JsonException e)
+ {
+ throw ErrorCode.GenSDKError(ErrorCode.INVALID_JSON, e.Message);
+ }
+ }
+ }
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/Public/Base/BaseResponse.cs b/src/AfterShipTracking/AfterShipTracking/Public/Base/BaseResponse.cs
new file mode 100644
index 0000000..92b977d
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Public/Base/BaseResponse.cs
@@ -0,0 +1,18 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System;
+using Newtonsoft.Json;
+
+namespace AfterShipTracking
+{
+ public class BaseResponse
+ {
+ [JsonProperty("meta")]
+ public Meta Meta { get; set; }
+
+ [JsonProperty("data")]
+ public Object Data { get; set; }
+ }
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/Public/Base/IBasePage.cs b/src/AfterShipTracking/AfterShipTracking/Public/Base/IBasePage.cs
new file mode 100644
index 0000000..3e31294
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Public/Base/IBasePage.cs
@@ -0,0 +1,12 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+
+namespace AfterShipTracking
+{
+ public interface IBasePage
+ {
+
+ }
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/Public/Base/ListOptions.cs b/src/AfterShipTracking/AfterShipTracking/Public/Base/ListOptions.cs
new file mode 100644
index 0000000..9a29314
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Public/Base/ListOptions.cs
@@ -0,0 +1,27 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using Newtonsoft.Json;
+
+namespace AfterShipTracking
+{
+ public class ListOptions : BaseOptions
+ {
+ ///
+ /// A limit on the number of objects to be returned, between 1 and 100.
+ ///
+ [JsonProperty("limit")]
+ public string Limit { get; set; }
+
+ ///
+ /// A limit on the number of objects to be returned, between 1 and 100.
+ ///
+ [JsonProperty("page")]
+ public string Page { get; set; }
+
+ public ListOptions()
+ {
+ }
+ }
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/Public/Base/Meta.cs b/src/AfterShipTracking/AfterShipTracking/Public/Base/Meta.cs
new file mode 100644
index 0000000..6b20523
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Public/Base/Meta.cs
@@ -0,0 +1,26 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using Newtonsoft.Json;
+
+namespace AfterShipTracking
+{
+ public class Meta
+ {
+ [JsonProperty("code")]
+ public int? Code { get; set; }
+ [JsonProperty("type")]
+ public string? Type { get; set; }
+ [JsonProperty("message")]
+ public string? Message { get; set; }
+
+ public Meta(int code, string type, string message)
+ {
+ Code = code;
+ Type = type;
+ Message = message;
+ }
+ }
+}
+
diff --git a/src/AfterShipTracking/AfterShipTracking/Public/Base/PaginationCursor.cs b/src/AfterShipTracking/AfterShipTracking/Public/Base/PaginationCursor.cs
new file mode 100644
index 0000000..0ccb033
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Public/Base/PaginationCursor.cs
@@ -0,0 +1,29 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using Newtonsoft.Json;
+
+namespace AfterShipTracking.Public._base
+{
+ public class PaginationCursor : IBasePage
+ {
+ ///
+ /// Total count
+ ///
+ [JsonProperty("total")]
+ public int Total;
+
+ ///
+ /// Has next page
+ ///
+ [JsonProperty("previous_cursor")]
+ public string PreviousCursor { get; }
+
+ ///
+ /// Next cursor
+ ///
+ [JsonProperty("next_cursor")]
+ public string NextCursor { get; }
+ }
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/Public/Base/PaginationPage.cs b/src/AfterShipTracking/AfterShipTracking/Public/Base/PaginationPage.cs
new file mode 100644
index 0000000..41d53f6
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Public/Base/PaginationPage.cs
@@ -0,0 +1,38 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using Newtonsoft.Json;
+
+namespace AfterShipTracking
+{
+ public class PaginationPage
+ {
+ ///
+ /// Page index
+ ///
+ [JsonProperty("cursor")]
+ public string? Cursor { get; set; }
+
+ ///
+ /// Total count
+ ///
+ [JsonProperty("total")]
+ public int? Total { get; set; }
+
+
+ ///
+ /// Total count
+ ///
+ [JsonProperty("has_next_page")]
+ public bool? HasNextPage { get; set; }
+
+ public PaginationPage(string? cursor, int? total, bool hasNextPage = false)
+ {
+ Cursor = cursor;
+ Total = total;
+ HasNextPage = hasNextPage;
+ }
+ }
+}
+
diff --git a/src/AfterShipTracking/AfterShipTracking/Public/Converter.cs b/src/AfterShipTracking/AfterShipTracking/Public/Converter.cs
new file mode 100644
index 0000000..52425bd
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Public/Converter.cs
@@ -0,0 +1,19 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+namespace AfterShipTracking
+{
+ public interface IAdapter
+ {
+ TTarget Adapt(TSource source);
+ }
+
+ public static class Converter
+ {
+ public static TTarget Convert(TSource source, IAdapter adapter)
+ {
+ return adapter.Adapt(source);
+ }
+ }
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/Public/Encryption.cs b/src/AfterShipTracking/AfterShipTracking/Public/Encryption.cs
new file mode 100644
index 0000000..9808b3f
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Public/Encryption.cs
@@ -0,0 +1,59 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System;
+using System.Security.Cryptography;
+using System.Text;
+
+namespace AfterShipTracking
+{
+ public class Encryption
+ {
+ public static string MD5Encode(string input)
+ {
+ using MD5 md5 = MD5.Create();
+ // Convert the input string to a byte array and compute the hash
+ byte[] inputBytes = Encoding.UTF8.GetBytes(input);
+ byte[] hashBytes = md5.ComputeHash(inputBytes);
+
+ // Convert the byte array to a hexadecimal string
+ StringBuilder sb = new StringBuilder();
+ for (int i = 0; i < hashBytes.Length; i++)
+ {
+ sb.Append(hashBytes[i].ToString("X2"));
+ }
+ return sb.ToString();
+ }
+
+ public static string HmacSha256Encrypt(string signString, string secretKey)
+ {
+ byte[] keyBytes = Encoding.UTF8.GetBytes(secretKey);
+ byte[] messageBytes = Encoding.UTF8.GetBytes(signString);
+
+ using (HMACSHA256 hmac = new HMACSHA256(keyBytes))
+ {
+ byte[] hashBytes = hmac.ComputeHash(messageBytes);
+ return Convert.ToBase64String(hashBytes);
+ }
+ }
+
+ public static string RsaPssSha256Encrypt(string data, string privateKeyPem)
+ {
+ byte[] dataBytes = Encoding.UTF8.GetBytes(data);
+
+ using (var rsa = RSA.Create())
+ {
+ rsa.ImportFromPem(privateKeyPem);
+
+ // sign data with SHA256
+ byte[] signature = rsa.SignData(dataBytes, HashAlgorithmName.SHA256, RSASignaturePadding.Pss);
+
+ // convert to Base64 string
+ string base64Signature = Convert.ToBase64String(signature);
+
+ return base64Signature;
+ }
+ }
+ }
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/Public/IHttpClient.cs b/src/AfterShipTracking/AfterShipTracking/Public/IHttpClient.cs
new file mode 100644
index 0000000..43cd740
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Public/IHttpClient.cs
@@ -0,0 +1,11 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+namespace AfterShipTracking
+{
+ public interface IHttpClient
+ {
+ public Response MakeRequest(Request request);
+ }
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/Public/Request.cs b/src/AfterShipTracking/AfterShipTracking/Public/Request.cs
new file mode 100644
index 0000000..8e27bd2
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Public/Request.cs
@@ -0,0 +1,75 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System;
+using System.Collections.Generic;
+using System.Net.Http;
+
+namespace AfterShipTracking
+{
+ ///
+ /// Request object
+ ///
+ public class Request
+ {
+ private readonly BaseOptions options;
+
+ public Uri Uri { get; private set; }
+
+ public string Path { get; private set; }
+
+ ///
+ /// HTTP Method
+ ///
+ public HttpMethod Method { get; }
+
+ ///
+ /// Query params
+ ///
+ public List> QueryParams { get; private set; }
+
+ ///
+ /// Post params
+ ///
+ public List> PostParams { get; private set; }
+
+ ///
+ /// Header params
+ ///
+ public List> HeaderParams { get; private set; }
+
+ ///
+ /// Body
+ ///
+ public string? Body { get; set; }
+
+ public Request(
+ HttpMethod method,
+ string path,
+ List> queryParams = null,
+ List> headerParams = null,
+ string body = null
+ )
+ {
+ Method = method;
+ Path = path;
+ QueryParams = queryParams ?? new List>();
+ HeaderParams = headerParams ?? new List>();
+ Body = body;
+ }
+
+ public Request(
+ HttpMethod method,
+ string path,
+ BaseOptions? options
+ )
+ {
+ Method = method;
+ Path = path;
+ QueryParams = options?.GetQueryParams() ?? new List>();
+ HeaderParams = options?.GetHeaderParams() ?? new List>();
+ Body = options?.GetBody();
+ }
+ }
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/Public/Response.cs b/src/AfterShipTracking/AfterShipTracking/Public/Response.cs
new file mode 100644
index 0000000..0c47a39
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Public/Response.cs
@@ -0,0 +1,42 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System.Net;
+using Headers = System.Net.Http.Headers.HttpResponseHeaders;
+
+namespace AfterShipTracking
+{
+ public class Response
+ {
+ ///
+ /// HTTP status code
+ ///
+ public HttpStatusCode StatusCode { get; }
+
+ ///
+ /// Content string
+ ///
+ public string Content { get; }
+
+ ///
+ /// Headers
+ ///
+ public Headers Headers { get; }
+
+ internal int NumRetries { get; set; }
+
+ ///
+ /// Create a new Response
+ ///
+ /// HTTP status code
+ /// Content string
+ /// Headers
+ public Response(HttpStatusCode statusCode, Headers headers, string content)
+ {
+ StatusCode = statusCode;
+ Headers = headers;
+ Content = content;
+ }
+ }
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/Public/SystemNetHttpClient.cs b/src/AfterShipTracking/AfterShipTracking/Public/SystemNetHttpClient.cs
new file mode 100644
index 0000000..209944f
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/Public/SystemNetHttpClient.cs
@@ -0,0 +1,409 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using System.Net;
+using System.Net.Http;
+using System.Net.Http.Headers;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AfterShipTracking
+{
+ ///
+ /// Standard client to make requests to API, using
+ /// to send HTTP requests. It can gather telemetry
+ /// about request latency (via ) and automatically retry failed
+ /// requests when it's safe to do so.
+ ///
+ public class SystemNetHttpClient : IHttpClient
+ {
+ /// Default maximum number of retries made by the client.
+ public const int DefaultMaxNumberRetries = 2;
+
+ ///
+ /// Default timeout in millseconds.
+ ///
+ public const int DefaultTimeout = 30000;
+
+ private readonly System.Net.Http.HttpClient httpClient;
+
+ private readonly object randLock = new object();
+
+ private readonly Random rand = new Random();
+
+ private string userAgent;
+
+ private int timeout;
+
+ private string baseUrl { get; set; }
+
+ private string proxy { get; set; }
+
+ private Authenticator authenticator { get; set; }
+
+ private RateLimit rateLimit = new RateLimit();
+
+ static SystemNetHttpClient()
+ {
+ // Enable support for TLS 1.2, as Tracking's API requires it. This should only be
+ // necessary for .NET Framework 4.5 as more recent runtimes should have TLS 1.2 enabled
+ // by default, but it can be disabled in some environments.
+ ServicePointManager.SecurityProtocol = ServicePointManager.SecurityProtocol |
+ SecurityProtocolType.Tls12;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The client to use. If null, an HTTP
+ /// client will be created with default parameters.
+ ///
+ ///
+ /// The maximum number of times the client will retry requests that fail due to an
+ /// intermittent problem.
+ ///
+
+ public SystemNetHttpClient(
+ String baseUrl = null,
+ Authenticator authenticator = null,
+ int maxNetworkRetries = DefaultMaxNumberRetries,
+ int timeout = DefaultTimeout,
+ string userAgent = "",
+ string proxy = null
+ )
+ {
+ if (string.IsNullOrEmpty(baseUrl))
+ {
+ throw ErrorCode.GenSDKError(ErrorCode.INVALID_REQUEST, "Base url empty");
+ }
+
+ this.baseUrl = baseUrl;
+ this.proxy = proxy;
+ this.MaxNetworkRetries = maxNetworkRetries;
+ this.userAgent = userAgent;
+ this.timeout = timeout;
+ this.authenticator = authenticator;
+ this.rateLimit = new RateLimit();
+ this.httpClient = BuildSystemNetHttpClient(this.timeout, this.proxy);
+ }
+
+ /// Default timespan before the request times out.
+ public static TimeSpan DefaultHttpTimeout => TimeSpan.FromSeconds(30);
+
+ ///
+ /// Maximum sleep time between tries to send HTTP requests after network failure.
+ ///
+ public static TimeSpan MaxNetworkRetriesDelay => TimeSpan.FromSeconds(5);
+
+ ///
+ /// Minimum sleep time between tries to send HTTP requests after network failure.
+ ///
+ public static TimeSpan MinNetworkRetriesDelay => TimeSpan.FromMilliseconds(500);
+
+ ///
+ /// Gets how many network retries were configured for this client.
+ ///
+ public int MaxNetworkRetries { get; }
+
+ ///
+ /// Gets or sets a value indicating whether the client should sleep between automatic
+ /// request retries.
+ ///
+ /// This is an internal property meant to be used in tests only.
+ internal bool NetworkRetriesSleep { get; set; } = true;
+
+ internal int NumRetries { get; set; }
+
+ ///
+ /// Initializes a new instance of the class
+ /// with default parameters.
+ ///
+ /// The new instance of the class.
+ public static HttpClient BuildSystemNetHttpClient(int timeoutMs = DefaultTimeout, string proxyUrl = null)
+ {
+ if (timeoutMs <= 0)
+ {
+ timeoutMs = DefaultTimeout;
+ }
+ TimeSpan timeout = TimeSpan.FromMilliseconds(timeoutMs);
+ if (string.IsNullOrEmpty(proxyUrl))
+ {
+ return new HttpClient
+ {
+ Timeout = timeout,
+ };
+ }
+ else
+ {
+ // Create HttpClientHandler
+ HttpClientHandler handler = new HttpClientHandler
+ {
+ Proxy = new WebProxy
+ {
+ Address = new Uri(proxyUrl),
+ UseDefaultCredentials = false,
+ },
+ UseProxy = true
+ };
+
+
+ // HttpClient
+ return new HttpClient(handler)
+ {
+ Timeout = timeout,
+ };
+
+ }
+ }
+
+
+ public Response MakeRequest(Request request)
+ {
+ var task = MakeRequestAsync(request);
+ task.Wait();
+ return task.Result;
+ }
+
+ ///
+ /// Sends a request to API as an asynchronous operation.
+ ///
+ ///
+ ///
+ public async Task MakeRequestAsync(
+ Request request)
+ {
+ var (response, retries) = await this.SendHttpRequest(request).ConfigureAwait(false);
+
+ var reader = new StreamReader(
+ await response.Content.ReadAsStreamAsync().ConfigureAwait(false));
+
+ return new Response(
+ response.StatusCode,
+ response.Headers,
+ await reader.ReadToEndAsync().ConfigureAwait(false))
+ {
+ NumRetries = retries,
+ };
+ }
+
+
+
+ private async Task<(HttpResponseMessage responseMessage, int retries)> SendHttpRequest(
+ Request request)
+ {
+ Exception? requestException;
+ HttpResponseMessage? response = null;
+ int retry = 0;
+
+ while (true)
+ {
+ requestException = null;
+ if (retry > this.MaxNetworkRetries)
+ {
+ requestException = ErrorCode.GenSDKError(ErrorCode.TIMED_OUT, ErrorCode.TIMED_OUT);
+ break;
+ }
+ var httpRequest = this.BuildRequestMessage(request);
+
+ var stopwatch = Stopwatch.StartNew();
+ // if (this.IsRateOverflow())
+ // {
+ // throw ErrorCode.GenSDKError(ErrorCode.RATE_LIMIT_EXCEEDED, ErrorCode.RATE_LIMIT_EXCEEDED);
+ // }
+ try
+ {
+ response = await this.httpClient.SendAsync(httpRequest)
+ .ConfigureAwait(false);
+ }
+ catch (HttpRequestException)
+ {
+ requestException = ErrorCode.GenSDKError(ErrorCode.INTERNAL_ERROR, ErrorCode.INTERNAL_ERROR); ;
+ }
+ catch (OperationCanceledException)
+ {
+ requestException = ErrorCode.GenSDKError(ErrorCode.TIMED_OUT, ErrorCode.TIMED_OUT);
+ }
+
+ stopwatch.Stop();
+
+ // SetRateLimit(this.rateLimit, response);
+
+ if (!this.ShouldRetry(
+ retry,
+ requestException != null,
+ response?.StatusCode,
+ response?.Headers))
+ {
+ break;
+ }
+
+ retry += 1;
+ await Task.Delay(SleepTime(retry)).ConfigureAwait(false);
+ }
+
+ if (requestException != null)
+ {
+ throw requestException;
+ }
+
+ return (response, retry);
+ }
+
+
+ private bool ShouldRetry(
+ int numRetries,
+ bool error,
+ HttpStatusCode? statusCode,
+ HttpHeaders headers)
+ {
+ // Do not retry if we are out of retries.
+ if (numRetries >= this.MaxNetworkRetries)
+ {
+ return false;
+ }
+
+ // Retry on connection error.
+ if (error == true)
+ {
+ return true;
+ }
+
+
+ // Retry on 500, 503, and other internal errors.
+ if (statusCode.HasValue && ((int)statusCode.Value >= 500))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ private HttpRequestMessage BuildRequestMessage(Request request)
+ {
+ string url = this.baseUrl + request.Path;
+
+ // query
+ if (request.QueryParams != null && request.QueryParams.Count > 0)
+ {
+ url += "?" + string.Join("&", request.QueryParams.Select(p => $"{p.Key}={p.Value}"));
+ }
+
+
+ HttpRequestMessage requestMessage = new HttpRequestMessage(request.Method, url);
+
+ // default headers
+ Dictionary defaultHeaders = BuildDefaultHeader(this.userAgent);
+ HttpHeaders headers = requestMessage.Headers;
+ foreach (var header in defaultHeaders)
+ {
+ requestMessage.Headers.TryAddWithoutValidation(header.Key, header.Value);
+ }
+
+ // Custom header
+ foreach (var header in request.HeaderParams)
+ {
+ requestMessage.Headers.TryAddWithoutValidation(header.Key, header.Value);
+ }
+
+ // auth headers
+ headers.TryAddWithoutValidation("as-api-key", authenticator.ApiKey);
+
+ // body
+ if (request.Body != null)
+ {
+ requestMessage.Content = new StringContent(request.Body, Encoding.UTF8);
+ requestMessage.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
+ }
+
+
+ // compute signature
+ this.authenticator.Sign(requestMessage);
+ return requestMessage;
+ }
+
+ private TimeSpan SleepTime(int retryAttempt)
+ {
+ int delayBase = 3;
+ int delay = delayBase * (int)Math.Pow(2, retryAttempt - 1);
+ double jitter = delay * (new Random().NextDouble() - 0.5);
+ int finalDelay = (int)(Math.Max(1, delay + jitter) * 1000);
+ return TimeSpan.FromMilliseconds(finalDelay);
+
+ }
+
+
+ public Dictionary BuildDefaultHeader(string userAgent)
+ {
+ userAgent = string.IsNullOrEmpty(userAgent) ? AfterShipConfiguration.DEFAULT_USER_AGENT : userAgent;
+ Dictionary headers = new();
+ headers.Add("content-type", "application/json");
+ headers.Add("date", DateTime.UtcNow.ToString("r"));
+ headers.Add("user-agent", userAgent);
+ headers.Add("aftreship-client", AfterShipConfiguration.DEFAULT_USER_AGENT);
+ return headers;
+ }
+
+ public void BuildAuthHeader(HttpRequestMessage request)
+ {
+ this.authenticator.Sign(request);
+ }
+
+ static void SetRateLimit(RateLimit rateLimit, HttpResponseMessage response)
+ {
+ if (rateLimit == null || response == null || response.Headers == null)
+ {
+ return;
+ }
+
+ if (response.Headers.TryGetValues("x-ratelimit-reset", out var resetValues) && !string.IsNullOrEmpty(resetValues.FirstOrDefault()))
+ {
+ if (long.TryParse(resetValues.First(), out var reset))
+ {
+ rateLimit.Reset = reset;
+ }
+ }
+
+ if (response.Headers.TryGetValues("x-ratelimit-limit", out var limitValues) && !string.IsNullOrEmpty(limitValues.FirstOrDefault()))
+ {
+ if (int.TryParse(limitValues.First(), out var limit))
+ {
+ rateLimit.Limit = limit;
+ }
+ }
+
+ if (response.Headers.TryGetValues("x-ratelimit-remaining", out var remainingValues) && !string.IsNullOrEmpty(remainingValues.FirstOrDefault()))
+ {
+ if (int.TryParse(remainingValues.First(), out var remaining))
+ {
+ rateLimit.Remaining = remaining;
+ }
+ }
+ }
+
+ private bool IsRateOverflow()
+ {
+ return rateLimit?.IsExceeded() ?? false;
+ }
+
+ }
+
+ public class RateLimit
+ {
+ public long Reset { get; set; }
+ public int Limit { get; set; }
+ public int Remaining { get; set; }
+
+ public bool IsExceeded()
+ {
+ return Remaining == 0 && Reset >= DateTimeOffset.Now.ToUnixTimeSeconds();
+ }
+ }
+}
+
diff --git a/src/AfterShipTracking/AfterShipTracking/RestAPI/Courier/CourierOption.cs b/src/AfterShipTracking/AfterShipTracking/RestAPI/Courier/CourierOption.cs
new file mode 100644
index 0000000..95cf3a7
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/RestAPI/Courier/CourierOption.cs
@@ -0,0 +1,55 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System.Collections.Generic;
+using Newtonsoft.Json;
+
+namespace AfterShipTracking
+{
+ ///
+ /// Description
+ ///
+ public class GetAllCouriersOptions : BaseOptions
+ {
+ public GetAllCouriersOptions()
+ {
+ }
+
+
+ }
+ ///
+ /// Description
+ ///
+ public class GetUserCouriersOptions : BaseOptions
+ {
+ public GetUserCouriersOptions()
+ {
+ }
+
+
+ }
+ ///
+ /// Description
+ ///
+ public class DetectCourierOptions : BaseOptions
+ {
+ public DetectCourierOptions()
+ {
+ }
+
+
+ public DetectCourierRequest DetectCourierRequest { get; set; }
+
+ override public string GetBody()
+ {
+ string body = null;
+
+ if (DetectCourierRequest != null)
+ {
+ body = BaseResourceService.ToJson(DetectCourierRequest);
+ }
+ return body;
+ }
+ }
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/RestAPI/Courier/CourierService.cs b/src/AfterShipTracking/AfterShipTracking/RestAPI/Courier/CourierService.cs
new file mode 100644
index 0000000..a8556d8
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/RestAPI/Courier/CourierService.cs
@@ -0,0 +1,57 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System;
+using System.Net.Http;
+
+namespace AfterShipTracking
+{
+ public class CourierService : BaseResourceService
+ {
+ IHttpClient HttpClient;
+
+ public CourierService(IHttpClient httpClient)
+ {
+ this.HttpClient = httpClient;
+ }
+
+ public GetAllCouriersResponse GetAllCouriers(GetAllCouriersOptions? options = null)
+ {
+ string path = $"/tracking/2025-01/couriers/all";
+ Request request = new Request(
+ HttpMethod.Get,
+ path,
+ options
+ );
+
+ var response = this.HttpClient.MakeRequest(request);
+ return ProcessData(response);
+ }
+ public GetUserCouriersResponse GetUserCouriers(GetUserCouriersOptions? options = null)
+ {
+ string path = $"/tracking/2025-01/couriers";
+ Request request = new Request(
+ HttpMethod.Get,
+ path,
+ options
+ );
+
+ var response = this.HttpClient.MakeRequest(request);
+ return ProcessData(response);
+ }
+ public DetectCourierResponse DetectCourier(DetectCourierOptions? options = null)
+ {
+ string path = $"/tracking/2025-01/couriers/detect";
+ Request request = new Request(
+ HttpMethod.Post,
+ path,
+ options
+ );
+
+ var response = this.HttpClient.MakeRequest(request);
+ return ProcessData(response);
+ }
+ }
+}
+
diff --git a/src/AfterShipTracking/AfterShipTracking/RestAPI/EstimatedDeliveryDate/EstimatedDeliveryDateOption.cs b/src/AfterShipTracking/AfterShipTracking/RestAPI/EstimatedDeliveryDate/EstimatedDeliveryDateOption.cs
new file mode 100644
index 0000000..5e2bb0f
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/RestAPI/EstimatedDeliveryDate/EstimatedDeliveryDateOption.cs
@@ -0,0 +1,56 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System.Collections.Generic;
+using Newtonsoft.Json;
+
+namespace AfterShipTracking
+{
+ ///
+ /// Description
+ ///
+ public class PredictOptions : BaseOptions
+ {
+ public PredictOptions()
+ {
+ }
+
+
+ public PredictRequest PredictRequest { get; set; }
+
+ override public string GetBody()
+ {
+ string body = null;
+
+ if (PredictRequest != null)
+ {
+ body = BaseResourceService.ToJson(PredictRequest);
+ }
+ return body;
+ }
+ }
+ ///
+ /// Description
+ ///
+ public class PredictBatchOptions : BaseOptions
+ {
+ public PredictBatchOptions()
+ {
+ }
+
+
+ public PredictBatchRequest PredictBatchRequest { get; set; }
+
+ override public string GetBody()
+ {
+ string body = null;
+
+ if (PredictBatchRequest != null)
+ {
+ body = BaseResourceService.ToJson(PredictBatchRequest);
+ }
+ return body;
+ }
+ }
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/RestAPI/EstimatedDeliveryDate/EstimatedDeliveryDateService.cs b/src/AfterShipTracking/AfterShipTracking/RestAPI/EstimatedDeliveryDate/EstimatedDeliveryDateService.cs
new file mode 100644
index 0000000..70fd714
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/RestAPI/EstimatedDeliveryDate/EstimatedDeliveryDateService.cs
@@ -0,0 +1,45 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System;
+using System.Net.Http;
+
+namespace AfterShipTracking
+{
+ public class EstimatedDeliveryDateService : BaseResourceService
+ {
+ IHttpClient HttpClient;
+
+ public EstimatedDeliveryDateService(IHttpClient httpClient)
+ {
+ this.HttpClient = httpClient;
+ }
+
+ public EstimatedDeliveryDateResponse Predict(PredictOptions? options = null)
+ {
+ string path = $"/tracking/2025-01/estimated-delivery-date/predict";
+ Request request = new Request(
+ HttpMethod.Post,
+ path,
+ options
+ );
+
+ var response = this.HttpClient.MakeRequest(request);
+ return ProcessData(response);
+ }
+ public PredictBatchResponse PredictBatch(PredictBatchOptions? options = null)
+ {
+ string path = $"/tracking/2025-01/estimated-delivery-date/predict-batch";
+ Request request = new Request(
+ HttpMethod.Post,
+ path,
+ options
+ );
+
+ var response = this.HttpClient.MakeRequest(request);
+ return ProcessData(response);
+ }
+ }
+}
+
diff --git a/src/AfterShipTracking/AfterShipTracking/RestAPI/Tracking/TrackingOption.cs b/src/AfterShipTracking/AfterShipTracking/RestAPI/Tracking/TrackingOption.cs
new file mode 100644
index 0000000..15e05d2
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/RestAPI/Tracking/TrackingOption.cs
@@ -0,0 +1,173 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System.Collections.Generic;
+using Newtonsoft.Json;
+
+namespace AfterShipTracking
+{
+ ///
+ /// Description
+ ///
+ public class MarkTrackingCompletedByIdOptions : BaseOptions
+ {
+ public MarkTrackingCompletedByIdOptions()
+ {
+ }
+
+
+ public MarkTrackingCompletedByIdRequest MarkTrackingCompletedByIdRequest { get; set; }
+
+ override public string GetBody()
+ {
+ string body = null;
+
+ if (MarkTrackingCompletedByIdRequest != null)
+ {
+ body = BaseResourceService.ToJson(MarkTrackingCompletedByIdRequest);
+ }
+ return body;
+ }
+ }
+ ///
+ /// Description
+ ///
+ public class CreateTrackingOptions : BaseOptions
+ {
+ public CreateTrackingOptions()
+ {
+ }
+
+
+ public CreateTrackingRequest CreateTrackingRequest { get; set; }
+
+ override public string GetBody()
+ {
+ string body = null;
+
+ if (CreateTrackingRequest != null)
+ {
+ body = BaseResourceService.ToJson(CreateTrackingRequest);
+ }
+ return body;
+ }
+ }
+ ///
+ /// Description
+ ///
+ public class GetTrackingByIdOptions : BaseOptions
+ {
+ public GetTrackingByIdOptions()
+ {
+ }
+
+ public string Fields { get; set; }
+ public string Lang { get; set; }
+
+ override public List> GetQueryParams()
+ {
+ var p = new List>();
+ p.Add(new KeyValuePair("fields", Fields));
+ p.Add(new KeyValuePair("lang", Lang));
+ return p;
+ }
+ }
+ ///
+ /// Description
+ ///
+ public class UpdateTrackingByIdOptions : BaseOptions
+ {
+ public UpdateTrackingByIdOptions()
+ {
+ }
+
+
+ public UpdateTrackingByIdRequest UpdateTrackingByIdRequest { get; set; }
+
+ override public string GetBody()
+ {
+ string body = null;
+
+ if (UpdateTrackingByIdRequest != null)
+ {
+ body = BaseResourceService.ToJson(UpdateTrackingByIdRequest);
+ }
+ return body;
+ }
+ }
+ ///
+ /// Description
+ ///
+ public class RetrackTrackingByIdOptions : BaseOptions
+ {
+ public RetrackTrackingByIdOptions()
+ {
+ }
+
+
+ }
+ ///
+ /// Description
+ ///
+ public class GetTrackingsOptions : BaseOptions
+ {
+ public GetTrackingsOptions()
+ {
+ }
+
+ public string Cursor { get; set; }
+ public string Limit { get; set; }
+ public string Keyword { get; set; }
+ public string TrackingNumbers { get; set; }
+ public string Slug { get; set; }
+ public string TransitTime { get; set; }
+ public string Origin { get; set; }
+ public string Destination { get; set; }
+ public string Tag { get; set; }
+ public string CreatedAtMin { get; set; }
+ public string CreatedAtMax { get; set; }
+ public string UpdatedAtMin { get; set; }
+ public string UpdatedAtMax { get; set; }
+ public string Fields { get; set; }
+ public string ReturnToSender { get; set; }
+ public string CourierDestinationCountryRegion { get; set; }
+ public string ShipmentTags { get; set; }
+ public string OrderId { get; set; }
+
+ override public List> GetQueryParams()
+ {
+ var p = new List>();
+ p.Add(new KeyValuePair("cursor", Cursor));
+ p.Add(new KeyValuePair("limit", Limit));
+ p.Add(new KeyValuePair("keyword", Keyword));
+ p.Add(new KeyValuePair("tracking_numbers", TrackingNumbers));
+ p.Add(new KeyValuePair("slug", Slug));
+ p.Add(new KeyValuePair("transit_time", TransitTime));
+ p.Add(new KeyValuePair("origin", Origin));
+ p.Add(new KeyValuePair("destination", Destination));
+ p.Add(new KeyValuePair("tag", Tag));
+ p.Add(new KeyValuePair("created_at_min", CreatedAtMin));
+ p.Add(new KeyValuePair("created_at_max", CreatedAtMax));
+ p.Add(new KeyValuePair("updated_at_min", UpdatedAtMin));
+ p.Add(new KeyValuePair("updated_at_max", UpdatedAtMax));
+ p.Add(new KeyValuePair("fields", Fields));
+ p.Add(new KeyValuePair("return_to_sender", ReturnToSender));
+ p.Add(new KeyValuePair("courier_destination_country_region", CourierDestinationCountryRegion));
+ p.Add(new KeyValuePair("shipment_tags", ShipmentTags));
+ p.Add(new KeyValuePair("order_id", OrderId));
+ return p;
+ }
+ }
+ ///
+ /// Description
+ ///
+ public class DeleteTrackingByIdOptions : BaseOptions
+ {
+ public DeleteTrackingByIdOptions()
+ {
+ }
+
+
+ }
+}
diff --git a/src/AfterShipTracking/AfterShipTracking/RestAPI/Tracking/TrackingService.cs b/src/AfterShipTracking/AfterShipTracking/RestAPI/Tracking/TrackingService.cs
new file mode 100644
index 0000000..3db3864
--- /dev/null
+++ b/src/AfterShipTracking/AfterShipTracking/RestAPI/Tracking/TrackingService.cs
@@ -0,0 +1,125 @@
+/*
+ * This code was auto generated by AfterShip SDK Generator.
+ * Do not edit the class manually.
+ */
+using System;
+using System.Net.Http;
+
+namespace AfterShipTracking
+{
+ public class TrackingService : BaseResourceService
+ {
+ IHttpClient HttpClient;
+
+ public TrackingService(IHttpClient httpClient)
+ {
+ this.HttpClient = httpClient;
+ }
+
+ public Tracking MarkTrackingCompletedById(string id, MarkTrackingCompletedByIdOptions? options = null)
+ {
+ string path = $"/tracking/2025-01/trackings/{id}/mark-as-completed";
+ if (string.IsNullOrEmpty(id))
+ {
+ throw ErrorCode.GenSDKError(ErrorCode.REQUEST_ERROR, "request error" + ": `id` is invalid");
+ }
+ Request request = new Request(
+ HttpMethod.Post,
+ path,
+ options
+ );
+
+ var response = this.HttpClient.MakeRequest(request);
+ return ProcessData(response);
+ }
+ public Tracking CreateTracking(CreateTrackingOptions? options = null)
+ {
+ string path = $"/tracking/2025-01/trackings";
+ Request request = new Request(
+ HttpMethod.Post,
+ path,
+ options
+ );
+
+ var response = this.HttpClient.MakeRequest(request);
+ return ProcessData(response);
+ }
+ public Tracking GetTrackingById(string id, GetTrackingByIdOptions? options = null)
+ {
+ string path = $"/tracking/2025-01/trackings/{id}";
+ if (string.IsNullOrEmpty(id))
+ {
+ throw ErrorCode.GenSDKError(ErrorCode.REQUEST_ERROR, "request error" + ": `id` is invalid");
+ }
+ Request request = new Request(
+ HttpMethod.Get,
+ path,
+ options
+ );
+
+ var response = this.HttpClient.MakeRequest(request);
+ return ProcessData(response);
+ }
+ public Tracking UpdateTrackingById(string id, UpdateTrackingByIdOptions? options = null)
+ {
+ string path = $"/tracking/2025-01/trackings/{id}";
+ if (string.IsNullOrEmpty(id))
+ {
+ throw ErrorCode.GenSDKError(ErrorCode.REQUEST_ERROR, "request error" + ": `id` is invalid");
+ }
+ Request request = new Request(
+ HttpMethod.Put,
+ path,
+ options
+ );
+
+ var response = this.HttpClient.MakeRequest(request);
+ return ProcessData(response);
+ }
+ public Tracking RetrackTrackingById(string id, RetrackTrackingByIdOptions? options = null)
+ {
+ string path = $"/tracking/2025-01/trackings/{id}/retrack";
+ if (string.IsNullOrEmpty(id))
+ {
+ throw ErrorCode.GenSDKError(ErrorCode.REQUEST_ERROR, "request error" + ": `id` is invalid");
+ }
+ Request request = new Request(
+ HttpMethod.Post,
+ path,
+ options
+ );
+
+ var response = this.HttpClient.MakeRequest(request);
+ return ProcessData(response);
+ }
+ public GetTrackingsResponse GetTrackings(GetTrackingsOptions? options = null)
+ {
+ string path = $"/tracking/2025-01/trackings";
+ Request request = new Request(
+ HttpMethod.Get,
+ path,
+ options
+ );
+
+ var response = this.HttpClient.MakeRequest(request);
+ return ProcessData(response);
+ }
+ public Tracking DeleteTrackingById(string id, DeleteTrackingByIdOptions? options = null)
+ {
+ string path = $"/tracking/2025-01/trackings/{id}";
+ if (string.IsNullOrEmpty(id))
+ {
+ throw ErrorCode.GenSDKError(ErrorCode.REQUEST_ERROR, "request error" + ": `id` is invalid");
+ }
+ Request request = new Request(
+ HttpMethod.Delete,
+ path,
+ options
+ );
+
+ var response = this.HttpClient.MakeRequest(request);
+ return ProcessData(response);
+ }
+ }
+}
+