REST Hooks: invoice.payment.add

I added a REST Hook with event key invoice.payment.add, it works, here is the answer:

{"event_key":"invoice.payment.add","object_type":"invoice.payment","object_keys":[{"apiUrl":"https://api.infusionsoft.com/crm/rest/v1/transactions/14","id":14,"timestamp":"2018-02-27T17:18:14Z"}],"api_url":""}

but 14 is a PaymentId, not a transaction id. If I follow the the apiUrl (with access token of course) it would return an empty string. The real transaction id is 422 (in this example), so the url should be https://api.infusionsoft.com/crm/rest/v1/transactions/422
What is wrong: the url or the id?

I need to get the list of the products from that transaction after the payment. How can I do it? Preferably without querying 3 tables (InvoicePayment, InvoiceItem, and OrderItem)

1 Like

Hi @and_dev it looks like we are giving back the PaymentId which mismatches what the transaction endpoint requires. You would need to first get the correct transaction Id from the orders/{orderId}/transactions endpoint… This looks like an oversight, I have created a ticket for the team to address this.

it’s not orderId either, orderId for this transaction would be 24, not 14. I was experimenting with promotions, when the price is $0, it doesn’t count as a payment, I guess. REST Hook wasn’t triggered.

14 matches PaymentId from the table InvoicePayment, so it requires several steps to get transactionId

Can you update this topic when the issue would be resolved? Thanks