# Update quantity\_shipped when fulfilling orders through API

**URL:** <https://community.shiphero.com/t/update-quantity-shipped-when-fulfilling-orders-through-api/2286>\
**Category:** GraphQL API\
**Created:** [December 27, 2022, 9:36pm UTC](https://community.shiphero.com/t/update-quantity-shipped-when-fulfilling-orders-through-api/2286 "2022-12-27T21:36:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cmora](https://avatars.discourse-cdn.com/v4/letter/c/bcef8e/32.png) [@cmora](https://community.shiphero.com/u/cmora)\
**Post date:** [December 27, 2022, 9:36pm UTC](https://community.shiphero.com/t/update-quantity-shipped-when-fulfilling-orders-through-api/2286/1 "2022-12-27T21:36:30Z")

</div>

Hello!

I hope you’re doing well.  
I saw a similar post around 2020, but it kind of ended relating to other issues that are not related to what we’re looking for.  
We’ve been testing fulfilling orders via API following the steps detailed in this [document](https://developer.shiphero.com/order-fulfillment/).  
We’ve successfully created a Shipment, removed the inventory and marked the order as fulfilled.  
Our issue is that we haven’t been able to relate this fulfillment to the quantity\_shipped value of a SKU in Shiphero.

Is there any parameter that we may be missing for it to relate to this field?

The order\_id that we used to test this is 325190201

Our mutations were:

1. Create shipment

```auto
mutation {
  shipment_create(
    data: {
      customer_account_id: "XXXXX"
      order_id: "325190201"
      warehouse_id: "XXXXX"
      address: {
        name: "Cristobal Mora"
        address1: "Avenida XASDRQWR 123"
        address2: "1801"
        city: "ZZZZZZZ"
        state: "RM"
        country: "CL"
        phone: "123456712"
      }
      line_items: [
        {line_item_id: "TGluZUl0ZW06ODI5NDI3MTE0", quantity: 1},
        {line_item_id: "TGluZUl0ZW06ODI5NDI3MTM4", quantity: 1}
      ]
      labels: {
        carrier: "api"
        shipping_name: "Test name"
        shipping_method: "Test"
        cost: "4500"
        address: {
          name: "Cristobal Mora"
          address1: "Avenida XASDRQWR 123"
          address2: "1801"
          city: "ZZZZZZZ"
          state: "RM"
          country: "CL"
          phone: "123456712"
        }
        dimensions: {
          weight: "2"
          height: "1"
          length: "1"
          width: "1"
        }
        label: {
          pdf_location: "https://test-cris.nohaynada.com/"
        }
        line_item_ids: [
          "TGluZUl0ZW06ODI5NDI3MTE0",
          "TGluZUl0ZW06ODI5NDI3MTM4"
        ]
        tracking_number: "test-cris3123890123"
      }
      shipped_off_shiphero: false
      notify_customer_via_shiphero: true
      notify_customer_via_store: true
    }
  ) {
    request_id
    complexity
    shipment {
      id
      legacy_id
      order_id
      user_id
    }
  }
}

```

1. Remove inventory

```auto
mutation {
  inventory_remove(
    data: { 
      customer_account_id: "XXXXX",
      sku: "YYYYY", 
      warehouse_id: "XXXXX",
      quantity: 1,
      reason: "Order <a href=\"/dashboard/orders/details/325190201\">#1590</a> shipped"
    }
  ) {
    request_id
    complexity
    warehouse_product {
      id
      legacy_id
      account_id
      sku
      warehouse_id
      warehouse_identifier
      on_hand
    }
  }
}

```

1. Update fulfillment status

```auto
mutation {
  order_update_fulfillment_status(
    data: { 
      customer_account_id: "XXXXX",
      order_id: "325190201", 
      fulfillment_status: "fulfilled",
      reason: "This order was shipped using Shiphero Public API"
    }
  ) {
    request_id
    complexity
    order {
      id
      legacy_id
      order_number
    }
  }
}

```

Is there any parameter that we may be missing for the shipping\_quantity value to relate with the shipment? Or is it simply not possible to achieve this?

Thanks,  
Cristóbal

---

<div class="post-metadata">

**Author:** ![sh-agent](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@sh-agent](https://community.shiphero.com/u/sh-agent)\
**Post date:** [December 28, 2022, 11:59am UTC](https://community.shiphero.com/t/update-quantity-shipped-when-fulfilling-orders-through-api/2286/2 "2022-12-28T11:59:47Z")

</div>

Hey @cmora!

Thanks for reaching out!  
Just wanted to let you know we’re looking into this issue now.

Let me know if there’s anything I can do in the meantime.

Best,  
RayanP

---

<div class="post-metadata">

**Author:** ![sh-agent](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@sh-agent](https://community.shiphero.com/u/sh-agent)\
**Post date:** [December 28, 2022, 6:55pm UTC](https://community.shiphero.com/t/update-quantity-shipped-when-fulfilling-orders-through-api/2286/3 "2022-12-28T18:55:06Z")

</div>

Hey @cmora,

Thanks for hanging in there!

Unfortunately, I don’t think there’s anyway to have that field relate to the shipment when fulfilling through our API.

Let me know if there’s anything at all I can do to assist you here.

Best,  
RayanP
