Viincenttt / MollieApi

This project allows you to easily add the Mollie payment provider to your application.
MIT License
147 stars 85 forks source link

GetInvoiceListAsync : Unprocessable Entity - Non-existent query parameter "include" for this API call #328

Closed Pskyco closed 8 months ago

Pskyco commented 11 months ago

Hi,

While calling GetInvoiceListAsync from InvoicesClient with parameter incldueLines: true, here is what I got,

await _invoicesClient.GetInvoiceListAsync(includeLines: true)

fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1]
      An unhandled exception has occurred while executing the request.
      Mollie.Api.Client.MollieApiException: Unprocessable Entity - Non-existent query parameter "include" for this API call. Did you mean: "from"?
         at Mollie.Api.Client.BaseMollieClient.ProcessHttpResponseMessage[T](HttpResponseMessage response)
         at Mollie.Api.Client.BaseMollieClient.SendHttpRequest[T](HttpMethod httpMethod, String relativeUri, Object data)
         at Mollie.Api.Client.BaseMollieClient.GetListAsync[T](String relativeUri, String from, Nullable`1 limit, IDictionary`2 otherParameters)
         at Mollie.Api.Client.InvoicesClient.GetInvoiceListAsync(String reference, Nullable`1 year, String from, Nullable`1 limit, Boolean includeLines, Boolean includeSettlements)
Viincenttt commented 11 months ago

That's weird. The Mollie documentation doesn't even state that this method has include parameters, so the error from the Mollie API is correct. The only thing I can do here is remove the includeLines and includeSettlements parameters from the GetInvoiceListAsync method.

https://docs.mollie.com/reference/v2/invoices-api/list-invoices

Pskyco commented 11 months ago

We have the same issue on GetInvoiceAsync. And indeed without those parameters, we have the lines and settlement détails

Le lun. 25 sept. 2023 à 20:44, Vincent Kok @.***> a écrit :

That's weird. The documentation doesn't even state that this method has include parameters, so the error from the Mollie API is correct. The only thing I can do here is remove the includeLines and includeSettlements parameters from the GetInvoiceListAsync method.

— Reply to this email directly, view it on GitHub https://github.com/Viincenttt/MollieApi/issues/328#issuecomment-1734282226, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJDUZNPOOQ5DMBS7WRN7ZTX4HGJ5ANCNFSM6AAAAAA5FZORFM . You are receiving this because you authored the thread.Message ID: @.***>

Viincenttt commented 11 months ago

Thanks for reporting this @Pskyco , I've just merged a pull request to remove those parameters

Viincenttt commented 8 months ago

This is now live in 3.4.1.0