Creating an order with gift card property on line item

Creating an order with gift card property on line item

Sozary
Visitor
1 0 0

Hi,

I'm facing an issue when I'm trying to create an order with a line item.

I'd like this line item to have the "gift_card" property set to true.

That's what I've done so far:

 

POST - https://domain.myshopify.com/admin/api/2021-10/draft_orders.json

Data:

 

 

{
    "draft_order": {
        "line_items": [
            {
                "gift_card": true,
                "title": "GiftCard test",
                "price": "20.00",
                "quantity": 1,
                "taxable": true,
                "requires_shipping": false
            }
        ]
    }
}

 

 

 I then receive

{
    "draft_order": {
        "id": 924299132982,
        "line_items": [
            {
                "id": 57580100223030,
                "variant_id": null,
                "product_id": null,
                "title": "GiftCard test",
                "variant_title": null,
                "sku": null,
                "vendor": null,
                "quantity": 1,
                "requires_shipping": false,
                "taxable": false,
                "gift_card": false,
                "fulfillment_service": "manual",
                "tax_lines": [],
                "applied_discount": null,
                "name": "GiftCard test",
                "properties": [],
                "custom": true,
                "price": "20.00",
            }
        ],
   
    }
}

I don't know what went wrong in the process, any idea?

Thank you

Replies 0 (0)