Update business status
Open or close a business. Expiration dates are optional.
/api/pos/business/{businessId}/statusstatus 0 = Closed. status 1 = Open.
Both openExpirationDate and closeExpirationDate are optional. When you omit a date, HAAT either calculates one from working hours (and days off) or clears it, depending on Open vs Close and whether the business is inside working hours.
To read the current POS display status (Open / Closed), use Get business status.
Auth uses X-Api-Key. Missing or invalid key returns 401 / 403.
Write responses use Success, Pending, or Failed. If Pending, poll Get request status.
Example:
X-Api-Key: YOUR_API_KEY
businessIdrequiredstatusrequiredopenExpirationDatecloseExpirationDateStatus values
status | Meaning | Typical body |
|---|---|---|
0 | Closed | { "status": 0 } or { "status": 0, "closeExpirationDate": "..." } |
1 | Open | { "status": 1 } or { "status": 1, "openExpirationDate": "..." } |
Do not send Busy, Soon, or other internal statuses on this endpoint. Get business status maps Busy / Close / Soon to display Closed.
Open (status 1)
- Opens the business and clears any close expiration.
- Inside working hours: a provided
openExpirationDateis ignored; open expiration is cleared. - Outside working hours: uses
openExpirationDateif provided; otherwise the next slot’s closing time; if none, about 8 hours from now. - Opening may clear today from days off when applicable.
Close (status 0)
- Closes the business and clears any open expiration.
- Uses
closeExpirationDateif provided; otherwise the next opening time from working hours (converted to UTC). - If no next opening time is found, close expiration may remain unset (
null).
Already open / already closed
If the business is already open and you send Open, or already closed and you send Closed:
- Response
statusisSuccess messageisBranch is already openorBranch is already closed- Dates are not recalculated and the status is not applied again
A temporary Busy / Soon state is not treated as already closed — a Close request still applies.
How to handle the response
- Read body
status(Success,Pending, orFailed), not only the HTTP code. - If
Success, the change is done (or was already in the requested state). - If
Pending, poll Get request status withrequestIduntilSuccessorFailed. - If
Failed, readmessageand fix the request.
| Response status | HTTP | Meaning |
|---|---|---|
Success | 200 | Applied now, or already open/closed |
Pending | 200 | Queued — poll Get request status |
Failed | 400 | Validation or apply failed |
requestIdrequiredstatusrequiredmessageCommon message values:
Branch status updated successfullyBranch is already openBranch is already closedRequest queued for processingCloseExpirationDate must not be provided when status is OpenOpenExpirationDate must not be provided when status is ClosedOpenExpirationDate must be in the futureCloseExpirationDate must be in the futureError: status 2 is not supported
Responses
200 — Success or queued
If body status is Pending, poll Get request status.
400 — Failed
Examples: unsupported status; open/close date on the wrong request; past expiration date; unknown business. Body has status Failed, a requestId, and message.
401 / 403 — Auth failed
Missing or invalid X-Api-Key.
curl -X PUT http://ext-integration.haat-delivery.io/api/pos/business/1021/status \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"status":1}'curl -X PUT http://ext-integration.haat-delivery.io/api/pos/business/1021/status \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"status":0,"closeExpirationDate":"2026-12-31T08:00:00Z"}'curl -X PUT http://ext-integration.haat-delivery.io/api/pos/business/1021/status \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"status":1,"openExpirationDate":"2026-12-31T22:00:00Z"}'{"requestId":"6651a3f2e1b2c3d4e5f60001","status":"Success","message":"Branch status updated successfully"}{"requestId":"6651a3f2e1b2c3d4e5f60002","status":"Success","message":"Branch is already open"}{"requestId":"6651a3f2e1b2c3d4e5f60003","status":"Pending","message":"Request queued for processing"}{"requestId":"6651a3f2e1b2c3d4e5f60004","status":"Failed","message":"Error: status 2 is not supported"}{"requestId":"6651a3f2e1b2c3d4e5f60005","status":"Failed","message":"CloseExpirationDate must be in the future"}