Create merchant
curl --request POST \
--url https://api.openfiskal.com/v1/merchants \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"legal_name": "Test GmbH",
"country_code": "DEU",
"address": {
"line1": "Musterstr. 1",
"city": "Berlin",
"postal_code": "10115",
"country_code": "DEU",
"line2": "Apt 4"
},
"fiscal_identities": [
{
"country_code": "DEU",
"tax_number": "21/815/08150",
"vat_id": "DE123456789"
}
]
}
'import requests
url = "https://api.openfiskal.com/v1/merchants"
payload = {
"legal_name": "Test GmbH",
"country_code": "DEU",
"address": {
"line1": "Musterstr. 1",
"city": "Berlin",
"postal_code": "10115",
"country_code": "DEU",
"line2": "Apt 4"
},
"fiscal_identities": [
{
"country_code": "DEU",
"tax_number": "21/815/08150",
"vat_id": "DE123456789"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
legal_name: 'Test GmbH',
country_code: 'DEU',
address: {
line1: 'Musterstr. 1',
city: 'Berlin',
postal_code: '10115',
country_code: 'DEU',
line2: 'Apt 4'
},
fiscal_identities: [{country_code: 'DEU', tax_number: '21/815/08150', vat_id: 'DE123456789'}]
})
};
fetch('https://api.openfiskal.com/v1/merchants', 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/merchants",
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([
'legal_name' => 'Test GmbH',
'country_code' => 'DEU',
'address' => [
'line1' => 'Musterstr. 1',
'city' => 'Berlin',
'postal_code' => '10115',
'country_code' => 'DEU',
'line2' => 'Apt 4'
],
'fiscal_identities' => [
[
'country_code' => 'DEU',
'tax_number' => '21/815/08150',
'vat_id' => 'DE123456789'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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/merchants"
payload := strings.NewReader("{\n \"legal_name\": \"Test GmbH\",\n \"country_code\": \"DEU\",\n \"address\": {\n \"line1\": \"Musterstr. 1\",\n \"city\": \"Berlin\",\n \"postal_code\": \"10115\",\n \"country_code\": \"DEU\",\n \"line2\": \"Apt 4\"\n },\n \"fiscal_identities\": [\n {\n \"country_code\": \"DEU\",\n \"tax_number\": \"21/815/08150\",\n \"vat_id\": \"DE123456789\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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/merchants")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"legal_name\": \"Test GmbH\",\n \"country_code\": \"DEU\",\n \"address\": {\n \"line1\": \"Musterstr. 1\",\n \"city\": \"Berlin\",\n \"postal_code\": \"10115\",\n \"country_code\": \"DEU\",\n \"line2\": \"Apt 4\"\n },\n \"fiscal_identities\": [\n {\n \"country_code\": \"DEU\",\n \"tax_number\": \"21/815/08150\",\n \"vat_id\": \"DE123456789\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openfiskal.com/v1/merchants")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"legal_name\": \"Test GmbH\",\n \"country_code\": \"DEU\",\n \"address\": {\n \"line1\": \"Musterstr. 1\",\n \"city\": \"Berlin\",\n \"postal_code\": \"10115\",\n \"country_code\": \"DEU\",\n \"line2\": \"Apt 4\"\n },\n \"fiscal_identities\": [\n {\n \"country_code\": \"DEU\",\n \"tax_number\": \"21/815/08150\",\n \"vat_id\": \"DE123456789\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"legal_name": "<string>",
"country_code": "DEU",
"status": "active",
"address": {
"line1": "<string>",
"city": "<string>",
"postal_code": "<string>",
"country_code": "DEU",
"line2": "<string>"
},
"fiscal_identities": [
{
"country_code": "DEU",
"tax_number": "21/815/08150",
"vat_id": "DE123456789"
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"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": "regime_validation_failed",
"message": "The payload violates regime-specific validation rules.",
"retryable": false
}Merchants
Create merchant
POST
/
merchants
Create merchant
curl --request POST \
--url https://api.openfiskal.com/v1/merchants \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"legal_name": "Test GmbH",
"country_code": "DEU",
"address": {
"line1": "Musterstr. 1",
"city": "Berlin",
"postal_code": "10115",
"country_code": "DEU",
"line2": "Apt 4"
},
"fiscal_identities": [
{
"country_code": "DEU",
"tax_number": "21/815/08150",
"vat_id": "DE123456789"
}
]
}
'import requests
url = "https://api.openfiskal.com/v1/merchants"
payload = {
"legal_name": "Test GmbH",
"country_code": "DEU",
"address": {
"line1": "Musterstr. 1",
"city": "Berlin",
"postal_code": "10115",
"country_code": "DEU",
"line2": "Apt 4"
},
"fiscal_identities": [
{
"country_code": "DEU",
"tax_number": "21/815/08150",
"vat_id": "DE123456789"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
legal_name: 'Test GmbH',
country_code: 'DEU',
address: {
line1: 'Musterstr. 1',
city: 'Berlin',
postal_code: '10115',
country_code: 'DEU',
line2: 'Apt 4'
},
fiscal_identities: [{country_code: 'DEU', tax_number: '21/815/08150', vat_id: 'DE123456789'}]
})
};
fetch('https://api.openfiskal.com/v1/merchants', 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/merchants",
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([
'legal_name' => 'Test GmbH',
'country_code' => 'DEU',
'address' => [
'line1' => 'Musterstr. 1',
'city' => 'Berlin',
'postal_code' => '10115',
'country_code' => 'DEU',
'line2' => 'Apt 4'
],
'fiscal_identities' => [
[
'country_code' => 'DEU',
'tax_number' => '21/815/08150',
'vat_id' => 'DE123456789'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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/merchants"
payload := strings.NewReader("{\n \"legal_name\": \"Test GmbH\",\n \"country_code\": \"DEU\",\n \"address\": {\n \"line1\": \"Musterstr. 1\",\n \"city\": \"Berlin\",\n \"postal_code\": \"10115\",\n \"country_code\": \"DEU\",\n \"line2\": \"Apt 4\"\n },\n \"fiscal_identities\": [\n {\n \"country_code\": \"DEU\",\n \"tax_number\": \"21/815/08150\",\n \"vat_id\": \"DE123456789\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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/merchants")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"legal_name\": \"Test GmbH\",\n \"country_code\": \"DEU\",\n \"address\": {\n \"line1\": \"Musterstr. 1\",\n \"city\": \"Berlin\",\n \"postal_code\": \"10115\",\n \"country_code\": \"DEU\",\n \"line2\": \"Apt 4\"\n },\n \"fiscal_identities\": [\n {\n \"country_code\": \"DEU\",\n \"tax_number\": \"21/815/08150\",\n \"vat_id\": \"DE123456789\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openfiskal.com/v1/merchants")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"legal_name\": \"Test GmbH\",\n \"country_code\": \"DEU\",\n \"address\": {\n \"line1\": \"Musterstr. 1\",\n \"city\": \"Berlin\",\n \"postal_code\": \"10115\",\n \"country_code\": \"DEU\",\n \"line2\": \"Apt 4\"\n },\n \"fiscal_identities\": [\n {\n \"country_code\": \"DEU\",\n \"tax_number\": \"21/815/08150\",\n \"vat_id\": \"DE123456789\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"legal_name": "<string>",
"country_code": "DEU",
"status": "active",
"address": {
"line1": "<string>",
"city": "<string>",
"postal_code": "<string>",
"country_code": "DEU",
"line2": "<string>"
},
"fiscal_identities": [
{
"country_code": "DEU",
"tax_number": "21/815/08150",
"vat_id": "DE123456789"
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"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": "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.
Body
application/json
Example:
"Test GmbH"
ISO 3166-1 alpha-3 country code for the legal entity (uppercase)
Required string length:
3Example:
"DEU"
Show child attributes
Show child attributes
fiscal_identities
(FiscalIdentityDEU · object | FiscalIdentityAUT · object | FiscalIdentityITA · object)[]
Country-specific fiscal identities
- FiscalIdentityDEU
- FiscalIdentityAUT
- FiscalIdentityITA
Show child attributes
Show child attributes
Response
Merchant created
ISO 3166-1 alpha-3 country code for the legal entity.
Required string length:
3Example:
"DEU"
Available options:
active, inactive Show child attributes
Show child attributes
fiscal_identities
(FiscalIdentityDEU · object | FiscalIdentityAUT · object | FiscalIdentityITA · object)[]
required
Country-specific fiscal identities.
- FiscalIdentityDEU
- FiscalIdentityAUT
- FiscalIdentityITA
Show child attributes
Show child attributes
Was this page helpful?