Hello,
I am retrieving orders using the php sdk and api version 43.2.0.20251016 with a sandbox account. In the documentation it shows that there should be a Discounts field returned with all of the discounts applied to the order or Null if no discounts are applied. But in what I am getting for the order this field is missing. Any idea why?
This is what I am getting back. I do not have an applied discount to this order but I used to be able to check for null (with the old php sdk) now there isn’t even a field.
array:1 [▼
"order" => array:17 [▼
"id" => "v889tQAPTbtMqb01ZK78vCRP4cNZY"
"state" => "COMPLETED"
"source" => array:1 [▶]
"tenders" => array:1 [▶]
"version" => 4
"closed_at" => "2025-12-31T16:51:14.758Z"
"created_at" => "2025-12-31T16:51:14.029Z"
"line_items" => array:2 [▶]
"updated_at" => "2025-12-31T16:51:15.000Z"
"location_id" => "LTX4QSAAJJK0E"
"net_amounts" => array:5 [▶]
"total_money" => array:2 [▶]
"total_tax_money" => array:2 [▶]
"total_tip_money" => array:2 [▶]
"net_amount_due_money" => array:2 [▶]
"total_discount_money" => array:2 [▶]
"total_service_charge_money" => array:2 [▶]
]
]
Little update I went back to check some of the old orders and they had this field
"orderDiscountArray": null
This is the full payload from the old order
+"id": "xxxxxxxx"
+"locationId": "xxxxxxxx"
+"created_at": "xxxxxxxxxx"
+"orderDiscountArray": null
+"lineItems": array:1 [▶]
+"refund": null
+"totalMoney": xxxxx
+"taxMoney": 0
+"discountMoney": 0
+"tipMoney": 0
+"tenders": array:1 [▶
0 => {#1606 ▶}
]
Another edit. Does this have to do with adding the orders via the api and not making them through the app? IS it another sandbox issue?
Last edit:
I figured it out. The Discounts Key only shows up if there are discounts applied now unlike before when it would return NULL.
THanks
Don