GraphQL Fulfillment Invoices Query returns empty

Hello Community,

I am trying to get information on fulfillment invoices, and the information for each category (eg if there is an ad_hoc charge, the associated charges with it). When I do the query, it returns empty.

We followed the instructions for third-party developer and I was able to see my scope:
“scope”: “openid profile view:products change:products view:orders change:orders view:purchase_orders change:purchase_orders view:shipments change:shipments view:returns change:returns view:warehouse_products change:warehouse_products view:picking_stats view:packing_stats offline_access”,

I noticed that bills are not on there. Could this be part of the problem? Not looking to do any mutations, just get the detailed items associated with the bill.

This is the query, at this point I am trying to get anything. I know for sure bills were issued in that period so I should be getting something.

Query


{
  fulfillment_invoices(date_from: "2024-12-01", date_to: "2024-12-05", analyze: true) {
    request_id
    complexity
    ...invoices
  }
}
fragment invoices on FulfillmentInvoicesQueryResult {
  data( first: 10) {
    pageInfo {
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }
    ...thing
  }
}

fragment thing on FulfillmentInvoiceConnection {
  edges {
    node {
      id
      legacy_id
      stripe_charge_id
      stripe_invoice_id
      stripe_invoice_number
      stripe_invoice_status
      stripe_invoice_url
      stripe_next_payment_attempt
      account_id
      cc_info
      amount
      created_at
      # shipping_items(
      #   sort: "string"
      #   before: "string"
      #   after: "string"
      #   first: 1
      #   last: 1
      # )
      # inbound_shipping_items(
      #   sort: "string"
      #   before: "string"
      #   after: "string"
      #   first: 1
      #   last: 1
      # )
      # returns_items(
      #   sort: "string"
      #   before: "string"
      #   after: "string"
      #   first: 1
      #   last: 1
      # )
      # storage_items(
      #   sort: "string"
      #   before: "string"
      #   after: "string"
      #   first: 1
      #   last: 1
      # )
    }
    cursor
  }
}

I tried with and without the 01, same result. This is the response:

{
  "data": {
    "fulfillment_invoices": {
      "request_id": "678ae6aa4949117d8124db56",
      "complexity": 11,
      "data": {
        "pageInfo": {
          "hasNextPage": false,
          "hasPreviousPage": false,
          "startCursor": null,
          "endCursor": null
        },
        "edges": []
      }
    }
  },
  "extensions": {
    "throttling": {
      "estimated_complexity": 0,
      "cost": 1,
      "cost_detail": {
        "fulfillment_invoices": {
          "items_count": 0,
          "cost": 1,
          "total_cost": 1,
          "fields": {}
        }
      },
      "user_quota": {
        "credits_remaining": 2002,
        "max_available": 2002,
        "increment_rate": 30
      }
    }
  }
}

I am also trying bills. In the UI the items are shown under “Bills”. Does anyone know if this is Bills or Fulfillment Invoices in the gql api?

update: I was able to get some items through the query but the latest items are from two years ago. I need items from 2024

Basically, i need to get the items in this bill. And the line items in them. For storage its the storage bins.

Hello @cathleenturner! Welcome to our Dev community.

The fulfillment_invoices query is for our fulfillment service customers.

The billing queries and mutations in our API are not available for third-party developers at the moment, they are only addressable by full users.

Have a great day

Hi Thomas,

Thanks for the warm welcome! I appreciate you.

So if I were added as a user and generated an API key, would I be able to access the billing queries?

Thank you for your time!

Hey @cathleenturner! Correct, that should be enough.