---
search:
  tags:
    - Sync
    - POST
seo:
  description: >-
    Admin or cashier. Replays a device's queued sales, customer, supplier,
    medicine… Reference for the POST /api/v1/sync/push endpoint in the
    PharmaFlow API.
sidebar:
  label: Push queued changes
  badge: POST
title: Push queued changes
type: openapi-operation
---
Admin or cashier. Replays a device's queued sales, customer, supplier, medicine changes. Per-entity results sit in the 200 body, and a replayed client_mutation_id is deduped.

`POST /api/v1/sync/push`

**Request body** (`application/json`, required)

- `device_id` (string, required)
- `changes` (object[], required)

Request body example:

```json
{
  "device_id": "string",
  "changes": [
    {
      "client_mutation_id": "string",
      "entity": "string",
      "op": "string",
      "payload": {
        "property1": null,
        "property2": null
      }
    }
  ]
}
```

**Responses**

- `200` — Accepted changes and per-entity rejections
- `400` — Body must contain device\_id and a changes array
- `401` — Not authenticated
- `403` — Caller's role is not allowed, the device belongs to another branch, or the device has been revoked
- `404` — Unknown device

Response example, 200:

```json
{
  "accepted": [
    {
      "client_mutation_id": "string",
      "id": "string",
      "icv": -9007199254740991,
      "invoice_number": "string"
    }
  ],
  "rejected": [
    {
      "client_mutation_id": "string",
      "code": "string",
      "message": "string"
    }
  ]
}
```
