AutumnA
Autumn4d ago
7 replies
lutz-grex

Issue with checkout - "No prepaid price found for feature"

Hi team! I’m hitting an error when trying to run a checkout for a prepaid feature.

The Error: No prepaid price found for feature dedicated_physical_device

The Setup: I have a product with a pricedFeatureItem set to usage_model: "prepaid". The feature itself is type: "continuous_use".

Config:

export const dedicatedPhysicalDevice = feature({
    id: "dedicated_physical_device",
    name: "Dedicated Physical Device",
    type: "continuous_use",
});

export const dedicatedPhysicalDevicePlan = product({
    id: "dedicated_physical_device_plan",
    name: "Dedicated Physical Device",
    items: [
        pricedFeatureItem({
            feature_id: dedicatedPhysicalDevice.id,
            price: 50,
            interval: "month",
            included_usage: 0,
            billing_units: 1,
            usage_model: "prepaid",
        }),
    ],
});


Checkout Implementation: I have verified that the productId and featureId being passed match the config exactly.
// Logs confirm: 
// productId: "dedicated_physical_device_plan"
// featureId: "dedicated_physical_device"

const result = await checkout({
    productId: id, 
    dialog: CheckoutDialog,     
    successUrl: `${window.location.origin}/devices?quantity=${quantity}`,
    options: [
      {
        featureId: "dedicated_physical_device", // verified match
        quantity: Number(quantity),
      }
    ]
})


What I've checked:
- Confirmed IDs are strings and match between the Feature and the Product item.
- Verified quantity is being passed as a number.
- Tried using both featureId and feature_id in the options array.

Organisation: Droidrun Develop

Is there a specific requirement for prepaid items when the feature type is continuous_use, or am I missing a field in the options object? Thanks!
Was this page helpful?