I am making a private app. I want to automatically generate a gift card with the ShopifyAPI::Order. I created a new order with the gift card product + variant as the line item and the gift_card as fulfillment_service. I am using the developer account with the gift card plan.
The following code is what I typed into the shopify console
order = ShopifyAPI::Order.new(:line_items => [ShopifyAPI::LineItem.new("fulfillment_service"=>"gift_card", "fulfillment_status"=>"fulfilled", "price"=>"10.00", "product_id"=>233702101, "quantity"=>1, "requires_shipping"=>false, "sku"=>"", "title"=>"Gift Card", "variant_id"=>528500937, "variant_title"=>"$10.00", "vendor"=>"ExampleDev", "name"=>"Gift Card - $10.00", "variant_inventory_management"=>nil)], :email => 'example@domain.com', :financial_status => 'paid', :customer => ShopifyAPI::Customer.first, :shipping_address => ShopifyAPI::Customer.first.default_address)
order.save
My order history shows:
Received new order
We submitted 1 line item for fulfillment to external service
Order was placed
Shipping Address has been updated
The order was generated but the gift card was not fulfilled.
How can I get it to trigger the gift_card fulfillment like the following?
1 gift card was sent
1 gift card is scheduled for delivery