Getting "Bad request" trying to use the Draft Order api

Topic summary

A user encountered a “Bad request” error when attempting to create a draft order via Shopify’s Admin API using FileMaker’s Insert from URL function.

Initial Setup:

  • Created an app in Shopify Admin’s App Development section
  • Obtained admin API access token
  • Targeted endpoint: https://[mystore].myshopify.com/admin/api/2024-04/draft_orders.json

Request Details:
The POST request included:

  • Headers for API token authentication and JSON content type
  • JSON payload with line items (price, quantity) and custom service title

Resolution:
The user self-resolved the issue, identifying that the cURL syntax was invalid. No further technical details about the specific fix were provided.

Status: Resolved

Summarized with AI on November 8. AI used: claude-sonnet-4-5-20250929.

I am trying to create a draft order through the api. I have created an app in App Development in Shopify admin, and got the admin API token.

I am now trying to send a http request with Filemaker’s function Insert from URL, with following json to “https://[mystore].myshopify.com/admin/api/2024-04/draft_orders.json”:

{
	"line_items" : 
	[
		{
			"price" : "100.00",
			"quantity" : 1,
			"title" : "Custom Service"
		}
	]
}

The cURL is:

"-H " & Quote ( "Content-Type: application/json" ) & " " & 
"-H " & Quote ( "X-Shopify-Access-Token: " & $apiToken ) & " " & 
"-X POST " & Quote ( $apiEndpoint ) & " " & 
"-d " & Quote ( $jsonData )

But I keep ketting “Bad request” as result. I would appreciate any ideas!

With kind regards,

  • Johan.

I figured this out - the curl was invalid.