Register the company as an issuer
curl --request POST \
--url https://api.melso.ai/v1/companies/{company_id}/invoicing/registration \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ticketbai_activity_code": "<string>"
}
'import requests
url = "https://api.melso.ai/v1/companies/{company_id}/invoicing/registration"
payload = { "ticketbai_activity_code": "<string>" }
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({ticketbai_activity_code: '<string>'})
};
fetch('https://api.melso.ai/v1/companies/{company_id}/invoicing/registration', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"status": "pending",
"invoicing_ready": true,
"fiscal_network": "verifactu",
"fiscal_missing": [
"<string>"
],
"invoicing_missing": [
"<string>"
],
"authorization_url": "<string>",
"error": "<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": "The tax return changed or is not ready for approval",
"code": "version_conflict",
"request_id": "req_01JAB3K9X2"
}{
"error": "The invoice number is reserved. Retry this same invoice to reconcile it; do not prepare a replacement.",
"code": "invoicing_provider_pending",
"request_id": "req_01JAB3K9X2"
}Invoicing setup
Register the company as an issuer
Registers the company as an invoice issuer on its network: VERI*FACTU in the common territory and the Canary Islands, TicketBAI in Álava, Bizkaia and Gipuzkoa.
POST
/
companies
/
{company_id}
/
invoicing
/
registration
Register the company as an issuer
curl --request POST \
--url https://api.melso.ai/v1/companies/{company_id}/invoicing/registration \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ticketbai_activity_code": "<string>"
}
'import requests
url = "https://api.melso.ai/v1/companies/{company_id}/invoicing/registration"
payload = { "ticketbai_activity_code": "<string>" }
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({ticketbai_activity_code: '<string>'})
};
fetch('https://api.melso.ai/v1/companies/{company_id}/invoicing/registration', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"status": "pending",
"invoicing_ready": true,
"fiscal_network": "verifactu",
"fiscal_missing": [
"<string>"
],
"invoicing_missing": [
"<string>"
],
"authorization_url": "<string>",
"error": "<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": "The tax return changed or is not ready for approval",
"code": "version_conflict",
"request_id": "req_01JAB3K9X2"
}{
"error": "The invoice number is reserved. Retry this same invoice to reconcile it; do not prepare a replacement.",
"code": "invoicing_provider_pending",
"request_id": "req_01JAB3K9X2"
}Live capability. Melso runs this in production today. Partner keys reach it once your partner account is enabled. See Availability.
A person decides. The company’s owner makes this call, signed in to Melso. Partner keys cannot make it: send the person the approval link instead. See Approvals and filing.
active, or pending with the authorization_url where the owner
authorizes the representation for invoice registration.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
application/json
Bizkaia only, the activity code of its LROE.
Response
The status after registering.
Available options:
pending, active, error The company can issue invoices.
Empty while the tax territory is unknown.
Available options:
verifactu, ticketbai, Fiscal profile fields still missing.
Invoicing fields still missing, such as vat_regime or city.
While pending, where the owner authorizes registration. Valid for 24 hours.