Update location
curl --request PATCH \
--url https://api.openfiskal.com/v1/locations/{locationId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-OpenFiskal-Merchant: <x-openfiskal-merchant>' \
--data '
{
"name": "Updated Store Name",
"external_id": "loc-002",
"timezone": "Europe/Vienna",
"fiscal_details": {
"regime": "czechia_eet2",
"eet2_business_unit_id": 141
}
}
'import requests
url = "https://api.openfiskal.com/v1/locations/{locationId}"
payload = {
"name": "Updated Store Name",
"external_id": "loc-002",
"timezone": "Europe/Vienna",
"fiscal_details": {
"regime": "czechia_eet2",
"eet2_business_unit_id": 141
}
}
headers = {
"X-OpenFiskal-Merchant": "<x-openfiskal-merchant>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'X-OpenFiskal-Merchant': '<x-openfiskal-merchant>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Updated Store Name',
external_id: 'loc-002',
timezone: 'Europe/Vienna',
fiscal_details: {regime: 'czechia_eet2', eet2_business_unit_id: 141}
})
};
fetch('https://api.openfiskal.com/v1/locations/{locationId}', 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/locations/{locationId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Updated Store Name',
'external_id' => 'loc-002',
'timezone' => 'Europe/Vienna',
'fiscal_details' => [
'regime' => 'czechia_eet2',
'eet2_business_unit_id' => 141
]
]),
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/locations/{locationId}"
payload := strings.NewReader("{\n \"name\": \"Updated Store Name\",\n \"external_id\": \"loc-002\",\n \"timezone\": \"Europe/Vienna\",\n \"fiscal_details\": {\n \"regime\": \"czechia_eet2\",\n \"eet2_business_unit_id\": 141\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.openfiskal.com/v1/locations/{locationId}")
.header("X-OpenFiskal-Merchant", "<x-openfiskal-merchant>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Updated Store Name\",\n \"external_id\": \"loc-002\",\n \"timezone\": \"Europe/Vienna\",\n \"fiscal_details\": {\n \"regime\": \"czechia_eet2\",\n \"eet2_business_unit_id\": 141\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openfiskal.com/v1/locations/{locationId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-OpenFiskal-Merchant"] = '<x-openfiskal-merchant>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Updated Store Name\",\n \"external_id\": \"loc-002\",\n \"timezone\": \"Europe/Vienna\",\n \"fiscal_details\": {\n \"regime\": \"czechia_eet2\",\n \"eet2_business_unit_id\": 141\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"merchant_id": "<string>",
"name": "<string>",
"fiscal_details": {
"regime": "czechia_eet2",
"eet2_business_unit_id": 141
},
"address": {
"line1": "<string>",
"city": "<string>",
"postal_code": "<string>",
"country_code": "DEU",
"line2": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"external_id": "<string>",
"timezone": "<string>"
}Locations
Update location
PATCH
/
locations
/
{locationId}
Update location
curl --request PATCH \
--url https://api.openfiskal.com/v1/locations/{locationId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-OpenFiskal-Merchant: <x-openfiskal-merchant>' \
--data '
{
"name": "Updated Store Name",
"external_id": "loc-002",
"timezone": "Europe/Vienna",
"fiscal_details": {
"regime": "czechia_eet2",
"eet2_business_unit_id": 141
}
}
'import requests
url = "https://api.openfiskal.com/v1/locations/{locationId}"
payload = {
"name": "Updated Store Name",
"external_id": "loc-002",
"timezone": "Europe/Vienna",
"fiscal_details": {
"regime": "czechia_eet2",
"eet2_business_unit_id": 141
}
}
headers = {
"X-OpenFiskal-Merchant": "<x-openfiskal-merchant>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'X-OpenFiskal-Merchant': '<x-openfiskal-merchant>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Updated Store Name',
external_id: 'loc-002',
timezone: 'Europe/Vienna',
fiscal_details: {regime: 'czechia_eet2', eet2_business_unit_id: 141}
})
};
fetch('https://api.openfiskal.com/v1/locations/{locationId}', 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/locations/{locationId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Updated Store Name',
'external_id' => 'loc-002',
'timezone' => 'Europe/Vienna',
'fiscal_details' => [
'regime' => 'czechia_eet2',
'eet2_business_unit_id' => 141
]
]),
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/locations/{locationId}"
payload := strings.NewReader("{\n \"name\": \"Updated Store Name\",\n \"external_id\": \"loc-002\",\n \"timezone\": \"Europe/Vienna\",\n \"fiscal_details\": {\n \"regime\": \"czechia_eet2\",\n \"eet2_business_unit_id\": 141\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.openfiskal.com/v1/locations/{locationId}")
.header("X-OpenFiskal-Merchant", "<x-openfiskal-merchant>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Updated Store Name\",\n \"external_id\": \"loc-002\",\n \"timezone\": \"Europe/Vienna\",\n \"fiscal_details\": {\n \"regime\": \"czechia_eet2\",\n \"eet2_business_unit_id\": 141\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openfiskal.com/v1/locations/{locationId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-OpenFiskal-Merchant"] = '<x-openfiskal-merchant>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Updated Store Name\",\n \"external_id\": \"loc-002\",\n \"timezone\": \"Europe/Vienna\",\n \"fiscal_details\": {\n \"regime\": \"czechia_eet2\",\n \"eet2_business_unit_id\": 141\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"merchant_id": "<string>",
"name": "<string>",
"fiscal_details": {
"regime": "czechia_eet2",
"eet2_business_unit_id": 141
},
"address": {
"line1": "<string>",
"city": "<string>",
"postal_code": "<string>",
"country_code": "DEU",
"line2": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"external_id": "<string>",
"timezone": "<string>"
}Authorizations
Body
application/json
Response
Location updated
Was this page helpful?