4 ms·
But the invoice endpoint is likely going to be something like "/customer/(id)/invoice/...". So what did we gain from getting it from the customer description fi
by viraptor 8y ago
But the invoice endpoint is likely going to be something like "/customer/(id)/invoice/...". So what did we gain from getting it from the customer description first? (vs getting the customer id from the response and the link pattern from the docs)
- rich-tea 8y agoYou gained the ability to find the invoice. There is no need to have customer id in the invoice url. Just /invoice/invoice_id is enough.
- viraptor 8y agoI meant a whole tree of methods. Sure, you can get specific invoices from `/invoice/id`, but you probably still want `/customer/id/invoices` or similar for searching through them. You could use extra parameters for `/invoice/...`, but I think often it's nicer to namespace that. (use case dependent)
- cs02rm0 8y agoIf an invoice id is unique across all customers. Which it probably should be, but other ids might reasonably not be.