Skip to main content
PATCH
Update an expense
Live capability. Melso runs this in production today. Partner keys reach it once your partner account is enabled. See Availability.
null clears category, account, file_id and description. The tax ID, number and date of an expense read from its document cannot change. An expense in a return that was approved or filed is not changed by its return: the filed return shows the difference in recalculated.

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.

expense_id
string<uuid>
required

Body

application/json
expected_version
integer
required
Required range: x >= 1
supplier_name
string
Required string length: 1 - 200
supplier_tax_id
string
supplier_country
string
default:ES
document_number
string
Maximum string length: 100
expense_date
string<date>
operation_date
string<date>
description
string
Maximum string length: 500
subtotal
string

An amount in euros as a decimal string with two decimals, such as "121.00".

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

"121.00"

vat_rate
string

A decimal number as a string, such as "21" or "0.5".

Pattern: ^-?[0-9]{1,10}(\.[0-9]{1,6})?$
vat_amount
string

An amount in euros as a decimal string with two decimals, such as "121.00".

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

"121.00"

total
string

An amount in euros as a decimal string with two decimals, such as "121.00".

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

"121.00"

irpf_rate
string

A decimal number as a string, such as "21" or "0.5".

Pattern: ^-?[0-9]{1,10}(\.[0-9]{1,6})?$
irpf_amount
string

An amount in euros as a decimal string with two decimals, such as "121.00".

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

"121.00"

vat_treatment
enum<string>

reverse_charge (inversión del sujeto pasivo) and exempt or not_subject carry no VAT amount.

Available options:
taxable,
exempt,
reverse_charge,
not_subject,
import
category
string

The AEAT expense concept, from G01 to G48, such as G03 (rent) or G05 (company Social Security).

Pattern: ^G[0-9]{2}$
account
string

The PGC account to book it to, such as 621 or 629, for an empresa. It sets the category.

deductible
enum<string>
Available options:
yes,
no,
unsure
file_id
string<uuid>

The document in Documents that supports it.

Response

The updated expense, with a new version.

supplier_name
string
required
Required string length: 1 - 200
expense_date
string<date>
required
subtotal
string
required

An amount in euros as a decimal string with two decimals, such as "121.00".

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

"121.00"

vat_amount
string
required

An amount in euros as a decimal string with two decimals, such as "121.00".

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

"121.00"

total
string
required

An amount in euros as a decimal string with two decimals, such as "121.00".

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

"121.00"

deductible
enum<string>
required
Available options:
yes,
no,
unsure
id
string<uuid>
required
version
integer
required
created_at
string<date-time>
required
supplier_tax_id
string
supplier_country
string
default:ES
document_number
string
Maximum string length: 100
operation_date
string<date>
description
string
Maximum string length: 500
vat_rate
string

A decimal number as a string, such as "21" or "0.5".

Pattern: ^-?[0-9]{1,10}(\.[0-9]{1,6})?$
irpf_rate
string

A decimal number as a string, such as "21" or "0.5".

Pattern: ^-?[0-9]{1,10}(\.[0-9]{1,6})?$
irpf_amount
string

An amount in euros as a decimal string with two decimals, such as "121.00".

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

"121.00"

vat_treatment
enum<string>

reverse_charge (inversión del sujeto pasivo) and exempt or not_subject carry no VAT amount.

Available options:
taxable,
exempt,
reverse_charge,
not_subject,
import
category
string

The AEAT expense concept, from G01 to G48, such as G03 (rent) or G05 (company Social Security).

Pattern: ^G[0-9]{2}$
account
string

The PGC account to book it to, such as 621 or 629, for an empresa. It sets the category.

file_id
string<uuid>

The document in Documents that supports it.

vat_lines
object[]
items
object[]
category_proposed
boolean

The category is Melso's proposal, not yet confirmed.

booked_account
string

The account it is booked to.

deductible_reason
string | null
deductibility
object

Melso's estimate of deductibility, and the rule it applied.

source
enum<string>
Available options:
upload,
whatsapp,
gmail,
melso,
import
review_reasons
string[]
currency
string
exchange_rate
string | null
updated_at
string<date-time>