Our company is the North America HQ of a company in Shanghai, China, we have a customer in United States asked for the FOB Shanghai term for our business but they will need to make a
Master Sales Agreement with our Shanghai office. If it is illegal to place the order to China and then pay the payment to the US company?
No, that is not illegal. However, you will need to draft up the contract documents carefully and if it is a significant order you should consult accountants who can make sure you don't create avoidable tax expenses either in China or the U.S.