Skip to main content

lock-capabilities

CreateOrderLock

Order & Pay
Pay at Table
QR Pay

POST REST /v1/orders/{orderId}/lock

REQUEST
RESPONSE
WS CreateOrderLockV1

This capability allows Dojo to acquire a lock on orders before making modifications to it like recording payments or adding items. These locks allow the EPOS to know when an Order being modified and give Dojo the guarantee that the Order will not be modified externally while these operations are taking place. Dojo will only try to acquire when making modifications, for other purposes fetching an eventually consistent snapshot of an Order from the EPOS through GetOrder should always be possible.

Registered capabilitiesBehaviour
RecordOrderPaymentDojo will send the RecordOrderPayment request, if a Conflict error is returned Dojo will attempt to reverse the payment
RecordOrderPayment, CreateOrderLock, DeleteOrderLockDojo will first try to create the order lock with a long expiry. If successful it will try to record one or multiple payments then delete the lock.
RecordOrderPayment, CreateOrderLock, DeleteOrderLock, ExtendOrderLockDojo will first try to create the order lock with a short expiry. If successful it will try to record one or multiple payments. If the payment session takes longer, it will extend the lock. After the payment session has finished we will delete the lock.

DeleteOrderLock

Order & Pay
Pay at Table
QR Pay

DELETE REST /v1/orders/{orderId}/locks/{lockId}

REQUEST
RESPONSE
WS DeleteOrderLockV1

This capability allows Dojo to release a lock on orders. If both this and CreateOrderLockRequest are registered then Dojo will only attempt to RecordOrderPayment against an order after having successfully acquired a lock and will release the lock once the payment is recorded.

ExtendOrderLock

Order & Pay
Pay at Table
QR Pay

PUT REST /v1/orders/{orderId}/locks/{lockId}

REQUEST
RESPONSE
WS DeleteOrderLockV1

This capability allows Dojo to extend an existing lock. It is not required for the locking flow to function, registering this will allow Dojo to create locks with a shorter initial expiry and extend as needed.