Facades: payout
Overview
Webhooks are an HTTP POST message sent from the BitPay server to the merchant’s eCommerce server. The primary purpose of a webhook is to alert the merchant’s ecommerce server that the status of a resource (invoice, payout, and now recipients) has changed. The messages are sent to the notificationURL field when creating the invoice or payout request.
Handling
BitPay does not sign webhooks, so the information in the payload should never be trusted outright:
- The webhook shall be used by the merchant as a trigger to verify the status of a specific recipient. This can be done by retrieving the corresponding recipient object, via the GET recipients/recipientId endpoint (recipientId will be provided in the body of the webhook).
- Merchants will be waiting for the
active
status for a given recipient before they include them on a payout batch - The BitPay server expects an HTTP 200 response with an empty body to the webhook. Any other response is considered by BitPay as a failed delivery.
- Merchants must use HTTPS for the
notificationURL
. - The BitPay server attempts to send webhooks multiple times until the send is either successful or the BitPay server gives up. (schedule to be defined).
Notification Codes
Code | Name | Purpose |
---|---|---|
4001 | recipient_invited | To notify merchants that a recipient has reached the status invited . |
4002 | recipient_unverified | To notify merchants that a recipient has reached the status unverified . |
4003 | recipient_verified | To notify merchants that a recipient has reached the status verified . |
4004 | recipient_active | To notify merchants that a recipient has reached the status active . |
4005 | recipient_paused | To notify merchants that a recipient has reached the status paused . |
4006 | recipient_removed | To notify merchants that a recipient has reached the status removed . |
4007 | recipient_manuallyNotified | Whenever a merchant request for the last notification to be resent. |
Example Webhook
{
"event":{
"code":4003,
"name":"recipient_verified"
},
"data":{
"id":"8Gq174SFAnQpdLDxRZCBPB",
"shopperId":"5QZnQKyanj8o7qohDf2zC2",
"email":"[email protected]",
"label":"updatedLabel",
"status":"verified"
}
}