HTTP endpoint responding with Bad Request

I created a http-functions.js file and have been working on some endpoint functions. The first function that I want to begin testing works just fine using functional testing, but it fails with a “Bad Request” response when I call it from Postman. Through my testing so far I’ve stripped the function down to just the bare essentials, so I don’t think the issue is with the function definition itself, but here it is anyway just in case I’m overlooking something.

import { ok, badRequest } from 'wix-http-functions';

export async function get_estimate(request) {
  const response = {
    "headers": {
      "Content-Type": "application/json"
  response.body = {
    "aid": request.query.aid,
    "txid": request.query.txid
  return ok(response)

FWIW, I’m making it an async function because in the final version I need to make numerous async calls. I tried it without the async prefix, and I still get the same result.

As for the call to the endpoint, I’ve tried it with both the dev and production URLs, and they both lead to the same “Bad Request” response. Here’s one attempt (it’s a premium site, so I’m using that URL format):


I’ve been tearing my hair out over this for at least an hour. Any idea what I’m doing incorrectly?

I am having the same problem. You’d think after two years WIX could have answered you.