What's your biggest current challenge? Have your say in Community Polls along the right column.
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.

Problems sending origin_location, destination_location, shipping_address nor billing_addres

Problems sending origin_location, destination_location, shipping_address nor billing_addres

AndresGhini
Visitor
2 0 0

Hi!

 

We are trying to includ in our POST the objs origin_location, destination_location, shipping_address nor billing_addres, but we are currently unable. 

 

This is our curl:

curl --request POST \   --url https://nestle-4.myshopify.com/admin/api/2022-01/orders.json \   --header 'Authorization: Basic NmQxOWVmZGNmZDZmMzg0YmQ5ZDljMDQyNjZiMTEyMmM6c2hwcGFfOWZjMzBkZTJiODg5NTFmZDYyYjVlZmI4YTFhZGYxMmU=' \   --header 'Content-Type: application/json' \   --data '{     "order": {         "line_items": [             {                 "variant_id": "31987198722123",                 "quantity": 1,                 "destination_location": {                     "id": 3384863555659,                     "country_code": "AR",                     "province_code": "X",                     "name": "Matias Infante",                     "address1": "Juan Cruz Varela 2872",                     "address2": "",                     "city": "Córdoba",                     "zip": "5000"                 },                 "origin_location": {                     "id": 2288321347,                     "country_code": "AR",                     "province_code": "B",                     "name": "Shop Nestlé",                     "address1": "Av Libertador 1855",                     "address2": "",                     "city": "Vicente Lopez",                     "zip": "1641"                 }             }         ],         "customer": {             "email": "pbusce@gmail.com"         },         "shipping_address": {             "address1": "Av Corrientes 1250",             "address2": "4 A",             "city": "caba",             "province": "Buenos Aires",             "country": "Argentina",             "zip": "1663",             "phone": "DI57IYL6QB-gBuyMdzyvadj5tpDdSxT4qfJuCU2"         },         "billing_address": {             "address1": "Av Corrientes 1250",             "address2": "4 A",             "city": "caba",             "province": "Buenos Aires",             "country": "Argentina",             "zip": "1663",             "phone": "DI57IYL6QB-gBuyMdzyvadj5tpDdSxT4qfJuCU2"         },         "shipping_lines": [             {                 "code": "Tipo de Envío",                 "title": "Envío a todo el país",                 "price": "600"             }         ]     } }'

 

Replies 3 (3)

lizk
Shopify Staff
246 58 78

Hi there! 

I just would like to confirm what you are trying to accomplish are you currently trying to create an order using the Admin REST API.

Could you let me the know the specific error that you are receiving when you make this CURL request?

Your data looks to be formatted correctly, so you are really close to getting this working! 

But I would recommend that you take a look into how to correctly authenticate when making requests to the Admin APIs.
https://shopify.dev/apps/auth/admin-app-access-tokens

You will need to create an App with the permission to read and write orders. Then you will generate an access token, which you will add to the request by a header 'X-Shopify-Access-Token'.

When you have that access token it is important that you keep it secret, and do not share it or add it to forum posts. 

To learn more visit the Shopify Help Center or the Community Blog.

AndresGhini
Visitor
2 0 0

Hi!

 
 
Just to clarify, we are trying to create an order and we are getting 0 errors. 
The problem is, that even with a successful response, we are having some issues giving parameters to the specified fields. 
 
Our company has many integrations with Shopify, we are familiar with your service, the problem is strictly related to the fields mentioned before. 
 
 
Cheers!
lizk
Shopify Staff
246 58 78

Thanks for the additional context!

I was not able to replicate the issue you saw with the data provided.

I would recommend reaching out to Partner support via the Partner Dashboard, with the request you are trying to make, the f description of the functionality you are seeing, and an example X-request-id header from an affected request. 

They will be able to take a closer look at your specific requests. 
Thanks!

To learn more visit the Shopify Help Center or the Community Blog.