Skip to content

Conversation

@TChukwuleta
Copy link
Contributor

include refund flow for Shopify plugin

@pavlenex @ndeet

@NicolasDorier
Copy link
Member

@TChukwuleta

In the webhook settings, click `Create webhook`, and in the modal select the following:
- For event, select Refund create
- Format should be JSON
- URL is the webhook URL you copied from Shopify refund settings on BTCPay Server page
- Webhook API version choose 2026-01

Please can you look if we can remove this step?
I would be surprised if you can't achieve this through the toml template file from the deployer project.

@ndeet
Copy link
Contributor

ndeet commented Jan 22, 2026

@NicolasDorier the step returns a webhook secret which you then enter in the plugin setting, not sure if that can be automated, maybe with an api call or you can set your own webhook secret in the toml but then it would need to be unique.

everybody:
On the refund settings I'm not sure if it's not better to make the "Use current exchange rate at time of refund" default and put it on the top. With refunds usually a few days go by and the current default of "Use exchange rate at time of original payment" could mean lots of difference and either customer or merchant rekt. My thinking is that on time of payment the current exchange rate gets set and used for payment of order in fiat currency terms, so it is consistent to also do that for the refund to send back the BTC in fiat currency terms? What's your thoughts?

@TChukwuleta
Copy link
Contributor Author

Hey @NicolasDorier

It is absolutely possible to do this via the toml template.. and even possible to do via graphql which I think is better so as to avoid multiple app deployment..

(https://shopify.dev/docs/api/admin-graphql/latest/mutations/webhookSubscriptionCreate)

There is just a small UX concern that made me feel customer doing this would be better...

If I create with graphql, It gets created, but on the app and not the store.... so if one goes to the webhook page on the shopify store, it wont be visible..

We need webhook signature to validate the calls and the webhook signature is only available on the store webhook page

When asking them to retrieve webhook signature on the page, they might be confused as to why they cant see any webhook created

{{
  "data": {
    "webhookSubscriptionCreate": {
      "webhookSubscription": {
        "id": "gid://shopify/WebhookSubscription/2158219788635",
        "topic": "REFUNDS_CREATE",
        "format": "JSON",
        "endpoint": {
          "__typename": "WebhookHttpEndpoint",
          "callbackUrl": "https://d48408880f85.ngrok-free.app/stores/yLcSb2jCQUGHLmxKMHaUt1ReV1a7vtgU2hMHisTVb43/plugins/shopify-v2/webhooks"
        },
        "includeFields": [],
        "metafieldNamespaces": []
      },
      "userErrors": []
    }
  }
  }
}}
image

Another thing to point out... (maybe not related to this)

But if you create webhook on this webhook settings page for a particular topic, you wouldn't be able to create another for the same topic

So if they had an existing refund/create.. they might not be able to the same

image

SHould I go ahead and use graphql (or toml)?

@TChukwuleta
Copy link
Contributor Author

Agree to this..
Can make "Use current exchange rate at time of refund" default..

everybody: On the refund settings I'm not sure if it's not better to make the "Use current exchange rate at time of refund" default and put it on the top. With refunds usually a few days go by and the current default of "Use exchange rate at time of original payment" could mean lots of difference and either customer or merchant rekt. My thinking is that on time of payment the current exchange rate gets set and used for payment of order in fiat currency terms, so it is consistent to also do that for the refund to send back the BTC in fiat currency terms? What's your thoughts?

@NicolasDorier
Copy link
Member

@TChukwuleta ok it makes sense

About this screen Go to Settings -> Notifications -> webhook...

image

I think you can simplify this by just make a link that the user just have to click on?

@TChukwuleta
Copy link
Contributor Author

Hey @NicolasDorier I have updated it..

Can you take another look


## Shopify Refunds

BTCPay Server supports processing refunds only for Shopify orders paid with Bitcoin via BTCPay Server. When you issue a refund in Shopify, BTCPay Server will handle refund process by sending a refund claim link based on the amount to be refunded back to the customer.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTCPay Server supports processing refunds only for Shopify orders paid with Bitcoin via BTCPay Server

Can you clarify what this means? It doesn't support other payment methods, just bitcoin?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only orders paid with BTCPay that the refund flow would work for..

So if you paid with credit card or others, BTCPay wont do refunds

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reworded it.. You can take another look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants