invoice.updated
결제 대기 주문의 입금자명, 금액, 입금 기한, 받을 계좌, 현금영수증 정보가 바뀌면 보내는 이벤트예요.
결제 대기 주문의 내용이 바뀌면 보내요. 대시보드 주문에서 수정했거나 주문 수정 API를 호출했을 때 와요.
결제 완료, 만료, 취소처럼 상태가 바뀔 때는 이 이벤트 대신 상태별 이벤트가 가요.
페이로드
data는 바뀐 뒤의 주문 페이로드예요. 무엇이 바뀌었는지는 담지 않아요. 바뀐 필드가 필요하면 주문 단건 조회의 history에서 UPDATED 항목의 changes를 확인하세요.
{
"id": "evt_b1c2d3e4f5g6h7i8j9k0l1m2",
"type": "invoice.updated",
"timestamp": "2026-04-28T05:00:00Z",
"data": {
"id": "ivc_a1b2c3d4e5f6g7h8i9j0k1l2",
"number": 1043,
"status": "PENDING",
"customer": {
"name": "홍길동",
"email": "hong@example.com",
"phoneNumber": "01012345678"
},
"amount": 48000,
"paidAmount": null,
"amountDiff": null,
"bankAccountIds": [],
"cashReceipt": null,
"metadata": { "orderId": "ORDER-2026-0001" },
"source": "API",
"createdAt": "2026-04-28T03:14:15Z",
"updatedAt": "2026-04-28T05:00:00Z",
"expiresAt": "2026-05-02T03:14:15Z",
"paidAt": null,
"paidTrigger": null,
"matchedTransactionId": null,
"canceledAt": null,
"cancelReason": null,
"expiredAt": null,
"reopenedAt": null
}
}
처리 예시
금액이나 입금 기한이 바뀌었을 수 있으니 내 시스템의 주문과 고객 화면을 맞춰요.
if (event.type === "invoice.updated") {
const invoice = event.data;
await db.orders.updateByInvoiceId(invoice.id, {
amount: invoice.amount,
customerName: invoice.customer.name,
expiresAt: invoice.expiresAt ? new Date(invoice.expiresAt) : null,
});
}