Make barbecue sauce:
In a large bowl, combine ketchup, brown sugar, water, apple cider vinegar, Worcestershire, molasses, and spices. Reserve about 225g of sauce for later. Add chicken to remaining barbecue sauce. Cover and refrigerate for at least 1 hour and up to overnight.
Preheat oven to 220°C (200ºC fan) and line a large baking tray with foil. Place onions on baking tray, drizzle with oil and toss to coat. Place chicken on top of onions, skin side up, and bake, basting often with sauce. until golden and internal temperature reaches 73°C, 30 to 40 minutes.
Bring to a boil. Place chicken in a shallow pan. Pour boiling sauce over it. Bake at 350 degrees for 1 hour, Alternative method: Cover chicken and sauce and bake at 200 degrees for 2 hours, uncover and bake at 450 degrees for 20 minutes
Turn oven to grill. Brush chicken with reserved barbecue sauce on both sides and grill until skin is crispy and sauce is thickened, 5 minutes.