Hello Shopify Community,
I am trying to create fulfillment orders via the Shopify API using the ShopifySharp library in my .NET application, but I am encountering some issues. Specifically, I am trying to generate a fulfillment order for an existing order, ensuring that the items are correctly assigned to the right fulfillment location.
Here are the steps I am following:
- I am using the ShopifySharp library to interact with the Shopify API.
- I am creating a
Order
object, which includes the order ID, location ID, and line items. - I am making a POST request to create the order for the specified items.
- Order is created and item numbers are correct.
However, I keep running into errors, and I’m not sure where the issue lies. My main concern is:
- Ensuring that the
OrderId
andAssignedLocationId
are correctly set. - Properly assigning line items and specifying their quantities for the fulfillment order.
- The products are not reserved, nor deducted when order is fulfilled.
- Should I create the order first, then make a fulfillment request?
- Can someone help me create the order and ‘reserve’ the line items in the correct location?
- Could it be because I do it in a playground store?
Has anyone worked with the ShopifySharp library to create fulfillment orders? Any help would be greatly appreciated!
I’ve included a snippet of my request below for reference.
Thank you in advance!
{
"AppId": null,
"BillingAddress": {
"Address1": "ADDRESS 1",
"Address2": null,
"City": "Aarhus",
"Company": null,
"Country": null,
"CountryCode": "DK",
"CountryName": null,
"Default": null,
"FirstName": "Mathias",
"LastName": "Growfunnels Test",
"Latitude": null,
"Longitude": null,
"Name": null,
"Phone": null,
"Province": null,
"ProvinceCode": null,
"Zip": "8210",
"Id": null,
"AdminGraphQLAPIId": null
},
"BrowserIp": null,
"BuyerAcceptsMarketing": null,
"CancelReason": null,
"CancelledAt": null,
"CartToken": null,
"CheckoutToken": null,
"CheckoutId": null,
"ClientDetails": null,
"ClosedAt": null,
"Confirmed": null,
"CreatedAt": "2025-03-09T20:37:44.4371613+01:00",
"Currency": "DKK",
"Customer": {
"Addresses": null,
"CreatedAt": null,
"Currency": null,
"DefaultAddress": null,
"Email": null,
"FirstName": "Mathias",
"MultipassIdentifier": null,
"LastName": "Growfunnels Test",
"LastOrderId": null,
"LastOrderName": null,
"Note": null,
"OrdersCount": null,
"Phone": null,
"State": null,
"Tags": null,
"TaxExempt": null,
"TaxExemptions": null,
"TotalSpent": null,
"UpdatedAt": null,
"VerifiedEmail": null,
"SmsMarketingConsent": null,
"Metafields": null,
"EmailMarketingConsent": null,
"Id": null,
"AdminGraphQLAPIId": null
},
"CustomerLocale": null,
"DeviceId": null,
"DiscountCodes": null,
"DiscountApplications": null,
"Email": "[test@test.dk](mailto:test@test.dk)",
"FinancialStatus": "paid",
"Fulfillments": null,
"FulfillmentStatus": "unfulfilled",
"Phone": "+4531180237",
"Tags": "MagicFunnel",
"LandingSite": null,
"LineItems": [
{
"FulfillableQuantity": 1,
"FulfillmentService": "manual",
"FulfillmentStatus": "null",
"Grams": null,
"Price": 2000,
"ProductId": 8957213999384,
"Quantity": 1,
"RequiresShipping": true,
"SKU": "1526TH",
"Title": "Door handle w/ rattan - Natural, black",
"VariantId": 47689227698456,
"VariantTitle": null,
"Name": null,
"Vendor": null,
"GiftCard": null,
"Taxable": true,
"TaxLines": [
{
"ChannelLiable": null,
"Price": 400,
"Rate": 0.25,
"RatePercentage": null,
"Source": null,
"Title": "Moms",
"PriceSet": null
}
],
"TipPaymentGateway": null,
"TipPaymentMethod": null,
"TipPaymentGatewaySpecified": false,
"TotalDiscount": null,
"TotalDiscountSet": null,
"DiscountAllocations": null,
"Properties": null,
"VariantInventoryManagement": "shopify",
"ProductExists": null,
"PriceSet": null,
"PreTaxPrice": null,
"PreTaxPriceSet": null,
"Duties": null,
"FulfillmentLineItemId": null,
"AttributedStaffs": null,
"Id": null,
"AdminGraphQLAPIId": null
},
{
"FulfillableQuantity": 1,
"FulfillmentService": "manual",
"FulfillmentStatus": "null",
"Grams": null,
"Price": 398,
"ProductId": 8957214949656,
"Quantity": 1,
"RequiresShipping": true,
"SKU": "16573AB",
"Title": "Cutlery holder - Ant.brass, natural",
"VariantId": 47689230123288,
"VariantTitle": null,
"Name": null,
"Vendor": null,
"GiftCard": null,
"Taxable": true,
"TaxLines": [
{
"ChannelLiable": null,
"Price": 79.6,
"Rate": 0.25,
"RatePercentage": null,
"Source": null,
"Title": "Moms",
"PriceSet": null
}
],
"TipPaymentGateway": null,
"TipPaymentMethod": null,
"TipPaymentGatewaySpecified": false,
"TotalDiscount": null,
"TotalDiscountSet": null,
"DiscountAllocations": null,
"Properties": null,
"VariantInventoryManagement": "shopify",
"ProductExists": null,
"PriceSet": null,
"PreTaxPrice": null,
"PreTaxPriceSet": null,
"Duties": null,
"FulfillmentLineItemId": null,
"AttributedStaffs": null,
"Id": null,
"AdminGraphQLAPIId": null
}
],
"LocationId": 95094538520,
"Name": null,
"Note": null,
"NoteAttributes": null,
"Number": null,
"OrderNumber": null,
"OrderStatusUrl": null,
"PaymentGatewayNames": null,
"ProcessedAt": null,
"ReferringSite": null,
"Refunds": null,
"ShippingAddress": {
"Address1": "Tamperdalsvej 11",
"Address2": null,
"City": "Aarhus",
"Company": null,
"Country": null,
"CountryCode": "DK",
"CountryName": null,
"Default": null,
"FirstName": "Mathias",
"LastName": "Growfunnels Test",
"Latitude": null,
"Longitude": null,
"Name": null,
"Phone": null,
"Province": null,
"ProvinceCode": null,
"Zip": "8210",
"Id": null,
"AdminGraphQLAPIId": null
},
"ShippingLines": [
{
"CarrierIdentifier": null,
"Code": "Gratis hjemmelevering",
"IsRemoved": null,
"Phone": null,
"Price": 0,
"DiscountedPrice": null,
"DiscountAllocations": null,
"Source": "shopify",
"Title": "Gratis hjemmelevering",
"TaxLines": null,
"PriceSet": null,
"DiscountedPriceSet": null,
"Id": null,
"AdminGraphQLAPIId": null
}
],
"SourceIdentifier": null,
"SourceName": null,
"SubtotalPrice": null,
"TaxLines": null,
"TaxesIncluded": true,
"Test": null,
"Token": null,
"TotalDiscounts": null,
"TotalLineItemsPrice": null,
"TotalTipReceived": null,
"TotalPrice": null,
"TotalTax": 479.6,
"TotalWeight": null,
"UpdatedAt": "2025-03-09T20:37:44.4372171+01:00",
"UserId": null,
"Transactions": [
{
"Amount": 2398,
"Authorization": null,
"AuthorizationExpiresAt": null,
"CreatedAt": null,
"DeviceId": null,
"Gateway": "stripe",
"SourceName": null,
"Source": null,
"PaymentDetails": null,
"Kind": "capture",
"OrderId": null,
"Receipt": null,
"ErrorCode": null,
"Status": "success",
"Test": null,
"UserId": null,
"Currency": "DKK",
"Message": null,
"LocationId": null,
"ParentId": null,
"ProcessedAt": null,
"MaximumRefundable": null,
"CurrencyExchangeAdjustment": null,
"PaymentsRefundAttributes": null,
"PaymentId": null,
"TotalUnsettledSet": null,
"AdjustmentReason": null,
"Id": null,
"AdminGraphQLAPIId": null
}
],
"Metafields": null,
"CurrentTotalDutiesSet": null,
"OriginalTotalDutiesSet": null,
"PresentmentCurrency": null,
"TotalLineItemsPriceSet": null,
"TotalDiscountsSet": null,
"TotalShippingPriceSet": null,
"SubtotalPriceSet": null,
"TotalPriceSet": null,
"TotalOutstanding": null,
"TotalTaxSet": null,
"EstimatedTaxes": null,
"CurrentSubtotalPrice": null,
"CurrentSubtotalPriceSet": null,
"CurrentTotalDiscounts": null,
"CurrentTotalDiscountsSet": null,
"CurrentTotalPrice": null,
"CurrentTotalPriceSet": null,
"CurrentTotalTax": null,
"CurrentTotalTaxSet": null,
"PaymentTerms": null,
"CurrentTotalAdditionalFeesSet": null,
"OriginalTotalAdditionalFeesSet": null,
"PoNumber": null,
"TaxExempt": null,
"Company": null,
"Id": null,
"AdminGraphQLAPIId": null
}
/Mathias