{"templateId":"markdown","versions":[{"version":"opendelivery","label":"Open Delivery API","link":"/en/apis/docs/development-guides/orders/polling","default":true,"active":true,"folderId":"62a846bf"},{"version":"standard","label":"Standard Keeta API","link":"/en/apis/standard/docs/development-guides/orders/polling","default":false,"active":false,"folderId":"62a846bf"},{"version":"grocery","label":"Grocery Keeta API","link":"/en/apis/grocery/docs/development-guides/orders/polling","default":false,"active":false,"folderId":"62a846bf"}],"sharedDataIds":{"sidebar":"sidebar-@l10n/en/apis/@opendelivery/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Polling"},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"id":"polling","level":1,"__idx":0},"children":["Polling "]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Receiving events via Polling works as follows:"]},{"$$mdtype":"Tag","name":"div","attributes":{"align":"center"},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"https://abrasel-nacional.github.io/opendelivery/images/polling.png"},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"query-new-order-events","__idx":1},"children":["Query new order events"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In order to receive new order events, the merchant Software Service must make requests on the polling endpoint regularly at a certain time interval, determined by  Keeta."," ","Whenever there is a new event the response will send the response code 200 with the list of events. If there are no new events, the response will send the response code 204."]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["IMPORTANT"]},":  It is important that the Software Service performs the requests within the timeframe determined by Keeta, as blocking and penalties may occur depending on the application's rules."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Keeta Polling Rate Limiting and Event TTL"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The Keeta polling API enforces a rate limit of ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["no more than two requests per minute per token"]},". Once a request is blocked due to rate limiting, it will be allowed again in the next time window, which resets every minute."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["It is recommended to poll for the latest order events associated with the token ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["every 30 seconds"]},". ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["The TTL for order events is 4 hours and 10 minutes"]},". In the Keeta system, orders automatically transition to a final state after 4 hours; an additional 10 minutes is provided as a buffer for time discrepancies."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Availability of new events in polling:"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Keeta may have specific rules about the maximum time new events are available in polling before they are removed."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Always check with Keeta what the rules are for using the polling service."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Duplicate Events"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Eventually Keeta may return the same event more than once, for example the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CREATED"]}," event, including old orders. For this reason ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["it is important that the Software Application handles the uniqueness of requests and events through id and the date"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["When receiving an event, the Software Service must check the event id and validate that this event (id) has not been processed before. ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["If this event has already been received previously, it must be discarded"]},"."]}]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["IMPORTANT"]},": The Software Services should only accept a new order or update the status of an order after validating that the event has not been processed before."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["It is also possible for the Software Service to make a request for the same event more than once (for example, requesting the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /v1/orders/{orderId}/confirm"]}," endpoint repeatedly)."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In these cases  Keeta can handle this situation in two different ways:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["As Keeta processes the requests synchronously, then Keeta should return ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["HTTP 422"]},", indicating that that event has been received before."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"acknowledgment-events","__idx":2},"children":["Acknowledgment Events"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When receiving new events via ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Polling"]},", the Software Service should always send acknowledgement so that Keeta does not send that same event again;"]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Important recommendations"]},":"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Merchants Software Service should make an acknowledgment request for each polling request with results."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["If it receives events that are not used by the itself, it needs to send the acknowledgment of these events anyway so that it is not receiving them every polling again."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["It is recommended that this be the default treatment for all events not yet mapped in the Software Service application."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The Software Services only needs to send acknowledgment of the event once."]}]}]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["IMPORTANT"]},": Acknowledgment NOT apply for WEBHOOKS."]}]}]},"headings":[{"value":"Polling","id":"polling","depth":1},{"value":"Query new order events","id":"query-new-order-events","depth":2},{"value":"Acknowledgment Events","id":"acknowledgment-events","depth":2}],"frontmatter":{"slug":"/apis/opendelivery/development-guides/orders/polling","seo":{"title":"Polling"}},"lastModified":"2026-11-12T19:50:41.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/en/apis/opendelivery/development-guides/orders/polling","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}