Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Re: 406 Not Acceptable when trying to create draft order

Solved

406 Not Acceptable when trying to create draft order

stjelic
New Member
4 0 0

Hi, I'm using Postman to create a draft order and I'm getting this 406 Not Acceptable error and I don't know why. 

I'm using POST with my API Key and Password on those blank spaces:  https://__:__@startmapapp.myshopify.com/admin/api/2021-01/draft-orders.json 

In the header, I have: Content-Type application/JSON

And my body is:

{
    "draft_order": {
        "line_items": [
            {
                "variant_id": 38950531236025,
                "quantity": 1
            }
        ]
    }
}

 

 

 

 

Accepted Solution (1)

_JB
Shopify Staff (Retired)
836 100 223

This is an accepted solution.

Hey @stjelic,

The endpoint URL should use draft_orders.json with an underscore instead of hyphen 🙂

JB | Solutions Engineer @ Shopify 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

View solution in original post

Replies 2 (2)

_JB
Shopify Staff (Retired)
836 100 223

This is an accepted solution.

Hey @stjelic,

The endpoint URL should use draft_orders.json with an underscore instead of hyphen 🙂

JB | Solutions Engineer @ Shopify 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

stjelic
New Member
4 0 0

@_JB Hi, thanks for an answer, thats the solution. Also I needed productID, not just variantID.