I am designing a REST API where I have the following behavior of the resource:
For creating a resource, there is initial data should be sent, which is relevant only for creation.
Which means, that the GET resource representation is different than the POST one.
Example:
POST
/api/customers Request body: { "name": "John", "surname": "Doe", "creation_specific_data": "data" } GET
/api/customers/1 Response body: { "id": 1, "name": "John", "surname": "Doe" } So, as you see, the data on GET will always be partial than the one upon creation.
From my understanding, it is acceptable to supply less properties in POST and upon GET you receive more data (e.g. id auto generated by the server). The question, is it also acceptable the other way around? Supply more data upon POST and receive less data upon GET?