Unable to fulfill the order: Request failed with status code 422

AndreMendes
Visitor
1 0 0

We have this upsell app that adds a line item to a current order and it is giving me issues when i try to fulfill the order using the api.

 

What is the problem here? is the plugin that is adding the line item incorrectly or it is the fulfill payload?

 

This is the order line items with the additional item added from the upsell app.

 

"line_items": [
            {
                "id": 9795885039766,
                "admin_graphql_api_id": "gid://shopify/LineItem/9795885039766",
                "fulfillable_quantity": 1,
                "fulfillment_service": "manual",
                "fulfillment_status": null,
                "gift_card": false,
                "grams": 91,
                "name": "Protect + Defend",
                "origin_location": {
                    "id": 2816542081174,
                    "country_code": "US",
                    "province_code": "FL",
                    "name": "Spore Life Sciences",
                    "address1": "Somewhere",
                    "address2": "",
                    "city": "Doral",
                    "zip": "123"
                },
                "price": "44.96",
                "price_set": {
                    "shop_money": {
                        "amount": "44.96",
                        "currency_code": "USD"
                    },
                    "presentment_money": {
                        "amount": "44.96",
                        "currency_code": "USD"
                    }
                },
                "product_exists": true,
                "product_id": 5676910280854,
                "properties": [],
                "quantity": 1,
                "requires_shipping": true,
                "sku": "5A-PROTECT",
                "taxable": true,
                "title": "Protect + Defend",
                "total_discount": "0.00",
                "total_discount_set": {
                    "shop_money": {
                        "amount": "0.00",
                        "currency_code": "USD"
                    },
                    "presentment_money": {
                        "amount": "0.00",
                        "currency_code": "USD"
                    }
                },
                "variant_id": 36096894238870,
                "variant_inventory_management": "shopify",
                "variant_title": "",
                "vendor": "Spore Life",
                "tax_lines": [],
                "duties": [],
                "discount_allocations": []
            },
            {
                "id": 9795888185494,
                "admin_graphql_api_id": "gid://shopify/LineItem/9795888185494",
                "fulfillable_quantity": 1,
                "fulfillment_service": "manual",
                "fulfillment_status": null,
                "gift_card": false,
                "grams": 0,
                "name": "Ultimate Wellness Bundle",
                "price": "199.80",
                "price_set": {
                    "shop_money": {
                        "amount": "199.80",
                        "currency_code": "USD"
                    },
                    "presentment_money": {
                        "amount": "199.80",
                        "currency_code": "USD"
                    }
                },
                "product_exists": true,
                "product_id": 6166999203990,
                "properties": [],
                "quantity": 1,
                "requires_shipping": true,
                "sku": "1234",
                "taxable": true,
                "title": "Ultimate Wellness Bundle",
                "total_discount": "149.80",
                "total_discount_set": {
                    "shop_money": {
                        "amount": "149.80",
                        "currency_code": "USD"
                    },
                    "presentment_money": {
                        "amount": "149.80",
                        "currency_code": "USD"
                    }
                },
                "variant_id": 37834798104726,
                "variant_inventory_management": "shopify",
                "variant_title": null,
                "vendor": "Spore Life Sciences",
                "tax_lines": [],
                "duties": [],
                "discount_allocations": [
                    {
                        "amount": "149.80",
                        "amount_set": {
                            "shop_money": {
                                "amount": "149.80",
                                "currency_code": "USD"
                            },
                            "presentment_money": {
                                "amount": "149.80",
                                "currency_code": "USD"
                            }
                        },
                        "discount_application_index": 0
                    }
                ]
            }
        ],

 

 

 

This is the fulfill payload

 

{
  "fulfillment": {
    "location_id": 1234455667,
    "tracking_urls": [
      "https://tools.usps.com/go/TrackConfirmAction?tLabels=xxxxxxxxxxxxxxxxxxx"
    ],
    "tracking_numbers": ["xxxxxxxxxxxxxxxxxxx"],
    "line_items": [
      { "id": 9795885039766, "quantity": 1 },
      { "id": 9795888185494, "quantity": 1 }
    ]
  }
}

 

 

Shopify response:

 

Error: Request failed with status code 422

 

 

Replies 0 (0)