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.

We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

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)