Sobes.tech
Middle

A request for a payment operation has arrived at the API, but there is an unknown attribute in the body that is not in the contract. How should the service respond and why?

sobes.tech AI

Answer from AI

If a request for a payment operation arrives at the API with an unknown attribute not present in the contract, the service should:

  • Ignore the unknown attribute if it does not affect processing, to ensure backward compatibility and flexibility.
  • Or return an error (e.g., 400 Bad Request) if strict validation is required and unknown fields are considered an error.

Most often, the preferred strategy is the first — ignoring additional fields so that clients can extend requests without disrupting service operation. This helps avoid failures due to minor changes and simplifies API evolution.

In any case, the behavior should be clearly documented in the API contract.