HAAT Integration Docs

Update business status

Open or close a business. Expiration dates are optional.

PUT/api/pos/business/{businessId}/status

status 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
PATH SCHEMA
businessIdrequired
integer

HAAT business id from List businesses.

REQUEST BODY SCHEMA: application/json
statusrequired
integer

0 Closed, 1 Open. Other values fail validation.

openExpirationDate
string | null

Optional. Only when status is 1 (Open). ISO 8601. Must be in the future if set.

closeExpirationDate
string | null

Optional. Only when status is 0 (Closed). ISO 8601. Must be in the future if set.

Status values

statusMeaningTypical body
0Closed{ "status": 0 } or { "status": 0, "closeExpirationDate": "..." }
1Open{ "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 openExpirationDate is ignored; open expiration is cleared.
  • Outside working hours: uses openExpirationDate if 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 closeExpirationDate if 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 status is Success
  • message is Branch is already open or Branch 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

  1. Read body status (Success, Pending, or Failed), not only the HTTP code.
  2. If Success, the change is done (or was already in the requested state).
  3. If Pending, poll Get request status with requestId until Success or Failed.
  4. If Failed, read message and fix the request.
Response statusHTTPMeaning
Success200Applied now, or already open/closed
Pending200Queued — poll Get request status
Failed400Validation or apply failed
RESPONSE BODY SCHEMA: application/json
requestIdrequired
string

Tracking id for Get request status.

statusrequired
string

Success, Pending, or Failed.

message
string | null

Human-readable result.

Common message values:

  • Branch status updated successfully
  • Branch is already open
  • Branch is already closed
  • Request queued for processing
  • CloseExpirationDate must not be provided when status is Open
  • OpenExpirationDate must not be provided when status is Closed
  • OpenExpirationDate must be in the future
  • CloseExpirationDate must be in the future
  • Error: 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.

Request example
cURL Open
bash
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 Close
bash
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 Open with openExpirationDate
bash
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"}'
Response example
200
json
{"requestId":"6651a3f2e1b2c3d4e5f60001","status":"Success","message":"Branch status updated successfully"}
200 Already open
json
{"requestId":"6651a3f2e1b2c3d4e5f60002","status":"Success","message":"Branch is already open"}
200 Pending
json
{"requestId":"6651a3f2e1b2c3d4e5f60003","status":"Pending","message":"Request queued for processing"}
400
json
{"requestId":"6651a3f2e1b2c3d4e5f60004","status":"Failed","message":"Error: status 2 is not supported"}
400 Past close date
json
{"requestId":"6651a3f2e1b2c3d4e5f60005","status":"Failed","message":"CloseExpirationDate must be in the future"}

Type to search…

↑↓ navigate↵ openesc close