Lock series to mobile device
curl --request POST \
--url https://api.contazen.ro/v1/invoice-series/{id}/lock \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.contazen.ro/v1/invoice-series/{id}/lock"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.contazen.ro/v1/invoice-series/{id}/lock', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.contazen.ro/v1/invoice-series/{id}/lock",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.contazen.ro/v1/invoice-series/{id}/lock"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.contazen.ro/v1/invoice-series/{id}/lock")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.contazen.ro/v1/invoice-series/{id}/lock")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"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"
}
}{
"success": false,
"error": {
"message": "<string>",
"type": "api_error",
"code": "<string>",
"param": "<string>",
"doc_url": "<string>"
},
"meta": {
"version": "v1",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"response_time": "23.45ms"
}
}{
"success": false,
"error": {
"message": "<string>",
"type": "api_error",
"code": "<string>",
"param": "<string>",
"doc_url": "<string>"
},
"meta": {
"version": "v1",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"response_time": "23.45ms"
}
}{
"success": false,
"error": {
"message": "<string>",
"type": "api_error",
"code": "<string>",
"param": "<string>",
"doc_url": "<string>"
},
"meta": {
"version": "v1",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"response_time": "23.45ms"
}
}Invoice Series
Lock Series to Mobile Device
Bind an invoice series to the caller mobile device so only that device can issue invoices against it.
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>'import requests
url = "https://api.contazen.ro/v1/invoice-series/{id}/lock"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.contazen.ro/v1/invoice-series/{id}/lock', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.contazen.ro/v1/invoice-series/{id}/lock",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.contazen.ro/v1/invoice-series/{id}/lock"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.contazen.ro/v1/invoice-series/{id}/lock")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.contazen.ro/v1/invoice-series/{id}/lock")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"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"
}
}{
"success": false,
"error": {
"message": "<string>",
"type": "api_error",
"code": "<string>",
"param": "<string>",
"doc_url": "<string>"
},
"meta": {
"version": "v1",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"response_time": "23.45ms"
}
}{
"success": false,
"error": {
"message": "<string>",
"type": "api_error",
"code": "<string>",
"param": "<string>",
"doc_url": "<string>"
},
"meta": {
"version": "v1",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"response_time": "23.45ms"
}
}{
"success": false,
"error": {
"message": "<string>",
"type": "api_error",
"code": "<string>",
"param": "<string>",
"doc_url": "<string>"
},
"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 thedevice_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 /invoiceswith a lockedseries_idreceive aseries_locked_to_deviceerror. - The locked device can call
POST /invoice-series/{id}/reserve-numbersto pre-allocate numbers for offline use.
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
object
required
Non-null once the series is locked.
Show Lock properties
Show Lock properties
string
Stable device identifier persisted on the mobile app (not a session ID).
integer
The
user_session.id that created the lock.integer
The user who locked the series.
string
Human-readable device label, e.g.
iPhone 15 Pro.string
ios, android or web.integer
Unix timestamp (seconds) when the lock was created.
boolean
Always
true after a successful lock.Was this page helpful?