When posting a Transaction Preview, the response doesn't allow Price to be null but I'm not sure if this is an API bug or an SDK handling bug.
My tested items array workflow:
Non-catalog price for an existing product
Steps to reproduce
Submit a PreviewTransaction with items constructed with TransactionItemPreviewWithNonCatalogPrice.
Expected behavior
I wouldn't expect the Paddle API to generate a price_id for a transaction preview but it does seem to do so. Querying that price_id with the Get Price API returns a 404 so it doesn't seem to persist the ID anywhere.
The price_id also changes with every POST request so all evidence points to it generating a temporary one on the fly for whatever reason.
If this is the expected behaviour
_And it should return a price_id:_
The data.items.price.id value currently returns null. Whereas it is generated in data.details.line_items.price_id. The generated price_id needs to be included as values for both of these objects. This is an API response fix.
This will allow the SDK to work as constructed as the Price constructor expects a string and doesn't allow null.
If this is not the expected behaviour
_And it should not return a price_id:_
The SDK needs to be able to accept a null value in the Price constructor.
Describe the bug
When posting a Transaction Preview, the response doesn't allow Price to be
null
but I'm not sure if this is an API bug or an SDK handling bug.My tested items array workflow:
Non-catalog price for an existing product
Steps to reproduce
PreviewTransaction
with items constructed withTransactionItemPreviewWithNonCatalogPrice
.Expected behavior
I wouldn't expect the Paddle API to generate a price_id for a transaction preview but it does seem to do so. Querying that
price_id
with the Get Price API returns a 404 so it doesn't seem to persist the ID anywhere.The
price_id
also changes with every POST request so all evidence points to it generating a temporary one on the fly for whatever reason.If this is the expected behaviour
_And it should return a
price_id
:_data.items.price.id
value currently returnsnull
. Whereas it is generated indata.details.line_items.price_id
. The generatedprice_id
needs to be included as values for both of these objects. This is an API response fix.null
.If this is not the expected behaviour
_And it should not return a
price_id
:_null
value in the Price constructor.Code snippets
PHP version
8.3.10
SDK version
1.3.1
API version
1
Additional context
No response