Skip to main content

Update invoice

Route

PUT
/api/v1/invoices/:lago_id

Usage

LAGO_URL="https://api.getlago.com"
API_KEY="__YOUR_API_KEY__"

curl --location --request PUT "$LAGO_URL/api/v1/invoices/5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba" \
--header "Authorization: Bearer $API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"invoice": {
"payment_status": "succeeded",
"metadata": [
{
"id": "__METADATA_ID__",
"key": "digital_ref_id",
"value": "INV-0123456-98765"
}
]
}
}'

Arguments

{
"invoice": {
"payment_status": "succeeded",
"metadata": [
{
"id": "__METADATA LAGO ID__",
"key": "Key example",
"value": "Value example"
}
]
}
}
AttributesTypeDescription
lago_idString      RequiredInvoice unique identifier in Lago
payment_statusString      OptionalInvoice payment status
It can be pending, succeeded or failed

Metadata

AttributesTypeDescription
keyString      OptionalMetadata object key
valueString      OptionalMetadata object value
idString      Required conditionallyMetadata object identifier - only required when updating existing metadata
caution

When updating existing metadata, if an existing metadata.id is not included in the payload, then the corresponding key-value pair will be deleted.

Responses

The invoice payment status has been successfully updated.

Returns an invoice object.