I have created a custom offline payment method, which I want to be visible through API, but not during web checkout.
I tried with <can_use_checkout>0</can_use_checkout>
in config.xml, but it affects API as well.
I have found the source of the payment list in this file,
vendor/magento/module-checkout/view/frontend/web/template/payment-methods/list.html
, but unsure how to hide a specific payment method from here.