Skip to main content
POST
/
invoice-series
/
{id}
/
lock
Lock series to mobile device
curl --request POST \
  --url https://api.contazen.ro/v1/invoice-series/{id}/lock \
  --header 'Authorization: Bearer <token>'
{
  "success": true,
  "data": {
    "id": "<string>",
    "object": "invoice_series",
    "name": "<string>",
    "document_type": "fiscal",
    "description": "<string>",
    "start_number": 123,
    "next_number": 123,
    "format": "FACT-{year}-{number}",
    "is_primary": true,
    "is_used": true,
    "is_locked": true,
    "lock": {
      "device_id": "<string>",
      "session_id": 123,
      "user_id": 123,
      "device_name": "<string>",
      "device_platform": "<string>",
      "locked_at": 123
    },
    "year": 123,
    "created_at": 123
  },
  "meta": {
    "version": "v1",
    "request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "response_time": "23.45ms"
  }
}

Overview

Locking a series binds it to the mobile device that issued the call (identified by the device_id stored on its user_session). Once locked:
  • Only that device can issue invoices against the series — online or via pre-reserved numbers when offline.
  • Web/API-key callers attempting to POST /invoices with a locked series_id receive a series_locked_to_device error.
  • The locked device can call POST /invoice-series/{id}/reserve-numbers to pre-allocate numbers for offline use.
This prevents race conditions on the invoice number counter when a mobile device is offline and a web user is also trying to emit invoices on the same series.
Requires a mobile JWT session (issued by /auth/login). The JWT’s backing user_session must have a non-empty device_id — re-authenticate from the app if device_id_missing is returned.

Response

lock
object
required
Non-null once the series is locked.
is_locked
boolean
Always true after a successful lock.

Authorizations

Authorization
string
header
required

Use your API key (sk_live_xxx or sk_test_xxx)

Path Parameters

id
string
required

Response

Series locked

success
boolean
data
object
meta
object