Shopify / shopify-api-ruby

ShopifyAPI is a lightweight gem for accessing the Shopify admin REST and GraphQL web services.
MIT License
1.06k stars 472 forks source link

The fulfillment order's assigned fulfillment service must be of api type #932

Closed achadee closed 2 years ago

achadee commented 2 years ago

Issue summary

Im getting this error when trying to close a fulfilment order on version 10

ShopifyAPI::Errors::HttpResponseError (The fulfillment order's assigned fulfillment service must be of api type)

my request:

fulfillment.close(message: "completed!")

The Fulfillment Order

#<ShopifyAPI::FulfillmentOrder:0x0000555aa0ad2d20
 @assigned_location=
  {"address1"=>"2 Plummer Rd. Mentone",
   "address2"=>"",
   "city"=>"Melbourne",
   "country_code"=>"AU",
   "location_id"=>68435738845,
   "name"=>"Melbourne",
   "phone"=>"",
   "province"=>"Victoria",
   "zip"=>"3194"},
 @assigned_location_id=68435738845,
 @client=
  #<ShopifyAPI::Clients::Rest::Admin:0x0000555aa0ae0380
   @base_uri="https://colab-pantry-dev-3.myshopify.com",
   @base_uri_and_path=
    "https://colab-pantry-dev-3.myshopify.com/admin/api/2022-04",
   @headers=
    {:"User-Agent"=>"Shopify API Library v10.0.0 | Ruby 2.6.9",
     :Accept=>"application/json",
     "X-Shopify-Access-Token"=>"shpat_****"}>,
 @custom_prefix=nil,
 @delivery_method={:method_type=>"shipping"},
 @destination=nil,
 @errors=#<ShopifyAPI::Rest::BaseErrors:0x0000555aa0afd818 @errors=[]>,
 @forced_nils=
  {"id"=>false,
   "destination"=>true,
   "assigned_location_id"=>false,
   "order_id"=>false,
   "assigned_location"=>false,
   "fulfill_at"=>true,
   "fulfillment_holds"=>false,
   "international_duties"=>true,
   "merchant_requests"=>false,
   "request_status"=>false,
   "shop_id"=>false,
   "line_items"=>false,
   "supported_actions"=>false,
   "status"=>false,
   "delivery_method"=>false},
 @fulfill_at=nil,
 @fulfillment_holds=[],
 @id=5805062521053,
 @international_duties=nil,
 @line_items=
  [{"id"=>12407415505117,
    "shop_id"=>63847629021,
    "fulfillment_order_id"=>5805062521053,
    "quantity"=>1,
    "line_item_id"=>12176395141341,
    "inventory_item_id"=>44712390656221,
    "fulfillable_quantity"=>1,
    "variant_id"=>42618887438557}],
 @merchant_requests=[],
 @order_id=4751141765341,
 @original_state=
  {:id=>5805062521053,
   :destination=>nil,
   :assigned_location_id=>68435738845,
   :order_id=>4751141765341,
   :assigned_location=>
    {"address1"=>"2 Plummer Rd. Mentone",
     "address2"=>"",
     "city"=>"Melbourne",
     "country_code"=>"AU",
     "location_id"=>68435738845,
     "name"=>"Melbourne",
     "phone"=>"",
     "province"=>"Victoria",
     "zip"=>"3194"},
   :fulfill_at=>nil,
   :fulfillment_holds=>[],
   :international_duties=>nil,
   :merchant_requests=>[],
   :request_status=>"unsubmitted",
   :shop_id=>63847629021,
   :line_items=>
    [{"id"=>12407415505117,
      "shop_id"=>63847629021,
      "fulfillment_order_id"=>5805062521053,
      "quantity"=>1,
      "line_item_id"=>12176395141341,
      "inventory_item_id"=>44712390656221,
      "fulfillable_quantity"=>1,
      "variant_id"=>42618887438557}],
   :supported_actions=>["create_fulfillment", "move", "hold"],
   :status=>"open",
   :delivery_method=>nil},
 @request_status="unsubmitted",
 @session=
  #<ShopifyAPI::Auth::Session:0x0000555aa00daa98
   @access_token="shpat_*****",
   @associated_user=nil,
   @associated_user_scope=nil,
   @expires=nil,
   @id="a4241fb1-5e4c-4be3-a008-fdeb598a7cc0",
   @is_online=false,
   @scope=
    #<ShopifyAPI::Auth::AuthScopes:0x0000555aa00da2a0
     @compressed_scopes=
      #<Set: {"read_analytics",
       "write_assigned_fulfillment_orders",
       "write_customers",
       "write_discounts",
       "write_draft_orders",
       "write_files",
       "write_fulfillments",
       "read_gdpr_data_request",
       "write_gift_cards",
       "write_inventory",
       "write_legal_policies",
       "read_locations",
       "write_marketing_events",
       "write_merchant_managed_fulfillment_orders",
       "read_online_store_navigation",
       "write_online_store_pages",
       "write_order_edits",
       "write_orders",
       "write_payment_terms",
       "write_price_rules",
       "write_product_listings",
       "write_products",
       "write_reports",
       "write_resource_feedbacks",
       "write_script_tags",
       "write_shipping",
       "write_locales",
       "write_markets",
       "read_shopify_payments_accounts",
       "read_shopify_payments_bank_accounts",
       "read_shopify_payments_disputes",
       "read_shopify_payments_payouts",
       "write_content",
       "write_themes",
       "write_third_party_fulfillment_orders",
       "write_translations"}>,
     @expanded_scopes=
      #<Set: {"read_analytics",
       "write_assigned_fulfillment_orders",
       "write_customers",
       "write_discounts",
       "write_draft_orders",
       "write_files",
       "write_fulfillments",
       "read_gdpr_data_request",
       "write_gift_cards",
       "write_inventory",
       "write_legal_policies",
       "read_locations",
       "write_marketing_events",
       "write_merchant_managed_fulfillment_orders",
       "read_online_store_navigation",
       "write_online_store_pages",
       "write_order_edits",
       "write_orders",
       "write_payment_terms",
       "write_price_rules",
       "write_product_listings",
       "write_products",
       "write_reports",
       "write_resource_feedbacks",
       "write_script_tags",
       "write_shipping",
       "write_locales",
       "write_markets",
       "read_shopify_payments_accounts",
       "read_shopify_payments_bank_accounts",
       "read_shopify_payments_disputes",
       "read_shopify_payments_payouts",
       "write_content",
       "write_themes",
       "write_third_party_fulfillment_orders",
       "write_translations",
       "read_assigned_fulfillment_orders",
       "read_customers",
       "read_discounts",
       "read_draft_orders",
       "read_files",
       "read_fulfillments",
       "read_gift_cards",
       "read_inventory",
       "read_legal_policies",
       "read_marketing_events",
       "read_merchant_managed_fulfillment_orders",
       "read_online_store_pages",
       "read_order_edits",
       "read_orders",
       "read_payment_terms",
       "read_price_rules",
       "read_product_listings",
       "read_products",
       "read_reports",
       "read_resource_feedbacks",
       "read_script_tags",
       "read_shipping",
       "read_locales",
       "read_markets",
       "read_content",
       "read_themes",
       "read_third_party_fulfillment_orders",
       "read_translations"}>>,
   @shop="colab-pantry-dev-3.myshopify.com",
   @shopify_session_id=nil,
   @state=nil>,
 @shop_id=63847629021,
 @status="closed",
 @supported_actions=["create_fulfillment", "move", "hold"]>

Expected behavior

Expect the Fulfilment order to close

Actual behavior

What actually happens?

ShopifyAPI::Errors::HttpResponseError (The fulfillment order's assigned fulfillment service must be of api type)
If you report this error, please include this id: 8692d482-521f-42cd-8074-b689520c981b.

Specifications

Christianlauw123 commented 2 years ago

up, same issue here

github-actions[bot] commented 2 years ago

This issue is stale because it has been open for 90 days with no activity. It will be closed if no further action occurs in 14 days.

github-actions[bot] commented 2 years ago

We are closing this issue because it has been inactive for a few months. This probably means that it is not reproducible or it has been fixed in a newer version. If it’s an enhancement and hasn’t been taken on since it was submitted, then it seems other issues have taken priority.

If you still encounter this issue with the latest stable version, please reopen using the issue template. You can also contribute directly by submitting a pull request– see the CONTRIBUTING.md file for guidelines

Thank you!