> Source: https://fiscal.link/integrators/docs/reference/cloud-commands/commands
> Starea și rezultatul unei comenzi, și listele de comenzi.

API Cloud: comenzi

# Comenzi

Starea și rezultatul unei comenzi, și listele de comenzi.

## Resursa GetCommandStatusResponse

`commandId` uuid doar citire

Id-ul comenzii.

`retryOfCommandId` uuid poate fi null doar citire

Id-ul inițial, când comanda a înlocuit alta sub un id nou (de exemplu un bon refuzat pentru lipsă de hârtie). Dacă ceri id-ul inițial, primești comanda nouă. `null` altfel. Nu apare pe sandbox.

`requestId` string poate fi null doar citire

`Idempotency-Key`\-ul cu care a fost creată comanda: al tău sau, pentru o retrimitere care înlocuiește o comandă eșuată, al celei inițiale. `null` dacă n-ai trimis unul.

`commandType` string doar citire

Felul comenzii.

-   `cashRegister.printReportZ` Raport Z.
-   `cashRegister.printReportX` Raport X.
-   `cashRegister.printFiscalReceipt` Bon fiscal.
-   `cashRegister.printNonFiscalReceipt` Bon nefiscal.
-   `cashRegister.readVatRates` Citire cote TVA.
-   `cashRegister.cashIn` Intrare de numerar.
-   `cashRegister.cashOut` Ieșire de numerar.
-   `cashRegister.openDrawer` Deschidere sertar.

`serialNumber` string doar citire

Seria fiscală a casei.

`status` string doar citire

Starea comenzii.

-   `Pending` În coadă.
-   `Processing` Casa o execută.
-   `Sent` Stare veche; nu se mai scrie.
-   `Failed` A eșuat.
-   `Cancelled` Anulată.
-   `Succeeded` A reușit.
-   `TimedOut` A expirat fără răspuns.

`createdAt` datetime doar citire

Când a fost creată, în UTC.

`completedAt` datetime poate fi null doar citire

Când s-a terminat, în UTC.

`statusCode` integer poate fi null doar citire

Codul de stare dat de casă, același ca pe API-ul local.

`contentType` string poate fi null doar citire

Tipul conținutului din `body`.

`body` [object](https://fiscal.link/integrators/docs/reference/objects/cloud-command-result-envelope) poate fi null doar citire

Răspunsul casei, de obicei plicul `{statusCode, data}`. Mai poate fi o eroare de transport (`cloud-framing-error`) sau un text.

`message` string poate fi null doar citire

Explicația stării.

`payload` object poate fi null doar citire

Corpul comenzii, exact cum l-ai trimis.

`trace` object poate fi null doar citire

Cu o cheie API e mereu `null`.

### Obiecte folosite aici

-   [CommandResult](https://fiscal.link/integrators/docs/reference/objects/cloud-command-result-envelope)
-   [CommandFramingError](https://fiscal.link/integrators/docs/reference/objects/cloud-framing-error)
-   [PrintFiscalReceiptResult](https://fiscal.link/integrators/docs/reference/objects/cloud-fiscal-receipt-result)
-   [ReceiptVatGroup](https://fiscal.link/integrators/docs/reference/objects/cloud-receipt-vat-group)
-   [ResolvedPluItem](https://fiscal.link/integrators/docs/reference/objects/cloud-resolved-plu-item)
-   [DailyReportSummary](https://fiscal.link/integrators/docs/reference/objects/cloud-report-summary)
-   [ReportTaxGroup](https://fiscal.link/integrators/docs/reference/objects/cloud-report-tax-group)
-   [ReportPayments](https://fiscal.link/integrators/docs/reference/objects/cloud-report-payments)
-   [VatRatesSummary](https://fiscal.link/integrators/docs/reference/objects/cloud-vat-rates-summary)
-   [CashOperationResult](https://fiscal.link/integrators/docs/reference/objects/cloud-cash-operation-result)
-   [PaginatedResponse](https://fiscal.link/integrators/docs/reference/objects/cloud-page)
-   [IntegratorCommandListItemResponse](https://fiscal.link/integrators/docs/reference/objects/cloud-command-list-item)
-   [RegisterCommandsQuery](https://fiscal.link/integrators/docs/reference/objects/cloud-register-commands-query)
-   [IntegratorCommandsQuery](https://fiscal.link/integrators/docs/reference/objects/cloud-commands-query)

## Rute

GET `…/cash-registers/{serialNumber}/commands/{commandId}` Sincron

### `get-command`

Starea unei comenzi: status, codul casei și răspunsul ei.

| Câmp | Descriere |
| --- | --- |
| `commandId` | ID-ul comenzii. |
| `retryOfCommandId` | La o reîncercare automată din lipsă de hârtie: ID-ul primei comenzi, cea primită de tine. `null` la comenzile obișnuite. |
| `commandType` | `cashRegister.printFiscalReceipt`, `cashRegister.printNonFiscalReceipt`, `cashRegister.printReportZ`, `cashRegister.printReportX` sau `cashRegister.readVatRates`. |
| `status` | Starea, vezi „Ciclul unei comenzi”. |
| `createdAt` / `completedAt` | Când a intrat în coadă / când a ajuns într-o stare finală. |
| `statusCode` | Codul raportat de casă: vezi „Rezultatul unei comenzi”. |
| `body` | Răspunsul casei, așa cum a venit. |
| `message` | Textul casei, din `body.message`; `null` la succes. |
| `payload` | Corpul trimis de tine; `null` la comenzile fără corp. |
| `trace` | Mereu `null` pentru cheile API. |

-   Răspuns [GetCommandStatusResponse](https://fiscal.link/integrators/docs/reference/objects/cloud-command-status)
-   Răspuns [CommandResult](https://fiscal.link/integrators/docs/reference/objects/cloud-command-result-envelope)
-   Răspuns [CommandFramingError](https://fiscal.link/integrators/docs/reference/objects/cloud-framing-error)
-   Răspuns [PrintFiscalReceiptResult](https://fiscal.link/integrators/docs/reference/objects/cloud-fiscal-receipt-result)
-   Răspuns [ReceiptVatGroup](https://fiscal.link/integrators/docs/reference/objects/cloud-receipt-vat-group)
-   Răspuns [ResolvedPluItem](https://fiscal.link/integrators/docs/reference/objects/cloud-resolved-plu-item)
-   Răspuns [DailyReportSummary](https://fiscal.link/integrators/docs/reference/objects/cloud-report-summary)
-   Răspuns [ReportTaxGroup](https://fiscal.link/integrators/docs/reference/objects/cloud-report-tax-group)
-   Răspuns [ReportPayments](https://fiscal.link/integrators/docs/reference/objects/cloud-report-payments)
-   Răspuns [VatRatesSummary](https://fiscal.link/integrators/docs/reference/objects/cloud-vat-rates-summary)
-   Răspuns [CashOperationResult](https://fiscal.link/integrators/docs/reference/objects/cloud-cash-operation-result)

GETCerere

```bash
curl -X GET 'https://cloud-api.fiscallink.ro/api/v2/tenants/YOUR_TENANT_ID/integrator/cash-registers/DT000001/commands/c3a9f1e7-5d2b-4c8a-9e61-0f1a2b3c4d5e' \
  -H 'X-Api-Key: fsk_YOUR_API_KEY'
```

200Starea unei comenzi — get-command, 200

```json
{
  "commandId": "c3a9f1e7-5d2b-4c8a-9e61-0f1a2b3c4d5e",
  "retryOfCommandId": null,
  "requestId": "3f2c1a9e-7b4d-4e8a-9c21-5d6f7a8b9c0d",
  "commandType": "cashRegister.printFiscalReceipt",
  "serialNumber": "DT000001",
  "status": "Succeeded",
  "createdAt": "2026-09-25T09:15:01.221Z",
  "completedAt": "2026-09-25T09:15:03.870Z",
  "statusCode": 200,
  "contentType": "application/json",
  "body": {
    "statusCode": 200,
    "data": {
      "message": "Receipt printed successfully.",
      "receiptNumber": null,
      "subtotal": null,
      "total": null,
      "paymentFinalized": null,
      "vatBreakdown": null,
      "pluItems": null,
      "nZrep": null,
      "nFNum": null,
      "brand": "Datecs",
      "printedAt": "2026-09-25T09:15:03.870Z",
      "debugCloseFields": null
    }
  },
  "message": null,
  "payload": { "receiptItems": [{ "type": 1, "pluSale": { "pluNumber": 101, "quantity": 2 } }] },
  "trace": null
}
```

GET `…/cash-registers/{serialNumber}/commands` Sincron

### `list-register-commands`

Comenzile tale către această serie, cele mai noi primele, paginat. Filtre: `status` (repetabil), `type`, `from`, `to`. O serie pe care n-ai comandat-o răspunde cu o pagină goală, nu `404`.

-   Răspuns [PaginatedResponse](https://fiscal.link/integrators/docs/reference/objects/cloud-page)
-   Răspuns [IntegratorCommandListItemResponse](https://fiscal.link/integrators/docs/reference/objects/cloud-command-list-item)
-   Cerere [RegisterCommandsQuery](https://fiscal.link/integrators/docs/reference/objects/cloud-register-commands-query)

GETCerere

```bash
curl -X GET 'https://cloud-api.fiscallink.ro/api/v2/tenants/YOUR_TENANT_ID/integrator/cash-registers/DT000001/commands' \
  -H 'X-Api-Key: fsk_YOUR_API_KEY'
```

200Răspuns

```json
{
  "page": 1,
  "pageSize": 20,
  "total": 1,
  "items": []
}
```

GET `…/commands` Sincron

### `list-commands`

Toate comenzile organizației, pe toată flota, paginat. Filtre: `status`, `type`, `from`, `to`, `serialNumber`, `registerId`.

-   Răspuns [PaginatedResponse](https://fiscal.link/integrators/docs/reference/objects/cloud-page)
-   Răspuns [IntegratorCommandListItemResponse](https://fiscal.link/integrators/docs/reference/objects/cloud-command-list-item)
-   Cerere [IntegratorCommandsQuery](https://fiscal.link/integrators/docs/reference/objects/cloud-commands-query)

GETCerere

```bash
curl -X GET 'https://cloud-api.fiscallink.ro/api/v2/tenants/YOUR_TENANT_ID/integrator/commands' \
  -H 'X-Api-Key: fsk_YOUR_API_KEY'
```

200Răspuns

```json
{
  "page": 1,
  "pageSize": 20,
  "total": 1,
  "items": []
}
```
