Skip to main content

Webhook Notifications

Overview​

Webhooks allow you to receive real-time notifications about contract events. Instead of polling the API for updates, WePay will send HTTP POST requests to your specified endpoint whenever important events occur.

Key Benefits:

  • Real-time Updates: Get notified immediately when events occur
  • Reduced API Calls: No need to poll for status changes
  • Reliable Delivery: Automatic retries with exponential backoff
  • Secure: HMAC-SHA256 signature verification

Webhook Event Types​

WePay sends webhooks for the following events:

Contract Events​

Event TypeDescription
contract.createdA new contract has been created
contract.approvedContract has been approved by the other party
contract.rejectedContract has been rejected
contract.cancelledContract has been cancelled
contract.deliveredSeller has marked the contract as delivered
contract.receivedBuyer has confirmed receipt
contract.releasedFunds have been released to the seller
contract.completedContract has been fully completed

Payment Events​

Event TypeDescription
payment.completedPayment has been completed and funds are in escrow
payment.unmatchedA payment arrived that could not be matched to a contract
contract.payment.underpaidLess than the expected amount was received
contract.payment.overpaidMore than the expected amount was received

Bank Transfer Events​

See Bank Transfer Events for payloads and recommended handling.

Event TypeDescription
bank_transfer.initiatedBank account details were issued to the buyer
bank_transfer.buyer_acknowledgedBuyer indicated they have sent the transfer
payment.completed or milestone.payment.completedThe transfer has arrived and the contract is funded

Dispute Events​

Opening or resolving a dispute sends more than one webhook. See Create Dispute and Resolve Dispute for the captured payloads.

Event TypeDescription
contract.disputedA dispute has been raised on a contract without milestones. status becomes Dispute
milestone.disputedA dispute has been raised on a milestone. Milestone status stays Escrow. contractStatus becomes Dispute
contract.disput.resolvedA contract dispute has been resolved. Event name is disput.resolved. amount is 0
milestone.disput.resolvedA milestone dispute has been resolved. Milestone status becomes PartiallyRefunded or Released. amount is 0
dispute.createdDispute has been created. Includes milestoneId when the dispute is on a milestone. Does not include status or amount
dispute.resolvedDispute has been resolved. disputeDecision is PartialRefund or FullRelease. Includes comment. Includes milestoneId when the dispute is on a milestone. Does not include status or amount
WhenWebhooks
Milestone dispute openeddispute.created, milestone.disputed
Contract dispute openeddispute.created, contract.disputed
Milestone dispute resolved with a partial refundmilestone.disput.resolved, dispute.resolved, milestone.refund.partial-initiated, then later milestone.refund.partial-succeeded
Milestone dispute resolved with a full releasemilestone.disput.resolved, dispute.resolved, milestone.released
Contract dispute resolved with a partial refundcontract.disput.resolved, dispute.resolved, refund.partial-initiated

Refund Events​

Event TypeDescription
contract.refundedContract has been refunded
refund.full-initiatedContract full refund has been initiated
refund.full-succeededContract full refund has succeeded
refund.partial-initiatedContract partial refund has been initiated. Status is PartiallyRefunded. transactionId is the refund id. amount is the refunded amount
refund.partial-succeededContract partial refund has succeeded
refund_request.cancelledA refund request was cancelled
overpaid.refund.succeededAn overpayment was refunded
underpaid.refund.succeededAn underpayment was refunded
unmatched.refund.succeededAn unmatched payment was refunded

Milestone Events​

Event TypeDescription
milestone.payment.completedMilestone payment has been completed
milestone.payment.underpaidLess than the expected milestone amount was received
milestone.payment.overpaidMore than the expected milestone amount was received
milestone.releasedMilestone has been released. Carries transactionReference and the released amount
milestone.disputedSee Dispute Events. Milestone status stays Escrow
milestone.disput.resolvedSee Dispute Events. amount on this event is 0
milestone.refundedMilestone has been refunded
milestone.completedMilestone has been fully completed
milestone.refund.full-initiatedMilestone full refund has been initiated
milestone.refund.full-succeededMilestone full refund has succeeded
milestone.refund.partial-initiatedMilestone partial refund has been initiated. Status is PartiallyRefunded. transactionId is the refund id
milestone.refund.partial-succeededMilestone partial refund has succeeded. Carries transactionReference, not transactionId

Testing​

Event TypeDescription
webhook.testTest webhook (sent via /webhooks/test endpoint)
Payload shapes differ between contracts and milestones

The properties inside data change depending on the event and on whether the contract uses milestones. On milestone events that include contractStatus, data.status is the milestone status and contractStatus is the contract. dispute.created and dispute.resolved do not include status.

See Payload Reference before writing your handler.