A per diem charge (from the Latin, meaning per day) applies when you require the use of equipment beyond a set amount of free time. Steamship lines and airlines charge this fee, and equipment include ocean containers and unit load devices (ULD). You have some free days, depending on the equipment and the carrier, before per diem kicks in. With imports, the charge applies to cargo leaving the arrival terminal. With exports, it applies to shipments leaving the departing terminal. Per diem fees accumulate until you return the equipment to the terminal of the port, rail yard dock or airline.
These terms of shipping delay charges are often (and incorrectly) used interchangeably. That often results in confusion when receiving your bill for detention, demurrage and per diem charges. Always clarify in advance what shipping delay charges you face for which specific case of delay.