Marking an fulfillment order as fulfilled - C# example

As of today (4/18/2026), as a result of getting my new store app setup which handles order fulfillments (shipping), I was doing full-cycle testing and ran into issues with my job that updates the fulfillment order to “fulfilled”. It wasnt returning errors, but it wasnt marking the order as fulfilled either. Once I got it working (see example below), the order was marked fulfilled.

So, I also have a webhook and this is what receives the order and marks it has accepted (after validation etc). Later, after the order has shipped there is a job that uses a graphql mutation to update the order to “fulfilled”. Below is just the part that sets up this mutation, now that I have it working - I thought I would share.

string mutation = @"
mutation fulfillmentCreate($fulfillment: FulfillmentInput!, $message: String) {
fulfillmentCreate(fulfillment: $fulfillment, message: $message) {
fulfillment {
id
status
}
userErrors {
field
message
}
}
}";

var fulfillment = new Dictionary<string, object>
{
[“lineItemsByFulfillmentOrder”] = new

{
new Dictionary<string, object>
{
[“fulfillmentOrderId”] =
$“gid://shopify/FulfillmentOrder/{fulfillment_order_id}”
}
},
[“notifyCustomer”] = true
};

if (!string.IsNullOrWhiteSpace(tracking_number))
{
fulfillment[“trackingInfo”] = new
{
number = tracking_number,
company = carrier_name // carrier ONLY
};
}
string message = $“Shipped via {carrier_name} – a simple notes here that shows in the order notes but not to customer…”;
var payload = new
{
query = mutation,
variables = new
{
fulfillment,
message
}
};

Maybe I should do a complete example, using my stack ? - C# with .NET Azure functions.