Dmitriy Kononov.
Let’s talkContact

News and analysis

API contract testing: validating schema changes before an upgrade

Validate requests, nullable fields and statuses before an API upgrade with contract tests, a Stripe example and runtime workflow checks.

DevelopmentPublished:

An integration can receive HTTP 200 while writing the wrong order status. Availability tells you that the service handled a request; whether the response is suitable for your application requires a separate check. Before an API upgrade, discuss more than the new SDK version. Define the data contract: what the application sends, receives and treats as permission for its next action.

A Stripe update and an n8n article illustrate two different aspects of this problem. The first describes an announced parameter change. The second addresses response validation inside a running workflow. Together, they suggest an upgrade process that detects a problem before it changes a business record.

A field name does not guarantee compatibility

The Stripe changelog for 2026-09-30.endive describes removing payment_method_types as a writable parameter from the listed Payment Intent and Setup Intent operations. In the affected version, sending it returns HTTP 400 with the code payment_method_types_no_longer_supported. The property with the same name remains readable on the objects.

That distinction matters: a field can exist in a response without being accepted in a request. Stripe describes dynamic payment methods, exclusions through excluded_payment_method_types and an allowed list through allowed_payment_method_types. With the last option, incompatible types are filtered out. Migration therefore needs to check both request validity and the actual payment options shown to the customer.

This is a specific change for a particular API version, not evidence that every existing Stripe integration has already broken. Check request versions, SDK versions and webhook endpoint versions separately. The captured publication also mentions a preview version; verify the documentation for your selected target version immediately before making a migration decision.

Define the consumer's contract

Start with one scenario: the application creates a payment, reads the response and presents the next available actions. Record required fields, types and meanings. Then add the cases often missing from documentation examples: an absent value, explicit null, an empty list and an unknown status.

Do not collapse those cases into a single “nothing” state. An absent field might indicate an older response version. null might represent an explicitly unknown value. An empty list might mean that no options are available. The correct interpretation depends on the API. Your application contract should state what happens in each case.

A practical working table contains the field name, direction, accepted values, business dependency and violation handling. For example: “The amount is required for reconciliation; an invalid type blocks automatic confirmation.” This connects the technical schema to the operational process, as described in API integration planning.

Route an unknown enum value to explicit handling rather than quietly treating it as the closest known status. A new “awaiting review” state should not become “paid” because of a default branch. Additional unused fields, on the other hand, do not necessarily require stopping the workflow. Rejecting every additive change can create avoidable failures of its own.

A person with a laptop beside a branching diagram.
K. Limpitsouni / unDraw · License

Three levels of pre-upgrade validation

n8n distinguishes contract testing, integration testing and schema validation. These methods answer related questions but do not replace one another. A schema checks message structure. A contract captures consumer expectations. An end-to-end scenario checks that interacting systems produce the intended result.

A useful upgrade set includes:

  • Outgoing request checks: removed parameters are no longer sent and required values are correct.
  • Incoming response checks: types, accepted states and nullable fields have explicit handling.
  • Customer outcome checks: the payment option is available, failures are explained and the order is not confirmed prematurely.

Saved, anonymised examples help compare old and new behaviour. Replaying an old response does not prove that the new API will produce it. Important scenarios need checks against the selected version in a suitable test environment. Write acceptance conditions before running them; otherwise a team may rationalise any difference as an acceptable upgrade.

Stop invalid data before it changes the process

The n8n article proposes validating responses after an HTTP Request node and routing violations separately. It also says that this requires configuration and does not happen automatically in built-in nodes. Using an automation platform does not, by itself, provide contract enforcement.

Place the validation boundary before a significant or irreversible action. If an amount has an invalid type, do not create a financial record containing zero just to keep the workflow moving. Save an operation reference, the rejection reason, the contract version and the person responsible for investigating. Technical logs should contain the information required for diagnosis; avoid copying an entire payment payload without a specific need.

When several applications share an API, check each consumer's expectations. The custom API architecture description covers shared resources, documentation and different clients. It provides context for discussing contracts, but does not establish that the project uses these new Stripe or n8n releases.

Accept an upgrade without silently changing business rules

Assign an upgrade owner and list dependent processes. Record the current and target versions, expected differences, test scenarios and rollback conditions. Evaluate application rollback alongside data already changed and provider settings. Switching code back does not necessarily restore the previous meaning of an operation.

After release, monitor both schema violations and business outcome discrepancies. Connecting documents, CRM and tasks requires agreement about who owns each value. API versioning adds another question: under which rules was that record received?

Validation also consumes requests. During a bulk migration, account for the shared API request budget so that checks and administrative reads do not displace live operations. In a payment integration, the next step is reconciling payment attempts and records. A structurally correct response must also carry the correct financial meaning.

Sources