Marta’s order starts as text copied from the shop platform, and her finished label must become text for the courier’s booking form. Your JavaScript port already knows how to choose the address and fill in defaults. Here you’ll read a shortened pasted order and print a separate label preview Marta can check before sending.
Read the Pasted Order
As a quick recap, JSON.parse(ORDER_TEXT) reads JSON text, as Python’s json.loads(ORDER_TEXT) does, and returns JavaScript values. Here’s a shortened paste from order 1042, held in backticks so the string can span lines:
const ORDER_TEXT = `{
"id": 1042,
"shipping_address": null,
"insured_value": 0
}`;
const order = JSON.parse(ORDER_TEXT);
console.log(order.id);
console.log(order.shipping_address);
console.log(order.insured_value);
The sample prints: