How to Update the Deprecated Order Status page Additional Scripts Used for Affirm?

Topic summary

A user is seeking guidance on updating deprecated Shopify code for Affirm payment tracking on the order status page. The code currently uses three deprecated variables: order.id, order.total_price, and order.line_items.

Current Code:
The existing script tracks order confirmation using Affirm’s analytics API with order ID, total price, and line item details (SKU and quantity).

Proposed Updates:

  • order.idcheckout.order_id
  • order.total_pricecheckout.order_id.totalprice
  • order.line_itemscheckout.order_id.line_items

Context:
This relates to deprecation notices sent in June 2024 regarding order status page scripts. The user references existing forum threads about this issue but seeks confirmation on the correct replacement syntax.

Status: The question remains unanswered, with no responses confirming whether the proposed replacements are correct or if alternative solutions exist.

Summarized with AI on October 31. AI used: claude-sonnet-4-5-20250929.

Does this code need to be updated? The three are order.id, order.total_price, and order.line_items. I see a few threads in this help forum about the email received back in June 2024 to update the script.

affirm.ui.ready(function(){
	affirm.analytics.trackOrderConfirmed({
	    "orderId": "{{ order.id }}",
	    "total": "{{ order.total_price }}"
	}, [
	   {% for item in order.line_items %}
	   {
		   "productId": "{{ item.sku }}",
		   "quantity": "{{ item.quantity }}",
	   }
	   {% endfor %}
	]);
});

So should I replace one phrase with the other like below?

order.id replace with checkout.order_id

order.total_price replace with checkout.order_id.totalprice

order.line_items replace with checkout.order_id.line_items