pip install orb-billing
import orb
from orb.models import shared
s = orb.Orb(
security=shared.Security(
api_key_auth="",
),
)
req = shared.CouponInput(
discount=shared.Discount(
amount_discount='corrupti',
applies_to_price_ids=[
'distinctio',
'quibusdam',
'unde',
],
discount_type=shared.DiscountType.PERCENTAGE,
percentage_discount=0.15,
trial_amount_discount='nulla',
usage_discount=5448.83,
),
duration_in_months=847252,
id='69a674e0-f467-4cc8-b96e-d151a05dfc2d',
max_redemptions=870088,
redemption_code='maiores',
times_redeemed=473608,
)
res = s.coupon.create(req)
if res.status_code == 200:
# handle response
- ping - Check availability
- archive - Archive a coupon
- create - Create a coupon
- fetch - Retrieve a coupon
- list - List coupons
- list_subscriptions - List subscriptions for a coupon
- add_by_external_id - Add credit ledger entry by external customer ID
- create - Add credit ledger entry
- fetch - Retrieve credit balance
- fetch_by_external_id - Retrieve credit balance by external customer ID
- fetch_ledger - View credits ledger
- fetch_ledger_by_external_id - View credits ledger by external customer ID
- list - List credit notes
- amend - Amend customer usage
- amend_by_external_id - Amend customer usage by external ID
- create - Create customer
- create_transaction - Create a customer balance transaction
- delete - Delete a customer
- fetch - Retrieve a customer
- fetch_by_external_id - Retrieve a customer by external ID
- fetch_costs - View customer costs
- fetch_costs_by_external_id - View customer costs by external customer ID
- fetch_transactions - Get customer balance transactions
- list - List customers
- update_by_external_id - Update a customer by external ID
- update_customer - Update customer
- amend - Amend single event
- close_backfill - Close a backfill
- create - Create a backfill
- deprecate_event - Deprecate single event
- ingest - Ingest events
- list_backfills - List backfills
- revert_backfill - Revert a backfill
- search - Search events
- create - Create invoice line item
- fetch - Retrieve an Invoice
- fetch_upcoming - Retrieve upcoming invoice
- list - List invoices
- void - Void an invoice
- fetch - Retrieve a plan
- get_by_external_id - Retrieve a plan by external plan ID
- list - List plans
- cancel - Cancel subscription
- create - Create subscription
- fetch - Retrieve a subscription
- fetch_costs - View subscription costs
- fetch_schedule - View subscription schedule
- fetch_usage - View subscription usage
- list - List subscriptions
- schedule_plan_change - Schedule plan change
- unschedule_cancellation - Unschedule pending cancellation
- unschedule_plan_change - Unschedule pending plan changes
- update_fixed_fee_quantity - Update fixed fee quantity
This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.
While we value open-source contributions to this SDK, this library is generated programmatically. Feel free to open a PR or a Github issue as a proof of concept and we'll do our best to include it in a future release !