Importing orders via Rest API

Solved
nduc2204
New Member
2 0 0

Hi guys, I am currently having this issue while trying to POST an order to SHOPIFY. Any ideas?

Much appreciated

{
"order": {
"financial_status": "authorized",
"confirmed": true,
"total_price": 76,
"subtotal_price": 69,
"currency": "EUR",
"processed_at": "2016-05-30 18:36:39",
"updated_at": "2017-01-24 18:29:14",
"send_receipt": false,
"send_fulfillment_receipt": false,
"suppress_notifications": true,
"shipping_lines": [
{
"price": 7,
"title": "Shipping",
"code": "Shipping"
}
],
"customer": {
"id": 5175617093676
},
"billing_address": {
"first_name": "Marica",
"last_name": "Angelini",
"address1": "Via oronzo de mita",
"address2": "57",
"city": "Martina franca",
"province": "Taranto",
"country": "Italia",
"province_code": "TA",
"country_code": "IT",
"zip": "74015",
"phone": "3272292924",
"name": "Marica Angelini",
"latitude": null,
"longitude": null,
"company": ""
},
"shipping_address": {
"first_name": "Marica",
"last_name": "Angelini",
"address1": "Via oronzo de mita",
"address2": "57",
"city": "Martina franca",
"province": "Taranto",
"country": "Italia",
"province_code": "TA",
"country_code": "IT",
"zip": "74015",
"phone": "3272292924",
"name": "Marica Angelini",
"latitude": null,
"longitude": null,
"company": ""
},
"note": "",
"line_items": [
{
"variant_id": null,
"title": "CAROL TAUPE ",
"price": 0,
"quantity": 1,
"sku": "CAROL TAUPE",
"product_id": null,
"total_discount": 0,
"variant_title": null,
"name": "CAROL TAUPE ",
"properties": [],
"grams": ""
}
]
}
}

Response: {"errors":"Service is unavailable."}

 

0 Likes
GrahamS
Shopify Staff
Shopify Staff
139 22 30

Hey @nduc2204 

Can you forward me an x-request-id from the headers of your most recent call attempt? I'll take a look at what might be happening here.

Best,

Graham

Graham S | API Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

0 Likes
nduc2204
New Member
2 0 0

Thanks for your reply. 

Data:

{"order": {"financial_status": "authorized", "confirmed": true, "total_price": 132.0, "subtotal_price": 132.0, "currency": "EUR", "processed_at": "2021-06-14 20:24:46", "updated_at": "2021-06-21 14:07:00", "send_receipt": false, "send_fulfillment_receipt": false, "suppress_notifications": true, "total_tax": 23.8, "tax_lines": [{"rate": 0.22, "title": "TAX", "price": 23.8}], "shipping_lines": [{"price": 0, "title": "Free Shipping", "code": "Shipping"}], "customer": {"id": 5176656986156}, "billing_address": {"first_name": "Sharon", "last_name": "Lobaccaro", "address1": "Via fugazza 39", "address2": "", "city": "Villanova del Sillaro", "province": "Lodi", "country": "Italia", "province_code": "LO", "country_code": "IT", "zip": "26818", "phone": "3338920402", "name": "Sharon Lobaccaro", "latitude": null, "longitude": null, "company": ""}, "shipping_address": {"first_name": "Sharon", "last_name": "Lobaccaro", "address1": "VIA STRADA LONGA 809, n 20", "address2": "OFFICINA EMMEZETA", "city": "Massalengo", "province": "Lodi", "country": "Italia", "province_code": "LO", "country_code": "IT", "zip": "26815", "phone": "3338920402", "name": "Sharon Lobaccaro", "latitude": null, "longitude": null, "company": ""}, "note": "", "line_items": [{"variant_id": 39421804740652, "title": "Sandali glitter argento tacco 9 cm", "price": 108.2, "quantity": 1, "sku": "ROXY GLITTER ARGENTO 37", "product_id": 6584449531948, "total_discount": 0.0, "variant_title": null, "name": "Sandali glitter argento tacco 9 cm", "properties": [], "grams": ""}]}}

 

Headers:

'X-Request-ID' : 'f94f790e-8546-4cbc-b5f7-ab5a772a2402'

 

Response: {"errors":"Service is unavailable."}

0 Likes
GrahamS
Shopify Staff
Shopify Staff
139 22 30

This is an accepted solution.

Hey @nduc2204 ,

I looked into this one a bit further."Service is unavailable" Is an error that will return for the orders endpoint if the shop is in a state where is cannot process orders, such as if it is frozen or in a full pause plan. In order to gain access to that command and endpoint, you would need to ensure that the shop in question is live and on a paid plan.

Graham S | API Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog