When creating an invoice payment, an existing batch cannot be set. It always defaults to creating a new batch.
Though the docs mention that you can provide a batchId, it is not apparent how (or if) you should add this to the body
e.g. adding batchId does not work
body = {
"batchId": batch_id,
"invoiceId": invoice.id,
"amount": {
"value": "10.00"
"currency": "CAD"
},
}
trolley_client = Configuration.gateway(public_key, private_key)
invoice_payment = trolley_client.invoice_payment.create(body)
# creates new batch