#smsajjadzaidi-invoice
1 messages · Page 1 of 1 (latest)
@tawdry atlas it should return it — it's the amount field of the Invoice object in the event payload.
do you have an example evt_xxx event ID where you're not seeing what you expect?
{
"id": "evt_1JeI0TI1sqAko3cZb1t2wbeY",
"object": "event",
"api_version": "2020-03-02",
"created": 1632742104,
"data": {
"object": {
"id": "in_1JeI0SI1sqAko3cZN8JmHjDI",
"object": "invoice",
"account_country": "US",
"account_name": "....",
"account_tax_ids": null,
"amount_due": 0,
"amount_paid": 0,
response obj from webhook
it shows amount_due as 0
ah because that's the .created event, and the details were added later
that's just how it works when creating invoices in the dashboard, they are created as a draft and then you add items to it; the .created event is just a snapshot of the initial state before adding the details
maybe use the invoice.finalized event instead.
invoice.finalised would not cover the event if invoice is still in draft
yep!
so, i am thinking of getting invoice via invoice.List API. is this a good approach?
it could be
I'm not sure I follow the wider use case, what are you really trying to do at a higher level?
just wanted to save invoice in our db whenever a new invoice is created
do you care about when it's created or when it's paid?