Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add UsageRecord creation ability #461

Closed
wants to merge 1 commit into from

Conversation

abouzek
Copy link

@abouzek abouzek commented Mar 7, 2018

While working on a project utilizing the new metered/usage based billing, I noticed the library didn't support UsageRecords yet, despite the docs having Java examples (probably due to auto-generated docs based on the template):

https://stripe.com/docs/api/java#usage_record_create

This is not really what I would consider a 'final' or mergeable copy of work, but I wanted to throw it out there for anyone utilizing the new feature.

I had to add subscriptionItem ID as a parameter passed to create because Stripe API will throw a 400 if you are using a sub-object endpoint such as subscription_items/<subscription_item_id>/usage_records and you pass the subscription item ID in both the URL and the body params. I think this problem needs to be solved in a more generic way, but for the intent of moving forward in my current project I am leaving as is and am open for suggestions :)

@alexander-stripe
Copy link
Contributor

Thank you very much for the pull request! I've just opened a new PR which includes all our flexible billing primitives including the usage record endpoints: #462 .

@abouzek
Copy link
Author

abouzek commented Mar 8, 2018

Awesome, thanks @alexander-stripe. I'll go ahead and close this as it duplicates some of that work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants