Affirm offsite payment extension throw error

I am creating an off-site payment extension.

I created a payment api and set it to payment_session_url of file shopify.extension.toml
I ran shopify app dev and test checkout. When I click “Pay Now” button, I got error message below. How to fix it?

This is payment api. It is a public API

This error usually happens when Shopify can’t reach or validate your payment_session_url. Make sure your API endpoint is publicly accessible (no localhost), uses HTTPS, and returns the correct JSON response structure required by Shopify’s Payment Sessions API. Also confirm the URL is correctly added in shopify.extension.toml and that your server isn’t blocking Shopify’s requests. Once the URL is valid and returns the expected fields, the “Pay Now” error should disappear.

1 Like