Pular para o conteúdo

Buscar novos eventos

Requisição

Host: Keeta. Pré-requisito: lojas registradas com PUT /v1/merchantOnboarding.

ParâmetroOndeDescrição
x-polling-merchantsheader (array)IDs dos merchants no seu sistema a consultar (os mesmos do onboarding)
eventTypequery (array)Filtra tipos; os demais são confirmados automaticamente e omitidos. Omita ou envie com valor — nunca vazio

Resposta 200 — lista de eventos:

CampoTipoDescrição
eventIdstringID único do evento
eventTypestringVer Tipos de evento no Guia de Desenvolvimento
orderIdstringID do pedido (gerado pela Keeta)
orderURLstringURL dos detalhes do pedido
createdAtstringData/hora UTC, ISO 8601
sourceAppIdstringApp Keeta de origem (útil para hubs)
virtualBrandstringID alternativo do merchant (ex.: dark kitchen com várias marcas)
metadatastring (JSON)Presente em alguns eventos (CANCELLED, USER_REFUND_REQUEST, PICKUP_ONGOING, RECOMMENDED_PREPARATION_START)

Respostas: 200, 204, 400, 401, 403, 503.

Segurança
OAuth2(Escopos obrigatórios: od.all) and Sig
Consulta
eventTypeArray of strings, <= 13 items

Desired event types. All other events not selected by group will be automatically acknowledged and omitted from the response. Must either be omitted or non-empty.

Event Types definitions:

CREATED : Order created.
CONFIRMED : Order confirmed.
READY_FOR_PICKUP: Order ready for pickup by the customer or delivery person.
DISPATCHED : Order went out for delivery.
PICKED_UP : Order has been picked up by customer. Since there is currently no self-pickup scenario, the PICKED_UP event will not be received.
DELIVERED : Order has been delivered to customer.
CONCLUDED : Order completed.
CANCELLATION_REQUESTED : Sent by the Software Service to Keeta.
CANCELLED : When the order is actually cancelled.
USER_REFUND_REQUEST : Sent by Keeta to the Software Service.
REFUNDED : Sent by Keeta to the Software Service.
REFUND_FAILED : Sent by Keeta to the Software Service.
RECOMMENDED_PREPARATION_START : Sent by Keeta to notify the merchant to begin kitchen preparation immediately.

Cabeçalhos
x-polling-merchantsArray of strings, <= 100 items

Subset of merchants to fetch events from. Must either be omitted or non-empty.

curl -i -X GET \
'https://open.mykeeta.com/api/open/opendelivery/v1/events:polling?eventType=CREATED,CANCELLED,CONCLUDED' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'X-App-Signature: YOUR_API_KEY_HERE' \
-H 'x-polling-merchants: 22815773000169-dbc7e35a-c936-4665-9e13-eb55eb8b6824'

Respostas

Successful returns list of polled events .

Corpoapplication/json
Array [
eventIdstringobrigatório

Identificador único do evento.

eventTypestringobrigatório

Tipo do evento. Consulte a definição de cada tipo em Eventos de pedidos.

Enum:"CREATED""CONFIRMED""DISPATCHED""READY_FOR_PICKUP""PICKUP_ONGOING""PICKED_UP""DELIVERED""CONCLUDED""CANCELLATION_REQUESTED""CANCELLED"
Discriminador
orderIdstringobrigatório

Identificador único do pedido. O ID do pedido é gerado pela Keeta.

orderURLstring, (uri)obrigatório

URL para obter os detalhes do pedido.

createdAtstring, (date-time)obrigatório

Data e hora UTC de criação do pedido.

sourceAppIdstring

AppId da Keeta que originou o pedido. Ajuda aplicações que atuam como Hub e intermediam as solicitações entre a Keeta e o Software Service.

virtualBrandstring

ID alternativo do merchant quando o mesmo merchant possui identificações ou marcas diferentes, como dark kitchens. A Keeta ou o Software Hub deve conhecer este ID previamente.

]
Resposta
[ { "eventId": "string", "eventType": "CREATED", "orderId": "string", "orderURL": "http://example.com", "createdAt": "2019-08-24T14:15:22Z", "sourceAppId": "string", "virtualBrand": "string" } ]