# Dolibarr 15.0.3 Create Invoice Rest API

**URL:** <https://www.dolibarr.org/forum/t/dolibarr-15-0-3-create-invoice-rest-api/22838>\
**Category:** Developing for Dolibarr\
**Tags:** Windows\
**Created:** [September 27, 2022, 7:30am UTC](https://www.dolibarr.org/forum/t/dolibarr-15-0-3-create-invoice-rest-api/22838 "2022-09-27T07:30:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hein](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/h/b2d939/32.png) [@hein](https://www.dolibarr.org/forum/u/hein)\
**Post date:** [September 27, 2022, 7:30am UTC](https://www.dolibarr.org/forum/t/dolibarr-15-0-3-create-invoice-rest-api/22838/1 "2022-09-27T07:30:31Z")

</div>

Hello all. We want to create a Dolibarr invoice using createinvoice REST api. How do we find out exactly what parameters to send and what syntax to use?

Hein

---

<div class="post-metadata">

**Author:** ![calebjay](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/calebjay/32/6689_2.png) [@calebjay](https://www.dolibarr.org/forum/u/calebjay)\
**Post date:** [November 23, 2023, 6:23am UTC](https://www.dolibarr.org/forum/t/dolibarr-15-0-3-create-invoice-rest-api/22838/2 "2023-11-23T06:23:37Z")

</div>

Bumping this because the swagger docs aren’t clear, they just give an endpoint, `POST` to `/invoices`, and they say use this model:

```auto
createInvoicesModel {
    request_data (Array[string], optional):
    Request datas
}

```

And if I look up that model all I find is

```auto
"createInvoicesModel": {
      "properties": {
        "request_data": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Request datas"
        }
      }
    },

```

So I’m not clear on how to construct my request

---

<div class="post-metadata">

**Author:** ![DG-Rilling](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/d/e495f1/32.png) [@DG-Rilling](https://www.dolibarr.org/forum/u/DG-Rilling)\
**Post date:** [November 23, 2023, 5:36pm UTC](https://www.dolibarr.org/forum/t/dolibarr-15-0-3-create-invoice-rest-api/22838/3 "2023-11-23T17:36:10Z")

</div>

Look at the related api\_\< modulname \>.class.php for the definition of $FIELDS  
In the case of invoices there is only one field “socid”.  
So put this in the Swagger UI (POST /invoices)

`{ "socid": "2597" }`

2597 is the socid of the thirdparty

I believe it works the same with the other API commands.
