Create register
curl --request POST \
--url https://api.openfiskal.com/v1/registers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-OpenFiskal-Merchant: <x-openfiskal-merchant>' \
--data '
{
"location_id": "loc_abc123",
"name": "Register 1",
"external_id": "POS-001"
}
'import requests
url = "https://api.openfiskal.com/v1/registers"
payload = {
"location_id": "loc_abc123",
"name": "Register 1",
"external_id": "POS-001"
}
headers = {
"X-OpenFiskal-Merchant": "<x-openfiskal-merchant>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-OpenFiskal-Merchant': '<x-openfiskal-merchant>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({location_id: 'loc_abc123', name: 'Register 1', external_id: 'POS-001'})
};
fetch('https://api.openfiskal.com/v1/registers', 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.openfiskal.com/v1/registers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'location_id' => 'loc_abc123',
'name' => 'Register 1',
'external_id' => 'POS-001'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-OpenFiskal-Merchant: <x-openfiskal-merchant>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.openfiskal.com/v1/registers"
payload := strings.NewReader("{\n \"location_id\": \"loc_abc123\",\n \"name\": \"Register 1\",\n \"external_id\": \"POS-001\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-OpenFiskal-Merchant", "<x-openfiskal-merchant>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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.openfiskal.com/v1/registers")
.header("X-OpenFiskal-Merchant", "<x-openfiskal-merchant>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"location_id\": \"loc_abc123\",\n \"name\": \"Register 1\",\n \"external_id\": \"POS-001\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openfiskal.com/v1/registers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-OpenFiskal-Merchant"] = '<x-openfiskal-merchant>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"location_id\": \"loc_abc123\",\n \"name\": \"Register 1\",\n \"external_id\": \"POS-001\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"merchant_id": "<string>",
"location_id": "<string>",
"name": "<string>",
"status": "active",
"fiscalization_status": "not_fiscalized",
"created_at": "2023-11-07T05:31:56Z",
"external_id": "<string>",
"fiscalization": {
"regime": "<string>",
"fiscalized_at": "2023-11-07T05:31:56Z",
"tse_serial": "<string>",
"client_id": "<string>"
}
}{
"code": "invalid_request",
"message": "The request body is malformed.",
"retryable": false
}{
"code": "unauthorized",
"message": "Authentication failed.",
"retryable": false
}{
"code": "forbidden",
"message": "The authenticated caller cannot access this resource.",
"retryable": false
}{
"code": "not_found",
"message": "The requested resource does not exist.",
"retryable": false
}{
"code": "regime_validation_failed",
"message": "The payload violates regime-specific validation rules.",
"retryable": false
}Registers
Create register
POST
/
registers
Create register
curl --request POST \
--url https://api.openfiskal.com/v1/registers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-OpenFiskal-Merchant: <x-openfiskal-merchant>' \
--data '
{
"location_id": "loc_abc123",
"name": "Register 1",
"external_id": "POS-001"
}
'import requests
url = "https://api.openfiskal.com/v1/registers"
payload = {
"location_id": "loc_abc123",
"name": "Register 1",
"external_id": "POS-001"
}
headers = {
"X-OpenFiskal-Merchant": "<x-openfiskal-merchant>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-OpenFiskal-Merchant': '<x-openfiskal-merchant>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({location_id: 'loc_abc123', name: 'Register 1', external_id: 'POS-001'})
};
fetch('https://api.openfiskal.com/v1/registers', 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.openfiskal.com/v1/registers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'location_id' => 'loc_abc123',
'name' => 'Register 1',
'external_id' => 'POS-001'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-OpenFiskal-Merchant: <x-openfiskal-merchant>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.openfiskal.com/v1/registers"
payload := strings.NewReader("{\n \"location_id\": \"loc_abc123\",\n \"name\": \"Register 1\",\n \"external_id\": \"POS-001\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-OpenFiskal-Merchant", "<x-openfiskal-merchant>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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.openfiskal.com/v1/registers")
.header("X-OpenFiskal-Merchant", "<x-openfiskal-merchant>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"location_id\": \"loc_abc123\",\n \"name\": \"Register 1\",\n \"external_id\": \"POS-001\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openfiskal.com/v1/registers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-OpenFiskal-Merchant"] = '<x-openfiskal-merchant>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"location_id\": \"loc_abc123\",\n \"name\": \"Register 1\",\n \"external_id\": \"POS-001\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"merchant_id": "<string>",
"location_id": "<string>",
"name": "<string>",
"status": "active",
"fiscalization_status": "not_fiscalized",
"created_at": "2023-11-07T05:31:56Z",
"external_id": "<string>",
"fiscalization": {
"regime": "<string>",
"fiscalized_at": "2023-11-07T05:31:56Z",
"tse_serial": "<string>",
"client_id": "<string>"
}
}{
"code": "invalid_request",
"message": "The request body is malformed.",
"retryable": false
}{
"code": "unauthorized",
"message": "Authentication failed.",
"retryable": false
}{
"code": "forbidden",
"message": "The authenticated caller cannot access this resource.",
"retryable": false
}{
"code": "not_found",
"message": "The requested resource does not exist.",
"retryable": false
}{
"code": "regime_validation_failed",
"message": "The payload violates regime-specific validation rules.",
"retryable": false
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Merchant identifier returned by the merchants resource.
Body
application/json
Response
Register created
Available options:
active, inactive Available options:
not_fiscalized, pending, failed, fiscalized, decommissioned Show child attributes
Show child attributes
Was this page helpful?