Shopify Create Order API
I used the Shopify API to create an order using my product's variantID.
For some reason,line_item
s in orders created using the API always have"vendor":"null"
. Whereas orders for the same variant created via the store returns the correctvendor
.
Am I doing anything wrong?
URL: https://xxyy.myshopify.com/admin/orders.json
{ "order": {
"email": "ken@xxyy.com",
"fulfillment_status": "unfulfilled" ,
"send_receipt": true,
"send_fulfillment_receipt": false,
"line_items": [{
"variant_id": 3866750123,
"quantity": 1
}]
}
}
Answer
Solution:
I get that sometimes too and it is truly crappy. If you create a line item using the API it seems you need to provide not only the product and variant ID, but also the vendor, as even if it exists in the product, that does not get picked up in the order creation process. A lot of Apps screw this up. Which screws up other Apps expecting good orders. And a it seems to me a good order should have the product vendor field set.
Source
Didn't find the answer?
Our community is visited by hundreds of Shopify development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.