Breaking Changes - AfterShip Tracking .NET SDK v14.0.0
1. Response Structure Complete Refactor
Major Change: All response classes now have a wrapper structure with ResponseHeader and Data properties instead of directly containing response data.
// v13 - Direct access to response properties
var response = client.Tracking.CreateTracking(request);
string id = response.Id;
string trackingNumber = response.TrackingNumber;
// v14 - Must access through Data property
var response = client.Tracking.CreateTracking(request);
string id = response.Data.Id;
string trackingNumber = response.Data.TrackingNumber;
var headers = response.ResponseHeader; // New: Access to HTTP response headersApplies to all API responses: CreateTracking, GetTrackingById, GetTrackings, UpdateTrackingById, GetCouriers, etc.
2. Model Name Changes - Prefix Naming Convention
Most nested model classes changed from suffix naming to prefix naming:
// v13 - Suffix naming
CourierEstimatedDeliveryDateTracking
ShipmentWeightTracking
AftershipEstimatedDeliveryDateTracking
CarbonEmissionsTracking
CustomEstimatedDeliveryDateTracking
FirstEstimatedDeliveryTracking
LatestEstimatedDeliveryTracking
FirstMileTracking
LastMileTracking
CustomersTracking
// v14 - Prefix naming
TrackingCourierEstimatedDeliveryDate
TrackingShipmentWeight
TrackingAftershipEstimatedDeliveryDate
TrackingCarbonEmissions
TrackingCustomEstimatedDeliveryDate
TrackingFirstEstimatedDelivery
TrackingLatestEstimatedDelivery
TrackingFirstMile
TrackingLastMile
TrackingCustomers3. Enum Member Name Changes
Tag enum member names changed to PascalCase:
| v13 | v14 |
|---|---|
Tag.Inforeceived |
Tag.InfoReceived |
Tag.Intransit |
Tag.InTransit |
Tag.Outfordelivery |
Tag.OutForDelivery |
Tag.Attemptfail |
Tag.AttemptFail |
Tag.Availableforpickup |
Tag.AvailableForPickup |
4. String to Enum Changes
Several string fields have been changed to enums (following API documentation):
Request Models (Input)
// 1. CreateTrackingRequest.DeliveryType
// v13
var request = new CreateTrackingRequest();
request.DeliveryType = "pickup_at_store";
// v14
var request = new CreateTrackingRequest();
request.DeliveryType = CreateTrackingRequestDeliveryType.PickupAtStore;
// 2. UpdateTrackingByIdRequest.DeliveryType
// v13
updateRequest.DeliveryType = "door_to_door";
// v14
updateRequest.DeliveryType = UpdateTrackingByIdRequestDeliveryType.DoorToDoor;
// 3. MarkTrackingCompletedByIdRequest.Reason
// v13
markRequest.Reason = "DELIVERED";
// v14
markRequest.Reason = MarkTrackingCompletedByIdRequestReason.Delivered;Response Models (Output)
// 4. Tracking.SignatureRequirement
// v13
string signature = tracking.SignatureRequirement;
// v14
TrackingSignatureRequirement? signature = tracking.SignatureRequirement;