---
title: "Close a tab"
method: DELETE
path: "/poslink/v1/tabs/{tab_id}"
tags: ["Pay at Table"]
---

# Close a tab

`DELETE /poslink/v1/tabs/{tab_id}`

## Request

- Base URL: `https://api.teya.com`
- URL: `https://api.teya.com/poslink/v1/tabs/{tab_id}`
- Auth: OAuth 2
  - Authorization code: `https://id.teya.com/oauth/v2/oauth-authorize`
  - Token URL: `https://id.teya.com/oauth/v2/oauth-token`
- TypeScript: <https://skmtc.dev/teya/apis/poslink-api/docs/poslink/v1/tabs/:tab_id/delete.ts> (a function with typed inputs; its response is checked against the schema)

Soft-deletes a tab by setting its status to CLOSED. The tab record is retained.
Allowed source states: `OPEN`, `COMPLETED`, `PAUSED`. Closing a `PAYING` tab
is rejected because a transaction is mid-flight; drive it to a stable state
first (resume or pause). Closing a `PAUSED` tab is allowed — if a late
payment-completed event lands on the now-CLOSED tab, the credit is logged
and counted via `eposconnect.tabs.credit.on_closed_tab.count` for ops
visibility (no data recovery). Already-CLOSED tabs are rejected — the
second close is treated as an error rather than an idempotent no-op.

## Path parameters

- `tab_id` string, uuid, required

## Response `200`

Tab closed successfully

- CloseTabResponse: Response for tab closure (soft delete)
  - `tab_id` string, uuid, required: Tab identifier
  - `status` 'OPEN' | 'PAYING' | 'PAUSED' | 'COMPLETED' | 'CLOSED', required: Tab status after closure
  - `closed_at` string, date-time, required: ISO 8601 timestamp of closure (in UTC)

## Other responses

- `400`: Bad request
- `401`: Lacks valid authentication credentials for the requested resource
- `403`: The server understands the request but refuses to authorize it
- `404`: Tab not found
- `408`: Request timeout
- `409`: Conflict — tab is not in a state that allows closing (TAB_NOT_CLOSEABLE)
- `429`: Too many requests in a given amount of time
- `500`: Internal Server Error

---

[API](https://skmtc.dev/teya/apis/poslink-api.md) - [All operations](https://skmtc.dev/teya/apis/poslink-api/llms.txt) - [OpenAPI document](https://skmtc.dev/teya/apis/poslink-api/revisions/cc7c1bd11e93?raw)
