Cart Transform API returns zero costs for POS CustomProduct items
Functions • cart-transform
Hi everyone,
I’ve encountered an issue with the Cart Transform API when custom sale items are added via POS.
- The function runs correctly for all cart updates
- CustomProduct items show all cost fields as “0.0” (amountPerQuantity, subtotalAmount, totalAmount)
- The prices only populate correctly at checkout time
- This causes checkout failure when trying to use the CustomProduct cost as part of the cost calculation for a lineExpand operation due to cart total mismatch.
Expected
CustomProduct items should have their actual prices available in all cost fields during normal cart operations, not just at checkout time.
Actual
All cost fields return “0.0” for CustomProduct items during cart updates. Prices suddenly populate at checkout, causing the cart total to differ from what was calculated initially, resulting in checkout failure when using CustomProduct prices to calculate lineExpand prices.
Environment
- Function type: Cart Transform
- Channel: POS (Shopify Point of Sale)
- API Version: 2025-07
- Regular checkout: Works correctly (no CustomProduct items)
Code Example
Cart Transform function input when custom sale item is in cart:
{
"presentmentCurrencyRate": "1.0",
"localization": {
"language": {
"isoCode": "EN"
}
},
"cart": {
"lines": [
{
"id": "gid:\/\/shopify\/CartLine\/cf951760-ea73-4bca-9f68-aac8916910f7",
"quantity": 1,
"cost": {
"amountPerQuantity": {
"amount": "0.0",
"currencyCode": "CAD"
},
"subtotalAmount": {
"amount": "0.0",
"currencyCode": "CAD"
},
"totalAmount": {
"amount": "0.0",
"currencyCode": "CAD"
}
},
"merchandise": {
"__typename": "CustomProduct"
},
"lineItemProperties": null
}
]
}
}
Cart Transform function input when trying to check out:
{
"presentmentCurrencyRate": "1.0",
"localization": {
"language": {
"isoCode": "EN"
}
},
"cart": {
"lines": [
{
"id": "gid:\/\/shopify\/CartLine\/cf951760-ea73-4bca-9f68-aac8916910f7",
"quantity": 1,
"cost": {
"amountPerQuantity": {
"amount": "130.0",
"currencyCode": "CAD"
},
"subtotalAmount": {
"amount": "130.0",
"currencyCode": "CAD"
},
"totalAmount": {
"amount": "130.0",
"currencyCode": "CAD"
}
},
"merchandise": {
"__typename": "CustomProduct"
},
"lineItemProperties": null
}
]
}
}
Note: The CustomProduct line item was added with a price of $130.00, but all three cost fields show “0.0”.
Even if I continue to update the cart, including adding non-custom items, the CustomProduct line item cost fields continue to show “0.0”.
At checkout time, the function runs again and the CustomProduct’s amountPerQuantity suddenly shows “130.0”, causing a cart total mismatch that fails the checkout.
Has anyone else seen this behavior, or is there a workaround for accessing CustomProduct prices in Cart Transform functions?