Cart Transform API returns zero dollar costs for POS CustomProduct items

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?

1 Like

Hey @jeffchew , thanks for reaching out and sharing all of the info there. I’ve done a bit of digging into this and I do know there are some limitations of the Cart Transform API, but the behaviour you’re reporting here does sound odd.

Would you be open to sharing your shop domain (myshopify.com URL), the complete Cart Transform function code (both input query and function logic), and the exact error message you’re seeing when checkout fails if possible? Also, if you can confirm if this happens with all custom sale items or just certain ones that would be super helpful to narrow down the issue.

If it’s easier to share this information privately, feel free to let me know and I can set up a DM, then we can work through the details that way. Once I have those details from you, I’m more than happy to keep looking into this with you and potentially reach out to my team to investigate further.