curl --request PATCH \
--url https://api.melso.ai/v1/companies/{company_id}/fiscal-profile \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"tax_id": "12345678Z",
"legal_name": "Lucía Martín Pérez",
"address": "Calle Mayor 1",
"postal_code": "50001",
"activity_type": "profesional",
"iae_code": "844",
"registration_status": "alta",
"registered_on": "2024-03",
"irpf_method": "directa_simplificada",
"vat_regime": "general",
"client_types": [
"es_business"
]
}
'import requests
url = "https://api.melso.ai/v1/companies/{company_id}/fiscal-profile"
payload = {
"tax_id": "12345678Z",
"legal_name": "Lucía Martín Pérez",
"address": "Calle Mayor 1",
"postal_code": "50001",
"activity_type": "profesional",
"iae_code": "844",
"registration_status": "alta",
"registered_on": "2024-03",
"irpf_method": "directa_simplificada",
"vat_regime": "general",
"client_types": ["es_business"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tax_id: '12345678Z',
legal_name: 'Lucía Martín Pérez',
address: 'Calle Mayor 1',
postal_code: '50001',
activity_type: 'profesional',
iae_code: '844',
registration_status: 'alta',
registered_on: '2024-03',
irpf_method: 'directa_simplificada',
vat_regime: 'general',
client_types: ['es_business']
})
};
fetch('https://api.melso.ai/v1/companies/{company_id}/fiscal-profile', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"profile": {
"tax_id": "<string>",
"legal_name": "<string>",
"trade_name": "<string>",
"address": "<string>",
"postal_code": "<string>",
"city": "<string>",
"province": "<string>",
"tax_territory": "comun",
"vat_regime": "general",
"activity_type": "profesional",
"activity_description": "<string>",
"iae_code": "<string>",
"registration_status": "alta",
"registered_on": "<string>",
"irpf_method": "directa_simplificada",
"irpf_retention_rate": 50,
"eu_operator": true,
"vat_sii": true,
"vat_redeme": true,
"is_large_company": true,
"client_types": [
"es_business"
],
"invoice_series": "<string>",
"next_invoice_number": 500000000,
"iban": "<string>",
"tax_id_type": "dni"
},
"missing": [
"<string>"
],
"errors": {},
"deduced": {},
"invoice_missing": [
"<string>"
],
"tax_missing": [
"<string>"
]
}{
"error": "lines[0].vat_rate must be 21, 10, 4 or 0",
"code": "invalid_invoice",
"request_id": "req_01JAB3K9X2"
}{
"error": "invalid token",
"code": "unauthorized",
"request_id": "req_01JAB3K9X2"
}{
"error": "invoice not found",
"code": "not_found",
"request_id": "req_01JAB3K9X2"
}Update the fiscal profile
Saves the fields you send.
curl --request PATCH \
--url https://api.melso.ai/v1/companies/{company_id}/fiscal-profile \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"tax_id": "12345678Z",
"legal_name": "Lucía Martín Pérez",
"address": "Calle Mayor 1",
"postal_code": "50001",
"activity_type": "profesional",
"iae_code": "844",
"registration_status": "alta",
"registered_on": "2024-03",
"irpf_method": "directa_simplificada",
"vat_regime": "general",
"client_types": [
"es_business"
]
}
'import requests
url = "https://api.melso.ai/v1/companies/{company_id}/fiscal-profile"
payload = {
"tax_id": "12345678Z",
"legal_name": "Lucía Martín Pérez",
"address": "Calle Mayor 1",
"postal_code": "50001",
"activity_type": "profesional",
"iae_code": "844",
"registration_status": "alta",
"registered_on": "2024-03",
"irpf_method": "directa_simplificada",
"vat_regime": "general",
"client_types": ["es_business"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tax_id: '12345678Z',
legal_name: 'Lucía Martín Pérez',
address: 'Calle Mayor 1',
postal_code: '50001',
activity_type: 'profesional',
iae_code: '844',
registration_status: 'alta',
registered_on: '2024-03',
irpf_method: 'directa_simplificada',
vat_regime: 'general',
client_types: ['es_business']
})
};
fetch('https://api.melso.ai/v1/companies/{company_id}/fiscal-profile', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"profile": {
"tax_id": "<string>",
"legal_name": "<string>",
"trade_name": "<string>",
"address": "<string>",
"postal_code": "<string>",
"city": "<string>",
"province": "<string>",
"tax_territory": "comun",
"vat_regime": "general",
"activity_type": "profesional",
"activity_description": "<string>",
"iae_code": "<string>",
"registration_status": "alta",
"registered_on": "<string>",
"irpf_method": "directa_simplificada",
"irpf_retention_rate": 50,
"eu_operator": true,
"vat_sii": true,
"vat_redeme": true,
"is_large_company": true,
"client_types": [
"es_business"
],
"invoice_series": "<string>",
"next_invoice_number": 500000000,
"iban": "<string>",
"tax_id_type": "dni"
},
"missing": [
"<string>"
],
"errors": {},
"deduced": {},
"invoice_missing": [
"<string>"
],
"tax_missing": [
"<string>"
]
}{
"error": "lines[0].vat_rate must be 21, 10, 4 or 0",
"code": "invalid_invoice",
"request_id": "req_01JAB3K9X2"
}{
"error": "invalid token",
"code": "unauthorized",
"request_id": "req_01JAB3K9X2"
}{
"error": "invoice not found",
"code": "not_found",
"request_id": "req_01JAB3K9X2"
}errors and the valid fields are still saved, so the response is 200
either way: read errors. A postal code fills in the province and the
tax territory (deduced).Authorizations
Your partner secret key, mk_live_… for real companies or mk_test_…
for test companies. Keep it on your servers. See
Authentication.
Path Parameters
The company's ID. Every company-scoped call works in exactly this company.
Body
DNI or NIE for an autónomo, CIF for an empresa, with a valid check character.
300300300Fills in province and tax_territory.
^[0-9]{5}$300300comun, alava, bizkaia, gipuzkoa, navarra, canarias, ceuta, melilla Must fit the tax territory.
general, recargo_equivalencia, simplificado, reagp, exento, igic_general, igic_simplificado, igic_repep, ipsi An empresa is always empresarial.
profesional, empresarial 300^[0-9]{1,4}(\.[0-9]{1,2})?$pendiente while the autónomo is not registered yet.
alta, pendiente YYYY-MM or YYYY-MM-DD, not in the future.
Autónomos only.
directa_simplificada, directa_normal, modulos Autónomos only.
0 <= x <= 100Registered in the ROI for intra-community operations.
Keeps its VAT books through the SII.
Registered for monthly VAT refunds.
Gran empresa
1es_business, es_individual, eu_business, non_eu_business 401 <= x <= 1000000000Returned masked.
Fields to empty.
Response
The whole profile, with errors for any field not saved.
Show child attributes
Show child attributes
The fields not saved, each with the reason.
Show child attributes
Show child attributes
Fields Melso filled in from others, such as the territory from the postal code.
What is still needed to invoice.
What is still needed to calculate returns.