Why money-in is a credit in a country’s balance of payment account?

So we know that like accounting, balance of payment account transaction are always recorded double-entryly. as: Current account=Capital account+ financial account. However, what I don’t understand is why an export(money-in) is a credit to the current account? Shouldn’t cash increase an debit according to accounting rules?

Can someone help explain with the following example?

Scenario1: United States purchased a machinery from China, using USD

Scenario 2: Unites States purchased a machinery from China, using RMB

How do we record these?

Thank you.