Error: Line item '{product_name}' is already fulfilled

vertex
Shopify Partner
4 0 1

Hey,  I'm making a fulfillment application, and I'm running into a strange error in a particular store.  In other test stores, this call works completely fine, but in this one, I get a strange error indicating that the product is already in the fufilemnt process.  I'm not sure at all how to debug this.  Thanks for your help!!!

POST: https://{shop}.myshopify.com/admin/orders/{order_id}/fulfillments.json
DATA: { 
  fulfillment:
    { 
       tracking_url: 'https://{shop}.myshopify.com/tools/rentals/{GUID}/';,
       tracking_company: '{string}',
       notify_customer: false,
       status: 'success',
       tracking_numbers: [ '{guid2}' ],
       line_items: [ { id: {product_id}, status: 'success' } ]
    } 

MORE: { headers: { 'X-Shopify-Access-Token': ["{access_token}"] }

RESPONSE: { errors: { base: [ 'Line item \'{product_name}\' is already fulfilled' ] } }

Here's the final order object

{
  order: {
  ...
  fulfillment_status: null,
  ...
  line_items: [
    {
      fulfillment_service: "{app-key}",
      fulfillment_status: null,
      ...
      fulfillable_quantity: 0,
    }
  ],
  fulfillments: [
    {
      ....
      order_id: {order_id},
      service: "{app-key}",
      status: "pending",
      tracking_company: null,
      updated_at: "2015-02-19T00:39:27-05:00",
      tracking_number: null,
      tracking_numbers: [ ],
      tracking_url: null,
      tracking_urls: [ ],
      receipt: { },
      line_items: [
        {
          fulfillment_service: "video-rental",
          fulfillment_status: null,
          gift_card: false,
          grams: 0,
          id: {order_lineitem_id},
          price: "{product_price}",
          product_id: {product_id},
          quantity: 1,
          requires_shipping: false,
          sku: "{product_sku}",
          taxable: true,
          title: "{product_name}",
          variant_id: {variant_id},
          variant_title: "{product_variant}",
          name: "{product_name} - {product_variat}",
          variant_inventory_management: null,
          properties: [ ],
          product_exists: true,
          fulfillable_quantity: 0,
          tax_lines: [ ]
        }
      ]
    }
  ],
  ...
}

 

 

vertex
Shopify Partner
4 0 1

I have no idea how this is on page three already, but I'd appreciate some help!  Thanks!! :)

0 Likes
codechefkk
Shopify Partner
8 0 0

I am also running into this issue, can somebody help please? In JSON data it says orderline is not fulfilled but in error it says lineitem is already fulfilled. Please help.

0 Likes