Skip to content

Commit 0269384

Browse files
authored
Merge pull request #10 from 1415003719/2025-07
support 2025-07 version
2 parents 153b61a + ebd8f69 commit 0269384

18 files changed

+219
-124
lines changed

README.md

Lines changed: 96 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ Each SDK version is designed to work with a specific API version. Please refer t
4242

4343
| SDK Version | Supported API Version | Branch |
4444
| ----------- | --------------------- | ---------------------------------------------------------- |
45+
| 12.x.x | 2025-07 | https://github.com/AfterShip/tracking-sdk-net/tree/2025-07 |
4546
| 11.x.x | 2025-04 | https://github.com/AfterShip/tracking-sdk-net/tree/2025-04 |
4647
| 10.x.x | 2025-01 | https://github.com/AfterShip/tracking-sdk-net/tree/2025-01 |
4748
| 9.x.x | 2024-10 | https://github.com/AfterShip/tracking-sdk-net/tree/2024-10 |
@@ -132,7 +133,7 @@ class Program
132133

133134
## Rate Limiter
134135

135-
See the [Rate Limit](https://www.aftership.com/docs/tracking/2025-04/quickstart/rate-limit) to understand the AfterShip rate limit policy.
136+
See the [Rate Limit](https://www.aftership.com/docs/tracking/2025-07/quickstart/rate-limit) to understand the AfterShip rate limit policy.
136137

137138
## Error Handling
138139

@@ -293,6 +294,73 @@ DetectCourierResponse resp = client.Courier.DetectCourier(options);
293294
Console.WriteLine(resp.Total);
294295
```
295296

297+
### /courier-connections
298+
299+
**POST** /courier-connections
300+
```csharp
301+
PostCourierConnectionsOptions postCourierConnectionsOptions = new PostCourierConnectionsOptions();
302+
postCourierConnectionsOptions.PostCourierConnectionsRequest = new PostCourierConnectionsRequest();
303+
PostCourierConnectionsRequest req = new PostCourierConnectionsRequest();
304+
req.CourierSlug = "dhl-api";
305+
Dictionary<string, string> credentails = new Dictionary<string, string>();
306+
credentails.Add("api_key", "<dhl_api_key>");
307+
req.Credentials = credentails;
308+
postCourierConnectionsOptions.PostCourierConnectionsRequest = req;
309+
CourierConnection createdCourierConnection = client.CourierConnection.PostCourierConnections(postCourierConnectionsOptions);
310+
if (createdCourierConnection != null)
311+
{
312+
Console.WriteLine(createdCourierConnection.Id);
313+
}
314+
```
315+
316+
**GET** /courier-connections
317+
```csharp
318+
GetCourierConnectionsResponseCourierConnectionListData listCourierConnectionData = client.CourierConnection.GetCourierConnections();
319+
if (listCourierConnectionData != null)
320+
{
321+
for (int i = 0; i < listCourierConnectionData.CourierConnections.Length; i++)
322+
{
323+
Console.WriteLine(listCourierConnectionData.CourierConnections[i].Id);
324+
}
325+
}
326+
```
327+
328+
**GET** /courier-connections/:id
329+
```csharp
330+
CourierConnection courierConnection = client.CourierConnection.GetCourierConnectionsById("<courier connection id>");
331+
if (courierConnection != null)
332+
{
333+
Console.WriteLine(courierConnection.Id);
334+
}
335+
```
336+
337+
**DELETE** /courier-connections/:id
338+
```csharp
339+
CourierConnection courierConnection = client.CourierConnection.DeleteCourierConnectionsById("<courier connection id>");
340+
if (courierConnection != null)
341+
{
342+
Console.WriteLine(courierConnection.Id);
343+
}
344+
```
345+
346+
**PATCH** /courier-connections/:id
347+
```csharp
348+
PutCourierConnectionsByIdOptions putCourierConnectionsOptions = new PutCourierConnectionsByIdOptions();
349+
putCourierConnectionsOptions.PutCourierConnectionsByIdRequest = new PutCourierConnectionsByIdRequest();
350+
PutCourierConnectionsByIdRequest req = new PutCourierConnectionsByIdRequest();
351+
352+
Dictionary<string, string> credentails = new Dictionary<string, string>();
353+
credentails.Add("api_key", "<dhl_api_key>");
354+
req.Credentials = credentails;
355+
putCourierConnectionsOptions.PutCourierConnectionsByIdRequest = req;
356+
CourierConnection courierConnection = client.CourierConnection.PutCourierConnectionsById("<courier connection id>", putCourierConnectionsOptions);
357+
if (courierConnection != null)
358+
{
359+
Console.WriteLine(courierConnection.Id);
360+
}
361+
```
362+
363+
296364
### /estimated-delivery-date
297365

298366
**POST** /estimated-delivery-date/predict-batch
@@ -326,6 +394,33 @@ PredictBatchResponse resp = client.EstimatedDeliveryDate.PredictBatch(options);
326394
Console.WriteLine(resp.EstimatedDeliveryDates[0].PickupTime);
327395
```
328396

397+
**POST** /estimated-delivery-date/predict
398+
399+
```csharp
400+
PredictOptions options = new PredictOptions();
401+
PredictRequest request = new PredictRequest();
402+
403+
EstimatedDeliveryDateRequest estimatedDeliveryDateRequest = new EstimatedDeliveryDateRequest();
404+
405+
DestinationAddressEstimatedDeliveryDateRequest dest = new DestinationAddressEstimatedDeliveryDateRequest();
406+
dest.CountryRegion = "<ISO 3166-1 country/region code>";
407+
dest.State = "<ISO 3166-1 country/region code>";
408+
estimatedDeliveryDateRequest.DestinationAddress = dest;
409+
410+
OriginAddressEstimatedDeliveryDateRequest origin = new OriginAddressEstimatedDeliveryDateRequest();
411+
origin.CountryRegion = "<ISO 3166-1 country/region code>";
412+
origin.State = "<ISO 3166-1 country/region code>";
413+
estimatedDeliveryDateRequest.OriginAddress = origin;
414+
415+
estimatedDeliveryDateRequest.Slug = "<slug>";
416+
estimatedDeliveryDateRequest.PickupTime = "2024-08-01 06:42:30";
417+
418+
options.PredictRequest = request;
419+
420+
EstimatedDeliveryDateResponse resp = client.EstimatedDeliveryDate.Predict(options);
421+
Console.WriteLine(resp.PickupTime);
422+
```
423+
329424
## Help
330425

331426
If you get stuck, we're here to help:

src/AfterShipTracking/AfterShipTracking/AfterShipTracking.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<Copyright>Copyright © AfterShip</Copyright>
1111
<AssemblyTitle>AfterShipTracking</AssemblyTitle>
1212
<NeutralLanguage>en-US</NeutralLanguage>
13-
<VersionPrefix>11.0.0</VersionPrefix>
13+
<VersionPrefix>12.0.0</VersionPrefix>
1414
<VersionSuffix>
1515
</VersionSuffix>
1616
<Authors>AfterShip</Authors>

src/AfterShipTracking/AfterShipTracking/AftershipClient.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ public class AfterShipClient
6464

6565
public IHttpClient HttpClient { get; }
6666

67+
public CourierConnectionService CourierConnection { get; set; }
6768
public TrackingService Tracking { get; set; }
68-
public CourierService Courier { get; set; }
6969
public EstimatedDeliveryDateService EstimatedDeliveryDate { get; set; }
70-
public CourierConnectionService CourierConnection { get; set; }
70+
public CourierService Courier { get; set; }
7171
public AfterShipClient(
7272
string domain = null,
7373
string apiKey = null,
@@ -96,10 +96,10 @@ public AfterShipClient(
9696

9797
HttpClient = httpClient ?? new SystemNetHttpClient(this.ApiBase, authenticator, this.MaxRetry, this.Timeout, this.UserAgent,this.Proxy);
9898

99+
CourierConnection = new CourierConnectionService(HttpClient);
99100
Tracking = new TrackingService(HttpClient);
100-
Courier = new CourierService(HttpClient);
101101
EstimatedDeliveryDate = new EstimatedDeliveryDateService(HttpClient);
102-
CourierConnection = new CourierConnectionService(HttpClient);
102+
Courier = new CourierService(HttpClient);
103103
}
104104

105105
private void CheckConfig()

src/AfterShipTracking/AfterShipTracking/Models/CreateTrackingResponse.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ public class LatestEstimatedDeliveryCreateTrackingResponse
564564
[JsonProperty("datetime_max")]
565565
public string? DatetimeMax { get; set; }
566566
/// <summary>
567-
/// ReviseReason Explains the reason for a change to the latest_estimated_delivery. This string will only have a value if:1. The source for the latest EDD is AfterShip EDD. 2. The reason for the change is known.For a comprehensive list of reasons, please refer to this document.
567+
/// ReviseReason Explains the reason for a change to the latest_estimated_delivery. This string will only have a value if:1. The source for the latest EDD is AfterShip EDD. 2. The reason for the change is known.For a comprehensive list of reasons, please refer to .
568568
/// </summary>
569569
[JsonProperty("revise_reason")]
570570
public string? ReviseReason { get; set; }

src/AfterShipTracking/AfterShipTracking/Models/DeleteTrackingByIdResponse.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ public class LatestEstimatedDeliveryDeleteTrackingByIdResponse
564564
[JsonProperty("datetime_max")]
565565
public string? DatetimeMax { get; set; }
566566
/// <summary>
567-
/// ReviseReason Explains the reason for a change to the latest_estimated_delivery. This string will only have a value if:1. The source for the latest EDD is AfterShip EDD. 2. The reason for the change is known.For a comprehensive list of reasons, please refer to this document.
567+
/// ReviseReason Explains the reason for a change to the latest_estimated_delivery. This string will only have a value if:1. The source for the latest EDD is AfterShip EDD. 2. The reason for the change is known.For a comprehensive list of reasons, please refer to .
568568
/// </summary>
569569
[JsonProperty("revise_reason")]
570570
public string? ReviseReason { get; set; }

src/AfterShipTracking/AfterShipTracking/Models/GetTrackingByIdResponse.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ public class LatestEstimatedDeliveryGetTrackingByIdResponse
564564
[JsonProperty("datetime_max")]
565565
public string? DatetimeMax { get; set; }
566566
/// <summary>
567-
/// ReviseReason Explains the reason for a change to the latest_estimated_delivery. This string will only have a value if:1. The source for the latest EDD is AfterShip EDD. 2. The reason for the change is known.For a comprehensive list of reasons, please refer to this document.
567+
/// ReviseReason Explains the reason for a change to the latest_estimated_delivery. This string will only have a value if:1. The source for the latest EDD is AfterShip EDD. 2. The reason for the change is known.For a comprehensive list of reasons, please refer to .
568568
/// </summary>
569569
[JsonProperty("revise_reason")]
570570
public string? ReviseReason { get; set; }

src/AfterShipTracking/AfterShipTracking/Models/MarkTrackingCompletedByIdResponse.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ public class LatestEstimatedDeliveryMarkTrackingCompletedByIdResponse
564564
[JsonProperty("datetime_max")]
565565
public string? DatetimeMax { get; set; }
566566
/// <summary>
567-
/// ReviseReason Explains the reason for a change to the latest_estimated_delivery. This string will only have a value if:1. The source for the latest EDD is AfterShip EDD. 2. The reason for the change is known.For a comprehensive list of reasons, please refer to this document.
567+
/// ReviseReason Explains the reason for a change to the latest_estimated_delivery. This string will only have a value if:1. The source for the latest EDD is AfterShip EDD. 2. The reason for the change is known.For a comprehensive list of reasons, please refer to .
568568
/// </summary>
569569
[JsonProperty("revise_reason")]
570570
public string? ReviseReason { get; set; }

src/AfterShipTracking/AfterShipTracking/Models/RetrackTrackingByIdResponse.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ public class LatestEstimatedDeliveryRetrackTrackingByIdResponse
564564
[JsonProperty("datetime_max")]
565565
public string? DatetimeMax { get; set; }
566566
/// <summary>
567-
/// ReviseReason Explains the reason for a change to the latest_estimated_delivery. This string will only have a value if:1. The source for the latest EDD is AfterShip EDD. 2. The reason for the change is known.For a comprehensive list of reasons, please refer to this document.
567+
/// ReviseReason Explains the reason for a change to the latest_estimated_delivery. This string will only have a value if:1. The source for the latest EDD is AfterShip EDD. 2. The reason for the change is known.For a comprehensive list of reasons, please refer to .
568568
/// </summary>
569569
[JsonProperty("revise_reason")]
570570
public string? ReviseReason { get; set; }

src/AfterShipTracking/AfterShipTracking/Models/Tracking.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ public class LatestEstimatedDeliveryTracking
564564
[JsonProperty("datetime_max",NullValueHandling = NullValueHandling.Ignore)]
565565
public string? DatetimeMax { get; set; }
566566
/// <summary>
567-
/// ReviseReason Explains the reason for a change to the latest_estimated_delivery. This string will only have a value if:1. The source for the latest EDD is AfterShip EDD. 2. The reason for the change is known.For a comprehensive list of reasons, please refer to this document.
567+
/// ReviseReason Explains the reason for a change to the latest_estimated_delivery. This string will only have a value if:1. The source for the latest EDD is AfterShip EDD. 2. The reason for the change is known.For a comprehensive list of reasons, please refer to .
568568
/// </summary>
569569
[JsonProperty("revise_reason",NullValueHandling = NullValueHandling.Ignore)]
570570
public string? ReviseReason { get; set; }

src/AfterShipTracking/AfterShipTracking/Models/UpdateTrackingByIdResponse.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ public class LatestEstimatedDeliveryUpdateTrackingByIdResponse
564564
[JsonProperty("datetime_max")]
565565
public string? DatetimeMax { get; set; }
566566
/// <summary>
567-
/// ReviseReason Explains the reason for a change to the latest_estimated_delivery. This string will only have a value if:1. The source for the latest EDD is AfterShip EDD. 2. The reason for the change is known.For a comprehensive list of reasons, please refer to this document.
567+
/// ReviseReason Explains the reason for a change to the latest_estimated_delivery. This string will only have a value if:1. The source for the latest EDD is AfterShip EDD. 2. The reason for the change is known.For a comprehensive list of reasons, please refer to .
568568
/// </summary>
569569
[JsonProperty("revise_reason")]
570570
public string? ReviseReason { get; set; }

0 commit comments

Comments
 (0)