Join us for an upcoming Shopify Partner webinar on February 27, 2024. Discover the latest Checkout Extensibility features, and deep dive on improvements to Shopify Functions and Web Pixels. Register now for either the 10am EST or 2pm EST sessions.

ShopifyAPI ApplicationCharge Bad Request

soona_gus
Shopify Partner
2 0 0

Hi all! Recently we've seen a few errors with our app when attempting to use the ShopifyAPI on version

2023-07 to make an Application Charge. We are running

 

 

ShopifyAPI::Auth::Session.temp(shop: shop_domain, access_token: access_token) do
    charge = ShopifyAPI::ApplicationCharge.new
    charge.name = name
    charge.price = price
    charge.return_url = return_url
    charge.save!
    charge
end

 

 

Sometimes the `charge.save!` throws

 

 

JSON::ParserError
Empty input (after ) at line 1, column 1 [parse.c:1081] in 'Bad Request

 

 

To me this looks like the response we're getting is a Bad Request error, however I have no idea how that could be generated. If the price were under $0.5 we'd be getting a 500, if the access token no longer worked or the domain were wrong I don't think we'd get a Bad Request response either. Would love some help on this, since everything works locally and the docs make me think we're not doing anything crazy.

Replies 0 (0)