Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

188
Views
422 Error Creating a Fulfillment using Shopify API

I am receiving a 422 error from the Shopify API. I've created a simplified version of the Javascript that I am using:

let response = await axios.get((`${ shopify_url }/admin/api/2022-04/orders/${ order_id }/fulfillment_orders.json`), shopify_config)

let fulfillment = {
  fulfillment: {
    message: fulfillment_notify_customer,
    notify_customer: fulfillment_notify_customer,
    tracking_info: null,
    line_items_by_fulfillment_order: [{
      fulfillment_order_id: response.data.fulfillment_orders[0].id,
      fulfillment_order_line_items: [{
        id: line_item_id,
        quantity: line_item_qty
      }]
    }]
  }
};

response = await axios.post((`${ shopify_url }/admin/api/2022-04/fulfillments.json`), fulfillment, shopify_config);

The response is: (422) ERR_BAD_REQUEST

I have confirmed all the values although I believe this error is solely related to syntax/structure of the object, rather than ID values.

As an FYI: I know this is ugky code. My actual code has error-checking, logging, and is promise-based (not using async/await).

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!