Skip to content

Add SDK features for v4.12.0#184

Draft
jessicahearn wants to merge 2 commits intomainfrom
jessica/pip-309-ruby-sdk-feature-updates
Draft

Add SDK features for v4.12.0#184
jessicahearn wants to merge 2 commits intomainfrom
jessica/pip-309-ruby-sdk-feature-updates

Conversation

@jessicahearn
Copy link
Contributor

Summary

  • Add Account include parameter for optional settings
  • Add DataSource empty! and soft_purge! methods for data management
  • Add Invoice update!, toggle_disabled!, update_status! methods
  • Add SubscriptionEvent toggle_disabled! method
  • Add standalone Transaction resource with CRUD and toggle_disabled!
  • Add standalone LineItem resource with CRUD and toggle_disabled!
  • Add external ID lookup methods (*_by_external_id) for Invoice, Transaction, LineItem, and SubscriptionEvent
  • Add JsonImport resource for bulk JSON imports
  • Add Upload resource for CSV file uploads (requires faraday-multipart)

New Features

Account include parameter

account = ChartMogul::Account.retrieve(include: %w[churn_recognition refund_handling])
account.churn_recognition  # => "churn_at_time_of_cancelation"

DataSource operations

ds = ChartMogul::DataSource.retrieve('ds_uuid')
ds.empty!       # Delete all data from the data source
ds.soft_purge!  # Clear for reimport

toggle_disabled! for Invoice, Transaction, LineItem, SubscriptionEvent

invoice = ChartMogul::Invoice.retrieve('inv_uuid')
invoice.toggle_disabled!(disabled: true)

External ID lookups (via data_source_uuid + external_id)

txn = ChartMogul::Transaction.retrieve_by_external_id(
  data_source_uuid: 'ds_uuid',
  external_id: 'txn_123'
)

JsonImport for bulk imports

import = ChartMogul::JsonImport.create!(
  data_source_uuid: 'ds_uuid',
  customers: [...],
  invoices: [...]
)
status = ChartMogul::JsonImport.retrieve(data_source_uuid: 'ds_uuid', id: import.id)

Upload for CSV files

ChartMogul::Upload.create!(
  data_source_uuid: 'ds_uuid',
  file: '/path/to/file.csv',
  type: 'invoices'
)

Test plan

  • SDK loads successfully with all new classes
  • Manual testing against ChartMogul API
  • Add unit tests for new features

🤖 Generated with Claude Code

- Add Account `include` parameter for optional settings (churn_recognition,
  churn_when_zero_mrr, auto_churn_subscription, refund_handling,
  proximate_movement_reclassification)
- Add DataSource `empty!` and `soft_purge!` methods for data management
- Add Invoice `update!`, `toggle_disabled!`, `update_status!` methods
- Add SubscriptionEvent `toggle_disabled!` method
- Add standalone Transaction resource with CRUD and `toggle_disabled!`
- Add standalone LineItem resource with CRUD and `toggle_disabled!`
- Add external ID lookup methods (`*_by_external_id`) for Invoice,
  Transaction, LineItem, and SubscriptionEvent
- Add JsonImport resource for bulk JSON imports
- Add Upload resource for CSV file uploads (requires faraday-multipart)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@jessicahearn jessicahearn self-assigned this Feb 13, 2026
Added optional handle_as_user_edit parameter to:
- Invoice: toggle_disabled!, update_by_external_id!, destroy_by_external_id!, toggle_disabled_by_external_id!
- Transaction: toggle_disabled!, update_by_external_id!, destroy_by_external_id!, toggle_disabled_by_external_id!
- LineItem: create!, toggle_disabled!, update_by_external_id!, destroy_by_external_id!, toggle_disabled_by_external_id!
- SubscriptionEvent: toggle_disabled!, update_by_external_id!, destroy_by_external_id!, toggle_disabled_by_external_id!

This allows API consumers to indicate when changes should be treated as user edits for edit history tracking purposes.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

1 participant