Admin API issue on fulfillment orders.

Highlighted
Tourist
7 1 0

I´m trying fulfill all line items for an order. (not specifying line item IDs causes all unfulfilled and partially fulfilled line items for the order to be fulfilled).

POST /admin/api/#{api_version}/orders/#{order_id}/fulfillments.json
{
  "fulfillment": {
    "location_id": mylocationid,
    "notify_customer": false
  }
}

 

works fine for a "normal" order, but ... ¿maybe not if the order has a product affected by a custom shipping rates?

the api give me the next error:

 

{"base":["An error occurred, please try again"]}


Notes:
- Shopify is not showing the fulfillment in the same card.
- We don't have a shipping zone with the alias "envío".
- Same issue in dif. api versions.

- You can fulfill the items one by one.

Order example from storeOrder example from store

¿It´s normal?

0 Likes
Highlighted
Shopify Staff (Retired)
Shopify Staff (Retired)
624 103 124

Hi @ChristianLopez ,

 

From the screenshot you provided, it appears to me that the reason why you are running into an error here is because these two products (The skirt and the jeans) are coming from different inventory/warehouse locations.

 

Shopify will always try to ship products in an order from the same inventory location whenever possible, but in cases where it cannot do this (e.g. product is out of stock in one location, or product is not stocked in that location) the products in the order will have to be fulfilled from the different locations. In this case you need to create multiple fulfillments for the one order in order to fulfill all the products. What is confusing about your particular issue is that your store's two locations are both named "Warehouse" but they must be set up as two different locations with two different locations_ids (please correct me if I am wrong here).

 

To solve your error, as mentioned above, you need to create multiple fulfillments for this one order (one fulfillment for each 'Warehouse' location ID)

Fulfillment 1 - POST /admin/api/#{api_version}/orders/#{order_id}/fulfillments.json

{
  "fulfillment": {
    "location_id": {location_id of first Warehouse}
    "line_items": [
      {
        "id": {line_item_id of Skirt}
      }
    ]
  }
}

Fulfillment 2 - POST /admin/api/#{api_version}/orders/#{order_id}/fulfillments.json

{
  "fulfillment": {
    "location_id": {location_id of second Warehouse}
    "line_items": [
      {
        "id": {line_item_id of Jeans}
      }
    ]
  }
}

Another alternative solution is to use the new Shopify resource of FulfillmentOrders to fulfill this order. This is a new resource that was introduced into our REST and GraphQL Admin API in version 2020-01, and make fulfilling an order from multiple inventory locations a lot easier (https://shopify.dev/tutorials/manage-fulfillments-with-fulfillment-and-fulfillmentorder-resources)

 

Let me know if this works for you. If it does not, or if you are sure that you only have one "Warehouse" location with one location ID, then could you please send me the value of the X-Request-ID response header from the Shopify API error response?

Hassain | Developer Support Specialist @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes
Highlighted
Tourist
7 1 0

hi @hassain 

Thanks for your time, my hack-solution is "fulfill" one by one, but i think that is a issue in the orders, maybe affected by "custom shipping", you can see here the fulfillments for the order, the same location_id.

 

...
fulfillments: [ { "id": 2154794647637, "order_id": 2278545653845, "status": "success", "created_at": "2020-04-27T09:38:39+02:00", "service": "manual", "updated_at": "2020-04-27T09:38:39+02:00", "tracking_company": null, "shipment_status": null, "location_id": 10130952, "line_items": [], "tracking_number": null, "tracking_numbers": [], "tracking_url": null, "tracking_urls": [], "receipt": {}, "name": "#R56335.1" }, { "id": 2154794680405, "order_id": 2278545653845, "status": "success", "created_at": "2020-04-27T09:38:39+02:00", "service": "manual", "updated_at": "2020-04-27T09:38:39+02:00", "tracking_company": null, "shipment_status": null, "location_id": 10130952, "line_items": [], "tracking_number": null, "tracking_numbers": [], "tracking_url": null, "tracking_urls": [], "receipt": {}, "name": "#R56335.2" } ]}...


Related to the "Warehouse" location:

1. We don`t have any location with the same alias in our Shopy.

2. The default location is Warehouse.
3. Only the location Warehouse has the option "Fulfill online orders from this location" enabled.
4. The next screenshot is the result in our fulfillment priority, we only have the "Warehouse".

 

Captura de pantalla 2020-04-27 a las 22.28.48.png

 

I have the same issue in more orders, a example with the order json object, the same "origin_location" for both fulfillments.

Captura de pantalla 2020-04-27 a las 22.35.06.png

 

{
   "order": {
      "id": 2290602246229, ...
"line_items": [ { "id": 4993501134933, "variant_id": 22838890594389, "title": "CAZADORA VAQUERA · NEGRO", "quantity": 1, "sku": "BDF-CAZ-NEG-4", "variant_title": "L / denim-negro", "vendor": "", "fulfillment_service": "manual", "product_id": 2636531826773, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "CAZADORA VAQUERA · NEGRO - L / denim-negro", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "69.95", "total_discount": "0.00", "fulfillment_status": null, "price_set": { ... }, "total_discount_set": { ... }, "discount_allocations": [], "tax_lines": [ { "title": "VAT", "price": "12.14", "rate": 0.21, "price_set": { "shop_money": { "amount": "12.14", "currency_code": "EUR" }, "presentment_money": { "amount": "12.14", "currency_code": "EUR" } } } ], "origin_location": { "id": 580677042229, "country_code": "ES", "province_code": "V", "name": "Equal", ... }, "destination_location": { "id": 2005073821781, "country_code": "ES", "province_code": "B", "name": "Equal", ... } }, { "id": 4993501167701, "variant_id": 30595642982485, "title": "JERSEY CELI · CRUDO Y BURDEOS", "quantity": 1, "sku": "S0049-CRU-2", "variant_title": "M / canalé-rayas-crudo-burdeos", "vendor": "", "fulfillment_service": "manual", "product_id": 4253226860629, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "JERSEY CELI · CRUDO Y BURDEOS - M / canalé-rayas-crudo-burdeos", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "39.95", "total_discount": "0.00", "fulfillment_status": null, "price_set": { ... }, "total_discount_set": { ... }, "discount_allocations": [], "tax_lines": [ { "title": "VAT", "price": "6.93", "rate": 0.21, "price_set": { "shop_money": { "amount": "6.93", "currency_code": "EUR" }, "presentment_money": { "amount": "6.93", "currency_code": "EUR" } } } ], "origin_location": { "id": 580677042229, "country_code": "ES", "province_code": "V", "name": "Equal", ... }, "destination_location": { "id": 2005073821781, "country_code": "ES", "province_code": "B", "name": "Equal", ... } } ], "fulfillments": [], "refunds": [], "total_tip_received": "0.0", "shipping_lines": [ { "id": 1878393192533, "title": "Envío", "price": "3.95", "code": "Envío", "source": "shopify", "phone": null, "requested_fulfillment_service_id": null, "delivery_category": null, "carrier_identifier": null, "discounted_price": "3.95", "price_set": { "shop_money": { "amount": "3.95", "currency_code": "EUR" }, "presentment_money": { "amount": "3.95", "currency_code": "EUR" } }, "discounted_price_set": { "shop_money": { "amount": "3.95", "currency_code": "EUR" }, "presentment_money": { "amount": "3.95", "currency_code": "EUR" } }, "discount_allocations": [], "tax_lines": [] } ] } }

 

 

0 Likes
Highlighted
Shopify Staff (Retired)
Shopify Staff (Retired)
624 103 124

Hi @ChristianLopez ,

 

Thank you for the extra context and information. Based on what you provided, it does look like there is only one "Warehouse" location with one location ID. So disregard my above comment, it does not apply.

 

It seems like the "custom shipping rates" you are setting is forcing these two items to have to be fulfilled separately. If you would like me to investigate further, could you let me know what your store's myshopify.com URL is? (feel free to DM me this information if you do not feel comfortable posting it on this thread here)

Hassain | Developer Support Specialist @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

1 Like