Payment error: invalid keys: purchase_order_number, tax_amount

Version v5.11.66

Environment Ubuntu 24.04

Checklist

  • Can you replicate the issue on our v5 demo site https://demo.invoiceninja.com or Invoice Ninja
  • Have you searched existing issues?
    Yes, none found
  • Have you inspected the logs in storage/logs/laravel.log for any errors?
    Yes… inconclusive

Describe the bug

After a troublesome update to v5.11.66, that involved fixing a few fields manually… invoice payments are now causing this error (invalid keys: purchase_order_number, tax_amount) and are not able to process the payment

Steps To Reproduce

client clicks pay on their invoice in their payment portal. payment info is filled out. clicking pay, causes the error.

Expected Behavior

Payment should process

it seems that there are missing / incorrect keys. not really sure what keys should be where. is there a schema diagram available?

would anyone care to share where they find their keys ( purchase_order_number, tax_amount ) so i can manually add them?

Hi,

You shouldn’t need to fix fields manually, we strongly advise against making any manual changes to the database.

What do you see when running: php artisan migrate

Can you share the exact error you’re seeing?

I’m not sure, I haven’t seen this error before. I suggest asking in a discussion on GitHub, please include the gateway you’re using.

ok, thanks.
could you tell me where these keys are supposed to exist so i can check it they’re there?

I don’t think this error is referring to keys in the database, I believe it means keys sent in the payment request.

we are using Braintree for our gateway
ok, thank you.

Now this has shown up:


Routing Parameters

{
    "invoice": {
        "assigned_user_id": null,
        "status_id": 2,
        "project_id": null,
        "vendor_id": null,
        "recurring_id": null,
        "design_id": 2,
        "number": "Apr2025-15569",
        "discount": "0.000000",
        "is_amount_discount": true,
        "po_number": null,
        "date": "2025-04-10",
        "last_sent_date": "2025-04-11",
        "due_date": "2025-05-10",
        "is_deleted": false,
        "line_items": [
            {
                "_id": "75c5f618-c664-4c69-807c-cfc035158773",
                "quantity": 1,
                "cost": 525,
                "product_key": "Online Service",
                "product_cost": 0,
                "notes": "CharterAce and QuickBooks Online Services ($300 Odyssey + $150 Odyssey Prep + $75 Odyssey, Inc.)",
                "discount": 0,
                "is_amount_discount": true,
                "tax_name1": "",
                "tax_rate1": 0,
                "tax_name2": "",
                "tax_rate2": 0,
                "tax_name3": "",
                "tax_rate3": 0,
                "sort_id": "0",
                "line_total": 525,
                "tax_amount": 0,
                "gross_line_total": 525,
                "date": "",
                "custom_value1": "",
                "custom_value2": "",
                "custom_value3": "",
                "custom_value4": "",
                "type_id": "1",
                "tax_id": "1",
                "task_id": "",
                "expense_id": "",
                "unit_code": "C62",
                "net_cost": 0
            },
            {
                "_id": "b545e3d0-9b48-4619-9ac0-16ccfcca22e4",
                "quantity": 1,
                "cost": 286.48,
                "product_key": "Bill.Com Reimbursement",
                "product_cost": 0,
                "notes": "Bill.Com Invoice (March Service) - Odyssey Charter School",
                "discount": 0,
                "is_amount_discount": true,
                "tax_name1": "",
                "tax_rate1": 0,
                "tax_name2": "",
                "tax_rate2": 0,
                "tax_name3": "",
                "tax_rate3": 0,
                "sort_id": "0",
                "line_total": 286.48,
                "tax_amount": 0,
                "gross_line_total": 286.48,
                "date": "",
                "custom_value1": "",
                "custom_value2": "",
                "custom_value3": "",
                "custom_value4": "",
                "type_id": "1",
                "tax_id": "1",
                "task_id": "",
                "expense_id": "",
                "unit_code": "C62",
                "net_cost": 0
            },
            {
                "_id": "3c33b301-481c-433b-8b2c-62f455a40c06",
                "quantity": 1,
                "cost": 87.62,
                "product_key": "Bill.Com Reimbursement",
                "product_cost": 0,
                "notes": "Bill.Com Invoice (March Service) - Odyssey, Inc.",
                "discount": 0,
                "is_amount_discount": true,
                "tax_name1": "",
                "tax_rate1": 0,
                "tax_name2": "",
                "tax_rate2": 0,
                "tax_name3": "",
                "tax_rate3": 0,
                "sort_id": "0",
                "line_total": 87.62,
                "tax_amount": 0,
                "gross_line_total": 87.62,
                "date": "",
                "custom_value1": "",
                "custom_value2": "",
                "custom_value3": "",
                "custom_value4": "",
                "type_id": "1",
                "tax_id": "1",
                "task_id": "",
                "expense_id": "",
                "unit_code": "C62",
                "net_cost": 0
            },
            {
                "_id": "5a1bab21-8a80-447f-adbf-6bc44e26637c",
                "quantity": 1,
                "cost": 106.22,
                "product_key": "Bill.Com Reimbursement",
                "product_cost": 0,
                "notes": "Bill.Com Invoice (March Service) - Odyssey Preparatory",
                "discount": 0,
                "is_amount_discount": true,
                "tax_name1": "",
                "tax_rate1": 0,
                "tax_name2": "",
                "tax_rate2": 0,
                "tax_name3": "",
                "tax_rate3": 0,
                "sort_id": "0",
                "line_total": 106.22,
                "tax_amount": 0,
                "gross_line_total": 106.22,
                "date": "",
                "custom_value1": "",
                "custom_value2": "",
                "custom_value3": "",
                "custom_value4": "",
                "type_id": "1",
                "tax_id": "1",
                "task_id": "",
                "expense_id": "",
                "unit_code": "C62",
                "net_cost": 0
            }
        ],
        "backup": null,
        "footer": null,
        "public_notes": null,
        "terms": null,
        "tax_name1": null,
        "tax_rate1": "0.000000",
        "tax_name2": null,
        "tax_rate2": "0.000000",
        "tax_name3": null,
        "tax_rate3": "0.000000",
        "total_taxes": "0.000000",
        "uses_inclusive_taxes": 0,
        "custom_value1": null,
        "custom_value2": null,
        "custom_value3": null,
        "custom_value4": null,
        "next_send_date": "2025-06-09 10:00:00",
        "custom_surcharge1": "0.000000",
        "custom_surcharge2": "0.000000",
        "custom_surcharge3": "0.000000",
        "custom_surcharge4": "0.000000",
        "custom_surcharge_tax1": false,
        "custom_surcharge_tax2": false,
        "custom_surcharge_tax3": false,
        "custom_surcharge_tax4": false,
        "exchange_rate": "1.000000",
        "amount": "1005.320000",
        "balance": "1005.320000",
        "partial": "0.000000",
        "partial_due_date": null,
        "last_viewed": null,
        "created_at": 1744340524,
        "updated_at": 1744818061,
        "deleted_at": null,
        "reminder1_sent": null,
        "reminder2_sent": null,
        "reminder3_sent": null,
        "reminder_last_sent": null,
        "auto_bill_enabled": 0,
        "paid_to_date": "0.000000",
        "subscription_id": null,
        "auto_bill_tries": 0,
        "is_proforma": 0,
        "tax_data": null,
        "e_invoice": null,
        "sync": null,
        "gateway_fee": "0.000000",
        "location_id": null,
        "hashed_id": "nXe0EQ7axr",
        "status": -2
    }
}

Has anything changed?

I suggest adding this to the discussion on GitHub.