# API get all proposal, order, invoice based on specific fk\_project value

**URL:** <https://www.dolibarr.org/forum/t/api-get-all-proposal-order-invoice-based-on-specific-fk-project-value/24542>\
**Category:** Developing for Dolibarr\
**Tags:** v18, Linux\
**Created:** [November 11, 2023, 10:10pm UTC](https://www.dolibarr.org/forum/t/api-get-all-proposal-order-invoice-based-on-specific-fk-project-value/24542 "2023-11-11T22:10:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonbendtsen](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/j/977dab/32.png) [@jonbendtsen](https://www.dolibarr.org/forum/u/jonbendtsen)\
**Post date:** [November 11, 2023, 10:10pm UTC](https://www.dolibarr.org/forum/t/api-get-all-proposal-order-invoice-based-on-specific-fk-project-value/24542/1 "2023-11-11T22:10:20Z")

</div>

I would like to through the API get a list of all proposals (and later orders and invoices) where the fk\_project has a specific value (in my current usecase that value is 6 and I knwo it before hand)

I tried setting the sqlfilter to (t.fk\_project:=:6)  
/dolibarr/api/index.php/orders?sortfield=t.rowid&sortorder=ASC&limit=100&sqlfilters=(t.fk\_project%3A%3D%3A6)

But that column apparently does not exist ☹ even though I can see that when I extract the json for a order or proposal or invoice that has a project value set.

```auto
{
  "error": {
    "code": 503,
    "message": "Service Unavailable: Error when retrieve commande list : Unknown column 't.fk_project' in 'where clause'"
  },
  "debug": {
    "source": "api_orders.class.php:251 at call stage",
    "stages": {
      "success": [
        "get",
        "route",
        "negotiate",
        "authenticate",
        "validate"
      ],
      "failure": [
        "call",
        "message"
      ]
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![jonbendtsen](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/j/977dab/32.png) [@jonbendtsen](https://www.dolibarr.org/forum/u/jonbendtsen)\
**Post date:** [November 11, 2023, 10:12pm UTC](https://www.dolibarr.org/forum/t/api-get-all-proposal-order-invoice-based-on-specific-fk-project-value/24542/2 "2023-11-11T22:12:23Z")

</div>

Okay, to answer my own question, as I just found a solution

(t.fk\_projet:=:6)

I have to name it fk\_projet not fk\_project even though the json says `"fk_project": "6",`

(I find it slightly annoying that field names in database and json does not match)
