### Install mx-platform-python using setup.py Source: https://github.com/mxenabled/mx-platform-python/blob/master/README.md Install the package by running the setup.py script. ```shell python setup.py install ``` -------------------------------- ### List Rewards using RewardsApi Source: https://github.com/mxenabled/mx-platform-python/blob/master/docs/RewardsApi.md This example demonstrates how to list all rewards for a given member using the RewardsApi. It requires user and member GUIDs and uses basic authentication. ```python import time import os import mx_platform_python from mx_platform_python.models.rewards_response_body import RewardsResponseBody from mx_platform_python.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://int-api.mx.com # See configuration.py for a list of all supported configuration parameters. configuration = mx_platform_python.Configuration( host = "https://int-api.mx.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. # Configure HTTP basic authorization: basicAuth configuration = mx_platform_python.Configuration( username = os.environ["USERNAME"], password = os.environ["PASSWORD"] ) # Enter a context with an instance of the API client with mx_platform_python.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = mx_platform_python.RewardsApi(api_client) user_guid = 'USR-fa7537f3-48aa-a683-a02a-b18940482f54' # str | The unique identifier for a `user`, beginning with the prefix `USR-`. member_guid = 'MBR-7c6f361b-e582-15b6-60c0-358f12466b4b' # str | The unique id for a `member`. try: # List Rewards api_response = api_instance.list_rewards(user_guid, member_guid) print("The response of RewardsApi->list_rewards:\n") pprint(api_response) except Exception as e: print("Exception when calling RewardsApi->list_rewards: %s\n" % e) ``` -------------------------------- ### Install mx-platform-python using pip Source: https://github.com/mxenabled/mx-platform-python/blob/master/README.md Install the package using pip from PyPI. ```shell pip install mx-platform-python ``` -------------------------------- ### BudgetResponse Example Usage Source: https://github.com/mxenabled/mx-platform-python/blob/master/docs/BudgetResponse.md Example of how to use the BudgetResponse model in Python, including instantiation from JSON and conversion to a dictionary. ```APIDOC ## Example ```python from mx_platform_python.models.budget_response import BudgetResponse # TODO update the JSON string below json = "{}" # create an instance of BudgetResponse from a JSON string budget_response_instance = BudgetResponse.from_json(json) # print the JSON string representation of the object print BudgetResponse.to_json() # convert the object into a dict budget_response_dict = budget_response_instance.to_dict() # create an instance of BudgetResponse from a dict budget_response_form_dict = budget_response.from_dict(budget_response_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) ``` -------------------------------- ### GET /users/{user_guid}/notifications/{notification_guid} Source: https://github.com/mxenabled/mx-platform-python/blob/master/docs/NotificationsApi.md Retrieves a specific notification by its GUID. ```APIDOC ## GET /users/{user_guid}/notifications/{notification_guid} ### Description Reads a specific notification for a user using its unique identifier. ### Method GET ### Endpoint /users/{user_guid}/notifications/{notification_guid} ### Parameters #### Path Parameters - **user_guid** (str) - Required - The unique identifier for a `user`, beginning with the prefix `USR-`. - **notification_guid** (str) - Required - The unique identifier for the `notification`, beginning with the prefix `NOT-`. ### Response #### Success Response (200) - **NotificationResponseBody** - The response body contains details of the requested notification. #### Response Example ```json { "guid": "NOT-12345", "user_guid": "USR-fa7537f3-48aa-a683-a02a-b18940482f54", "subject": "subject_example", "content": "content_example", "created_at": "2023-10-27T10:00:00Z", "updated_at": "2023-10-27T10:00:00Z", "type": "API_NOTIFICATION", "channel": "PUSH" } ``` ``` -------------------------------- ### Delete Goal using Basic Authentication Source: https://github.com/mxenabled/mx-platform-python/blob/master/docs/GoalsApi.md Provides an example of how to delete a goal using basic authentication. This operation requires the goal's GUID and the user's GUID. ```python import time import os import mx_platform_python from mx_platform_python.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://int-api.mx.com # See configuration.py for a list of all supported configuration parameters. configuration = mx_platform_python.Configuration( host = "https://int-api.mx.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. # Configure HTTP basic authorization: basicAuth configuration = mx_platform_python.Configuration( username = os.environ["USERNAME"], password = os.environ["PASSWORD"] ) ``` -------------------------------- ### Create Spending Plan with Basic Authentication Source: https://github.com/mxenabled/mx-platform-python/blob/master/docs/SpendingPlanApi.md This example demonstrates how to create a spending plan for a user using basic authentication. Ensure your username and password are set as environment variables. ```python import time import os import mx_platform_python from mx_platform_python.models.spending_plan_response import SpendingPlanResponse from mx_platform_python.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://int-api.mx.com # See configuration.py for a list of all supported configuration parameters. configuration = mx_platform_python.Configuration( host = "https://int-api.mx.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. # Configure HTTP basic authorization: basicAuth configuration = mx_platform_python.Configuration( username = os.environ["USERNAME"], password = os.environ["PASSWORD"] ) ``` -------------------------------- ### Initialize MX Platform Python SDK with Custom Host Source: https://github.com/mxenabled/mx-platform-python/blob/master/docs/MembersApi.md This example demonstrates initializing the MX Platform Python SDK with a custom host URL. This is useful for targeting specific environments like staging or development. ```python import mx_platform_python configuration = mx_platform_python.Configuration( host = "https://int-api.mx.com" ) ``` -------------------------------- ### GET /categories/{category_guid} Source: https://github.com/mxenabled/mx-platform-python/blob/master/docs/CategoriesApi.md Retrieves details of a specific default category using its GUID. ```APIDOC ## GET /categories/{category_guid} ### Description Reads a default category. ### Method GET ### Endpoint /categories/{category_guid} ### Parameters #### Path Parameters - **category_guid** (str) - Required - The unique identifier for the `category`, beginning with the prefix `CAT-`. ### Response #### Success Response (200) - **CategoryResponseBody** (CategoryResponseBody) - The details of the requested default category. #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### GET /users/{user_guid}/taggings/{tagging_guid} Source: https://github.com/mxenabled/mx-platform-python/blob/master/docs/TaggingsApi.md Retrieves details of a specific tagging using its GUID. ```APIDOC ## GET /users/{user_guid}/taggings/{tagging_guid} ### Description Read tagging ### Method GET ### Endpoint /users/{user_guid}/taggings/{tagging_guid} ### Parameters #### Path Parameters - **tagging_guid** (str) - Required - The unique identifier for a `tagging`, beginning with the prefix `TAGGING-`. - **user_guid** (str) - Required - The unique identifier for a `user`, beginning with the prefix `USR-`. ### Response #### Success Response (200) - **tagging** (TaggingResponseBody) - The requested tagging object. #### Response Example ```json { "tagging": { "created_at": "2023-10-27T10:00:00Z", "guid": "TAGGING-xxxxxx", "tag_guid": "TAG-xxxxxx", "transaction_guid": "TRX-xxxxxx", "updated_at": "2023-10-27T10:00:00Z", "user_guid": "USR-fa7537f3-48aa-a683-a02a-b18940482f54" } } ``` ``` -------------------------------- ### List Spending Plan Iterations with Basic Authentication Source: https://github.com/mxenabled/mx-platform-python/blob/master/docs/SpendingPlanApi.md Demonstrates how to list spending plan iterations using basic authentication. This example sets up the MX Platform Python SDK configuration with username and password, typically sourced from environment variables. ```python import time import os import mx_platform_python from mx_platform_python.models.spending_plan_iterations_response import SpendingPlanIterationsResponse from mx_platform_python.rest import ApiException from pprint import pprint configuration = mx_platform_python.Configuration( host = "https://int-api.mx.com" ) configuration = mx_platform_python.Configuration( username = os.environ["USERNAME"], password = os.environ["PASSWORD"] ) ``` -------------------------------- ### GET /users/{user_guid}/investment_holdings/{holding_guid} Source: https://github.com/mxenabled/mx-platform-python/blob/master/docs/InvestmentHoldingsApi.md Retrieves details for a specific investment holding by its GUID. ```APIDOC ## GET /users/{user_guid}/investment_holdings/{holding_guid} ### Description Read holding. ### Method GET ### Endpoint /users/{user_guid}/investment_holdings/{holding_guid} ### Parameters #### Path Parameters - **user_guid** (str) - Required - The unique identifier for a `user`, beginning with the prefix `USR-`. - **holding_guid** (str) - Required - The unique identifier for a `holding`, beginning with the prefix `holding-`. ### Request Example ```python { "example": "request body" } ``` ### Response #### Success Response (200) - **InvestmentHolding** (object) - Details of the requested investment holding. #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### List Tokens with Basic Authentication Source: https://github.com/mxenabled/mx-platform-python/blob/master/docs/ProcessorTokenApi.md Demonstrates how to list tokens using basic authentication. Ensure your environment variables USERNAME and PASSWORD are set. ```python import time import os import mx_platform_python from mx_platform_python.models.token_request_body import TokenRequestBody from mx_platform_python.models.token_response_body import TokenResponseBody from mx_platform_python.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://int-api.mx.com # See configuration.py for a list of all supported configuration parameters. configuration = mx_platform_python.Configuration( host = "https://int-api.mx.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. # Configure HTTP basic authorization: basicAuth configuration = mx_platform_python.Configuration( username = os.environ["USERNAME"], password = os.environ["PASSWORD"] ) # Enter a context with an instance of the API client with mx_platform_python.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = mx_platform_python.ProcessorTokenApi(api_client) token_request_body = mx_platform_python.TokenRequestBody() # TokenRequestBody | (optional) try: # View a List of Tokens api_response = api_instance.list_tokens(token_request_body=token_request_body) print("The response of ProcessorTokenApi->list_tokens:\n") pprint(api_response) except Exception as e: print("Exception when calling ProcessorTokenApi->list_tokens: %s\n" % e) ``` -------------------------------- ### List User Accounts with Basic Authentication Source: https://github.com/mxenabled/mx-platform-python/blob/master/docs/AccountsApi.md Demonstrates how to list accounts for a user using HTTP basic authentication. Ensure USERNAME and PASSWORD environment variables are set. ```python import time import os import mx_platform_python from mx_platform_python.models.account_response_body import AccountResponseBody from mx_platform_python.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://int-api.mx.com # See configuration.py for a list of all supported configuration parameters. configuration = mx_platform_python.Configuration( host = "https://int-api.mx.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. # Configure HTTP basic authorization: basicAuth configuration = mx_platform_python.Configuration( username = os.environ["USERNAME"], password = os.environ["PASSWORD"] ) # Enter a context with an instance of the API client with mx_platform_python.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = mx_platform_python.AccountsApi(api_client) user_guid = 'USR-fa7537f3-48aa-a683-a02a-b18940482f54' # str | The unique identifier for a `user`, beginning with the prefix `USR-`. page = 1 # int | Results are paginated. Specify current page. (optional) member_is_managed_by_user = True # bool | List only accounts whose member is managed by the user. (optional) is_manual = True # bool | List only accounts that were manually created. (optional) records_per_page = 10 # int | This specifies the number of records to be returned on each page. Defaults to `25`. The valid range is from `10` to `1000`. If the value exceeds `1000`, the default value of `25` will be used instead. (optional) use_case = 'MONEY_MOVEMENT' # str | The use case associated with the member. Valid values are `PFM` and `MONEY_MOVEMENT`. For example, you can append either `?use_case=PFM` or `?use_case=MONEY_MOVEMENT`. (optional) try: # List accounts api_response = api_instance.list_user_accounts(user_guid, page=page, member_is_managed_by_user=member_is_managed_by_user, is_manual=is_manual, records_per_page=records_per_page, use_case=use_case) print("The response of AccountsApi->list_user_accounts:\n") pprint(api_response) except Exception as e: print("Exception when calling AccountsApi->list_user_accounts: %s\n" % e) ``` -------------------------------- ### GET /users/{user_guid}/transaction_rules/{transaction_rule_guid} Source: https://github.com/mxenabled/mx-platform-python/blob/master/docs/TransactionRulesApi.md Retrieves a specific transaction rule by its GUID for a given user. ```APIDOC ## GET /users/{user_guid}/transaction_rules/{transaction_rule_guid} ### Description Read transaction rule ### Method GET ### Endpoint /users/{user_guid}/transaction_rules/{transaction_rule_guid} ### Parameters #### Path Parameters - **user_guid** (str) - Required - The unique identifier for a `user`, beginning with the prefix `USR-`. - **transaction_rule_guid** (str) - Required - The unique identifier for a `transaction_rule`, beginning with the prefix `TR-`. ### Response #### Success Response (200) - **transaction_rule** (TransactionRuleResponseBody) - The requested transaction rule. #### Response Example ```json { "example": "{\"id\": \"TR-abc123xyz\", \"user_guid\": \"USR-fa7537f3-48aa-a683-a02a-b18940482f54\", \"description\": \"A sample description\", \"category_guid\": \"CAT-123\", \"match_description\": \"*Example Transaction*\", \"created_at\": \"2023-10-27T10:00:00Z\", \"updated_at\": \"2023-10-27T10:00:00Z\"}" } ``` ``` -------------------------------- ### GET /users/{user_guid}/categories/{category_guid} Source: https://github.com/mxenabled/mx-platform-python/blob/master/docs/CategoriesApi.md Retrieves details of a specific custom category using its GUID. ```APIDOC ## GET /users/{user_guid}/categories/{category_guid} ### Description Reads a custom category. ### Method GET ### Endpoint /users/{user_guid}/categories/{category_guid} ### Parameters #### Path Parameters - **user_guid** (str) - Required - The unique identifier for a `user`, beginning with the prefix `USR-`. - **category_guid** (str) - Required - The unique identifier for the `category`, beginning with the prefix `CAT-`. ### Response #### Success Response (200) - **CategoryResponseBody** (CategoryResponseBody) - The details of the requested custom category. #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### List Categories with Basic Authentication and Pagination Source: https://github.com/mxenabled/mx-platform-python/blob/master/docs/CategoriesApi.md This example demonstrates how to list all categories for a user, including options for pagination. Basic authentication is required, and it's recommended to set the host if not using the default. ```python import time import os import mx_platform_python from mx_platform_python.models.categories_response_body import CategoriesResponseBody from mx_platform_python.rest import ApiException from pprint import pprint configuration = mx_platform_python.Configuration( host = "https://int-api.mx.com" ) configuration = mx_platform_python.Configuration( username = os.environ["USERNAME"], password = os.environ["PASSWORD"] ) with mx_platform_python.ApiClient(configuration) as api_client: api_instance = mx_platform_python.CategoriesApi(api_client) user_guid = 'USR-fa7537f3-48aa-a683-a02a-b18940482f54' # str | The unique identifier for a `user`, beginning with the prefix `USR-`. page = 1 # int | Results are paginated. Specify current page. (optional) records_per_page = 10 # int | This specifies the number of records to be returned on each page. Defaults to `25`. The valid range is from `10` to `1000`. If the value exceeds `1000`, the default value of `25` will be used instead. (optional) try: api_response = api_instance.list_categories(user_guid, page=page, records_per_page=records_per_page) print("The response of CategoriesApi->list_categories:\n") pprint(api_response) except Exception as e: print("Exception when calling CategoriesApi->list_categories: %s\n" % e) ``` -------------------------------- ### Read Account with Basic Authentication Source: https://github.com/mxenabled/mx-platform-python/blob/master/docs/AccountsApi.md Demonstrates how to read a specific account resource using basic authentication. This example requires account_guid and user_guid. ```python import time import os import mx_platform_python from mx_platform_python.models.account_response_body import AccountResponseBody from mx_platform_python.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://int-api.mx.com # See configuration.py for a list of all supported configuration parameters. configuration = mx_platform_python.Configuration( host = "https://int-api.mx.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. # Configure HTTP basic authorization: basicAuth configuration = mx_platform_python.Configuration( username = os.environ["USERNAME"], password = os.environ["PASSWORD"] ) ``` -------------------------------- ### GET /users/{user_guid}/budgets/{budget_guid} Source: https://github.com/mxenabled/mx-platform-python/blob/master/docs/BudgetsApi.md Retrieves details for a specific budget identified by its GUID for a given user. ```APIDOC ## GET /users/{user_guid}/budgets/{budget_guid} ### Description Read a specific budget for a given user. ### Method GET ### Endpoint /users/{user_guid}/budgets/{budget_guid} ### Parameters #### Path Parameters - **user_guid** (str) - Required - The unique identifier for a `user`, beginning with the prefix `USR-`. - **budget_guid** (str) - Required - The unique identifier for the `budget`, beginning with the prefix `bud-`. ### Request Body This endpoint does not accept a request body. ### Response #### Success Response (200) - **budget_response_body** (BudgetResponseBody) - An object containing the specific budget details. #### Response Example ```json { "budgets": [ { "account_guid": "account-guid-1", "amount": 100.50, "category_guid": "category-guid-1", "created_at": "2023-01-01T12:00:00Z", "guid": "budget-guid-1", "name": "Groceries", "updated_at": "2023-01-01T12:00:00Z", "user_guid": "user-guid-1" } ], "metadata": { "created_at": "2023-01-01T12:00:00Z", "guid": "metadata-guid-1", "updated_at": "2023-01-01T12:00:00Z" } } ``` ``` -------------------------------- ### GET /ach_returns/{ach_return_guid} Source: https://github.com/mxenabled/mx-platform-python/blob/master/docs/AchReturnApi.md Retrieves a specific ACH return by its GUID. Note: This feature is in beta and subject to change. ```APIDOC ## GET /ach_returns/{ach_return_guid} ### Description Read ACH Return ### Method GET ### Endpoint /ach_returns/{ach_return_guid} ### Parameters #### Path Parameters - **ach_return_guid** (string) - Required - The unique identifier for the ACH return. ### Response #### Success Response (200) - **ACHReturnResponseBody** (ACHReturnResponseBody) - Description of the response body. #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### Configure MX Platform Python SDK with Basic Authentication Source: https://github.com/mxenabled/mx-platform-python/blob/master/docs/NotificationsApi.md This example demonstrates how to set up the MX Platform Python SDK client using basic authentication. It requires setting the host and providing username and password, typically from environment variables. ```python configuration = mx_platform_python.Configuration( host = "https://int-api.mx.com" ) configuration = mx_platform_python.Configuration( username = os.environ["USERNAME"], password = os.environ["PASSWORD"] ) ``` -------------------------------- ### GET /users/{user_guid}/tags/{tag_guid} - Read Tag Source: https://github.com/mxenabled/mx-platform-python/blob/master/docs/TagsApi.md Retrieves details of a specific tag using its unique GUID. ```APIDOC ## GET /users/{user_guid}/tags/{tag_guid} ### Description Retrieves details of a specific tag using its unique GUID. ### Method GET ### Endpoint /users/{user_guid}/tags/{tag_guid} ### Parameters #### Path Parameters - **user_guid** (str) - Required - The unique identifier for a `user`, beginning with the prefix `USR-`. - **tag_guid** (str) - Required - The unique identifier for the `tag`, beginning with the prefix `TAG-`. ### Response #### Success Response (200) - **TagResponseBody** (TagResponseBody) - Description of the tag response body. #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### Create a User with MX Platform Python SDK Source: https://github.com/mxenabled/mx-platform-python/blob/master/README.md Example of creating a user using the MxPlatformApi. Requires configuration with Client ID/API Key and specifying the environment host. ```python import mx_platform_python from mx_platform_python.api import mx_platform_api from mx_platform_python.models import * from pprint import pprint configuration = mx_platform_python.Configuration( # Configure with your Client ID/API Key from https://dashboard.mx.com username = 'Your Client ID', password = 'Your API Key', # Configure environment. https://int-api.mx.com for development, https://api.mx.com for production host = 'https://int-api.mx.com' ) with mx_platform_python.ApiClient(configuration, 'Accept', 'application/vnd.mx.api.v1+json') as api_client: api_instance = mx_platform_api.MxPlatformApi(api_client) request_body = UserCreateRequestBody( user = UserCreateRequest( metadata = 'Creating a user!' ) ) try: api_response = api_instance.create_user(request_body) pprint(api_response) except mx_platform_python.ApiException as e: print("Exception when calling MxPlatformApi->create_user: %s\n" % e) ``` -------------------------------- ### GET /users/{user_guid} Source: https://github.com/mxenabled/mx-platform-python/blob/master/docs/UsersApi.md Retrieves the details of a specific user identified by their GUID. This allows for detailed inspection of a single user's information. ```APIDOC ## GET /users/{user_guid} ### Description Retrieves the details of a specific user identified by their GUID. This allows for detailed inspection of a single user's information. ### Method GET ### Endpoint /users/{user_guid} ### Parameters #### Path Parameters - **user_guid** (string) - Required - The unique identifier of the user to retrieve. ### Response #### Success Response (200) - **UserResponseBody** (UserResponseBody) - The user object with detailed information. #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### List Transactions with Basic Authentication Source: https://github.com/mxenabled/mx-platform-python/blob/master/docs/TransactionsApi.md This example demonstrates how to list transactions for a user using basic authentication. It includes configuration for the API host and authentication credentials. ```python import time import os import mx_platform_python from mx_platform_python.models.transactions_response_body_includes import TransactionsResponseBodyIncludes from mx_platform_python.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://int-api.mx.com # See configuration.py for a list of all supported configuration parameters. configuration = mx_platform_python.Configuration( host = "https://int-api.mx.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. # Configure HTTP basic authorization: basicAuth configuration = mx_platform_python.Configuration( username = os.environ["USERNAME"], password = os.environ["PASSWORD"] ) ``` -------------------------------- ### GET /users/{user_guid}/members/{member_guid}/rewards/{reward_guid} Source: https://github.com/mxenabled/mx-platform-python/blob/master/docs/RewardsApi.md Reads a specific reward by its GUID. This endpoint is useful for retrieving detailed information about a single reward. ```APIDOC ## GET /users/{user_guid}/members/{member_guid}/rewards/{reward_guid} ### Description Reads a specific reward by its GUID. ### Method GET ### Endpoint /users/{user_guid}/members/{member_guid}/rewards/{reward_guid} ### Parameters #### Path Parameters - **user_guid** (str) - Required - The unique identifier for a user. - **member_guid** (str) - Required - The unique identifier for a member. - **reward_guid** (str) - Required - The unique identifier for a reward. ### Request Example ```python import mx_platform_python configuration = mx_platform_python.Configuration( username=os.environ.get("USERNAME"), password=os.environ.get("PASSWORD") ) with mx_platform_python.ApiClient(configuration) as api_client: api_instance = mx_platform_python.RewardsApi(api_client) user_guid = 'user-guid-abc' member_guid = 'member-guid-xyz' reward_guid = 'reward-guid-1' try: api_response = api_instance.read_rewards(user_guid, member_guid, reward_guid) print(api_response) except Exception as e: print(f"Exception when calling RewardsApi->read_rewards: {e}") ``` ### Response #### Success Response (200) - **RewardResponseBody** - Contains detailed information about the specified reward. #### Response Example ```json { "guid": "reward-guid-1", "member_guid": "member-guid-xyz", "name": "1000 Bonus Points", "points_value": 1000, "description": "Earn 1000 bonus points on your next purchase.", "expires_at": "2024-12-31T23:59:59Z" } ``` ``` -------------------------------- ### Configure and Use Basic Authentication for Spending Plan API Source: https://github.com/mxenabled/mx-platform-python/blob/master/docs/SpendingPlanApi.md Demonstrates how to configure HTTP basic authorization using environment variables for username and password, and then use the SpendingPlanApi to read a spending plan iteration. Ensure environment variables `USERNAME` and `PASSWORD` are set. ```python import os import mx_platform_python from pprint import pprint configuration = mx_platform_python.Configuration( username = os.environ["USERNAME"], password = os.environ["PASSWORD"] ) with mx_platform_python.ApiClient(configuration) as api_client: api_instance = mx_platform_python.SpendingPlanApi(api_client) user_guid = 'USR-fa7537f3-48aa-a683-a02a-b18940482f54' spending_plan_guid = 'SPL-e5f9a5bd-c5b3-4901-bdc0-62119b9db262' iteration_number = 1 page = 1 records_per_page = 10 try: api_response = api_instance.read_spending_plan_iteration(user_guid, spending_plan_guid, iteration_number, page=page, records_per_page=records_per_page) print("The response of SpendingPlanApi->read_spending_plan_iteration:\n") pprint(api_response) except Exception as e: print("Exception when calling SpendingPlanApi->read_spending_plan_iteration: %s\n" % e) ``` -------------------------------- ### Update a Specific Transaction Source: https://github.com/mxenabled/mx-platform-python/blob/master/docs/TransactionsApi.md This example demonstrates how to update a specific transaction using its GUID. Basic authentication is required, and you need to provide the transaction details in the request body. ```python import time import os import mx_platform_python from mx_platform_python.models.transaction_response_body import TransactionResponseBody from mx_platform_python.models.transaction_update_request_body import TransactionUpdateRequestBody from mx_platform_python.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://int-api.mx.com # See configuration.py for a list of all supported configuration parameters. configuration = mx_platform_python.Configuration( host = "https://int-api.mx.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. # Configure HTTP basic authorization: basicAuth configuration = mx_platform_python.Configuration( username = os.environ["USERNAME"], password = os.environ["PASSWORD"] ) ``` -------------------------------- ### Initialize API Client and Create Manual Transaction Source: https://github.com/mxenabled/mx-platform-python/blob/master/docs/TransactionsApi.md Demonstrates how to initialize the MX Platform API client and create a manual transaction. Ensure you have the necessary configuration and API keys set up. ```python import mx_platform_python # Enter a context with an instance of the API client with mx_platform_python.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = mx_platform_python.TransactionsApi(api_client) user_guid = 'USR-fa7537f3-48aa-a683-a02a-b18940482f54' # str | The unique identifier for a `user`, beginning with the prefix `USR-`. account_guid = 'ACT-06d7f44b-caae-0f6e-1384-01f52e75dcb1' # str | The unique id for an `account`. transaction_create_request_body = mx_platform_python.TransactionCreateRequestBody() # TransactionCreateRequestBody | try: # Create manual transaction api_response = api_instance.create_manual_transaction(user_guid, account_guid, transaction_create_request_body) print("The response of TransactionsApi->create_manual_transaction:\n") pprint(api_response) except Exception as e: print("Exception when calling TransactionsApi->create_manual_transaction: %s\n" % e) ``` -------------------------------- ### GET /credit_card_products/{credit_card_product_guid} Source: https://github.com/mxenabled/mx-platform-python/blob/master/docs/RewardsApi.md Reads a specific Credit Card Product using its unique GUID. This endpoint is useful for retrieving detailed information about a credit card product. ```APIDOC ## GET /credit_card_products/{credit_card_product_guid} ### Description Reads a Credit Card Product using its unique GUID. ### Method GET ### Endpoint /credit_card_products/{credit_card_product_guid} ### Parameters #### Path Parameters - **credit_card_product_guid** (str) - Required - The required `credit_card_product_guid` can be found on the `account` object. ### Request Example ```python import mx_platform_python configuration = mx_platform_python.Configuration( username=os.environ.get("USERNAME"), password=os.environ.get("PASSWORD") ) with mx_platform_python.ApiClient(configuration) as api_client: api_instance = mx_platform_python.RewardsApi(api_client) credit_card_product_guid = 'your_credit_card_product_guid' try: api_response = api_instance.credit_card(credit_card_product_guid) print(api_response) except Exception as e: print(f"Exception when calling RewardsApi->credit_card: {e}") ``` ### Response #### Success Response (200) - **CreditCardProductResponse** - Details of the credit card product. #### Response Example ```json { "credit_card_product": { "guid": "ccp-guid-1234", "name": "Example Rewards Card", "annual_fee_amount": 99.00, "annual_fee_currency": "USD" } } ``` ``` -------------------------------- ### BudgetResponse Model Usage Source: https://github.com/mxenabled/mx-platform-python/blob/master/docs/BudgetResponse.md Demonstrates how to create a BudgetResponse instance from a JSON string and convert it to a dictionary. Also shows how to create an instance from a dictionary and print its JSON string representation. Ensure the JSON string is valid and properly formatted. ```python from mx_platform_python.models.budget_response import BudgetResponse # TODO update the JSON string below json = "{}" # create an instance of BudgetResponse from a JSON string budget_response_instance = BudgetResponse.from_json(json) # print the JSON string representation of the object print BudgetResponse.to_json() # convert the object into a dict budget_response_dict = budget_response_instance.to_dict() # create an instance of BudgetResponse from a dict budget_response_form_dict = budget_response.from_dict(budget_response_dict) ``` -------------------------------- ### Get Transactions Data with Verifiable Credentials API Source: https://github.com/mxenabled/mx-platform-python/blob/master/docs/VerifiableCredentialsApi.md Retrieves transaction data for a user's account within a specified date range. Requires basic authentication and valid user and account GUIDs. The date range is limited to one year. ```python import time import os import mx_platform_python from mx_platform_python.models.vc_response import VCResponse from mx_platform_python.rest import ApiException from pprint import pprint configuration = mx_platform_python.Configuration( host = "https://int-api.mx.com" ) configuration = mx_platform_python.Configuration( username = os.environ["USERNAME"], password = os.environ["PASSWORD"] ) with mx_platform_python.ApiClient(configuration) as api_client: api_instance = mx_platform_python.VerifiableCredentialsApi(api_client) user_guid = 'USR-fa7537f3-48aa-a683-a02a-b18940482f54' # str | The unique identifier for a `user`, beginning with the prefix `USR-`. account_guid = 'ACT-06d7f44b-caae-0f6e-1384-01f52e75dcb1' # str | The unique id for an `account`. start_time = '2015-09-20' # str | Filter transactions from this date. Must be in the format YYYY-MM-DD. The range is limited to 1 year. (optional) end_time = '2015-09-20' # str | Filter transactions to this date. Must be in the format YYYY-MM-DD. The range is limited to 1 year. (optional) try: api_response = api_instance.get_transactions_data(user_guid, account_guid, start_time=start_time, end_time=end_time) print("The response of VerifiableCredentialsApi->get_transactions_data:\n") pprint(api_response) except Exception as e: print("Exception when calling VerifiableCredentialsApi->get_transactions_data: %s\n" % e) ``` -------------------------------- ### Read Account by Member GUID Source: https://github.com/mxenabled/mx-platform-python/blob/master/docs/AccountsApi.md This snippet demonstrates how to fetch account information using the account GUID, member GUID, and user GUID. Basic authentication is required, and the API client must be configured with your username and password. ```python import time import os import mx_platform_python from mx_platform_python.models.account_response_body import AccountResponseBody from mx_platform_python.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://int-api.mx.com # See configuration.py for a list of all supported configuration parameters. configuration = mx_platform_python.Configuration( host = "https://int-api.mx.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. # Configure HTTP basic authorization: basicAuth configuration = mx_platform_python.Configuration( username = os.environ["USERNAME"], password = os.environ["PASSWORD"] ) # Enter a context with an instance of the API client with mx_platform_python.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = mx_platform_python.AccountsApi(api_client) account_guid = 'ACT-06d7f44b-caae-0f6e-1384-01f52e75dcb1' # str | The unique id for an `account`. member_guid = 'MBR-7c6f361b-e582-15b6-60c0-358f12466b4b' # str | The unique id for a `member`. user_guid = 'USR-fa7537f3-48aa-a683-a02a-b18940482f54' # str | The unique identifier for a `user`, beginning with the prefix `USR-`. try: # Read account by member api_response = api_instance.read_account_by_member(account_guid, member_guid, user_guid) print("The response of AccountsApi->read_account_by_member:\n") pprint(api_response) except Exception as e: print("Exception when calling AccountsApi->read_account_by_member: %s\n" % e) ``` -------------------------------- ### Create Goal using Basic Authentication Source: https://github.com/mxenabled/mx-platform-python/blob/master/docs/GoalsApi.md Demonstrates how to create a goal for a user using basic authentication. Ensure that the MX-Skip-Webhook header or skip_webhook parameter is configured if needed. ```python import time import os import mx_platform_python from mx_platform_python.models.goal_request_body import GoalRequestBody from mx_platform_python.models.goal_response_body import GoalResponseBody from mx_platform_python.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://int-api.mx.com # See configuration.py for a list of all supported configuration parameters. configuration = mx_platform_python.Configuration( host = "https://int-api.mx.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. # Configure HTTP basic authorization: basicAuth configuration = mx_platform_python.Configuration( username = os.environ["USERNAME"], password = os.environ["PASSWORD"] ) # Enter a context with an instance of the API client with mx_platform_python.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = mx_platform_python.GoalsApi(api_client) user_guid = 'USR-fa7537f3-48aa-a683-a02a-b18940482f54' # str | The unique identifier for a `user`, beginning with the prefix `USR-`. goal_request_body = mx_platform_python.GoalRequestBody() # GoalRequestBody | try: # Create a goal api_response = api_instance.create_goal(user_guid, goal_request_body) print("The response of GoalsApi->create_goal:\n") pprint(api_response) except Exception as e: print("Exception when calling GoalsApi->create_goal: %s\n" % e) ``` -------------------------------- ### Instantiate and Convert BudgetResponseBody Source: https://github.com/mxenabled/mx-platform-python/blob/master/docs/BudgetResponseBody.md Demonstrates how to create a BudgetResponseBody instance from a JSON string or a dictionary, and how to convert it back to JSON or a dictionary. Requires the BudgetResponseBody model to be imported. ```python from mx_platform_python.models.budget_response_body import BudgetResponseBody # TODO update the JSON string below json = "{}" # create an instance of BudgetResponseBody from a JSON string budget_response_body_instance = BudgetResponseBody.from_json(json) # print the JSON string representation of the object print BudgetResponseBody.to_json() # convert the object into a dict budget_response_body_dict = budget_response_body_instance.to_dict() # create an instance of BudgetResponseBody from a dict budget_response_body_form_dict = budget_response_body.from_dict(budget_response_body_dict) ``` -------------------------------- ### Read Insight Details Source: https://github.com/mxenabled/mx-platform-python/blob/master/docs/InsightsApi.md Retrieve the attributes of an insight using its unique GUID. This method requires the user's GUID and the insight's GUID for identification. ```python configuration = mx_platform_python.Configuration( username = os.environ["USERNAME"], password = os.environ["PASSWORD"] ) with mx_platform_python.ApiClient(configuration) as api_client: api_instance = mx_platform_python.InsightsApi(api_client) user_guid = 'USR-fa7537f3-48aa-a683-a02a-b18940482f54' insight_guid = 'BET-1234-abcd' try: api_response = api_instance.read_insight_user(user_guid, insight_guid) print("The response of InsightsApi->read_insight_user:\n") pprint(api_response) except Exception as e: print("Exception when calling InsightsApi->read_insight_user: %s\n" % e) ``` -------------------------------- ### Delete Transaction Rule Source: https://github.com/mxenabled/mx-platform-python/blob/master/docs/TransactionsApi.md Permanently delete a transaction rule using its unique GUID. This operation requires the transaction rule's GUID and the user's GUID. ```python import time import os import mx_platform_python from mx_platform_python.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://int-api.mx.com # See configuration.py for a list of all supported configuration parameters. configuration = mx_platform_python.Configuration( host = "https://int-api.mx.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. # Configure HTTP basic authorization: basicAuth configuration = mx_platform_python.Configuration( username = os.environ["USERNAME"], password = os.environ["PASSWORD"] ) # Enter a context with an instance of the API client with mx_platform_python.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = mx_platform_python.TransactionsApi(api_client) transaction_rule_guid = 'TXR-a080e0f9-a2d4-4d6f-9e03-672cc357a4d3' # str | The unique id for a `transaction_rule`. user_guid = 'USR-fa7537f3-48aa-a683-a02a-b18940482f54' # str | The unique identifier for a `user`, beginning with the prefix `USR-`. try: # Delete transaction rule api_instance.delete_transaction_rule(transaction_rule_guid, user_guid) except Exception as e: print("Exception when calling TransactionsApi->delete_transaction_rule: %s\n" % e) ``` -------------------------------- ### Instantiate ImageOptionResponse from JSON and Dict Source: https://github.com/mxenabled/mx-platform-python/blob/master/docs/ImageOptionResponse.md Demonstrates creating an ImageOptionResponse object from a JSON string and a dictionary. Also shows converting the object back to JSON and a dictionary. ```python from mx_platform_python.models.image_option_response import ImageOptionResponse # TODO update the JSON string below json = "{}" # create an instance of ImageOptionResponse from a JSON string image_option_response_instance = ImageOptionResponse.from_json(json) # print the JSON string representation of the object print ImageOptionResponse.to_json() # convert the object into a dict image_option_response_dict = image_option_response_instance.to_dict() # create an instance of ImageOptionResponse from a dict image_option_response_form_dict = image_option_response.from_dict(image_option_response_dict) ``` -------------------------------- ### Configure Basic Authentication for Spending Plan Iteration Item API Source: https://github.com/mxenabled/mx-platform-python/blob/master/docs/SpendingPlanApi.md Shows how to set up basic authentication for the MX Platform Python SDK, specifically for accessing the SpendingPlanApi to read a spending plan iteration item. This example requires the `USERNAME` and `PASSWORD` environment variables to be set. ```python import time import os import mx_platform_python from mx_platform_python.models.spending_plan_iteration_item_response import SpendingPlanIterationItemResponse from mx_platform_python.rest import ApiException from pprint import pprint configuration = mx_platform_python.Configuration( host = "https://int-api.mx.com" ) configuration = mx_platform_python.Configuration( username = os.environ["USERNAME"], password = os.environ["PASSWORD"] ) ``` -------------------------------- ### Request Authorization Code with Basic Authentication Source: https://github.com/mxenabled/mx-platform-python/blob/master/docs/ProcessorTokenApi.md This example shows how to request an authorization code using basic authentication. Set the USERNAME and PASSWORD environment variables. ```python import time import os import mx_platform_python from mx_platform_python.models.authorization_code_request_body import AuthorizationCodeRequestBody from mx_platform_python.models.authorization_code_response_body import AuthorizationCodeResponseBody from mx_platform_python.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://int-api.mx.com # See configuration.py for a list of all supported configuration parameters. configuration = mx_platform_python.Configuration( host = "https://int-api.mx.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. # Configure HTTP basic authorization: basicAuth configuration = mx_platform_python.Configuration( username = os.environ["USERNAME"], password = os.environ["PASSWORD"] ) # Enter a context with an instance of the API client with mx_platform_python.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = mx_platform_python.ProcessorTokenApi(api_client) authorization_code_request_body = mx_platform_python.AuthorizationCodeRequestBody() # AuthorizationCodeRequestBody | The scope for the authorization code. try: # Request an authorization code api_response = api_instance.request_authorization_code(authorization_code_request_body) print("The response of ProcessorTokenApi->request_authorization_code:\n") pprint(api_response) except Exception as e: print("Exception when calling ProcessorTokenApi->request_authorization_code: %s\n" % e) ```