Get the default series of a company
Scopeseries:readReports, for each DocumentType used by automatic invoicing flows, whether the company
(NIF) has a default invoice series and which one: exists, plus the series_id when there
is one.
- No default: that document type cannot be issued without naming a
series_idexplicitly, and automatic flows skip it withfailure.payment.skip.missing_default_series. - Environment: resolved from the request context; it takes no input.
Keys are prefixed beel_sk_, and each one carries the scopes it was created with: a key
short of the scope an operation needs is answered 403. The scope an operation requires
is shown next to its title, and the full catalogue lives in the Scopes reference.
Keys are created from the BeeL dashboard. They are secret credentials: do not share them or commit them to source control.
In: header
Path Parameters
NIF (company) the operation acts on. It is the only source of context: the account that owns it is derived from it, and the BeeL-Active-Company header plays no part. A NIF you do not reach answers 403, and so does a NIF that does not exist, so the existence of a NIF in another account is never disclosed.
uuidResponse Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://app.beel.es/api/v1/companies/497f6eca-6276-4993-bfeb-53cbbbba6f08/series/defaults"{
"success": true,
"data": {
"defaults": [
{
"document_type": "UNASSIGNED",
"exists": true,
"series_id": "0f6582ac-1e7e-41dc-a63a-24fccd074d0c",
"code": "string",
"provisional": true
}
]
},
"meta": {
"timestamp": "2025-01-15T10:30:00Z",
"request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "The parameter 'invoice_id' has an invalid type. Expected: UUID.",
"details": {
"field": "invoice_id",
"invalid_value": "deliveries",
"expected_format": "UUID"
}
},
"meta": {
"timestamp": "2025-01-15T10:30:00Z",
"request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Authentication is required to access this resource"
},
"meta": {
"timestamp": "2025-01-15T10:30:00Z",
"request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "The provided data is not valid",
"details": {
"field": "specific error message"
}
},
"meta": {
"timestamp": "2025-01-15T10:30:00Z",
"request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
},
"type": "https://docs.beel.es/errors/INVOICE_NO_LINES",
"title": "INVOICE_NO_LINES",
"detail": "La factura debe tener al menos una línea",
"instance": "/v1/invoices/abc-123"
}{
"success": false,
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Too many requests. Please try again in 60 seconds."
},
"meta": {
"timestamp": "2025-01-15T10:30:00Z",
"request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"success": false,
"error": {
"code": "INTERNAL_ERROR",
"message": "Internal server error"
},
"meta": {
"timestamp": "2025-01-15T10:30:00Z",
"request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"success": false,
"error": {
"code": "UNSUPPORTED_MEDIA_TYPE",
"message": "Unsupported media type: text/plain. Supported: application/json"
},
"meta": {
"timestamp": "2025-01-15T10:30:00Z",
"request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}Ensure a default series per document type PUT
Ensures the company (NIF) has a default invoice series for `STANDARD`, `SIMPLIFIED` and `CORRECTIVE` in the current environment, and returns the resulting set. The request takes no body: the desired end state is one default per document type, so repeating it changes nothing. - **Already there:** a document type that already has a default keeps it, and it is returned unchanged. - **Missing:** it is created with code `F`, `S` or `R` and format `{CODIGO}-{YYYY}-{NUM:4}`, active and marked as default. - **Code taken:** if that code already belongs to another series, the document type is omitted from the response and is left with no default.
Create an invoice series for a company POST
Creates an invoice series under a company (NIF). - **Code:** must be unique within the company; a code already taken answers `409`. - **Numbering:** `format` must contain `{NUM}` or `{NUM:X}` and only accepts uppercase tokens. `counter_reset` defaults to `ANNUAL`, so a format with no year token has to be sent with `counter_reset: NEVER`. - **Default series:** the first series created for a document type is marked as default even if you send `default_series: false`.