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

Solved

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

johstrom
Shopify Partner
21 1 3

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.

Accepted Solution (1)

johstrom
Shopify Partner
21 1 3

This is an accepted solution.

I figured this out - the curl was invalid.

View solution in original post

Reply 1 (1)

johstrom
Shopify Partner
21 1 3

This is an accepted solution.

I figured this out - the curl was invalid.