Most of the code in a warehouse API isn't about doing things. It's about refusing them. A packer taps "Pack" on an order nobody has picked. A scanner on bad Wi-Fi sends the same "ship" twice. Two orders want the last five lamps at the same moment. A buggy handheld sends {} where a quantity should be.
Each of those requests needs a clear "no", with the right status code and enough detail that the client knows what to do next. Get the codes wrong and your support team spends the afternoon decoding "500 Internal Server Error" from a warehouse floor.
I built a small pick-pack-ship order API on .NET 10 Minimal APIs and EF Core 10 (SQLite) to work through this. It has 55 passing tests (43 unit, 12 integration) and I poked it by hand with curl. This post is about one slice of it: the six requests it refuses, what it answers with, and the one request it deliberately does not refuse. Code is trimmed to the shape; omitted parts are marked.
Tech Skill Builder is $5/month for a very limited time only (normally $10).…