Discussions

Ask a Question
Back to all

Add fulfillment filters

Allow filtering fulfillments by:

  1. tracking code
  2. associated invoice id

Before creating fulfillment for an invoice I want to make sure the same fulfillment does't already exist. For complete fulfillments that's easy: just fetch invoice and check fulfillment_status. Or just attempt to submit the fulfillment and handle error about invoice items being already fulfilled

It gets tricky for partial fulfillments. I'd like to check if there's already a fulfillment record with the same tracking code, associated with same invoice.

Currently, in order to do that I'd need to fetch all fulfillments for the workspace, but that's a bit of an overkill.

Alternatively, line items in invoice JSON response could include associated fulfillment ids.