Closed First-Derivative closed 6 months ago
Hi @First-Derivative, sorry for the delay in looking into this. I'm not sure if I understand this correctly. Could you share a code snippet that results in the error
purchase_items[unit_amount][0] : wrong format
Also, I see you've mentioned both chargebee
and chargebee-typescript
versions. Are you seeing this error in both the SDKs?
@First-Derivative — can you please confirm if you're still having this issue and share more details about it?
Hi @cb-sriramthiagarajan, I can confirm this is no longer an issue. Most likely your API updated on on the backend and this error was resolved.
Thank you @First-Derivative!
Issue:
When utilizing the Node Chargebee v2 Purchases API the types from chargebee-typescript suggest that
unit_amount
type should benumber
. However, upon testing, we have encountered an error response suggesting that theunit_amount
type should benumber[]
instead.Error Response:
This error response indicates a discrepancy between the expected and actual data type for
unit_amount
in the_purchase.create_params
object. The API documentation states thatunit_amount
should be of typenumber
, but the error message implies that it is being interpreted as an array of numbers (number[]
). The API call returns no error when the parameters forunit_amount
are of typenumber[]
.Expected Behavior:
The API should accept
unit_amount
as anumber
type as per the documentation, and error messages should accurately reflect any issues related to the format or type mismatch.Impact:
This issue prevents us from properly utilizing your chargebee-typescript types. It hinders our ability to rely on your typescript definitions for API calls.
Steps to Reproduce:
Versions:
unit_amount
being set to a number.unit_amount
.Additional Information:
We have verified that the data being sent to the API conforms to the documented specifications. This issue occurs consistently across multiple API calls and environments. No recent changes have been made to our integration setup that could have caused this behavior.
Request:
We kindly request your prompt attention to this matter. Please investigate and resolve this discrepancy in the Chargebee API as soon as possible. If there are any updates or workarounds available, we would appreciate receiving guidance on how to proceed in the interim.
Thank you, Ash, Launched