Can Coinbase Commerce interact with Smart Contracts?

I have a smart contract that has an Onchain Supply Management system. Can Coinbase Commerce be used to accept payment and transfer the payment along with the functionCall information ? My dApp is https://SpecieCircle.web.app. If a guest buys 3 small hoodies, can the data of 3 small hoodies be recorded seperately on Coinbase Commerce. While also sending a functionCall along with the correct payment through coinbase commerce to the dApp?

Hello @BeenOnChain, welcome to the Coinbase Cloud Developer Forum! Thank you for taking an interest in trying out the Coinbase APIs. For the details regarding your concern, we will check on this for you with our team. We will get back to you once we have more information. Keep in touch!

1 Like

Hello @BeenOnChain! Thank you so much for your patience, but we just wanted to make sure what you really wanted to achieve so we can give a proper resolution to your concern.

  1. Do you want to have your users connect a wallet and make a contract call through your dapp, which would then pass the payment along to a Commerce charge? You could do this by creating a charge via the API and then passing the charge address as an argument to the contract call your dApp makes. Your contract could then send the funds along to the Commerce charge. You would need to collect a token approval from the user in order to do this.

  2. Do you want Commerce to make a call to your contract with details for every charge that gets paid? Commerce can’t call your contract but you could set up a webhook to receive notifications on, and then make a contract call in the handler. You would need to keep track of the items/quantities for each charge separately.

We hope we were able to address your concern. If there is anything else, feel free to reach out. Thank you so much!