Ad

Shopify Create Order API

- 1 answer

I used the Shopify API to create an order using my product's variantID.

For some reason, line_items in orders created using the API always have "vendor":"null". Whereas orders for the same variant created via the store returns the correct vendor.

Am I doing anything wrong?

URL: https://xxyy.myshopify.com/admin/orders.json

{   "order": {     
        "email": "[email protected]",   
        "fulfillment_status": "unfulfilled" , 
        "send_receipt": true,   
        "send_fulfillment_receipt": false,     
        "line_items": [{         
            "variant_id": 3866750123,     
            "quantity": 1       
        }]   
    } 
 }
Ad

Answer

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.

Ad
source: stackoverflow.com
Ad