Payments are experiencing issues due to temporary restrictions in Russia. If your payment does not go through, please submit a support request.Our support team is available 24/7 — we are always here to help with hosting and server issues.We are now accepting requests for dedicated server rental and colocation services in our data center.Reminder: we recommend enabling backups for additional data protection.A new VPS/VDS lineup with NVMe storage and improved performance is now available.Maintenance work on some servers has been completed. All services are operating normally.
Article5 min readViews1

New Status in the API: How Not to Accidentally Close an Order

An external service expanded its list of states, but the store is unaware of the new code. We examine preserving the original event, halting dependent actions, and validating the new mapping rule.

Comments 0

A yellow hexagon separate from a purple ring: a new value requires a distinct solution
In this article

The delivery service added the status "awaiting address clarification." The store knows only "created," "in transit," and "delivered." The old handler finds no match and assigns the default value—"delivered." The request parses successfully with no exceptions, and a congratulatory message is already sent to the buyer. Formally, the program executed; however, it invented the meaning of the event itself.

This is a training scenario, not a description of a specific service. Its useful takeaway: an unknown value must remain a distinguishable uncertainty. The recipient may save the event for later analysis, but must not treat the absence of a matching rule as a confirmed business outcome.

A new field and a new status are different changes

An additional comment field can sometimes be ignored without changing the decision. The new status field value may itself determine the decision: whether to ship the product, close the order, or notify the buyer. The rule 'be tolerant of new data' does not answer what to do with an unknown control value.

Google AIP-180 recommendations specifically warn about new enumeration values in responses: an older client may process them incorrectly. This is an API design guide, not a guarantee of compatibility for any external service. For a specific integration, the ability to extend the list and the client behavior must be determined by its contract.

If JSON Schema validation restricts the field via enum, any value outside the list fails that validation. This is expected behavior for a closed set. Removing the restriction allows reading the string, but does not create a valid mapping to the internal status. Successful form validation and understanding the state are different stages.

Preserve the original value, stop the dependent action

Suppose an external service sends a test code address_check. The recipient saves exactly this code, the external shipment identifier, the timestamp, and the event identifier if the source provides one. Separately, it records the matching result: the rule is currently missing. Do not merge an internal confirmed order status with an external unprocessed signal into a single field.

What to stop depends on the consequences. For our scenario, it is reasonable to halt delivery and refrain from sending a successful delivery notification until the meaning is clarified. There is no need to automatically block the entire store: other orders and independent operations can continue if the architecture allows such isolation.

Silently retaining the previous status is also insufficient. The operator must see that new data has been received but not yet applied. Otherwise, 'in transit' will appear as fresh confirmed information, even though the system has already encountered an exception. A visible signal, a review deadline, and a responsible person are needed, not perpetual calm on a green card.

Confirming delivery of a message is not equivalent to applying a status

The notification recipient must adhere to the retry rules for the specific API. If the event is reliably persisted for later processing, the protocol may allow acknowledging receipt while leaving business processing incomplete. However, if the event is not persisted, a positive response could deprive the system of the ability to retrieve it again. There is no universal HTTP status code for every service in this scenario.

A failure followed by retries will not fix an unknown dictionary on its own. The same new status can arrive for hours, clogging the queue. Therefore, temporary unavailability of the handler and the absence of a mapping rule must be distinguished in advance. In the latter case, preserving the original source, visibility of the issue, and controlled resumption of processing after the fix are critical.

There is no need to copy the buyer's address and phone number into the diagnostic log just for the status name. For initial analysis, technical identifiers and status codes are usually sufficient. The full original document, if storage is required, demands defined access controls and a retention period. A diagnostic record must not become a second uncontrolled order database.

How to add a rule without rewriting history

First, determine the meaning of the new status from the provider's documentation. 'Address being clarified' is not equal to 'delivery cancelled' and is not equal to 'delivered'. Sometimes there is no direct internal equivalent: in that case, a separate integration status or an additional flag is needed, not the closest word from the dropdown list.

After agreement, test the new branch on saved anonymized examples in the staging environment. Reapplying must account for the already reached state and the order of events: an old notification about clarifying the address must not cancel a later confirmation of delivery. Choose a version rule or order based on the source's capabilities, not the order of lines in the log.

The acceptance test suite should include a known code, a new non-empty code, an empty value, and the absence of the field. Then, repeat one event and receive it after a newer one. These are different cases; a common result of 'it did not crash' does not prove correctness. For each case, define in advance what is saved, what action is allowed, and what the operator will see.

In integrating a store with 1C or a delivery service, it is useful to require a separate answer to the question: 'What will happen tomorrow when the source dictionary expands?' A good answer preserves a verifiable original signal and limits the consequences of uncertainty. It does not promise to guess a new status by name.

Discussion 0

Share your experience and ask questions. Comments without links appear after editorial review.

No comments yet. Start the discussion.