Skip to content

Commit 153b61a

Browse files
authored
Merge pull request #9 from 1415003719/2025-04
support 2025-04 version
2 parents 72bceb2 + 01a16b4 commit 153b61a

60 files changed

Lines changed: 2509 additions & 2006 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ If you need support using AfterShip products, please contact support@aftership.c
2222
- [Endpoints](#endpoints)
2323
- [/trackings](#trackings)
2424
- [/couriers](#couriers)
25+
- [/courier-connections](#courier-connections)
2526
- [/estimated-delivery-date](#estimated-delivery-date)
2627
- [Help](#help)
2728
- [License](#license)
@@ -41,6 +42,7 @@ Each SDK version is designed to work with a specific API version. Please refer t
4142

4243
| SDK Version | Supported API Version | Branch |
4344
| ----------- | --------------------- | ---------------------------------------------------------- |
45+
| 11.x.x | 2025-04 | https://github.com/AfterShip/tracking-sdk-net/tree/2025-04 |
4446
| 10.x.x | 2025-01 | https://github.com/AfterShip/tracking-sdk-net/tree/2025-01 |
4547
| 9.x.x | 2024-10 | https://github.com/AfterShip/tracking-sdk-net/tree/2024-10 |
4648
| 8.x.x | 2024-07 | https://github.com/AfterShip/tracking-sdk-net/tree/2024-07 |
@@ -130,7 +132,7 @@ class Program
130132

131133
## Rate Limiter
132134

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

135137
## Error Handling
136138

@@ -178,6 +180,7 @@ The AfterShip instance has the following properties which are exactly the same a
178180

179181
- courier - Get a list of our supported couriers.
180182
- tracking - Create trackings, update trackings, and get tracking results.
183+
- courier-connection - Create courier connections, update courier connections, and get courier connections results.
181184
- estimated-delivery-date - Get estimated delivery date for your order.
182185

183186

@@ -216,7 +219,7 @@ if (resp != null)
216219
```csharp
217220
GetTrackingsOptions options = new GetTrackingsOptions();
218221
options.Keyword = "test";
219-
GetTrackingsResponseTrackingListData trackingsData = client.Tracking.GetTrackings(options);
222+
GetTrackingsResponse trackingsData = client.Tracking.GetTrackings(options);
220223
if (trackingsData != null && trackingsData.Trackings != null)
221224
{
222225
for (int i = 0; i < trackingsData.Trackings.Length; i++)
@@ -274,16 +277,8 @@ Console.WriteLine(tracking.TrackingNumber);
274277
**GET** /couriers
275278

276279
```csharp
277-
GetUserCouriersOptions options = new GetUserCouriersOptions();
278-
GetUserCouriersResponse resp = client.Courier.GetUserCouriers(options);
279-
Console.WriteLine(resp.Total);
280-
```
281-
282-
**GET** /couriers/all
283-
284-
```csharp
285-
GetAllCouriersOptions options = new GetAllCouriersOptions();
286-
GetAllCouriersResponse resp = client.Courier.GetAllCouriers(options);
280+
GetCouriersOptions options = new GetCouriersOptions();
281+
GetCouriersResponse resp = client.Courier.GetCouriers(options);
287282
Console.WriteLine(resp.Total);
288283
```
289284

src/.DS_Store

-6 KB
Binary file not shown.

src/AfterShipTracking/.DS_Store

-6 KB
Binary file not shown.

src/AfterShipTracking/AfterShipTracking.sln

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,24 @@ MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AfterShipTracking", "AfterShipTracking\AfterShipTracking.csproj", "{D3099A91-E005-4291-88AD-D7A3B85DDC1D}"
77
EndProject
88
Global
9-
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10-
Debug|Any CPU = Debug|Any CPU
11-
Release|Any CPU = Release|Any CPU
12-
EndGlobalSection
13-
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14-
{D3099A91-E005-4291-88AD-D7A3B85DDC1D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15-
{D3099A91-E005-4291-88AD-D7A3B85DDC1D}.Debug|Any CPU.Build.0 = Debug|Any CPU
16-
{D3099A91-E005-4291-88AD-D7A3B85DDC1D}.Release|Any CPU.ActiveCfg = Release|Any CPU
17-
{D3099A91-E005-4291-88AD-D7A3B85DDC1D}.Release|Any CPU.Build.0 = Release|Any CPU
18-
{D2C22390-8325-4493-B940-F89BD8BA19EA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
19-
{D2C22390-8325-4493-B940-F89BD8BA19EA}.Debug|Any CPU.Build.0 = Debug|Any CPU
20-
{D2C22390-8325-4493-B940-F89BD8BA19EA}.Release|Any CPU.ActiveCfg = Release|Any CPU
21-
{D2C22390-8325-4493-B940-F89BD8BA19EA}.Release|Any CPU.Build.0 = Release|Any CPU
22-
EndGlobalSection
23-
GlobalSection(SolutionProperties) = preSolution
24-
HideSolutionNode = FALSE
25-
EndGlobalSection
26-
GlobalSection(ExtensibilityGlobals) = postSolution
27-
SolutionGuid = {5C216FDA-5980-4A44-A348-7C9B82282CE4}
28-
EndGlobalSection
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{D3099A91-E005-4291-88AD-D7A3B85DDC1D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{D3099A91-E005-4291-88AD-D7A3B85DDC1D}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{D3099A91-E005-4291-88AD-D7A3B85DDC1D}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{D3099A91-E005-4291-88AD-D7A3B85DDC1D}.Release|Any CPU.Build.0 = Release|Any CPU
18+
{D2C22390-8325-4493-B940-F89BD8BA19EA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
19+
{D2C22390-8325-4493-B940-F89BD8BA19EA}.Debug|Any CPU.Build.0 = Debug|Any CPU
20+
{D2C22390-8325-4493-B940-F89BD8BA19EA}.Release|Any CPU.ActiveCfg = Release|Any CPU
21+
{D2C22390-8325-4493-B940-F89BD8BA19EA}.Release|Any CPU.Build.0 = Release|Any CPU
22+
EndGlobalSection
23+
GlobalSection(SolutionProperties) = preSolution
24+
HideSolutionNode = FALSE
25+
EndGlobalSection
26+
GlobalSection(ExtensibilityGlobals) = postSolution
27+
SolutionGuid = {5C216FDA-5980-4A44-A348-7C9B82282CE4}
28+
EndGlobalSection
2929
EndGlobal

src/AfterShipTracking/AfterShipTracking/AfterShipTracking.csproj

Lines changed: 4 additions & 4 deletions
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>10.0.0</VersionPrefix>
13+
<VersionPrefix>11.0.0</VersionPrefix>
1414
<VersionSuffix>
1515
</VersionSuffix>
1616
<Authors>AfterShip</Authors>
@@ -30,9 +30,9 @@
3030
</PropertyGroup>
3131

3232
<ItemGroup>
33-
<None Include="../../../README.md" Pack="true" PackagePath="\" />
34-
<None Include="../../../icon.png" Pack="true" PackagePath="\" />
35-
<None Include="../../../LICENSE.txt" Pack="true" PackagePath="\" />
33+
<None Include="../../../README.md" Pack="true" PackagePath="\"/>
34+
<None Include="../../../icon.png" Pack="true" PackagePath="\"/>
35+
<None Include="../../../LICENSE.txt" Pack="true" PackagePath="\"/>
3636
</ItemGroup>
3737

3838
<ItemGroup>

src/AfterShipTracking/AfterShipTracking/AftershipClient.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ public class AfterShipClient
6767
public TrackingService Tracking { get; set; }
6868
public CourierService Courier { get; set; }
6969
public EstimatedDeliveryDateService EstimatedDeliveryDate { get; set; }
70+
public CourierConnectionService CourierConnection { get; set; }
7071
public AfterShipClient(
7172
string domain = null,
7273
string apiKey = null,
@@ -81,8 +82,8 @@ public AfterShipClient(
8182
{
8283
Domain = domain ?? AfterShipConfiguration.Domain;
8384
ApiBase = Domain;
84-
MaxRetry = maxRetry == 0 ? AfterShipConfiguration.MaxRetry : maxRetry;
85-
Timeout = timeout == 0 ? AfterShipConfiguration.Timeout : timeout;
85+
MaxRetry = maxRetry ==0 ? AfterShipConfiguration.MaxRetry:maxRetry;
86+
Timeout = timeout ==0? AfterShipConfiguration.Timeout: timeout;
8687
UserAgent = userAgent ?? AfterShipConfiguration.UserAgent;
8788
Proxy = proxy ?? AfterShipConfiguration.Proxy;
8889
ApiKey = apiKey ?? AfterShipConfiguration.ApiKey;
@@ -93,11 +94,12 @@ public AfterShipClient(
9394

9495
Authenticator authenticator = new Authenticator(ApiKey, ApiSecret, AuthenticationType);
9596

96-
HttpClient = httpClient ?? new SystemNetHttpClient(this.ApiBase, authenticator, this.MaxRetry, this.Timeout, this.UserAgent, this.Proxy);
97+
HttpClient = httpClient ?? new SystemNetHttpClient(this.ApiBase, authenticator, this.MaxRetry, this.Timeout, this.UserAgent,this.Proxy);
9798

9899
Tracking = new TrackingService(HttpClient);
99100
Courier = new CourierService(HttpClient);
100101
EstimatedDeliveryDate = new EstimatedDeliveryDateService(HttpClient);
102+
CourierConnection = new CourierConnectionService(HttpClient);
101103
}
102104

103105
private void CheckConfig()

src/AfterShipTracking/AfterShipTracking/Exception/ErrorCode.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public class ErrorCode
9999
{ INTERNAL_ERROR, "Something went wrong on AfterShip's end."},
100100
};
101101

102-
public static AfterShipError GenAPIError(int statusCode, int metaCode, string responseBody = null, string message = null, object responseHeader = null)
102+
public static AfterShipError GenAPIError(int statusCode, int metaCode, string responseBody = null, string message = null, object responseHeader= null)
103103
{
104104
string errorCode = LocateErrorCode(metaCode);
105105
return GenError(errorCode, statusCode, metaCode, responseBody, message, responseHeader);

src/AfterShipTracking/AfterShipTracking/Models/AdditionalFieldsV1.cs renamed to src/AfterShipTracking/AfterShipTracking/Models/AdditionalFields.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@ namespace AfterShipTracking
1212
/// All available additional fields
1313
/// </summary>
1414
[JsonConverter(typeof(StringEnumConverter))]
15-
public enum AdditionalFieldsV1
15+
public enum AdditionalFields
1616
{
1717
[EnumMember(Value = "tracking_account_number")]
1818
TrackingAccountNumber,
19-
[EnumMember(Value = "tracking_postal_code")]
20-
TrackingPostalCode,
21-
[EnumMember(Value = "tracking_ship_date")]
22-
TrackingShipDate,
19+
[EnumMember(Value = "destination_postal_code")]
20+
DestinationPostalCode,
21+
[EnumMember(Value = "destination_state")]
22+
DestinationState,
2323
[EnumMember(Value = "tracking_key")]
2424
TrackingKey,
25-
[EnumMember(Value = "tracking_origin_country_region")]
26-
TrackingOriginCountryRegion,
27-
[EnumMember(Value = "tracking_destination_country_region")]
28-
TrackingDestinationCountryRegion,
29-
[EnumMember(Value = "tracking_state")]
30-
TrackingState,
25+
[EnumMember(Value = "origin_country_region")]
26+
OriginCountryRegion,
27+
[EnumMember(Value = "destination_country_region")]
28+
DestinationCountryRegion,
29+
[EnumMember(Value = "tracking_ship_date")]
30+
TrackingShipDate,
3131
}
3232
}

src/AfterShipTracking/AfterShipTracking/Models/Checkpoint.cs

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -11,113 +11,113 @@ namespace AfterShipTracking
1111
/// <summary>
1212
/// Object describes checkpoint information.
1313
/// </summary>
14-
public class Checkpoint
14+
public class Checkpoint
1515
{
1616
/// <summary>
1717
/// 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.
1818
/// </summary>
19-
[JsonProperty("created_at", NullValueHandling = NullValueHandling.Ignore)]
20-
public string? CreatedAt { get; set; }
19+
[JsonProperty("created_at",NullValueHandling = NullValueHandling.Ignore)]
20+
public string? CreatedAt { get; set; }
2121
/// <summary>
2222
/// Slug The unique code of courier for this checkpoint. Get courier slug
2323
/// </summary>
24-
[JsonProperty("slug", NullValueHandling = NullValueHandling.Ignore)]
25-
public string? Slug { get; set; }
24+
[JsonProperty("slug",NullValueHandling = NullValueHandling.Ignore)]
25+
public string? Slug { get; set; }
2626
/// <summary>
2727
/// 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
2828
/// </summary>
29-
[JsonProperty("checkpoint_time", NullValueHandling = NullValueHandling.Ignore)]
30-
public string? CheckpointTime { get; set; }
29+
[JsonProperty("checkpoint_time",NullValueHandling = NullValueHandling.Ignore)]
30+
public string? CheckpointTime { get; set; }
3131
/// <summary>
3232
/// Location Location info provided by carrier
3333
/// </summary>
34-
[JsonProperty("location", NullValueHandling = NullValueHandling.Ignore)]
35-
public string? Location { get; set; }
34+
[JsonProperty("location",NullValueHandling = NullValueHandling.Ignore)]
35+
public string? Location { get; set; }
3636
/// <summary>
3737
/// City City info provided by carrier
3838
/// </summary>
39-
[JsonProperty("city", NullValueHandling = NullValueHandling.Ignore)]
40-
public string? City { get; set; }
39+
[JsonProperty("city",NullValueHandling = NullValueHandling.Ignore)]
40+
public string? City { get; set; }
4141
/// <summary>
4242
/// State State info provided by carrier
4343
/// </summary>
44-
[JsonProperty("state", NullValueHandling = NullValueHandling.Ignore)]
45-
public string? State { get; set; }
44+
[JsonProperty("state",NullValueHandling = NullValueHandling.Ignore)]
45+
public string? State { get; set; }
4646
/// <summary>
4747
/// Zip Postal code info provided by carrier
4848
/// </summary>
49-
[JsonProperty("zip", NullValueHandling = NullValueHandling.Ignore)]
50-
public string? Zip { get; set; }
49+
[JsonProperty("zip",NullValueHandling = NullValueHandling.Ignore)]
50+
public string? Zip { get; set; }
5151
/// <summary>
5252
/// Coordinate The latitude and longitude coordinates indicate the precise location of the shipments that are currently in transit.
5353
/// </summary>
54-
[JsonProperty("coordinate", NullValueHandling = NullValueHandling.Ignore)]
55-
public CoordinateCheckpoint? Coordinate { get; set; }
54+
[JsonProperty("coordinate",NullValueHandling = NullValueHandling.Ignore)]
55+
public CoordinateCheckpoint? Coordinate { get; set; }
5656
/// <summary>
5757
/// CountryRegion Country/Region ISO Alpha-3 (three letters) of the checkpoint
5858
/// </summary>
59-
[JsonProperty("country_region", NullValueHandling = NullValueHandling.Ignore)]
60-
public string? CountryRegion { get; set; }
59+
[JsonProperty("country_region",NullValueHandling = NullValueHandling.Ignore)]
60+
public string? CountryRegion { get; set; }
6161
/// <summary>
6262
/// CountryRegionName Country/Region name of the checkpoint, may also contain other location info.
6363
/// </summary>
64-
[JsonProperty("country_region_name", NullValueHandling = NullValueHandling.Ignore)]
65-
public string? CountryRegionName { get; set; }
64+
[JsonProperty("country_region_name",NullValueHandling = NullValueHandling.Ignore)]
65+
public string? CountryRegionName { get; set; }
6666
/// <summary>
6767
/// Message Checkpoint message
6868
/// </summary>
69-
[JsonProperty("message", NullValueHandling = NullValueHandling.Ignore)]
70-
public string? Message { get; set; }
69+
[JsonProperty("message",NullValueHandling = NullValueHandling.Ignore)]
70+
public string? Message { get; set; }
7171
/// <summary>
7272
/// Tag Current status of tracking. (
7373
/// </summary>
74-
[JsonProperty("tag", NullValueHandling = NullValueHandling.Ignore)]
75-
public TagV1? Tag { get; set; }
74+
[JsonProperty("tag",NullValueHandling = NullValueHandling.Ignore)]
75+
public Tag? Tag { get; set; }
7676
/// <summary>
7777
/// Subtag Current subtag of checkpoint. (
7878
/// </summary>
79-
[JsonProperty("subtag", NullValueHandling = NullValueHandling.Ignore)]
80-
public string? Subtag { get; set; }
79+
[JsonProperty("subtag",NullValueHandling = NullValueHandling.Ignore)]
80+
public string? Subtag { get; set; }
8181
/// <summary>
8282
/// SubtagMessage Normalized checkpoint message. (
8383
/// </summary>
84-
[JsonProperty("subtag_message", NullValueHandling = NullValueHandling.Ignore)]
85-
public string? SubtagMessage { get; set; }
84+
[JsonProperty("subtag_message",NullValueHandling = NullValueHandling.Ignore)]
85+
public string? SubtagMessage { get; set; }
8686
/// <summary>
8787
/// RawTag Checkpoint raw status provided by courier
8888
/// </summary>
89-
[JsonProperty("raw_tag", NullValueHandling = NullValueHandling.Ignore)]
90-
public string? RawTag { get; set; }
89+
[JsonProperty("raw_tag",NullValueHandling = NullValueHandling.Ignore)]
90+
public string? RawTag { get; set; }
9191
/// <summary>
9292
/// 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 </span>- The events' value for the same checkpoint message is subject to change as we consistently strive to enhance the performance of this feature.
9393
/// </summary>
94-
[JsonProperty("events", NullValueHandling = NullValueHandling.Ignore)]
95-
public EventsCheckpoint?[] Events { get; set; }
94+
[JsonProperty("events",NullValueHandling = NullValueHandling.Ignore)]
95+
public EventsCheckpoint? [] Events { get; set; }
9696
/// <summary>
9797
/// Source The source of the checkpoint, which can either be from the carrier or when the user marks the tracking as completed.
9898
/// </summary>
99-
[JsonProperty("source", NullValueHandling = NullValueHandling.Ignore)]
100-
public string? Source { get; set; }
99+
[JsonProperty("source",NullValueHandling = NullValueHandling.Ignore)]
100+
public string? Source { get; set; }
101101
public Checkpoint()
102102
{
103103
}
104104
}
105-
105+
106106
/// <summary>
107107
///
108108
/// </summary>
109-
public class CoordinateCheckpoint
109+
public class CoordinateCheckpoint
110110
{
111111
/// <summary>
112112
/// Latitude Represents the latitude.
113113
/// </summary>
114-
[JsonProperty("latitude", NullValueHandling = NullValueHandling.Ignore)]
115-
public double? Latitude { get; set; }
114+
[JsonProperty("latitude",NullValueHandling = NullValueHandling.Ignore)]
115+
public double? Latitude { get; set; }
116116
/// <summary>
117117
/// Longitude Represents the longitude.
118118
/// </summary>
119-
[JsonProperty("longitude", NullValueHandling = NullValueHandling.Ignore)]
120-
public double? Longitude { get; set; }
119+
[JsonProperty("longitude",NullValueHandling = NullValueHandling.Ignore)]
120+
public double? Longitude { get; set; }
121121

122122
public CoordinateCheckpoint()
123123
{
@@ -126,13 +126,13 @@ public CoordinateCheckpoint()
126126
/// <summary>
127127
///
128128
/// </summary>
129-
public class ReasonEventsCheckpoint
129+
public class ReasonEventsCheckpoint
130130
{
131131
/// <summary>
132132
/// Code The code of the reason.
133133
/// </summary>
134-
[JsonProperty("code", NullValueHandling = NullValueHandling.Ignore)]
135-
public string? Code { get; set; }
134+
[JsonProperty("code",NullValueHandling = NullValueHandling.Ignore)]
135+
public string? Code { get; set; }
136136

137137
public ReasonEventsCheckpoint()
138138
{
@@ -141,18 +141,18 @@ public ReasonEventsCheckpoint()
141141
/// <summary>
142142
///
143143
/// </summary>
144-
public class EventsCheckpoint
144+
public class EventsCheckpoint
145145
{
146146
/// <summary>
147147
/// Code Represents the event code.
148148
/// </summary>
149-
[JsonProperty("code", NullValueHandling = NullValueHandling.Ignore)]
150-
public string? Code { get; set; }
149+
[JsonProperty("code",NullValueHandling = NullValueHandling.Ignore)]
150+
public string? Code { get; set; }
151151
/// <summary>
152152
/// Reason Describes the specific reason that led to the event.
153153
/// </summary>
154-
[JsonProperty("reason", NullValueHandling = NullValueHandling.Ignore)]
155-
public ReasonEventsCheckpoint? Reason { get; set; }
154+
[JsonProperty("reason",NullValueHandling = NullValueHandling.Ignore)]
155+
public ReasonEventsCheckpoint? Reason { get; set; }
156156

157157
public EventsCheckpoint()
158158
{

0 commit comments

Comments
 (0)