Shakira and her estranged partner Gerard Piqué have formalised their child custody agreement in court.