ForecastingError.NOT_ENOUGH_INVENTORY on order approval vith setSkipInventoryCheck set to true

485 views
Skip to first unread message

RDFP

unread,
Jan 21, 2017, 1:10:14 PM1/21/17
to Google's DoubleClick for Publishers API Forum
Hi,

Why do I still get a ForecastingError.NOT_ENOUGH_INVENTORY when attempting to approve an order, even with the setSkipInventoryCheck set to true?

ApproveOrders approveOrders = new ApproveOrders();
        approveOrders.setSkipInventoryCheck(true)

Thank you!

Vincent Racaza (DFP API Team)

unread,
Jan 22, 2017, 10:24:18 PM1/22/17
to Google's DoubleClick for Publishers API Forum
Hi,

Could you try updating the line item first before approving the order? In your update line item method, you need to set the skipInventoryCheck and allowOverbook properties to true. After updating the line item with these changes, you can now approve the order.

Let me know if this solve your issue.

Thanks,
Vincent Racaza, DFP API Team

RDFP

unread,
Jan 24, 2017, 5:05:33 PM1/24/17
to Google's DoubleClick for Publishers API Forum
Hi,

Yes, I actually already have those set to true in the code, but when I looked up the line item created, the values are both false.  Why is that?

            lineItem.setAllowOverbook(true);
            lineItem.setSkipInventoryCheck(true);

Thanks!

RDFP

unread,
Jan 24, 2017, 7:53:10 PM1/24/17
to Google's DoubleClick for Publishers API Forum
Hi,

We created the line item with both flags set to true.
   lineItem.setAllowOverbook(true);
   lineItem.setSkipInventoryCheck(true);

When I looked up the line item, both values show false, so I set the to true again and attempted to do an update and the values still show false.

What else can I try to make those two flags true?

Thanks!


On Sunday, January 22, 2017 at 7:24:18 PM UTC-8, Vincent Racaza (DFP API Team) wrote:

RDFP

unread,
Jan 24, 2017, 9:29:38 PM1/24/17
to Google's DoubleClick for Publishers API Forum
I got it; I got the order approved to ready state by first using SubmitOrdersForApprovalAndOverbook to get to the pending approval state and then ApproveOrders to get it to ready state.

Can you tell us more about this for future reference?  I just found SubmitOrdersForApprovalAndOverbook in the javadoc.

Vincent Racaza (DFP API Team)

unread,
Jan 24, 2017, 10:14:38 PM1/24/17
to Google's DoubleClick for Publishers API Forum
Hi,

I'm glad that you were able to solve the issue. Yes, aside from using ApproveOrders action, you can also also use the SubmitOrdersForApprovalAndOverbook action (on which you did) and ApproveAndOverbookOrders to bypass the "Not enough inventory" error. You can check all the action methods of an order in this document. In the document, some of the action methods are under the reference document of an action. An example would be the SubmitOrdersForApprovalAndOverbook action which is under the SubmitOrderForApproval action in the reference document.

Thanks,
Vincent Racaza, DFP API Team

RDFP

unread,
Jan 26, 2017, 2:01:24 PM1/26/17
to Google's DoubleClick for Publishers API Forum
Hi Vincent,

So right now, I'm using SubmitOrdersForApprovalAndOverbook, followed by ApproveOrders to approve an order.  It sounds like I can just use ApproveAndOverbookOrders to do the same thing, but with one class/call, right?
If so, I'll switch to the latter to simplify.
Thanks

Vincent Racaza (DFP API Team)

unread,
Jan 26, 2017, 9:48:54 PM1/26/17
to Google's DoubleClick for Publishers API Forum
Hi,

Yes, you are correct. You can directly use the ApproveAndOverbookOrders action to directly overbook and approve the orders.

Let me know if you encounter any error when using this action method.

Regards,
Vincent Racaza, DFP API Team

Reply all
Reply to author
Forward
0 new messages