Metadata on a credit_note object allows you to store additional structured information and context. This is especially useful when integrating Lago with external systems.
For example, after creating a credit note, you can save your government-issued credit note ID, the synchronization status with your ERP, or any internal reference needed for your workflows.
Metadata is stored in the credit_note object but is not displayed on the PDF file.
To add metadata:
Go to the credit note detail page for the credit note you want to update.
Click “Add metadata.”
Enter your key–value pairs.
Click Save to confirm.
Add metadata when creating a credit note
LAGO_URL = "https://api.getlago.com"
INVOICE_ID = "__YOU_INVOICE_ID__"
API_KEY = "__YOUR_API_KEY__"
curl --location --request POST " $LAGO_URL /api/v1/credit_notes" \
--header "Authorization: Bearer $API_KEY " \
--header 'Content-Type: application/json' \
--data-raw '{
"credit_note": {
…
"metadata": {
"sync_to_netsuite": "false",
"sync_to_salesforce": "false"
}
}'
Add metadata to an existing credit note
LAGO_URL = "https://api.getlago.com"
INVOICE_ID = "__YOU_INVOICE_ID__"
API_KEY = "__YOUR_API_KEY__"
curl --location --request POST " $LAGO_URL /api/v1/credit_notes/:lago_id/metadata" \
--header "Authorization: Bearer $API_KEY " \
--header 'Content-Type: application/json' \
--data-raw '{
"metadata": {
"sync_to_netsuite": "false",
"sync_to_salesforce": "false"
}
}'
To edit metadata on a credit note:
Navigate to the credit note detail page.
Click “Edit metadata.”
Add, update key–value pairs.
Save your changes.
Edit or add metadata on a credit note
LAGO_URL = "https://api.getlago.com"
INVOICE_ID = "__YOU_INVOICE_ID__"
API_KEY = "__YOUR_API_KEY__"
curl --location --request PATCH " $LAGO_URL /api/v1/credit_notes/:lago_id/metadata" \
--header "Authorization: Bearer $API_KEY " \
--header 'Content-Type: application/json' \
--data-raw '{
"metadata": {
"sync_to_netsuite": "true",
"netsuite_id": "cn_1234567890"
}
}'
Replace all metadata on a credit note
LAGO_URL = "https://api.getlago.com"
INVOICE_ID = "__YOU_INVOICE_ID__"
API_KEY = "__YOUR_API_KEY__"
curl --location --request POST " $LAGO_URL /api/v1/credit_notes/:lago_id/metadata" \
--header "Authorization: Bearer $API_KEY " \
--header 'Content-Type: application/json' \
--data-raw '{
"metadata": {
"sync_to_netsuite": "true",
"netsuite_id": "cn_1234567890"
"sync_to_salesforce": "false"
}
}'
To delete metadata on a credit note:
Open the credit note detail page.
Click “Edit metadata.”
Click the trash icon next to the key–value pair you want to remove.
Save your changes.
Delete a specific metadata key
LAGO_URL = "https://api.getlago.com"
INVOICE_ID = "__YOU_INVOICE_ID__"
API_KEY = "__YOUR_API_KEY__"
curl --location --request DELETE " $LAGO_URL /api/v1/credit_notes/:lago_id/metadata/:key" \
--header "Authorization: Bearer $API_KEY " \
--header 'Content-Type: application/json'
Delete all metadata on a credit note
LAGO_URL = "https://api.getlago.com"
INVOICE_ID = "__YOU_INVOICE_ID__"
API_KEY = "__YOUR_API_KEY__"
curl --location --request DELETE " $LAGO_URL /api/v1/credit_notes/:lago_id/metadata" \
--header "Authorization: Bearer $API_KEY " \
--header 'Content-Type: application/json'
A maximum of 50 metadata key–value pairs is allowed per credit note.
Keys must be strings of up to 40 characters.
Values must be strings of up to 255 characters.