### Configuring Regular Navigation in mint.json (JSON) Source: https://github.com/toltapp/api-docs/blob/main/essentials/navigation.mdx This snippet demonstrates the basic syntax for defining a navigation group in `mint.json`. It creates a 'Getting Started' group containing a single page named 'quickstart', which will appear in the website's navigation menu. ```json "navigation": [ { "group": "Getting Started", "pages": ["quickstart"] } ] ``` -------------------------------- ### Installing Mintlify CLI Globally (Shell) Source: https://github.com/toltapp/api-docs/blob/main/README.md This command installs the Mintlify Command Line Interface (CLI) globally on your system. The CLI is required to preview documentation changes locally before publishing. It uses npm, the Node.js package manager, to fetch and install the `mintlify` package. ```Shell npm i -g mintlify ``` -------------------------------- ### Making an Example GET Request - Tolt API - Bash Source: https://github.com/toltapp/api-docs/blob/main/api/authentication.mdx This example demonstrates how to perform a GET request to the Tolt API's /v1/links endpoint using curl. It shows the correct way to include the Authorization header with a Bearer token, using a placeholder API key, to successfully authenticate the request. This provides a practical illustration of API interaction. ```bash curl -X GET 'https://api.tolt.com/v1/links' \ -H 'Authorization: Bearer tlt_live_3eYx5GATWpBpW1bJXw4ZD9' ``` -------------------------------- ### Example GET Request with Bearer Token - Bash Source: https://github.com/toltapp/api-docs/blob/main/authentication.mdx This example demonstrates a complete `curl` command to perform a GET request to the Tolt API's `/v1/links` endpoint. It illustrates how to correctly include the `Authorization` header with a sample Bearer token, showcasing the practical application of the authentication method. ```bash curl -X GET 'https://api.tolt.com/v1/links' \ -H 'Authorization: Bearer tlt_live_3eYx5GATWpBpW1bJXw4ZD9' ``` -------------------------------- ### Successful API Response Example (JSON) Source: https://github.com/toltapp/api-docs/blob/main/api/introduction.mdx Provides an example of a successful API response in JSON format, indicating a 'success' status and containing the requested data object. This structure is common for successful operations and includes relevant resource details. ```json { "success": true, "data": { "id": "part_s7mbzRGn46BhVgNFHD6fDgXW", "first_name": "Michael", "last_name": "Scott" // ... other fields } } ``` -------------------------------- ### Installing tolt.js Script (Alternative) - JavaScript Source: https://github.com/toltapp/api-docs/blob/main/javascript/overview.mdx This snippet provides an alternative method for installing the tolt.js script dynamically using JavaScript. It creates a new script element, sets its source and data-tolt attribute, and then appends it to the document's , allowing for programmatic control over script loading. ```javascript var toltScript = document.createElement('script'); toltScript.src = 'https://cdn.tolt.io/tolt.js'; toltScript.setAttribute('data-tolt', 'YOUR_PUBLIC_ORG_KEY'); document.head.appendChild(toltScript); ``` -------------------------------- ### Configuring Nested Navigation in mint.json (JSON) Source: https://github.com/toltapp/api-docs/blob/main/essentials/navigation.mdx This example illustrates how to create nested navigation groups within `mint.json`. It shows a 'Getting Started' group that includes both a direct page link ('quickstart') and a sub-group ('Nested Reference Pages') containing its own page ('nested-reference-page'), allowing for hierarchical menu structures. ```json "navigation": [ { "group": "Getting Started", "pages": [ "quickstart", { "group": "Nested Reference Pages", "pages": ["nested-reference-page"] } ] } ] ``` -------------------------------- ### Create Promotion Code Request (cURL) Source: https://github.com/toltapp/api-docs/blob/main/promotion-codes/create.mdx This cURL example demonstrates how to make a POST request to create a promotion code, including required headers and the JSON body with code, type, value, and partner_id. ```bash curl -X POST 'https://api.tolt.com/v1/promotion-codes' \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ -d '{ "code": "SUMMER2024", "type": "percentage", "value": 20, "partner_id": "part_s7mbzRGn46BhVgNFHD6fDgXW" }' ``` -------------------------------- ### Error API Response Example (JSON) Source: https://github.com/toltapp/api-docs/blob/main/api/introduction.mdx Demonstrates an example of an API error response in JSON format, indicating a 'false' success status and providing an 'error' object with a message and type. This structure helps in handling API failures and debugging issues. ```json { "success": false, "error": { "message": "Invalid API key provided", "type": "authentication_error" } } ``` -------------------------------- ### Running Mintlify Development Server (Shell) Source: https://github.com/toltapp/api-docs/blob/main/README.md This command starts a local development server for your Mintlify documentation. It should be executed from the root directory of your documentation project, where the `mint.json` configuration file is located. This allows you to preview changes in real-time as you develop. ```Shell mintlify dev ``` -------------------------------- ### Installing tolt.js Script (Default) - HTML Source: https://github.com/toltapp/api-docs/blob/main/guides/with-toltjs.mdx This snippet demonstrates the default method to include the tolt.js tracking script in your web page's head. It loads the script from the CDN and initializes it with your public organization key for tracking partner activities. ```html ``` -------------------------------- ### Example Basic Partner Details Response (JSON) Source: https://github.com/toltapp/api-docs/blob/main/partners/retrieve.mdx This JSON object illustrates a successful response containing the core attributes of a partner, such as ID, name, email, company, and status, as returned by the basic GET request. ```json { "success": true, "data": { "id": "part_s7mbzRGn46BhVgNFHD6fDgXW", "first_name": "Michael", "last_name": "Scott", "email": "michael.scott@dundermifflin.com", "company_name": "Dunder Mifflin", "program_id": "prg_YRsbPDAKhWfdqJbFACheh", "organization_id": "org_JE3mfYNL9ci7sFaJazAv2", "group_id": "grp_Zc2uw9zm1eyBiD3MHcjV3RDn", "payout_method": "paypal", "payout_details": { "email": "michael.paypal@dundermifflin.com" }, "country_code": "US", "created_at": "2025-01-13T10:06:11.251Z", "status": "active", "custom_fields": [] } } ``` -------------------------------- ### Installing tolt.js Script (Default) - HTML Source: https://github.com/toltapp/api-docs/blob/main/javascript/overview.mdx This snippet demonstrates the default method for integrating the tolt.js script into your website or application. It involves adding a ``` -------------------------------- ### Example Expanded Customer List API Response Source: https://github.com/toltapp/api-docs/blob/main/customers/list.mdx This JSON object shows a partial example of an API response when customer details are expanded. It indicates success and pagination status, and would typically include expanded `partner` and `program` objects within the `data` array, providing more comprehensive information about related entities. ```json { "success": true, "has_more": true, } ``` -------------------------------- ### Listing Promotion Codes using cURL Source: https://github.com/toltapp/api-docs/blob/main/api/promotion-codes/list.mdx This cURL command demonstrates how to make a basic GET request to the Tolt API to list all promotion codes. It requires an Authorization header with a Bearer token for authentication. ```bash curl -X GET 'https://api.tolt.com/v1/promotion-codes' \ -H 'Authorization: Bearer ' ``` -------------------------------- ### Example JSON Response with Expanded Partner and Program Objects Source: https://github.com/toltapp/api-docs/blob/main/api/promotion-codes/list.mdx This JSON object demonstrates a response where the 'partner' and 'program' related objects have been expanded. It shows how additional details for the associated partner and program are nested within each promotion code object. ```json { "success": true, "has_more": true, "total_count": 45, "data": [ { "id": "prc_dK9bzRGn46BhVgNFHD6fDgXW", "code": "SUMMER2024", "type": "percentage", "value": 20, "partner_id": "part_s7mbzRGn46BhVgNFHD6fDgXW", "created_at": "2025-01-15T14:30:00.000Z", "program_id": "prg_YRsbPDAKhWfdqJbFACheh", "organization_id": "org_JE3mfYNL9ci7sFaJazAv2", "partner": { "id": "part_s7mbzRGn46BhVgNFHD6fDgXW", "first_name": "Michael", "last_name": "Scott", "email": "michael.scott@dundermifflin.com", "company_name": "Dunder Mifflin", "status": "active", "created_at": "2025-01-13T10:06:11.251Z" }, "program": { "id": "prg_YRsbPDAKhWfdqJbFACheh", "status": "active", "name": "Tolt's Partnership Program", "product_name": "Tolt", "subdomain": "affiliates", "type": "public", "currency_code": "USD", "created_at": "2024-03-05T10:28:08.984+00:00" } } ] } ``` -------------------------------- ### Create Promotion Code Success Response (JSON) Source: https://github.com/toltapp/api-docs/blob/main/promotion-codes/create.mdx This JSON example shows a successful response after creating a promotion code, detailing the structure of the returned data object including the unique ID, code details, and timestamps. ```json { "success": true, "data": [ { "id": "prc_dK9bzRGn46BhVgNFHD6fDgXW", "active": true, "entity_type": null, "code": "SUMMER2024", "value": 20, "type": "percentage", "program_id": "prg_YRsbPDAKhWfdqJbFACheh", "group_id": null, "organization_id": "org_JE3mfYNL9ci7sFaJazAv2", "partner_id": "part_s7mbzRGn46BhVgNFHD6fDgXW", "created_at": "2025-01-15T14:30:00.000Z", "updated_at": "2025-01-15T14:30:00.000Z" } ] } ``` -------------------------------- ### Example Referral Creation API Response Source: https://github.com/toltapp/api-docs/blob/main/api/referrals/create.mdx This JSON object represents a successful response from the Tolt.io API after creating a referral. It includes the unique ID, email, plan, status, program ID, and a boolean indicating if the referral is considered a lead. ```json { "id": "ccf33a0a-8641-44f7-a7e0-d638932x115", "email": "test@gmail.com", "plan": "Starter", "status": "active", "programId": "cadc56c7-4a4d-4993-b1be-f44ca139ba", "lead": true } ``` -------------------------------- ### Example Transaction Response (Expanded) Source: https://github.com/toltapp/api-docs/blob/main/transactions/list.mdx This JSON snippet demonstrates a successful response when the `expand` parameter is used. It includes the full details of the associated `customer`, `program`, and `partner` objects nested within the transaction data. ```json { "success": true, "has_more": true, "total_count": 45, "data": [ { "id": "txn_eK9bzRGn46BhVgNFHD6fDgXW", "amount": 9999, "customer_id": "cust_dK9bzRGn46BhVgNFHD6fDgXW", "billing_type": "subscription", "charge_id": "ch_9bzRGn46BhVgNFHD6fDgXW", "click_id": "clk_7mbzRGn46BhVgNFHD6fDgXW", "source": "stripe", "interval": "month", "created_at": "2025-01-15T14:30:00.000Z", "updated_at": "2025-01-15T14:30:00.000Z", "program_id": "prg_YRsbPDAKhWfdqJbFACheh", "partner_id": "part_JE3jbmkL9ci7sFaJazAv2", "customer": { "id": "cust_dK9bzRGn46BhVgNFHD6fDgXW", "email": "cust_123", "name": "Jim Halpert", "status": "active", "created_at": "2025-01-15T14:30:00.000Z" }, "program": { "id": "prg_YRsbPDAKhWfdqJbFACheh", "status": "active", "name": "Tolt's Partnership Program", "product_name": "Tolt", "subdomain": "affiliates", "type": "public", "currency_code": "USD", "created_at": "2024-03-05T10:28:08.984+00:00" }, "partner": { "id": "part_s7mbzRGn46BhVgNFHD6fDgXW", "first_name": "Michael", "last_name": "Scott", "email": "michael.scott@dundermifflin.com", "company_name": "Dunder Mifflin", "status": "active", "created_at": "2025-01-13T10:06:11.251Z" } } ] } ``` -------------------------------- ### Example of a Successful Tolt API Response Source: https://github.com/toltapp/api-docs/blob/main/introduction.mdx Illustrates the standard JSON format for a successful Tolt API response. It includes a "success" boolean indicating the request's outcome and a "data" object containing the requested resource's details. ```json { "success": true, "data": { "id": "part_s7mbzRGn46BhVgNFHD6fDgXW", "first_name": "Michael", "last_name": "Scott" // ... other fields } } ``` -------------------------------- ### Example Reward Creation Response (JSON) Source: https://github.com/toltapp/api-docs/blob/main/rewards/create.mdx This snippet shows the expected JSON response after successfully creating a reward. The response includes a unique 'id' for the newly created reward and the 'amount' that was specified in the request body. ```json { "id": "458fa144-298c-9901-t150-5b3cf3913h95", "amount": 100 } ``` -------------------------------- ### Installing tolt.js Script (Alternative) - JavaScript Source: https://github.com/toltapp/api-docs/blob/main/guides/with-toltjs.mdx This JavaScript snippet provides an alternative, programmatic way to add the tolt.js tracking script to your web page. It dynamically creates a script element, sets its source and data-tolt attribute, and appends it to the document's head. ```javascript ``` -------------------------------- ### Example Response for Create Affiliate Source: https://github.com/toltapp/api-docs/blob/main/affiliates/create.mdx This JSON object represents the successful response from the Create Affiliate endpoint. It includes the newly created affiliate's ID, personal details, payout information, program ID, and a nested `link` object with its ID, parameter, and URL. ```json { "id": "ae85655d-0001-41e6-b407-8901b135a854", "firstName": "AffName", "lastName": "AFffLName", "email": "somemail@gmail.com", "payoutEmail": "somemail@gmail.com", "payoutMethod": "wise", "programId": "8ebb4425-bdca-409c-b345-812a5t4111c", "link": { "id": "86d50816-7bbe-4a4c-8d15-03c466cc580d", "param": "via", "url": "someurl" } } ``` -------------------------------- ### Querying Transactions with cURL (Expanded) Source: https://github.com/toltapp/api-docs/blob/main/transactions/list.mdx This cURL example shows how to fetch transactions while expanding related objects like `customer`, `program`, and `partner`. This provides more detailed information directly within the transaction response. ```bash curl -X GET 'https://api.tolt.com/v1/transactions?program_id=prg_YRsbPDAKhWfdqJbFACheh&expand[]=customer&expand[]=program&expand[]=partner' \ -H 'Authorization: Bearer ' ``` -------------------------------- ### Defining a Basic Hello World Class in Java Source: https://github.com/toltapp/api-docs/blob/main/essentials/code.mdx This Java code snippet presents a standard 'Hello, World!' program. It defines a `HelloWorld` class with a `main` method that prints the classic greeting to the console, serving as a fundamental example of a Java application's structure and output. ```java class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World!"); } } ``` -------------------------------- ### Example Transaction Response (Standard) Source: https://github.com/toltapp/api-docs/blob/main/transactions/list.mdx This JSON snippet illustrates a standard successful response for a transaction query. It includes core transaction details such as ID, amount, customer, and timestamps, along with pagination information. ```json { "success": true, "has_more": true, "total_count": 45, "data": [ { "id": "txn_eK9bzRGn46BhVgNFHD6fDgXW", "amount": 9999, "customer_id": "cust_dK9bzRGn46BhVgNFHD6fDgXW", "billing_type": "subscription", "charge_id": "ch_9bzRGn46BhVgNFHD6fDgXW", "click_id": "clk_7mbzRGn46BhVgNFHD6fDgXW", "product_id": "prod_123", "product_name": "Premium Plan", "source": "stripe", "interval": "month", "created_at": "2025-01-15T14:30:00.000Z", "updated_at": "2025-01-15T14:30:00.000Z", "program_id": "prg_YRsbPDAKhWfdqJbFACheh", "partner_id": "part_JE3jbmkL9ci7sFaJazAv2" } ] } ``` -------------------------------- ### Configuring Footer Social Media Links (JSON) Source: https://github.com/toltapp/api-docs/blob/main/essentials/settings.mdx This snippet provides an example of configuring the 'footerSocials' object, mapping social media platform keys to their respective account URLs. This allows for custom social links in the documentation footer. ```json { "twitter": "https://twitter.com/mintlify", "website": "https://mintlify.com" } ``` -------------------------------- ### Example JSON Response with Expanded Partner and Program Details Source: https://github.com/toltapp/api-docs/blob/main/api/promotion-codes/retrieve.mdx This JSON object illustrates a successful response when retrieving a promotion code with the 'partner' and 'program' objects expanded. It includes the full details of the associated partner and program directly within the 'data' object. ```json { "success": true, "data": { "id": "prc_dK9bzRGn46BhVgNFHD6fDgXW", "code": "SUMMER2024", "type": "percentage", "value": 20, "partner_id": "part_s7mbzRGn46BhVgNFHD6fDgXW", "created_at": "2025-01-15T14:30:00.000Z", "program_id": "prg_YRsbPDAKhWfdqJbFACheh", "organization_id": "org_JE3mfYNL9ci7sFaJazAv2", "partner": { "id": "part_s7mbzRGn46BhVgNFHD6fDgXW", "first_name": "Michael", "last_name": "Scott", "email": "michael.scott@dundermifflin.com", "company_name": "Dunder Mifflin", "status": "active", "created_at": "2025-01-13T10:06:11.251Z" }, "program": { "id": "prg_YRsbPDAKhWfdqJbFACheh", "status": "active", "name": "Tolt's Partnership Program", "product_name": "Tolt", "subdomain": "affiliates", "type": "public", "currency_code": "USD", "created_at": "2024-03-05T10:28:08.984+00:00" } } } ``` -------------------------------- ### Standard Commissions API Response Example Source: https://github.com/toltapp/api-docs/blob/main/commissions/list.mdx This JSON snippet illustrates the typical successful response structure for a commissions query. It includes basic commission details within the `data` array and metadata such as `success`, `has_more`, and `total_count`. ```json { "success": true, "has_more": true, "total_count": 45, "data": [ { "id": "comm_eK9bzRGn46BhVgNFHD6fDgXW", "amount": 1999, "customer_id": "cust_dK9bzRGn46BhVgNFHD6fDgXW", "transaction_id": "txn_7mbzRGn46BhVgNFHD6fDgXW", "charge_id": "ch_9bzRGn46BhVgNFHD6fDgXW", "source": "stripe", "status": "pending", "revenue": 9999, "created_at": "2025-01-15T14:30:00.000Z", "updated_at": "2025-01-15T14:30:00.000Z", "program_id": "prg_YRsbPDAKhWfdqJbFACheh", "organization_id": "org_JE3mfYNL9ci7sFaJazAv2" } ] } ``` -------------------------------- ### Example JSON Response for Listing Promotion Codes Source: https://github.com/toltapp/api-docs/blob/main/api/promotion-codes/list.mdx This JSON object illustrates a successful response when listing promotion codes without any expanded objects. It includes metadata like 'success', 'has_more', 'total_count', and an array of 'data' containing promotion code objects. ```json { "success": true, "has_more": true, "total_count": 45, "data": [ { "id": "prc_dK9bzRGn46BhVgNFHD6fDgXW", "code": "SUMMER2024", "type": "percentage", "value": 20, "partner_id": "part_s7mbzRGn46BhVgNFHD6fDgXW", "created_at": "2025-01-15T14:30:00.000Z", "program_id": "prg_YRsbPDAKhWfdqJbFACheh", "organization_id": "org_JE3mfYNL9ci7sFaJazAv2" } ] } ``` -------------------------------- ### Retrieving Commissions using cURL Source: https://github.com/toltapp/api-docs/blob/main/commissions/list.mdx This snippet demonstrates how to fetch a list of commissions using a basic cURL GET request. It requires an API key for authorization and can be filtered by `program_id` to retrieve commissions specific to a particular program. ```bash curl -X GET 'https://api.tolt.com/v1/commissions?program_id=prg_YRsbPDAKhWfdqJbFACheh' \ -H 'Authorization: Bearer ' ``` -------------------------------- ### Example Expanded Partner Details Response (JSON) Source: https://github.com/toltapp/api-docs/blob/main/partners/retrieve.mdx This JSON object demonstrates a successful response when 'group', 'program', and 'stats' data are expanded and included. It provides a comprehensive view of the partner, their associated group, program details, and performance statistics. ```json { "success": true, "data": { "id": "part_s7mbzRGn46BhVgNFHD6fDgXW", "first_name": "Michael", "last_name": "Scott", "email": "michael.scott@dundermifflin.com", "company_name": "Dunder Mifflin", "program_id": "prg_YRsbPDAKhWfdqJbFACheh", "organization_id": "org_JE3mfYNL9ci7sFaJazAv2", "group_id": "grp_Zc2uw9zm1eyBiD3MHcjV3RDn", "payout_method": "paypal", "payout_details": { "email": "michael.paypal@dundermifflin.com" }, "country_code": "US", "created_at": "2025-01-13T10:06:11.251Z", "group": { "id": "grp_Zc2uw9zm1eyBiD3MHcjV3RDn", "name": "Dunder Mifflin Group", "description": "Dunder Mifflin Group 20% off", "created_at": "2024-11-25T15:24:26.846428+00:00", "public_key": "dunder-mifflin-group", "default": true }, "program": { "id": "prg_YRsbPDAKhWfdqJbFACheh", "status": "active", "name": "Tolt's Partnership Program", "product_name": "Tolt", "subdomain": "affiliates", "type": "public", "currency_code": "USD", "cookie_duration": 30, "payout_methods": [ "none", "crypto", "wise", "bank_transfer", "wire", "paypal" ], "payout_term": "15", "url_params": [ "aff", "via" ], "created_at": "2024-03-05T10:28:08.984+00:00" }, "stats": { "total_clicks": 40, "total_customers": 41, "total_revenue": 522226, "total_commission": 1741877, "total_leads": 11, "total_trial_customers": 0, "total_paid_customers": 23, "total_canceled_customers": 6 } } } ``` -------------------------------- ### Example of an Error Tolt API Response Source: https://github.com/toltapp/api-docs/blob/main/introduction.mdx Shows the structure of an error response from the Tolt API. It includes a "success" boolean set to "false" and an "error" object detailing the specific message and type of the error encountered. ```json { "success": false, "error": { "message": "Invalid API key provided", "type": "authentication_error" } } ``` -------------------------------- ### Example JSON Response for Create Referral Source: https://github.com/toltapp/api-docs/blob/main/referrals/create.mdx This JSON object represents a successful response after creating a new referral. It includes the unique ID of the newly created referral, the associated email, plan, current status (active or lead), the program ID, and a boolean indicating if it's a lead. ```json { "id": "ccf33a0a-8641-44f7-a7e0-d638932x115", "email": "test@gmail.com", "plan": "Starter", "status": "active", "programId": "cadc56c7-4a4d-4993-b1be-f44ca139ba" "lead": true } ``` -------------------------------- ### Example JSON Response with Expanded Objects Source: https://github.com/toltapp/api-docs/blob/main/api/links/retrieve.mdx This JSON object demonstrates a successful response when retrieving a tracking link with the 'partner' and 'program' objects expanded. In addition to the link's core details, it includes comprehensive information about the associated partner and the program it belongs to. ```json { "success": true, "data": { "id": "lnk_dK9bzRGn46BhVgNFHD6fDgXW", "param": "ref", "value": "michael_scott", "partner_id": "part_s7mbzRGn46BhVgNFHD6fDgXW", "created_at": "2025-01-15T14:30:00.000Z", "program_id": "prg_YRsbPDAKhWfdqJbFACheh", "organization_id": "org_JE3mfYNL9ci7sFaJazAv2", "partner": { "id": "part_s7mbzRGn46BhVgNFHD6fDgXW", "first_name": "Michael", "last_name": "Scott", "email": "michael.scott@dundermifflin.com", "company_name": "Dunder Mifflin", "status": "active", "created_at": "2025-01-13T10:06:11.251Z" }, "program": { "id": "prg_YRsbPDAKhWfdqJbFACheh", "status": "active", "name": "Tolt's Partnership Program", "product_name": "Tolt", "subdomain": "affiliates", "type": "public", "currency_code": "USD", "created_at": "2024-03-05T10:28:08.984+00:00" } } } ``` -------------------------------- ### Example JSON Response for Expanded Commissions Query Source: https://github.com/toltapp/api-docs/blob/main/api/commissions/list.mdx This JSON object illustrates a response from the commissions API when `expand` parameters are used. In addition to the standard commission fields, it includes nested objects for `partner`, `program`, `customer`, and `transaction`, providing comprehensive details for each associated entity. ```json { "success": true, "has_more": true, "total_count": 45, "data": [ { "id": "comm_eK9bzRGn46BhVgNFHD6fDgXW", "amount": 1999, "customer_id": "cust_dK9bzRGn46BhVgNFHD6fDgXW", "transaction_id": "txn_7mbzRGn46BhVgNFHD6fDgXW", "charge_id": "ch_9bzRGn46BhVgNFHD6fDgXW", "source": "stripe", "status": "pending", "revenue": 9999, "created_at": "2025-01-15T14:30:00.000Z", "program_id": "prg_YRsbPDAKhWfdqJbFACheh", "organization_id": "org_JE3mfYNL9ci7sFaJazAv2", "partner": { "id": "part_s7mbzRGn46BhVgNFHD6fDgXW", "first_name": "Michael", "last_name": "Scott", "email": "michael.scott@dundermifflin.com", "company_name": "Dunder Mifflin", "status": "active", "created_at": "2025-01-13T10:06:11.251Z" }, "program": { "id": "prg_YRsbPDAKhWfdqJbFACheh", "status": "active", "name": "Tolt's Partnership Program", "product_name": "Tolt", "subdomain": "affiliates", "type": "public", "currency_code": "USD", "created_at": "2024-03-05T10:28:08.984+00:00" }, "customer": { "id": "cust_dK9bzRGn46BhVgNFHD6fDgXW", "identifier": "cust_123", "name": "Jim Halpert", "status": "active", "created_at": "2025-01-15T14:30:00.000Z" }, "transaction": { "id": "txn_7mbzRGn46BhVgNFHD6fDgXW", "amount": 9999, "status": "completed", "created_at": "2025-01-15T14:30:00.000Z" } } ] } ``` -------------------------------- ### Example Expanded and Included Customer Response JSON Source: https://github.com/toltapp/api-docs/blob/main/customers/retrieve.mdx This JSON object illustrates a successful API response for a customer request that includes expanded 'partner' and 'program' details, and 'stats' data. This provides a more comprehensive view of the customer's associated entities and metrics directly within the response. ```json { "success": true, "data": { "id": "cust_dK9bzRGn46BhVgNFHD6fDgXW", "email": "customer@email.com", "partner_id": "part_s7mbzRGn46BhVgNFHD6fDgXW", "name": "Jim Halpert", "customer_id": "jim_halpert_789", "created_at": "2025-01-15T14:30:00.000Z", "updated_at": "2025-01-15T15:00:00.000Z", "status": "active", ``` -------------------------------- ### Example JSON Response for Tolt Customer Data Source: https://github.com/toltapp/api-docs/blob/main/api/customers/retrieve.mdx This JSON snippet provides a sample successful response structure for a customer retrieval request from the Tolt API. It illustrates the typical fields returned for a customer object, including identifiers, timestamps, and status. ```json { "success": true, "data": [ { "id": "cust_dK9bzRGn46BhVgNFHD6fDgXW", "identifier": "cust_123", "partner_id": "part_s7mbzRGn46BhVgNFHD6fDgXW", "name": "Jim Halpert", "subscription_id": "sub_456", "customer_id": "jim_halpert_789", "click_id": "click_abc", "created_at": "2025-01-15T14:30:00.000Z", "lead_at": null, "active_at": "2025-01-15T15:00:00.000Z", "status": "active", "program_id": "prg_YRsbPDAKhWfdqJbFACheh", ``` -------------------------------- ### Expanded Commissions API Response Example Source: https://github.com/toltapp/api-docs/blob/main/commissions/list.mdx This JSON snippet demonstrates a commissions response where related objects (`partner`, `program`, `customer`, `transaction`) have been expanded. This provides richer contextual data directly embedded within each commission object, reducing the need for subsequent API calls. ```json { "success": true, "has_more": true, "total_count": 45, "data": [ { "id": "comm_eK9bzRGn46BhVgNFHD6fDgXW", "amount": 1999, "customer_id": "cust_dK9bzRGn46BhVgNFHD6fDgXW", "transaction_id": "txn_7mbzRGn46BhVgNFHD6fDgXW", "charge_id": "ch_9bzRGn46BhVgNFHD6fDgXW", "source": "stripe", "status": "pending", "revenue": 9999, "created_at": "2025-01-15T14:30:00.000Z", "updated_at": "2025-01-15T14:30:00.000Z", "program_id": "prg_YRsbPDAKhWfdqJbFACheh", "organization_id": "org_JE3mfYNL9ci7sFaJazAv2", "partner": { "id": "part_s7mbzRGn46BhVgNFHD6fDgXW", "first_name": "Michael", "last_name": "Scott", "email": "michael.scott@dundermifflin.com", "company_name": "Dunder Mifflin", "status": "active", "created_at": "2025-01-13T10:06:11.251Z" }, "program": { "id": "prg_YRsbPDAKhWfdqJbFACheh", "status": "active", "name": "Tolt's Partnership Program", "product_name": "Tolt", "subdomain": "affiliates", "type": "public", "currency_code": "USD", "created_at": "2024-03-05T10:28:08.984+00:00" }, "customer": { "id": "cust_dK9bzRGn46BhVgNFHD6fDgXW", "email": "cust_123", "name": "Jim Halpert", "status": "active", "created_at": "2025-01-15T14:30:00.000Z" }, "transaction": { "id": "txn_7mbzRGn46BhVgNFHD6fDgXW", "amount": 9999, "status": "completed", "created_at": "2025-01-15T14:30:00.000Z" } } ] } ``` -------------------------------- ### Reinstalling Mintlify Dependencies (Shell) Source: https://github.com/toltapp/api-docs/blob/main/README.md This command is used for troubleshooting when the `mintlify dev` server is not running correctly. It re-installs the necessary dependencies for your Mintlify project, which can resolve issues related to corrupted or missing packages. It's a common first step in debugging local development problems. ```Shell mintlify install ``` -------------------------------- ### Example Basic Customer Response JSON Source: https://github.com/toltapp/api-docs/blob/main/customers/retrieve.mdx This JSON object represents a successful API response containing the basic details of a customer, including their unique ID, email, name, and various timestamps and identifiers. It reflects the data returned by a standard GET request without expansion. ```json { "success": true, "data": { "id": "cust_dK9bzRGn46BhVgNFHD6fDgXW", "email": "customer@email.com", "partner_id": "part_s7mbzRGn46BhVgNFHD6fDgXW", "name": "Jim Halpert", "customer_id": "jim_halpert_789", "created_at": "2025-01-15T14:30:00.000Z", "updated_at": "2025-01-15T15:00:00.000Z", "status": "active", "program_id": "prg_YRsbPDAKhWfdqJbFACheh", "organization_id": "org_JE3mfYNL9ci7sFaJazAv2" } } ``` -------------------------------- ### Tolt API Base URL Source: https://github.com/toltapp/api-docs/blob/main/introduction.mdx Specifies the base URL for all Tolt API requests. All API endpoints should be made to this URL to interact with the Tolt platform. ```bash https://api.tolt.com ``` -------------------------------- ### Example Reward Creation Response Source: https://github.com/toltapp/api-docs/blob/main/api/rewards/create.mdx This JSON object represents a successful response from the Tolt API after creating a reward. It includes the unique ID assigned to the newly created reward and the recorded amount. ```json { "id": "458fa144-298c-9901-t150-5b3cf3913h95", "amount": 100 } ``` -------------------------------- ### Querying Commissions via cURL Source: https://github.com/toltapp/api-docs/blob/main/api/commissions/list.mdx This cURL command performs a GET request to retrieve a list of commissions. It filters the results by a specific `program_id` and requires an `Authorization` header with a Bearer token for authentication. ```bash curl -X GET 'https://api.tolt.com/v1/commissions?program_id=prg_YRsbPDAKhWfdqJbFACheh' \ -H 'Authorization: Bearer ' ``` -------------------------------- ### Tolt API Base URL (Bash) Source: https://github.com/toltapp/api-docs/blob/main/api/introduction.mdx Specifies the base URL for all API requests to the Tolt platform, ensuring all endpoints are accessed from this root. All subsequent API calls should prepend this URL. ```bash https://api.tolt.com ``` -------------------------------- ### Tracking Leads with tolt.js Signup - JavaScript Source: https://github.com/toltapp/api-docs/blob/main/guides/with-toltjs.mdx This JavaScript snippet demonstrates how to convert a visitor into a lead using the `window.tolt.signup` function, typically called after a user completes a signup process. It takes the user's email and returns signup data, including a crucial `customer_id`. ```javascript const result = await window.tolt.signup("user@example.com"); // Returns signup data including customer_id ``` -------------------------------- ### Example JSON Response for Deleted Commission Source: https://github.com/toltapp/api-docs/blob/main/api/commissions/delete.mdx This JSON object represents a successful response from the API after a commission has been deleted. It confirms the operation's success and provides the ID of the deleted commission along with a 'deleted' flag. ```json { "success": true, "data": { "id": "comm_eK9bzRGn46BhVgNFHD6fDgXW", "deleted": true } } ``` -------------------------------- ### Creating Affiliate via cURL - With Promo Code Source: https://github.com/toltapp/api-docs/blob/main/affiliates/create.mdx This cURL command sends a POST request to create a new affiliate, including an associated promo code. It requires an Authorization header with an API ID and a JSON body containing the affiliate's personal details, program ID, URL parameters, payout information, and a `promoCode` object with its details. ```bash curl -X POST 'https://api.tolt.io/private/v1/affiliates' \ -H 'Authorization: ' \ -H 'Content-Type: application/json' \ -d '{ "firstName": "AffName", "lastName": "AFffLName", "email": "somemail@gmail.com", "programId": "8ebb4425-bdca-409c-b345-812a5t4111c", "param": "via", "url": "someurl", "payoutMethod": "wise", "payoutEmail": "somemail@gmail.com", "promoCode": { "active": true, "code": "SOMECODE", "value": 15, "type": "percentage" } }' ``` -------------------------------- ### Querying Transactions with cURL (Basic) Source: https://github.com/toltapp/api-docs/blob/main/transactions/list.mdx This snippet demonstrates how to retrieve a list of transactions using a basic cURL GET request. It filters transactions by a specific `program_id` and requires an API key for authorization. ```bash curl -X GET 'https://api.tolt.com/v1/transactions?program_id=prg_YRsbPDAKhWfdqJbFACheh' \ -H 'Authorization: Bearer ' ``` -------------------------------- ### Signing Up Visitor with Tolt.js - JavaScript Source: https://github.com/toltapp/api-docs/blob/main/javascript/sign-up.mdx This asynchronous JavaScript function attempts to sign up a visitor as a lead using the `window.tolt.signup` method. It first verifies if the visitor originated from an affiliate link (`window.tolt_data` exists) and if they haven't already been signed up (`customer_id` is null). The `identifier` parameter, such as an email or user ID, must be unique for each customer. On success, it logs and returns the result; otherwise, it logs any errors encountered during the signup process. ```javascript async function signUpVisitor(identifier) { // Check if visitor came through affiliate link if (!window.tolt_data) { console.log("Not an affiliate click"); return; } // Check if visitor is already signed up if (window.tolt_data.customer_id) { console.log("Visitor already signed up"); return; } try { const result = await window.tolt.signup(identifier); console.log("Signup successful:", result); return result; } catch (error) { console.error("Signup failed:", error); } } ```