-1

I have VAT registration process and once it is completed user will proceed for VAT E-Filing process.

My VAT APIs are like below :

/api/vat

Now E-Filing is part of VAT process so does below API make sense and is as per REST API standards:

api/vat/efiling/transactions  //get latest transactions for efiling process 

Apart from this it would be very helpful if someone can list out some points which will be useful when designing APIs.

halfer
  • 19,824
  • 17
  • 99
  • 186
I Love Stackoverflow
  • 6,738
  • 20
  • 97
  • 216
  • This appears to be seeking opinions. From the close reasons: _Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise._ – halfer Jun 25 '18 at 10:32

1 Answers1

1

Once you are talking about the URI design rather than the API design itself, you must be aware that REST doesn't care about it. It's a misconception.

A clean URI may be desirable but it's not mandatory in REST architectural style, which is defined in the chapter 5 of Fielding's dissertation.


Anyways, I think you are probably missing a VAT identifier. Something like:

/api/vat/{id}/efiling/transactions

Check article from Vinay Sahni for some insights to design your API.

cassiomolin
  • 124,154
  • 35
  • 280
  • 359
  • Actually I will have vat id but Efiling will be done as seperate process for the specific month and year.But Once user have applied for vat and it is successfully approved after that user can proceed on to filing EFiling.Hence EFiling is part of vat process. – I Love Stackoverflow Jun 25 '18 at 11:52
  • @Learning-Overthinker-Confused So if a VAT id is required for the E-Filing, what's wrong with `/api/vat/{id}/efiling/transactions`? – cassiomolin Jun 25 '18 at 12:02
  • But in my database there is nothing as such which is mapping vat id with EFiling id.So i aint gonna have any use if i put vat id as path parameter – I Love Stackoverflow Jun 25 '18 at 13:23
  • @Learning-Overthinker-Confused If they are not related (on they don't depend on each other), simply use `/api/vat` and `/api/efiling`. – cassiomolin Jun 25 '18 at 13:32
  • Upvoted for your kind efforts towards helping me and for your valuable time.but my point is that efiling is part of vat.I mean user cannot directly proceed EFiling unless and untill his/her vat process is not completed.Hence i am thinking like that. – I Love Stackoverflow Jun 25 '18 at 13:35
  • if the E-Filing depends on the VAT number, you can express such hierarchy with `/api/vat/{number}/efiling`. Otherwise, use different endpoints. – cassiomolin Jun 25 '18 at 14:01