Use just one API Operation regardless of having validated a VAT number before

The choice between using a POST or a PUT operation is depending on whether a Business Entity for the given VAT number already exists. This requires that you keep track of previous API calls for a given VAT number. In most cases this is relatively easily done, simply by making a call to the POST Operation as soon as a VAT number gets added to your data.

In some usage scenarios, keeping track of the registered VAT numbers is more difficult to achieve. To facilitate these scenarios, the POST Operation will return a HTTP 303 status code if VAT number has been validated before and a Business Entity already exists. This 303 (See Other) response includes a Location header that points to the already existing Business Entity. If your client supports forwards in the HTTP dialogue (most client frameworks do) it will be able to automatically change the request to a GET on the URL provided.

The POST and GET operations are designed to use the same format for its responses. Therefore, you can disregard the protocol switch as you will receive the same output The URL in the 303 Location Header will include the correlationId (if set) and will instruct the GET Operation to re-validate the VAT number in question.

By leveraging the ‘See Other’ (303) response you can simplify your API calls to only using a POST if this is more convenient.