openmeter icon indicating copy to clipboard operation
openmeter copied to clipboard

Invoice API swaps subscription ID and item ID in subscription references

Open Funeralsawa opened this issue 4 weeks ago • 0 comments

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.id should contain the subscription ID.
  • subscription.item.id should contain the subscription item ID.

Actual Behavior

The two IDs are swapped in the invoice API response:

  • subscription.subscription.id contains the subscription item ID.
  • subscription.item.id contains 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

  1. Install the Custom Invoicing App and configure a billing profile.
  2. Create a Customer and a published Plan with a recurring flat-fee rate card.
  3. Create a subscription using that Plan.
  4. Retrieve the subscription details and note the subscription ID and item ID.
  5. Retrieve the generated invoice.
  6. 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.

Funeralsawa avatar Nov 06 '26 07:11 Funeralsawa