Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

lide's avatar
Level 1

Api resource listing with status

Hi everybody!

I will have one api endpoint /invoices, which list invoices 50/request. What is your suggestion, that I can get invoices with different statuses using this endpoint? Example invoices with status draft or sent.

Do I use get parameters, example /invoices?status=draft&status=sent or /invoices?status=draft,sent? Or what is best solution when I want follow rest standards?

I tried google, but maybe I had wrong key words, because not found good answer yet.

0 likes
2 replies
Snapey's avatar

Either tag on filters as a querystring, or consider if there is enough business logic behind the state to create different resource types, eg /draftinvoices

Please or to participate in this conversation.