openmeter
openmeter copied to clipboard
Invoice API swaps subscription ID and item ID in subscription references
Preflight Checklist
- [x] I have searched the issue tracker for an issue that matches the one I want to file, without success.
- [x] I am not looking for support or already pursued the available support channels without success.
OpenMeter Version
main(e76f18dce8ed5493abaeccc87b181c3f01c55f7c)
Expected Behavior
Invoice-line subscription references should match their documented meanings:
subscription.subscription.idshould contain the subscription ID.subscription.item.idshould contain the subscription item ID.
Actual Behavior
The two IDs are swapped in the invoice API response:
subscription.subscription.idcontains the subscription item ID.subscription.item.idcontains the subscription ID.
Reproduced on a self-hosted instance at commit e76f18dce8ed5493abaeccc87b181c3f01c55f7c. The subscription created with ID 01M6QNHXFHPA5QN3TGVPYFHZPR appears under subscription.item.id in the generated invoice, instead of subscription.subscription.id.
Steps To Reproduce
- Install the Custom Invoicing App and configure a billing profile.
- Create a Customer and a published Plan with a recurring flat-fee rate card.
- Create a subscription using that Plan.
- Retrieve the subscription details and note the subscription ID and item ID.
- Retrieve the generated invoice.
- Inspect the subscription reference on its subscription-managed invoice line.
Additional Information
This might not be a major issue, but I’m not sure what to expect from future updates.