POST API Connector Error Shopify API

Hi there,

I am trying to create discount codes in a Shopify Store (POST to admin/api/2025-10/price_rules.json). With Postman everything works without problem. When doing exactly the same here in Bubble Connector I get the following error:

There was an issue setting up your call.
Raw response for the API
Status code 400
{"errors": ("price _rule":"Required parameter missing or invalid"}

This guy seemed to had the same problem: API Connector error with Shopify API but unfortunately this does not the trick here for me.
Unfortunately, I’m at my wit’s end. What else could be the cause?

It looks like you’re missing that parameter in the body of your API call

There is no parameter missing. As mentioned with Postman this exact call works (I copy and pasted everything, checked it a lot of times), with Bubble API Connector it does not. It gives this error

Your JSON might be breaking in the API Connector. Try formatting it better in the API Connector body. Because of that, it probably works in Postman but not in Bubble.

How you mean “formatting it better in the API Connector body”?

You should using something like https://reqbin.com/

call it with bubble and postmaster and compare. The beauty is that it will show exactly what you send and therefore easy to compare if it truly is the same as you claim.

It’s just a guess about the problem, I’m not sure if that’s it, but it’s worth a try.

The formatted JSON would look like this:

{
  "price_rule": {
    "title": "SUMMERSALE100FF",
    "target_type": "line_item",
    "target_selection": "all",
    "allocation_method": "across",
    "value_type": "fixed_amount",
    "value": "-10.0",
    "customer_selection": "all",
    "starts_at": "2017-01-19T17:59:10Z"
  }
}

Unfortunately same error

I do not understand your exact intention.

You mean the following?
Do I get a URL there which I should call from bubble and postmaster and can then inspect the respective request?

Can you send screenshots of how it looks in Postman? If it’s the same, it shouldn’t be failing, there must be something we’re not seeing.

Yeah it really drives me crazy as I have more Get Requests they work without problem. But to not be able get this Post running is frustrating.

Here from Postman:

Yes you get the url and you can POST anything to it. It accepts everything. So therefore you can also see exactly what Bubble sends out and postmaster

mojo, here’s 2 things to try that almost always solve it for me…

#1 explicitly set the header to Content-Type: application/json. - Exact casing - yeah technically http isnt case sensitive but some frameworks won’t recognize it unless its capital C and capital T.

If that doesn’t fix it –> #2 switch the body to Raw and paste the full JSON payload directly. Bubble’s structured body sometimes serializes nested objects differently than the API expects.

Do you have any shared headers? This could create a conflict with your call.

You can always send the request from Postman and from Bubble to a beeceptor endpoint and compare both (the body and headers)

Holy moly. thank you. C and T with capitalized letters and it worked instantly. omg :sweat_smile: I’ll have to remember that, big thanks!

1 Like

yeah, it doesn’t make much sense but it works…. (Bubble should fix that or have a auto capitalization…)

It’s not really a Bubble issue (except if you are using the defaulted one. But in this case, it was set by user)

I’m pretty sure this is on Bubble. Header names are case-insensitive, so Shopify shouldn’t care about capitalization. What probably happened is that Bubble didn’t actually treat content-type as the real Content-Type header and either ignored it or overrode it.

Bubble has a track record of silently overriding user-set headers in some modes, so this wouldn’t be surprising.

And even if you argue it’s not strictly a “bug,” it doesn’t really change the takeaway. Bubble is a low-code tool, and this is exactly the kind of sharp edge it should smooth over automatically. Especially if it’s trying to compete in an AI-heavy world, it should be able to figure out that content-type == Content-Type.

2 Likes

Absolutely… the issue is the server that receive the call that reject the call because of that, not Bubble that convert the header to something else. The server should accept header.

Yes Bubble will in some case, overwrite (keep the default in fact) the Content-type (if entered correctly Bubble will use the one you entered). For that, I could consider this a bug. But at the end, the server should accept the header even if this is capitalized or not.

At the moment you play in API connector, you are a little more than just in a no-code. Don’t forget this is why API Connector is consider a plugin actually. This is not a basic feature, not a no-code feature.