How to realize freight calculation for international express delivery

there are freight quotation materials for UPS DHL FedEx express delivery. The freight needs to be calculated according to the number of goods settled by the user and the country and region chosen by the user. How to achieve this function is better?

    Is
  1. configured in js, then calculated directly in js and displayed?
  2. is written in the background interface, and the js access interface gets the calculation result?

in addition, is there a direct interface to the express delivery company to provide query function?

Nov.19,2021

I wonder if our business is the same as yours.

my understanding is that it is best to write to the back end. Most of the time, the data is real-time. For example, if a courier company modifies the freight calculation formula, they will notify your back end so that you can reconcile the account. Otherwise, if the front-end calculation, what about this part of the error


first of all, no matter whether the frontend is freight or not, the freight must be calculated in the backend API, because for the backend, the data transmitted by the frontend is "untrusted" (the frontend cannot prevent tampering), so even if the frontend calculates the freight and transmits it to the backend, the backend still needs to adjust the API to calculate the freight.
so back-end computing is recommended.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3741c-2c082.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3741c-2c082.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?