The total percent distributed must equal 100%

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
}
]
}
]
}

Comments

  • Erik Leaver
    Erik Leaver Blackbaud Employee
    Tenth Anniversary Kudos 5 First Reply Name Dropper

    @Mauro Di Masso I think the issue is that you are including amount and percent. From the documentation you referenced (though far down on the page):
    Only one of Amount or Percent can be specified.”

  • @Erik Leaver thank you for this clue. However, the error is the same when removing the percent or amount properties from the distribution_split objects. I also tried leaving the distribution_split as an empty list since no real split is being applied. The error keeps saying that the total percent must be 100%.

    I think the issue might be in the particular accounting for this invoice, since we have been able to post other invoices with the initial payload before (even if it goes against the documentation) when all the expenses are debits.

    This is an invoice for 1499 with two expense lines, one debit and one credit. Each balanced against the AP account.

    Debit 1650 from 01.2040.00
    Credit 1650 to 01.2010.00 (AP)

    Credit 151 to 01.4045.06
    Debit 151 from 01.2010.00 (AP)

    The AP account 01.2010.00 ends up with a 1499 credit.


    You can see below the three attempts.

    Payload 1:
    {
    "vendor_id": "874",
    "amount": "1499.00",
    "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
    }
    ]
    }
    ]
    }

    Payload 2:
    {
    "vendor_id": "874",
    "amount": "1499.00",
    "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": [],
    "percent": 100
    }
    ]
    },
    {
    "amount": 1650,
    "description": "October 2024",
    "account_number": "01.2010.00",
    "type_code": "Credit",
    "distribution_splits": [
    {
    "transaction_code_values": [],
    "percent": 100
    }
    ]
    },
    {
    "amount": 151,
    "description": "October 2024",
    "account_number": "01.4045.06",
    "type_code": "Credit",
    "distribution_splits": [
    {
    "transaction_code_values": [],
    "percent": 100
    }
    ]
    },
    {
    "amount": 151,
    "description": "October 2024",
    "account_number": "01.2010.00",
    "type_code": "Debit",
    "distribution_splits": [
    {
    "transaction_code_values": [],
    "percent": 100
    }
    ]
    }
    ]
    }

    Payload 3:
    {
    "vendor_id": "874",
    "amount": "1499.00",
    "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": []
    },
    {
    "amount": 1650,
    "description": "October 2024",
    "account_number": "01.2010.00",
    "type_code": "Credit",
    "distribution_splits": []
    },
    {
    "amount": 151,
    "description": "October 2024",
    "account_number": "01.4045.06",
    "type_code": "Credit",
    "distribution_splits": []
    },
    {
    "amount": 151,
    "description": "October 2024",
    "account_number": "01.2010.00",
    "type_code": "Debit",
    "distribution_splits": []
    }
    ]
    }

  • Alex Wong
    Alex Wong Community All-Star
    Tenth Anniversary Kudos 5 Facilitator 4 bbcon 2025 Attendee Badge

    @Mauro Di Masso
    I used your JSON and is not working neither (updating to use my FE NXT data). However, i created a sample one that does work and created the invoice in my FE test environment. maybe you can see how mine differs to update yours.

    {
    "vendor_id": 2138,
    "amount": 503.43,
    "description": "FLB-Temp Help for Office week ended 1/2/2015",
    "invoice_number": "999999999999",
    "invoice_date": "2021-11-01T00:00:00",
    "due_date": "2021-11-03T00:00:00",
    "balance": 0,
    "total_paid": 503.43,
    "payment_details": {
    "payment_method": "Check"
    },
    "post_status": "NotYetPosted",
    "post_date": "2021-11-03T00:00:00",
    "distributions": [
    {
    "distribution_splits": [
    {
    "ui_project_id": "UNREST",
    "transaction_code_values": [],
    "amount": 503.43
    }
    ],
    "amount": 503.43,
    "account_number": "10-5260-750",
    "type_code": "Debit"
    },
    {
    "distribution_splits": [
    {
    "ui_project_id": "UNREST",
    "transaction_code_values": [],
    "amount": 503.43
    }
    ],
    "amount": 503.43,
    "account_number": "10-2000-750",
    "type_code": "Credit"
    }
    ]
    }

  • @Alex Wong thank you but we have no problem when using just two lines. The key to my issue I think is the fact that one of the expenses is a debit and one is a credit.
    Would you please try following my sample or at least try so that you have both a credit and a debit to the AP account?

  • Alex Wong
    Alex Wong Community All-Star
    Tenth Anniversary Kudos 5 Facilitator 4 bbcon 2025 Attendee Badge

    @Mauro Di Masso
    first try this:

    {
    "vendor_id": "874",
    "amount": "1499.00",

    vendor_id is the system record id of the vendor, which needs to be a number, don't put double quote around it.

    amount is also in “string” data type as well, remove the double quote.

    {
    "vendor_id": 874,
    "amount": 1499,

  • @Alex Wong thank you, but that does not change the error. I'll edit the initial post to match but that is not it.

  • Alex Wong
    Alex Wong Community All-Star
    Tenth Anniversary Kudos 5 Facilitator 4 bbcon 2025 Attendee Badge

    @Mauro Di Masso
    I see what you mean by the “amount” situation, so the invoice has a “discount” or “deduction” of some sort. I am not sure how you would account for that.

    One method is, try to manually create an invoice in FE NXT directly, then use API to GET the invoice by system id and see how the JSON look.

  • @Alex Wong we found the issue. Expsense lines on invoices should always be of type Debit, regardless of their sign. That means you can end up with negative debit and credit lines.

    The correct coding, then, is:

    Debit 1650 from 01.2040.00
    Credit 1650 to 01.2010.00 (AP)

    Debit -151 from 01.4045.06
    Credit -151 to 01.2010.00 (AP)

Categories