When posting the payload below to api.sky.blackbaud.com/accountspayable/v1/invoices we get an error saying that the distributions must equal 100%.
The invoice includes two expenses, one of them actually a credit, correctly balanced against the AP account. There are no distribution splits, so the percents are always 100.
Could you please help me find the error?
{
"Error": "Failed to save invoice",
"Details": [
"The total percent distributed must equal 100%."
]
}
Payload:
{
"vendor_id": 874,
"amount": 1499,
"description": "October 2024",
"invoice_number": "October 2024",
"approval_status": "Approved",
"due_date": "2024-11-08T00:00:00",
"payment_details": {
"payment_method": "EFT"
},
"invoice_date": "2024-11-08T00:00:00",
"post_status": "NotYetPosted",
"post_date": "2024-11-08T00:00:00",
"distributions": [
{
"amount": 1650,
"description": "October 2024",
"account_number": "01.2040.00",
"type_code": "Debit",
"distribution_splits": [
{
"transaction_code_values": [],
"amount": 1650
}
]
},
{
"amount": 1650,
"description": "October 2024",
"account_number": "01.2010.00",
"type_code": "Credit",
"distribution_splits": [
{
"transaction_code_values": [],
"amount": 1650
}
]
},
{
"amount": 151,
"description": "October 2024",
"account_number": "01.4045.06",
"type_code": "Credit",
"distribution_splits": [
{
"transaction_code_values": [],
"amount": 151
}
]
},
{
"amount": 151,
"description": "October 2024",
"account_number": "01.2010.00",
"type_code": "Debit",
"distribution_splits": [
{
"transaction_code_values": [],
"amount": 151
}
]
}
]
}