Search code examples
callbacknotificationswebhookscoinbase-api

How to create a custom webhook URL per address via API


We are creating a custom payment service that uses Coinbase as a Bitcoin backbone. I managed to set up Bitcoin address creation (wallets) and the checkout process is actually finished (Bitcoin address is being created).

However, I did not find a way to attach a custom callback URL to an address I've created. The address should "listen" to incoming transactions and trigger the webhook URL.

We cannot use any of the predigested merchant solutions from Coinbase (button / page / iframe) because the payment flow should be deeply integrated into our existing processes, look and feel. Instead the system is just creating a new Bitcoin address and should be notified on incoming transaction events, but without using a merchant solution.

When creating an address using the Coinbase API v2, you get an object that includes the callback_url property. However, it is empty and in the documentation there is no hint on how to specify that.

I thought about polling the addresses, but that could easily exceed the 10,000 requests per hour rate limit. Any clues how to specify the callback_url on address creation (https://api.coinbase.com/v2/accounts/:account_id/addresses)?


Solution

  • I’d recommend a third-party for this - I’ve personally used https://blockchainwebhooks.com and https://www.blockcypher.com - both have been reliable and offer free plans. Blockchain WebHooks is significantly more affordable, that’s what we still used today.