I assume your ordering system is not capable of storing this reference and returning it with the invoice.
One option is to store the reference in the orchestration instance and reuse this orchestration instance to process the invoice. Have a long running orchestration that receives the order, saves the reference in an orchestration variable, sends the order, waits for the invoice (correlating on order number) receives the invoice, injects the order reference and send the invoice.
Otherwise create a SQL table with three columns, order number and order reference. Insert the order number and reference when processing the order When processing the invoice retrieve the order reference using the order number and when the invoice send successfully completes delete the row from the database. Use SQL adapter with three stored procedures to insert, retrieve and delete..