> ## Documentation Index
> Fetch the complete documentation index at: https://developer.clopos.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Receipt (after close)

> Update specific fields of an existing receipt

## Purpose

Update specific fields of a receipt using the PATCH method. Only the provided fields will be updated; all other fields remain unchanged.

**Important Notes:**

* The PATCH method can update receipts even after they are closed (when `closed_at` is not null).
* Only limited fields can be updated via PATCH (see the field list below).

## HTTP Request

```http theme={null}
PATCH https://integrations.clopos.com/open-api/v2/receipts/{id}
```

<Warning>
  This endpoint requires authentication. Include your JWT in the `x-token` header. See [Authentication](/authentication) for how to obtain a token and [Errors](/errors) for error responses.
</Warning>

## Path Parameters

| Parameter | Type   | Description                                 |
| --------- | ------ | ------------------------------------------- |
| `id`      | number | Unique identifier of the receipt to update. |

## Request Body

Only the fields you want to update need to be included in the request body. Available updateable fields:

| Field          | Type    | Description                                                                                                                  |
| -------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `order_status` | string  | Order status. Valid values: `"NEW"`, `"SCHEDULED"`, `"IN_PROGRESS"`, `"READY"`, `"PICKED_UP"`, `"COMPLETED"`, `"CANCELLED"`. |
| `order_number` | string  | Order number identifier (e.g., `"RPO-00001"`).                                                                               |
| `fiscal_id`    | string  | Fiscal receipt identifier.                                                                                                   |
| `lock`         | boolean | Lock status of the receipt (`true` or `false`).                                                                              |

## Request Example

<CodeGroup>
  ```bash curl theme={null}
  curl --location --request PATCH 'https://integrations.clopos.com/open-api/v2/receipts/1' \
    --header 'Content-Type: application/json' \
    --header 'x-token: oauth_example_token' \
    --data '{
      "order_status": "NEW",
      "order_number": "RPO-00001",
      "fiscal_id": "Twrewr89fnscvj22",
      "lock": false
  }'
  ```

  ```javascript javascript theme={null}
  const receiptId = 1;

  const response = await fetch(`https://integrations.clopos.com/open-api/v2/receipts/${receiptId}`, {
    method: 'PATCH',
    headers: {
      'Content-Type': 'application/json',
      'x-token': 'oauth_example_token',
    },
    body: JSON.stringify({
      order_status: 'NEW',
      order_number: 'RPO-00001',
      fiscal_id: 'Twrewr89fnscvj22',
      lock: false
    })
  });

  const receipt = await response.json();
  ```

  ```python python theme={null}
  import requests

  receipt_id = 1
  url = f"https://integrations.clopos.com/open-api/v2/receipts/{receipt_id}"
  headers = {
      "Content-Type": "application/json",
      "x-token": "oauth_example_token",
  }
  payload = {
      "order_status": "NEW",
      "order_number": "RPO-00001",
      "fiscal_id": "Twrewr89fnscvj22",
      "lock": False
  }

  response = requests.patch(url, headers=headers, json=payload)
  receipt = response.json()
  ```
</CodeGroup>

## Response

### 200 OK — Receipt Updated

The response returns the full receipt data with updated fields:

```json theme={null}
{
  "success": true,
  "data": {
    "id": 1,
    "venue_id": 1,
    "cid": "96ab5d26-d6bb-4976-a6f8-9e8806ef6aa5",
    "customer_id": null,
    "sale_type_id": 2,
    "source": "web",
    "guests": 1,
    "status": 2,
    "order_status": "NEW",
    "order_number": "RPO-00001",
    "lock": false,
    "total": 30000,
    "subtotal": 30000,
    "discount_type": 0,
    "discount_value": 0,
    "discount_rate": 0,
    "total_discount": 0,
    "service_charge": 0,
    "service_charge_value": 0,
    "delivery_fee": 0,
    "remaining": 0,
    "i_tax": 0,
    "e_tax": 0,
    "total_tax": 0,
    "payment_methods": [
      {
        "id": 1,
        "name": "Cash",
        "amount": 30000
      }
    ],
    "fiscal_id": "Twrewr89fnscvj22",
    "loyalty_type": null,
    "loyalty_value": null,
    "address": null,
    "description": null,
    "created_at": "2026-01-19 14:51:33",
    "updated_at": "2026-01-20 12:43:07",
    "closed_at": "2026-01-19 15:07:49",
    "shift_date": "2026-01-19"
  },
  "message": "Operation completed successfully"
}
```

### 404 Not Found — Receipt Not Found

```json theme={null}
{
  "success": false,
  "error": "not_found",
  "message": "Receipt not found"
}
```

### 400 Bad Request — Validation Error

```json theme={null}
{
  "success": false,
  "error": "validation_failed",
  "message": "Invalid field values provided"
}
```

## Field Reference

### Updateable Fields

| Field          | Type    | Description                                                                                                                          |
| -------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `order_status` | string  | Current order status. Valid values: `"NEW"`, `"SCHEDULED"`, `"IN_PROGRESS"`, `"READY"`, `"PICKED_UP"`, `"COMPLETED"`, `"CANCELLED"`. |
| `order_number` | string  | External order number or identifier.                                                                                                 |
| `fiscal_id`    | string  | Fiscal receipt identifier used for tax reporting.                                                                                    |
| `lock`         | boolean | If `true`, locks the receipt to prevent further modifications.                                                                       |

## Notes

* Only the fields provided in the request body will be updated; all other fields remain unchanged.
* The response includes the complete receipt object with all integrator-relevant fields, not just the updated ones.
* Only the specified fields (`order_status`, `order_number`, `fiscal_id`, `lock`) can be updated through this endpoint.
* Other receipt fields are read-only and cannot be modified via this API.
* This method can update receipts even after they are closed (when `closed_at` is not null).
* The response also includes `time`, `timestamp`, and `unix` fields for diagnostics; these are omitted from the example for brevity.
