Skip to main content

Locations

Manage merchant locations with country-specific fiscal configurations. All endpoints require authentication.

Create a location

POST /v1/locations

Creates a new merchant location for the authenticated account. The country field determines which validations apply.

Request body

FieldTypeRequiredDescription
namestringYesLocation name (max 255 chars)
countrystringYesISO 3166-1 alpha-2 code (ES, IT, FR)
addressstringNoPhysical address (max 500 chars)
tax_idstringNoTax identification number (max 50 chars)
country_configobjectVariesCountry-specific config. Required for Spain.

Examples

Spanish location with TicketBAI:

curl -X POST https://api.fiscalapi.com/v1/locations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer fsk_test_abc123def456..." \
-d '{
"name": "Madrid Office",
"country": "ES",
"address": "Calle Gran Vía 1, 28013 Madrid",
"tax_id": "B12345674",
"country_config": {
"system": "ticketbai",
"territory_code": "48"
}
}'

French location (minimal):

curl -X POST https://api.fiscalapi.com/v1/locations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer fsk_test_abc123def456..." \
-d '{
"name": "Paris Store",
"country": "FR",
"address": "10 Rue de Rivoli, 75001 Paris",
"tax_id": "FR12345678901"
}'

Response 201 Created

{
"id": "550e8400-e29b-41d4-a716-446655440000",
"account_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"name": "Madrid Office",
"country": "ES",
"address": "Calle Gran Vía 1, 28013 Madrid",
"tax_id": "B12345674",
"country_config": {
"system": "ticketbai",
"territory_code": "48"
},
"status": "active",
"created_at": "2026-03-08T12:00:00Z",
"updated_at": "2026-03-08T12:00:00Z"
}

Errors

StatusErrorCause
400Key: 'CreateRequest.Name'...Missing required field
400Spain locations require country_config with system field (ticketbai or verifactu)Missing Spain config
400Spain country_config.system must be "ticketbai" or "verifactu"Invalid system value

List locations

GET /v1/locations

Returns a paginated list of locations for the authenticated account, ordered by created_at descending.

Query parameters

ParameterTypeDefaultDescription
limitinteger20Items per page (max 100)
offsetinteger0Pagination offset (max 10000)
countrystring--Filter by ISO country code
statusstring--Filter by active or inactive

Example

# List all locations
curl https://api.fiscalapi.com/v1/locations \
-H "Authorization: Bearer fsk_test_abc123def456..."

# Filter by country and paginate
curl "https://api.fiscalapi.com/v1/locations?country=ES&limit=10&offset=0" \
-H "Authorization: Bearer fsk_test_abc123def456..."

Response 200 OK

{
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"account_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"name": "Madrid Office",
"country": "ES",
"address": "Calle Gran Vía 1, 28013 Madrid",
"tax_id": "B12345674",
"country_config": {
"system": "ticketbai",
"territory_code": "48"
},
"status": "active",
"created_at": "2026-03-08T12:00:00Z",
"updated_at": "2026-03-08T12:00:00Z"
}
],
"total": 1,
"limit": 20,
"offset": 0
}

Get a location

GET /v1/locations/{id}

Returns a single location by ID, scoped to the authenticated account.

Path parameters

ParameterTypeDescription
iduuidLocation UUID

Example

curl https://api.fiscalapi.com/v1/locations/550e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer fsk_test_abc123def456..."

Response 200 OK

Returns a Location object.

Errors

StatusError
404location not found

Update a location

PATCH /v1/locations/{id}

Partially updates a location. Only supplied fields are modified.

info

The country and tax_id fields are immutable and cannot be changed after creation.

Request body

FieldTypeDescription
namestringUpdated location name
addressstringUpdated address
country_configobjectUpdated country-specific config
statusstringactive or inactive

Examples

Update name:

curl -X PATCH https://api.fiscalapi.com/v1/locations/550e8400-e29b-41d4-a716-446655440000 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer fsk_test_abc123def456..." \
-d '{"name": "Madrid HQ"}'

Deactivate location:

curl -X PATCH https://api.fiscalapi.com/v1/locations/550e8400-e29b-41d4-a716-446655440000 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer fsk_test_abc123def456..." \
-d '{"status": "inactive"}'

Switch fiscalization system:

curl -X PATCH https://api.fiscalapi.com/v1/locations/550e8400-e29b-41d4-a716-446655440000 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer fsk_test_abc123def456..." \
-d '{"country_config": {"system": "verifactu"}}'

Response 200 OK

Returns the updated Location object.


Delete a location

DELETE /v1/locations/{id}

Soft-deletes a location. It will no longer appear in list queries.

Example

curl -X DELETE https://api.fiscalapi.com/v1/locations/550e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer fsk_test_abc123def456..."

Response 204 No Content

No response body.


Location object

FieldTypeDescription
iduuidLocation identifier
account_iduuidOwning account identifier
namestringHuman-readable name
countrystringISO 3166-1 alpha-2 country code
addressstringPhysical address
tax_idstringTax identification number
country_configobjectCountry-specific fiscalization config
statusstringactive or inactive
cert_expirydatetimeCertificate expiration (if applicable)
created_atdatetimeCreation timestamp
updated_atdatetimeLast update timestamp

Spain country config

FieldTypeRequiredDescription
systemstringYesticketbai or verifactu
territory_codestringNoTerritory code (e.g., 01=Alava, 20=Gipuzkoa, 48=Bizkaia)