Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8581335
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:01:21+00:00 2026-06-11T21:01:21+00:00

I am starting to develop a Shopify integration. The app that I am trying

  • 0

I am starting to develop a Shopify integration. The app that I am
trying to integrate has a different subdomain per user account, and so
will need to redirect to a different callback domain for each oauth
connection request. So far I am redirecting to the Shopify authorise
URL to allow the user to grant access to their account. However, I get
an error response of:

{"error":"invalid_request",
 "error_description":"The redirect_uri and application url must have matching hosts"}

The URL is of the form:

https://SHOP_NAME.myshopify.com/admin/oauth/authorize?client_id=MY_CLIENT_ID&scope=read_order&redirect_uri=SUBDOMAIN.MYAPP.com

I have tried setting the application URL (set in the admin page in
Shopify) to all of these and receive the same error:

http://MYAPP.com
http://.MYAPP.com
http://*.MYAPP.com

However, I can get it to work with:

http://SUBDOMAIN.MYAPP.com

I can create an endpoint that just takes information from the query
string, and redirects to the subdomain, for example:

callback.MYAPP.com?subdomain=SUBDOMAIN

Which would work around this, but I would rather that the Shopify API
supported subdomains since I would like to also create links in the
Shopify pages into my app, and would rather not have to keep building
these levels of indirection. (Although, looking at the admin page for
the application links, it looks like I will have to do the same there
too.)

I am using a non-standard TLD (since this is currently in
development). So where I’ve put MYAPP.com it’s really oh.dev, however
I have tried using a .com by editing my hosts file, with the same
results.

Does anyone know how to get Shopify to accept a subdomain as a
callback_url? Have I missed something obvious?

Here’s some Clojure code:

(require '[com.twinql.clojure.http :as http] '[clojure.contrib.logging :as log])

(defn consumer []
  {:key "1234567890"
   :secret "1234567890abcde"})

(defn shopify-config [shop-name]
  {:request-token-url (str "https://" shop-name ".myshopify.com/admin/oauth/authorize")
   :authorise-url (str "https://" shop-name ".myshopify.com/admin/oauth/authorize")
   :access-token-url (str "https://" shop-name ".myshopify.com/admin/oauth/access_token")
   :api-endpoint-url (str "https://" shop-name ".myshopify.com")})

(defn get-redirect-url [shop-name callback-url]
  (let [{consumer-token :key consumer-token-secret :secret} (consumer)]
    (str (-> shop-name shopify-config :request-token-url)
         "?client_id=" consumer-token
         "&scope=read_orders,read_products,read_customers"
         "&redirect_uri=" callback-url)))

(defn get-access-credentials [verifier shop-name]
  (let [{:keys [key secret]} (consumer)
        response (http/post (-> shop-name shopify-config :access-token-url)
                            :as :json
                            :query {"client_id" key
                                    "client_secret" secret
                                    "code" verifier})]
    (log/debug (str "response from getting access credentials from shopify : " response))
    {:access-token (-> response :content :access_token)
     :consumer-key key
     :consumer-secret secret}))

(def methods {:get http/get
              :post http/post
              :delete http/delete
              :put http/put})

(defn- make-request [method shop-name url token params]
  (let [response (method (str (-> shop-name shopify-config :api-endpoint-url) url)
                         :as :json
                         :query params
                         :headers {"X-Shopify-Access-Token" token})]
    (if (-> response :code (= 200))
      (:content response)
      (do
        (log/error (str "Error in shopify request : " response))
        (throw (Err. {:handle :shopify-request-error
                      :response response}))))))

(defn get-products [shop-name token page]
  (make-request (:get methods) shop-name "/admin/products.json" token {:page page :limit 200}))

Also, there is some code that gets things like the shop-name from the
user, and stores it in the DB and so on. So we basically call
get-redirect-url to redirect the user to shopify, and get them to
approve the permissions. The callback-url that we pass to Shopify is
something like:

http://customer1.oh.dev/integrations/shopify/1/callback

Which then takes the code provided and calls get-access-credentials.
The surrounding code stores the access-token, etc that we return. Then
there is an other user action that will call get-products, after
retrieving the token & shop-name.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T21:01:23+00:00Added an answer on June 11, 2026 at 9:01 pm

    If you set the application URL to http://myapp.com you should be able to specify the redirect_uri=http://domain.myapp.com, is this what you are doing? Can you post the code you are using to make the oauth request?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am starting to develop an Android app and I have seen that in
Hi there I'm starting to develop an Android app which will be using a
I am starting to develop apps for iPhone. There is 1 specific app that
I'm starting to develop a web application in PHP that I hope will become
We're starting to develop a Web application that will have some complex functionality written
I am starting to develop app where you basically could buy books and read
I'm starting to develop a facebook application using Django. I'm trying to choose the
I'm starting to develop an application that involves dealing with recording audio. I'm using
I'm starting to develop a mobile version of a website that we run. Our
I'm using VS2008 to develop a project that I'm starting to test under Mono.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.