Skip to content

cloudbeds/cloudbeds-accounting-python

Repository files navigation

Cloudbeds Accounting

The Cloudbeds Accounting Service API provides programmatic access to financial data and operations for hospitality properties. Use this API to manage transactions, folios, deposits, accounts receivable ledgers, trial balances, and related accounting configuration. Key concepts: - Transactions represent individual financial entries (charges, payments, taxes, fees) associated with a source such as a reservation, group profile, or house account. - Folios organize transactions into logical groups within a source. You can create custom folios and move or route transactions between them. - Source Balances provide a real-time financial summary (charges, payments, balance due, tax/fee breakdowns) for a reservation, group profile, house account, or accounts receivable ledger. - Accounts Receivable (AR) Ledgers track outstanding balances that have been transferred from reservations or group profiles for later collection. - Trial Balance is a daily financial reconciliation report that summarizes ledger activity across guest, deposit, and AR ledgers. - Custom Codes let you map Cloudbeds internal transaction codes to your own chart-of-accounts codes and general ledger codes. Authentication: All endpoints require a valid OAuth2 bearer token. Endpoints are protected by scopes: read:payment for read operations and write:payment for mutating operations. A few search endpoints use POST with a request body to support complex filter criteria; these require the read:payment scope. Base URL: Use https://api.cloudbeds.com for production and https://api.cloudbeds-stage.com for staging. All endpoint paths are prefixed with /accounting/v1.0. Property context: Every request must include the X-Property-ID header to identify which property the request applies to. Monetary amounts: Unless otherwise noted, monetary amounts are expressed in the smallest currency unit (e.g., cents for USD). Use the currencyScale field to determine the number of decimal places. Pagination: Paginated endpoints return a nextPageToken value. Pass this token in subsequent requests to retrieve the next page of results. When nextPageToken is null or absent, you have reached the last page.

The cloudbeds_accounting package is automatically generated by the OpenAPI Generator project:

  • API version: v0
  • Package version: 1.7.0
  • Generator version: 7.20.0
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen

Requirements.

Python 3.9+

Installation & Usage

This python library package is generated without supporting files like setup.py or requirements files

To be able to use it, you will need these dependencies in your own package that uses this library:

  • urllib3 >= 2.1.0, < 3.0.0
  • python-dateutil >= 2.8.2
  • pydantic >= 2
  • typing-extensions >= 4.7.1

Getting Started

In your own code, to use this library to connect and interact with Cloudbeds Accounting, you can run the following:

import cloudbeds_accounting
from cloudbeds_accounting.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.cloudbeds-stage.com
# See configuration.py for a list of all supported configuration parameters.
configuration = cloudbeds_accounting.Configuration(
    host = "https://api.cloudbeds-stage.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

configuration.access_token = os.environ["ACCESS_TOKEN"]


# Enter a context with an instance of the API client
with cloudbeds_accounting.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = cloudbeds_accounting.AccountsReceivableLedgerApi(api_client)
    x_property_id = 56 # int | Unique identifier of the property. Required for all requests to scope data to a specific property. 
    accounts_receivable_ledger_id = 56 # int | Unique identifier of the accounts receivable ledger.
    reservation_id = 56 # int | Reservation ID

    try:
        # Reverse a reservation-to-AR balance transfer
        api_response = api_instance.delete_accounts_receivable_ledger_reservation_balance_transfer(x_property_id, accounts_receivable_ledger_id, reservation_id)
        print("The response of AccountsReceivableLedgerApi->delete_accounts_receivable_ledger_reservation_balance_transfer:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling AccountsReceivableLedgerApi->delete_accounts_receivable_ledger_reservation_balance_transfer: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://api.cloudbeds-stage.com

Class Method HTTP request Description
AccountsReceivableLedgerApi delete_accounts_receivable_ledger_reservation_balance_transfer DELETE /accounting/v1.0/accounts-receivable-ledgers/{accountsReceivableLedgerId}/reservation/{reservationId}/balance-transfer Reverse a reservation-to-AR balance transfer
AccountsReceivableLedgerApi get_accounts_receivable_ledger_by_id GET /accounting/v1.0/accounts-receivable-ledgers/{accountsReceivableLedgerId} Get an accounts receivable ledger by ID
AccountsReceivableLedgerApi get_accounts_receivable_ledger_reservation_balance_transfer GET /accounting/v1.0/accounts-receivable-ledgers/reservation/{reservationId}/balance-transfer Get AR balance transfer details for a reservation
AccountsReceivableLedgerApi get_accounts_receivable_ledger_totals GET /accounting/v1.0/accounts-receivable-ledgers/totals Get AR ledger totals
AccountsReceivableLedgerApi get_accounts_receivable_ledger_transactions GET /accounting/v1.0/accounts-receivable-ledgers/{accountsReceivableLedgerId}/transactions List transactions for an AR ledger
AccountsReceivableLedgerApi get_accounts_receivable_ledgers GET /accounting/v1.0/accounts-receivable-ledgers List accounts receivable ledgers
AccountsReceivableLedgerApi patch_accounts_receivable_ledger PATCH /accounting/v1.0/accounts-receivable-ledgers Update an accounts receivable ledger
AccountsReceivableLedgerApi post_accounts_receivable_ledger POST /accounting/v1.0/accounts-receivable-ledgers Create an accounts receivable ledger
AccountsReceivableLedgerApi post_accounts_receivable_ledger_group_balance_transfer POST /accounting/v1.0/accounts-receivable-ledgers/{accountsReceivableLedgerId}/group-profile/{groupProfileId}/balance-transfer Transfer a group profile balance to an AR ledger
AccountsReceivableLedgerApi post_accounts_receivable_ledger_reservation_balance_transfer POST /accounting/v1.0/accounts-receivable-ledgers/{accountsReceivableLedgerId}/reservation/{reservationId}/balance-transfer Transfer a reservation balance to an AR ledger
CustomGeneralLedgerCodesApi get_custom_general_ledger_codes GET /accounting/v1.0/custom-general-ledger-codes List custom general ledger codes
CustomGeneralLedgerCodesApi put_custom_general_ledger_codes PUT /accounting/v1.0/custom-general-ledger-codes Create or update custom general ledger codes
CustomTransactionCodesApi get_custom_transaction_codes GET /accounting/v1.0/custom-transaction-codes List custom transaction codes
CustomTransactionCodesApi initialize_custom_transaction_codes POST /accounting/v1.0/custom-transaction-codes/initialize Initialize custom transaction codes
CustomTransactionCodesApi put_custom_transaction_codes PUT /accounting/v1.0/custom-transaction-codes Update custom transaction code mappings
DepositsApi get_deposit_balance GET /accounting/v1.0/deposits/balance Get deposit balance
DepositsApi get_deposit_transactions GET /accounting/v1.0/deposits/transactions List deposit transactions
DepositsApi post_deposits_transfer POST /accounting/v1.0/deposits/transfer Transfer deposit transactions
FolioConfigurationApi assign_folio_configuration_to_source PUT /accounting/v1.0/folios/configurations/sources
FolioConfigurationApi delete_folio_configuration DELETE /accounting/v1.0/folios/configurations/{id} Delete a folio configuration
FolioConfigurationApi get_folio_configuration GET /accounting/v1.0/folios/configurations/{id}
FolioConfigurationApi get_folio_configuration_source GET /accounting/v1.0/folios/configurations/sources
FolioConfigurationApi get_folio_configurations GET /accounting/v1.0/folios/configurations
FolioConfigurationApi get_routing_rules GET /accounting/v1.0/folios/rules Get autorouting rules
FolioConfigurationApi save_folio_configuration PUT /accounting/v1.0/folios/configurations Create or update a folio configuration
FolioConfigurationApi set_folio_configuration_default POST /accounting/v1.0/folios/configurations/{id}/set-default Set the default folio configuration
FoliosApi create_folio POST /accounting/v1.0/folios Create a folio
FoliosApi delete_folio DELETE /accounting/v1.0/folios/{id} Delete a folio
FoliosApi get_folios GET /accounting/v1.0/folios List folios for a source
FoliosApi list_folio_transactions POST /accounting/v1.0/folios/transactions Search folio transactions
FoliosApi move_transactions POST /accounting/v1.0/folios/transactions/move Move transactions between folios
FoliosApi route_transactions POST /accounting/v1.0/folios/transactions/route Route transactions to a group profile
FoliosApi unroute_transactions POST /accounting/v1.0/folios/transactions/unroute Unroute transactions from a group profile
FoliosApi update_folio PUT /accounting/v1.0/folios/{id} Update a folio
InternalTransactionCodesApi get_internal_transaction_codes GET /accounting/v1.0/internal-transaction-codes List internal transaction codes
SettingsApi get_settings GET /accounting/v1.0/settings Get property accounting settings
SettingsApi patch_settings PATCH /accounting/v1.0/settings Update property accounting settings
SourceBalanceApi get_source_balance_by_source GET /accounting/v1.0/source-balances/{sourceKind}/{sourceId} Get source balance
SourceBalanceApi get_source_balance_snapshot_by_source GET /accounting/v1.0/source-balances/snapshots/{reservationId}
TransactionsApi list_pending_transactions POST /accounting/v1.0/pending-transactions Search pending transactions
TransactionsApi list_transactions POST /accounting/v1.0/transactions Search posted transactions
TrialBalanceApi calculate_trial_balance POST /accounting/v1.0/trial-balance/configuration/calculate Calculate initial trial balance
TrialBalanceApi get_trial_balance_configuration GET /accounting/v1.0/trial-balance/configuration Get trial balance configuration
TrialBalanceApi get_trial_balance_report GET /accounting/v1.0/trial-balance/report Get trial balance report
TrialBalanceApi is_trial_balance_configured GET /accounting/v1.0/trial-balance/configuration/status Check trial balance configuration status
TrialBalanceApi set_trial_balance POST /accounting/v1.0/trial-balance/configuration Configure trial balance

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

bearerAuth

  • Type: OAuth
  • Flow: implicit
  • Authorization URL: https://hotels.cloudbeds.com/api/v1.2/oauth
  • Scopes:
  • read:payment: Read payment and transaction information
  • write:payment: Create, update, or delete payment and transaction data

Author

About

Cloudbeds Accounting Python API (managed by Terraform)

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors