Skip to content

Latest commit

 

History

History
164 lines (108 loc) · 6.4 KB

File metadata and controls

164 lines (108 loc) · 6.4 KB

cloudbeds_accounting.CustomGeneralLedgerCodesApi

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

Method HTTP request Description
get_custom_general_ledger_codes GET /accounting/v1.0/custom-general-ledger-codes List custom general ledger codes
put_custom_general_ledger_codes PUT /accounting/v1.0/custom-general-ledger-codes Create or update custom general ledger codes

get_custom_general_ledger_codes

List[CustomGeneralLedgerCodeModel] get_custom_general_ledger_codes(x_property_id)

List custom general ledger codes

Retrieve all custom general ledger (GL) codes configured for a property. GL codes let you map Cloudbeds transaction categories to your own chart-of-accounts structure for reporting and export to external accounting systems.

Example

  • OAuth Authentication (bearerAuth):
import cloudbeds_accounting
from cloudbeds_accounting.models.custom_general_ledger_code_model import CustomGeneralLedgerCodeModel
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.CustomGeneralLedgerCodesApi(api_client)
    x_property_id = 56 # int | Unique identifier of the property. Required for all requests to scope data to a specific property. 

    try:
        # List custom general ledger codes
        api_response = api_instance.get_custom_general_ledger_codes(x_property_id)
        print("The response of CustomGeneralLedgerCodesApi->get_custom_general_ledger_codes:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CustomGeneralLedgerCodesApi->get_custom_general_ledger_codes: %s\n" % e)

Parameters

Name Type Description Notes
x_property_id int Unique identifier of the property. Required for all requests to scope data to a specific property.

Return type

List[CustomGeneralLedgerCodeModel]

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Bad Request -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

put_custom_general_ledger_codes

put_custom_general_ledger_codes(x_property_id, custom_general_ledger_codes_update_request)

Create or update custom general ledger codes

Create or update custom general ledger (GL) codes for a property. Send the full list of GL codes you want to persist. Each code must have a unique name and code value. You can assign codes to groups (payments, products, reservations, taxes/fees, etc.) to categorize them. To archive a code, set its archived flag to true.

Example

  • OAuth Authentication (bearerAuth):
import cloudbeds_accounting
from cloudbeds_accounting.models.custom_general_ledger_codes_update_request import CustomGeneralLedgerCodesUpdateRequest
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.CustomGeneralLedgerCodesApi(api_client)
    x_property_id = 56 # int | Unique identifier of the property. Required for all requests to scope data to a specific property. 
    custom_general_ledger_codes_update_request = cloudbeds_accounting.CustomGeneralLedgerCodesUpdateRequest() # CustomGeneralLedgerCodesUpdateRequest | 

    try:
        # Create or update custom general ledger codes
        api_instance.put_custom_general_ledger_codes(x_property_id, custom_general_ledger_codes_update_request)
    except Exception as e:
        print("Exception when calling CustomGeneralLedgerCodesApi->put_custom_general_ledger_codes: %s\n" % e)

Parameters

Name Type Description Notes
x_property_id int Unique identifier of the property. Required for all requests to scope data to a specific property.
custom_general_ledger_codes_update_request CustomGeneralLedgerCodesUpdateRequest

Return type

void (empty response body)

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Bad Request -

[Back to top] [Back to API list] [Back to Model list] [Back to README]