Creating Invoice from sales order API

Creating Invoice from sales order API

Hey there,

I created a new sales order via API. Then, I created an invoice from that sales order (tried both ways, via api and manually).
Once I did this the status is automatically "closed" instead of "confirmed".

Now the crux : when I manually create a sales order and then create an invoice from that it works fine : status is "confirmed".

How can I solve that? Is there even a way to change the status of Invoice, packaging and shipping via API in the sales order display?

I also attached the response of listing all sales orders, where you can see the difference aswell. (First one created manually, second one API)

{
  "code": 0,
  "message": "success",
  "salesorders": [
    {
      "salesorder_id": "486503000000069609",
      "customer_name": "xxx@ccc.de",
      "customer_id": "486503000000069561",
      "email": "xxx@ccc.de",
      "order_status": "confirmed",
      "salesorder_number": "SO-00029",
      "reference_number": "",
      "date": "2017-06-07",
      "shipment_date": "",
      "shipment_days": "",
      "due_by_days": "",
      "due_in_days": "",
      "quantity": 1,
      "quantity_invoiced": 1,
      "quantity_packed": 0,
      "quantity_shipped": 0,
      "currency_id": "486503000000000109",
      "currency_code": "EUR",
      "total": 8.93,
      "bcy_total": 8.93,
      "status": "confirmed",
      "created_time": "2017-06-07T20:12:27+0200",
      "last_modified_time": "2017-06-07T20:12:37+0200",
      "is_emailed": false,
      "is_drop_shipment": false,
      "is_backorder": false,
      "is_manually_fulfilled": false,
      "sales_channel": "direct_sales",
      "payment_mode": "",
      "paid_amount": 0,
      "balance": 8.93
    },
    {
      "salesorder_id": "486503000000069573",
      "customer_name": "xxx@ccc.de",
      "customer_id": "486503000000069561",
      "email": "xxx@ccc.de",
      "order_status": "closed",
      "salesorder_number": "SO-00028",
      "reference_number": "Woocommerce",
      "date": "2017-06-07",
      "shipment_date": "",
      "shipment_days": "",
      "due_by_days": "",
      "due_in_days": "",
      "quantity": 5,
      "quantity_invoiced": 5,
      "quantity_packed": 0,
      "quantity_shipped": 0,
      "currency_id": "486503000000000109",
      "currency_code": "EUR",
      "total": 37.5,
      "bcy_total": 37.5,
      "status": "fulfilled",
      "created_time": "2017-06-07T20:11:51+0200",
      "last_modified_time": "2017-06-07T20:12:11+0200",
      "is_emailed": false,
      "is_drop_shipment": false,
      "is_backorder": false,
      "is_manually_fulfilled": false,
      "sales_channel": "direct_sales",
      "payment_mode": "",
      "paid_amount": 0,
      "balance": 37.5
    }
  ],
  "page_context": {
    "page": 1,
    "per_page": 200,
    "has_more_page": false,
    "report_name": "Aufträge",
    "applied_filter": "Status.All",
    "custom_fields": [],
    "sort_column": "created_time",
    "sort_order": "D"
  }
}