0

so i need to create a rest endpoint that basically creates an entry in the database, a address token when the customer is initialised. I have two possible endpoints:

POST - customer/address-token - this creates a address for a user

POST - customer/initialise -

im thinking should i use the former or latter? I have read a few topics on this, whereby the latter is a termed a controller resource type?

user1555190
  • 2,803
  • 8
  • 47
  • 80
  • I have voted to close this question because it already has an answer here: [Understanding REST: Verbs, error codes, and authentication](https://stackoverflow.com/questions/2001773/understanding-rest-verbs-error-codes-and-authentication) . To summarize, the REST architecture style is to avoid verbs in URLs, so your first form is right. – www.admiraalit.nl Jun 30 '22 at 13:39

1 Answers1

0

I guess the first form is better and more intuitive to know what are do.

POST - customer/address-token - this creates a address for a user