softwerkab / fortnox-csharp-api-sdk

.NET SDK for Fortnox API.
MIT License
53 stars 65 forks source link

Search order by YourOrderNumber #252

Open martenw opened 2 years ago

martenw commented 2 years ago

Orders in Fortnox has a the property YourOrderNumber to store to external ordernumber.

Would it be possible to add this to OrderSearch to get orders by external Id?

richardrandak commented 2 years ago

The implemented search parameters were based on the old documentation. Not sure where the available search parameters are listed in the new documentation. Try to ask the Fortnox support. If such search parameter exists in the API, I will add it to the OrderSearch, but I a don't think it is supported.

martenw commented 2 years ago

From docs it seems that it is only possible to get orders by status (https://apps.fortnox.se/apidocs#operation/list_OrdersResource).

I have sent the question on to Fortnox support, will update here when I get a reply.

martenw commented 2 years ago

The response from support was just that it is possible to sort and filter using some fields but it will be trial and error to find out which ones. If an invalid field is used an exception will be thrown, for example:

{
  "ErrorInformation": {
      "error": 1,
      "message": "Ett felaktigt fält för sortering har använts.",
      "code": 2000865
  }
}