Recipient Webhooks

Recipient Webhooks

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:

  1. 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).

  2. Merchants will be waiting for the "active" status for a given recipient before they include them on a payout batch

  3. 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.

  4. Merchants must use HTTPS for the notificationURL.

  5. 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).

Headers

HeaderValue
Acceptapplication/json
Content-Typeapplication/json

Body

NameDescriptionType
eventWebhook event object.object
→ codeSee the list of available Webhook notification codes for more information.number
→ nameSee the list of available Webhook notification codes for more information.string
dataWebhook data object, containing the recipient information.object
→ idUnique recipient id assigned by BitPay for a given customer email.string
→ shopperIdThis is the unique id assigned by BitPay if the shopper used his personal BitPay account to authenticate and pay an invoice. For customers signing up for a brand new BitPay personal account, this id will only be created as part of the payout onboarding. The same field would also be available on paid invoices if the customer signed in with his BitPay personal account before completing the payment. This can allow merchants to monitor the activity of a customer deposits & payouts).string
→ emailRecipient email address to which the invite link shall be sent.string
→ statusRecipient status, can have the following values: "invited", "unverified", "verified", "active", "paused", "removed"string
→ labelFor merchant use, pass through - could be customer name or unique reference ID.string

Webhook notification codes

CodeNamePurpose
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

HTTP Response

{
    "event":{
        "code":4003,
        "name":"recipient_verified"
    },
    "data":{
        "id":"8Gq174SFAnQpdLDxRZCBPB",
        "shopperId":"5QZnQKyanj8o7qohDf2zC2",
        "email":"[email protected]",
        "label":"updatedLabel",
        "status":"verified"
    }
}