Skip to main content
POST
Record a return filed elsewhere
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.
Later quarters then carry forward from it: the 303’s amounts to offset and the 130’s payments to date. It does not file, approve or pay anything. Send expected_version 0 for a period Melso has no return for, or the current draft’s version to replace it. A return under review, approved or filed by Melso cannot be replaced.

Authorizations

Authorization
string
header
required

Your partner secret key, mk_live_… for real companies or mk_test_… for test companies. Keep it on your servers. See Authentication.

Path Parameters

company_id
string<uuid>
required

The company's ID. Every company-scoped call works in exactly this company.

Body

application/json
request_id
string<uuid>
required

Your key for this import. Reusing it with different details is refused.

model
enum<string>
required
Available options:
303,
130
period
string
required
Pattern: ^[0-9]{4}-Q[1-4]$
tax_id
string
required

The tax ID on the receipt. Must be the company's.

filed_at
string<date-time>
required

After the quarter ended and no later than today.

external_reference
string
required

The AEAT's submission reference on the receipt.

Maximum string length: 200
receipt_file_id
string<uuid>
required

The receipt, a PDF already in the company's Documents.

expected_version
integer
required
Required range: x >= 0
boxes
object
required

The declared boxes, by AEAT box number, as amounts with two decimals.

Response

The same import was already recorded with this request_id.

id
string
required

The return's UUID, or estimate:<model>:<period> for an estimate.

model
string
required

The form. Melso calculates 303, 130, 111, 115, 190, 180, 347, 349 and 390 today; a reminder form marked filed has its own model.

period
string
required

A year (2026), a quarter (2026-Q3), a month (2026-09) or an instalment (2026-1P).

Pattern: ^[0-9]{4}(-Q[1-4]|-(0[1-9]|1[0-2])|-[1-3]P)?$
Example:

"2026-Q3"

status
enum<string>
required

draft: calculated, still recalculated from the records. approved: the owner authorized this exact version. filed: filed, with the administration's reference and receipt when Melso filed it.

Available options:
draft,
approved,
filed
is_estimate
boolean
required

An estimate has an amount only. It has no boxes, no version and no approval.

amount
string
required

The result. Negative to offset or refund (303); 0.00 for an informative return.

Pattern: ^-?[0-9]+\.[0-9]{2}$
Example:

"121.00"

version
integer | null

Raised on every recalculation that changes the draft. Approval needs the exact version.

approved_version
integer | null
approved_at
string<date-time> | null
deadline
string<date>
direct_debit_deadline
string<date> | null
boxes
object[]
records
object[]
review
enum<string>[]

What to check before approving.

Available options:
missing_tax_id,
cadastral_reference,
eu_key_assumed,
rates_assumed,
volume_split
unconfirmed_expenses
integer

Expenses in the return that are not yet confirmed as deductible.

filed_at
string<date-time> | null
filing
object | null

Preview. The administration's evidence, when Melso filed the return.

recalculated
object | null

For a filed return whose records changed afterwards, what it would be today. A difference may need a complementary or corrective return.

created_at
string<date-time>
updated_at
string<date-time>