### OAuth2 Authorization Steps Source: https://api.infoodle.com This outlines the three-step process for obtaining an OAuth2 token. Ensure you replace placeholders like YOURSITE, USERS-LOGIN-OR-CLIENT-ID, and USERS-CLIENT-SECRET with your actual credentials. ```shell curl -G https://YOURSITE.infoodle.com/apiv2/oauth2/authorise -d "client_id=USERS-LOGIN-OR-CLIENT-ID" -d "redirect_uri=https://YOURSITE.infoodle.com/apiv2_auth" -d "response_type=code" ``` ```shell curl https://YOURSITE.infoodle.com/apiv2/oauth2/authorise -d "client_id=USERS-LOGIN-OR-CLIENT-ID" -d "redirect_uri=https://YOURSITE.infoodle.com/apiv2_auth" -d "response_type=code" -d "authorized=yes" ``` ```shell curl https://YOURSITE.infoodle.com/apiv2/oauth2/token -d "grant_type=authorization_code" -d "code=CODE-FROM-LAST-CALL" -d "client_secret=USERS-CLIENT-SECRET" -d "client_id=USERS-LOGIN-OR-CLIENT-ID" -d "redirect_uri=https://YOURSITE.infoodle.com/apiv2_auth" ``` -------------------------------- ### Create Account Code Source: https://api.infoodle.com Use this endpoint to add a new account code to your Infoodle site. The request body should be a JSON object containing the account code details. ```shell curl -X POST https://{sitecode}.infoodle.com/apiv2/accountcode \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{ "accountcode": "200-D", "name": "Donations", "incomeexpense": 1, "taxable": 1, "salestax": 1, "sort_order": 1, "xero_account_id": "62f28bd8-3d47-4302-88a3-dc6ff53d8126", "xero_status": "OK", "primary_for_duplicates": 1, "for_group_id": 28 }' ``` -------------------------------- ### Add New Account Code using cURL Source: https://api.infoodle.com Use this cURL command to add a new account code to your infoodle site. Ensure you replace YOURSITE and YOUR_SECRET_TOKEN with your actual credentials. The request body includes parameters like account code, name, income/expense type, and taxability. ```shell curl https://YOURSITE.infoodle.com/apiv2/accountcode \ --request POST \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \ --data '{ "accountcode": "200-D", "name": "Donations", "incomeexpense": 1, "taxable": 1, "salestax": 1, "sort_order": 1, "xero_account_id": "62f28bd8-3d47-4302-88a3-dc6ff53d8126", "xero_status": "OK", "primary_for_duplicates": 1, "for_group_id": 28 }' ``` -------------------------------- ### Add Account Code Source: https://api.infoodle.com Adds a new account code to the Infoodle system. Requires authentication. ```APIDOC ## POST /accountcode ### Description Adds a new account code. ### Method POST ### Endpoint https://{sitecode}.infoodle.com/apiv2/accountcode ### Request Body - **accountcode** (string) - Required - The account code identifier. - **name** (string) - Required - The name of the account code. - **incomeexpense** (integer) - Required - Indicates if it's income or expense (1 for income, 0 for expense). - **taxable** (integer) - Required - Indicates if the account code is taxable (1 for yes, 0 for no). - **salestax** (integer) - Required - Indicates if sales tax applies (1 for yes, 0 for no). - **sort_order** (integer) - Required - The order in which to sort the account code. - **xero_account_id** (string) - Optional - The associated Xero account ID. - **xero_status** (string) - Optional - The status in Xero. - **primary_for_duplicates** (integer) - Optional - Flag for primary account for duplicates. - **for_group_id** (integer) - Optional - The group ID this account belongs to. ### Request Example ```json { "accountcode": "200-D", "name": "Donations", "incomeexpense": 1, "taxable": 1, "salestax": 1, "sort_order": 1, "xero_account_id": "62f28bd8-3d47-4302-88a3-dc6ff53d8126", "xero_status": "OK", "primary_for_duplicates": 1, "for_group_id": 28 } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message upon successful addition. ``` -------------------------------- ### Add a new account code Source: https://api.infoodle.com Adds a new account code to your infoodle site. This operation requires authentication and accepts account code details in the request body. ```APIDOC ## POST /accountcode ### Description Adds a new account code to your infoodle site. ### Method POST ### Endpoint /accountcode ### Parameters #### Request Body - **accountcode** (string) - Required - The account code identifier. - **for_group_id** (integer) - Optional - The group ID if this code is only referenced by a specific group. - **incomeexpense** (integer) - Required - Indicates if it's an income (1) or expense (0) account code. - **name** (string) - Required - The name of the account code. - **primary_for_duplicates** (integer) - Optional - Identifies the primary code when duplicated. - **salestax** (integer) - Optional - Indicates if sales tax is included (1) or not (0). - **sort_order** (integer) - Optional - The order in which this code appears in lists. - **taxable** (integer) - Optional - Indicates if the code is taxable (1) or non-taxable (0). - **xero_account_id** (string) - Optional - The ID of the corresponding Xero account. - **xero_status** (string) - Optional - The status of the code in Xero (e.g., OK, No longer in Xero). ### Request Example ```curl curl https://YOURSITE.infoodle.com/apiv2/accountcode \ --request POST \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \ --data '{ "accountcode": "200-D", "name": "Donations", "incomeexpense": 1, "taxable": 1, "salestax": 1, "sort_order": 1, "xero_account_id": "62f28bd8-3d47-4302-88a3-dc6ff53d8126", "xero_status": "OK", "primary_for_duplicates": 1, "for_group_id": 28 }' ``` ### Response #### Success Response (200) - **id** (integer) - The ID of the newly created account code. #### Response Example ```json { "id": 4325342 } ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.