Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- `ApiKey.Delete`
- `ApiKey.Enable`
- `ApiKey.Disable`
- Adds `Tracker.Delete` function

## v7.4.0 (2025-11-24)

Expand Down
15 changes: 15 additions & 0 deletions EasyPost.Tests/ServicesTests/TrackerServiceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,21 @@ public async Task TestRetrieve()
Assert.Equal(tracker.Id, retrievedTracker.Id);
}

[Fact]
[CrudOperations.Delete]
[Testing.Function]
public async Task TestDelete()
{
UseVCR("delete");

Tracker tracker = await Client.Tracker.Create(Fixtures.Usps, "EZ1000000001");

await Client.Tracker.Delete(tracker.Id);

// Deleting a Tracker does not return anything, so we can't test the response
Assert.True(true);
Comment on lines +159 to +162
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could assert that an exception was not raised.

}

#endregion

#endregion
Expand Down
98 changes: 98 additions & 0 deletions EasyPost.Tests/cassettes/net/tracker_service/delete.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions EasyPost/Services/TrackerService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,16 @@ public async Task<TrackerCollection> RetrieveBatch(Parameters.Tracker.Batch para
return collection;
}

/// <summary>
/// Delete a <see cref="Tracker"/>.
/// <a href="https://docs.easypost.com/docs/trackers#delete-a-tracker">Related API documentation</a>.
/// </summary>
/// <param name="id">The ID of the <see cref="Tracker"/> to delete.</param>
/// <param name="cancellationToken"><see cref="CancellationToken"/> to use for the HTTP request.</param>
/// <returns>None.</returns>
[CrudOperations.Delete]
public async Task Delete(string id, CancellationToken cancellationToken = default) => await RequestAsync(Method.Delete, $"trackers/{id}", cancellationToken);

#endregion
}
}
Loading