This transaction type cannot be matched with a line on the statement.

This transaction type cannot be matched with a line on the statement.

When using the books API

I get this error "This transaction type cannot be matched with a line on the statement."

What I'm doing is for the uncategorized transaction, I'm creating an invoice, then a customer payment for the amount of the invoice, then I try to match the uncategorized transaction with the customer payment transaction

Here are the transaction relevant transaction ids:

uncategorized transaction id 4478805000000587123

request payload
  1. {
  2.         transactions_to_be_matched: [
  3.             {
  4.                 transaction_id: 4478805000000615005,
  5.                 transaction_type: 'customer_payment',
  6.             }
  7.         ]
  8.     }
Why do I get the error "This transaction type cannot be matched with a line on the statement"?