LeadDyno REST API Documentation Explore the comprehensive LeadDyno REST API documentation to seamlessly integrate and manage affiliate tracking. Access detailed guides on endpoints, authentication, data management, and more. ## Sections • [LeadDyno API](https://app.theneo.io/leaddyno/leaddyno-rest-api/leaddyno-api.md): The LeadDyno REST API allows users to track web traffic and effectively manage their affiliate program. • [Authentication](https://app.theneo.io/leaddyno/leaddyno-rest-api/leaddyno-api/authentication.md): Find your API key in your LeadDyno Account - Profile section . If you need to refresh your private key, contact LeadDyno support at support@leaddyno.com for assistance. 2. Add the key as a parameter in the request header or URL query string. CURL curl -X GET "https://api.leaddyno.com/v1/visitors?key=YOUR_PRIVATE_KEY" • [Errors](https://app.theneo.io/leaddyno/leaddyno-rest-api/leaddyno-api/errors.md): LeadDyno uses standard HTTP response codes to indicate the success or failure of an API request. Codes in the 2xx range indicate success, while codes in the 4xx range indicate an error with the information provided (e.g., a required parameter was omitted). Codes in the 5xx range indicate a server error (these are rare). Common HTTP Response Codes: • 200 OK : The request was successful. • 400 Bad Request : The request was unacceptable, often due to missing a required parameter. • 401 Unauthorized : No valid API key provided. • 403 Unauthorized : No valid API key provided. • 404 Not Found : The requested resource doesn’t exist. • 429 Too Many Requests : Too many requests hit the API too quickly. We recommend an exponential backoff of your requests. Title Description • 500 Server Error : Something went wrong on LeadDyno’s end (these are rare). Error Handling Recommendations: • Validate Input : Ensure all required parameters are included and correctly formatted. • Graceful Handling : Handle 400 and 401 errors by checking for missing or invalid parameters, such as an incorrect API key. • Retry on 5xx : For server-side errors, consider retrying the request with exponential backoff to avoid overwhelming the API. • [Affiliates](https://app.theneo.io/leaddyno/leaddyno-rest-api/affiliates.md): The Affiliates section allows users to manage and track affiliate relationships within their program. By utilizing this section, users can view, add, update, an • [Create a new affiliate](https://app.theneo.io/leaddyno/leaddyno-rest-api/affiliates/post-affiliates.md): This section allows users to create a new affiliate within the LeadDyno system. Users can input details such as email, name, custom code, PayPal information, and referral affiliations. • [Retrieve commissions for a specific affiliate filtering by status](https://app.theneo.io/leaddyno/leaddyno-rest-api/affiliates/get-affiliates-id-commissions-total.md): Retrieve all commissions for a specific affiliate filtering by status. • [Retrieve total commissions for a specific affiliate](https://app.theneo.io/leaddyno/leaddyno-rest-api/affiliates/retrieve-total-commissions-for-a-specific-affiliate.md): Retrieve the total commission data (due, pending, paid, and total) in the default currency for a specific affiliate. This section allows users to view a comprehensive overview of an affiliate's commission status at a glance, making it easier to track and manage affiliate earnings effectively. • [Retrieve purchases by affiliate](https://app.theneo.io/leaddyno/leaddyno-rest-api/affiliates/get-affiliates-id-purchases.md): This section allows users to retrieve the purchases associated with a specific affiliate. • [Retrieve leads associated with an affiliate](https://app.theneo.io/leaddyno/leaddyno-rest-api/affiliates/get-affiliates-id-leads.md): This section allows users to retrieve leads associated with a specific affiliate. • [Retrieve an affiliate by ID](https://app.theneo.io/leaddyno/leaddyno-rest-api/affiliates/get-affiliates-id.md): This endpoint retrieves detailed information about a specific affiliate using their unique ID. • [Retrieve an affiliate by Affiliate Code](https://app.theneo.io/leaddyno/leaddyno-rest-api/affiliates/get-affiliates-by-affiliate-code.md): This endpoint retrieves detailed information about a specific affiliate using their affiliate code. • [Retrieve an affiliate by Email](https://app.theneo.io/leaddyno/leaddyno-rest-api/affiliates/get-affiliates-by-email.md): This endpoint retrieves detailed information about a specific affiliate using their affiliate email. • [Retrieve total number of affiliates](https://app.theneo.io/leaddyno/leaddyno-rest-api/affiliates/get-affiliates-count.md): This endpoint allows users to retrieve the total number of affiliates. • [List all affiliates](https://app.theneo.io/leaddyno/leaddyno-rest-api/affiliates/get-affiliates.md): Retrieve a paginated list of all affiliates within your LeadDyno platform. • [Unarchive an affiliate](https://app.theneo.io/leaddyno/leaddyno-rest-api/affiliates/post-affiliates-id-unarchive.md): Unarchive a specific affiliate within LeadDyno. This endpoint allows users to reactivate previously archived affiliates. • [Archive affiliate](https://app.theneo.io/leaddyno/leaddyno-rest-api/affiliates/post-affiliates-id-archive.md): Archives a specific affiliate within LeadDyno. This action moves the affiliate into an inactive state. • [Reject an affiliate](https://app.theneo.io/leaddyno/leaddyno-rest-api/affiliates/post-affiliates-id-reject.md): This section allows users to reject a specific affiliate within LeadDyno. Users can formally decline affiliates from participating in their affiliate program, ensuring proper management of affiliate registrations. • [Approve an affiliate](https://app.theneo.io/leaddyno/leaddyno-rest-api/affiliates/post-affiliates-id-approve.md): This section allows users to approve a specific affiliate within LeadDyno. Users can formally approve affiliates from participating in their affiliate program, ensuring proper management of affiliate registrations. • [Update affiliate information](https://app.theneo.io/leaddyno/leaddyno-rest-api/affiliates/put-affiliates-id.md): This section allows users to update the information of a specific affiliate in LeadDyno. Users can modify fields such as email, first name, last name, affiliate code, PayPal email, and other relevant details associated with the affiliate. • [Generate Affiliate Sign-In link](https://app.theneo.io/leaddyno/leaddyno-rest-api/affiliates/create-a-new-affiliate-copy.md): This section allows users to generate a time-limited sign-in URL for an affiliate. • [Purchases](https://app.theneo.io/leaddyno/leaddyno-rest-api/purchases.md): This section allows users to retrieve detailed information about purchases made through the platform. With this functionality, users can track and manage customer transactions, gain insights into purchase patterns, and analyze sales data for informed decision-making. • [Create a purchase](https://app.theneo.io/leaddyno/leaddyno-rest-api/purchases/post-purchases.md): Creates a new purchase entry in your LeadDyno account. • [Retrieve a purchase by ID](https://app.theneo.io/leaddyno/leaddyno-rest-api/purchases/get-purchases-id.md): Retrieve detailed information about a specific purchase by its unique identifier. Users have the option to include line items (SKUs) for a detailed view of the purchase details. • [Update a purchase](https://app.theneo.io/leaddyno/leaddyno-rest-api/purchases/update-a-purchase.md): This section allows users to update the information of a specific purchase in LeadDyno. Commission recalculation is automatically triggered when the amount, currency, plan_code, affiliate, or line items change. • [Retrieve a purchase by purchase code](https://app.theneo.io/leaddyno/leaddyno-rest-api/purchases/get-purchases-by-purchase-code.md): This section allows users to retrieve detailed information about a purchase using its unique purchase code. By optionally including line items, users can gain a comprehensive view of the items included in the purchase. • [Retrieve purchase commissions](https://app.theneo.io/leaddyno/leaddyno-rest-api/purchases/get-purchases-id-commissions.md): This endpoint allows users to get detailed information about the commissions associated with a specific purchase ID. • [Retrieve total purchase count](https://app.theneo.io/leaddyno/leaddyno-rest-api/purchases/get-purchases-count.md): Retrieve the total number of purchases. • [List all purchases](https://app.theneo.io/leaddyno/leaddyno-rest-api/purchases/get-purchases.md): Returns a paginated list of purchases. • [Cancel a purchase by ID](https://app.theneo.io/leaddyno/leaddyno-rest-api/purchases/delete-purchases-id.md): This section allows users to cancel a specific purchase. • [Cancel a purchase by purchase code or customer email](https://app.theneo.io/leaddyno/leaddyno-rest-api/purchases/delete-purchases.md): This section allows users to cancel a purchase either by providing the customer's email address or the purchase code. This action enables users to efficiently manage and update their purchase records within the system. Additionally, users can include optional parameters, such as a custom cancellation code or an effective date, to further customize the cancellation process. • [Approve a purchase by ID](https://app.theneo.io/leaddyno/leaddyno-rest-api/purchases/approve-a-purchase-by-id.md): Approves a purchase that is currently pending approval, identified by its unique ID. • [Reject a purchase by ID](https://app.theneo.io/leaddyno/leaddyno-rest-api/purchases/reject-a-purchase-by-id.md): Rejects a purchase that is currently pending approval, identified by its unique ID. • [Commissions](https://app.theneo.io/leaddyno/leaddyno-rest-api/commissions.md): This section allows users to retrieve detailed information about the commissions earned through their affiliate marketing program. With this functionality, users can track and manage the financial aspects of their affiliate relationships, providing insight into earnings and performance metrics. • [Create an affiliate commission](https://app.theneo.io/leaddyno/leaddyno-rest-api/commissions/post-affiliates-id-commissions.md): Create a new commission for a specific affiliate. This endpoint allows you to set commission amounts, specify currency codes, add notes or descriptions, and set due dates. • [Retrieve commissions by affiliate ID](https://app.theneo.io/leaddyno/leaddyno-rest-api/commissions/get-affiliates-id-commissions.md): Retrieve commission details associated with a specific affiliate ID. Use this endpoint to access information about the commissions linked to a particular affiliate, helping track earnings and performance within your affiliate network effectively. • [Retrieve commission totals](https://app.theneo.io/leaddyno/leaddyno-rest-api/commissions/get-commissions-totals.md): This section allows users to retrieve the total commission amounts earned within a specified date range. Users can track and analyze their commission totals over time, helping to monitor and assess their overall performance and earnings. • [List all commissions](https://app.theneo.io/leaddyno/leaddyno-rest-api/commissions/get-commissions.md): Retrieve a paginated list of all commissions. • [Mark affiliate commissions as paid](https://app.theneo.io/leaddyno/leaddyno-rest-api/commissions/mark-affiliate-commissions-as-paid.md): Mark commissions for a specific purchase and affiliate as paid. • [Cancel affiliate commissions](https://app.theneo.io/leaddyno/leaddyno-rest-api/commissions/mark-affiliate-commissions-as-paid-copy-1.md): Mark commissions for a specific purchase and affiliate as canceled. • [Leads](https://app.theneo.io/leaddyno/leaddyno-rest-api/leads.md): The Leads section allows users to manage information related to potential leads or customers. Users can retrieve details about leads, update lead informati • [Create a lead](https://app.theneo.io/leaddyno/leaddyno-rest-api/leads/create-a-lead.md): Creates a new Lead in your LeadDyno account. • [Retrieve a lead by ID](https://app.theneo.io/leaddyno/leaddyno-rest-api/leads/retrieve-a-lead-by-id.md): Fetches a lead by their unique ID. • [Retrieve a lead by email](https://app.theneo.io/leaddyno/leaddyno-rest-api/leads/retrieve-a-lead-by-email.md): Fetches a lead using their email address. • [Retrieve total lead count](https://app.theneo.io/leaddyno/leaddyno-rest-api/leads/get-leads-count.md): Retrieves the total number of leads captured within the LeadDyno platform. • [Retrieve purchases for a lead](https://app.theneo.io/leaddyno/leaddyno-rest-api/leads/retrieve-purchases-for-a-lead.md): Retrieve a paginated list of purchases linked to a specific lead. Users can opt to include detailed information about the line items (SKUs) for each purchase. Each page contains up to 100 records. • [List all leads](https://app.theneo.io/leaddyno/leaddyno-rest-api/leads/list-all-leads.md): Returns a paginated list of all leads. Leads are returned in descending order by creation date, with the most recent leads appearing first. Use the page parameter to navigate through the results. Each page contains up to 100 records. • [Update a lead](https://app.theneo.io/leaddyno/leaddyno-rest-api/leads/update-a-lead.md): Updates the details of an existing lead. You can modify the lead’s email, first name, last name, and other relevant information using this endpoint. • [Cancel all purchases for a lead](https://app.theneo.io/leaddyno/leaddyno-rest-api/leads/delete-purchases-for-a-lead.md): Cancel all purchases associated with the given lead. • [Visitors](https://app.theneo.io/leaddyno/leaddyno-rest-api/visitors.md): The Visitors section allows users to manage and retrieve data related to website visitors, whether they were referred by affiliates or arrived organically. Yo • [Create a visitor](https://app.theneo.io/leaddyno/leaddyno-rest-api/visitors/create-a-visitor.md): Creates a new visitor entry in your LeadDyno account. You can manually create visitors using this endpoint and specify details like tracking code, email, and other relevant information. • [Retrieve a visitor by ID](https://app.theneo.io/leaddyno/leaddyno-rest-api/visitors/retrieve-a-visitor-by-id.md): The endpoint (GET /visitors/:id) retrieves detailed information about a specific visitor based on their unique identifier. By requesting this endpoint, users can access valuable data about individual visitors for analysis and tracking purposes within the LeadDyno REST API. • [Retrieve a visitor by tracking code](https://app.theneo.io/leaddyno/leaddyno-rest-api/visitors/retrieve-a-visitor-by-tracking-code.md): The endpoint (GET /visitors/by_tracking_code) r etrieves detailed information about a visitor by specifying their unique tracking code. By using this API section, users can access visitor data associated with a specific tracking code, enabling them to analyze visitor behavior and interactions on their platform. • [Retrieve total visitor count](https://app.theneo.io/leaddyno/leaddyno-rest-api/visitors/retrieve-total-visitor-count.md): This endpoint (GET /visitors/count) allows users to retrieve the total number of visitors tracked by LeadDyno. • [List all visitors](https://app.theneo.io/leaddyno/leaddyno-rest-api/visitors/list-all-visitors.md): Returns a paginated list of visitors. Visitors are returned in descending order by creation date, with the most recent visitors appearing first. Use the page parameter to navigate through the results. Each page contains up to 100 records. • [Campaigns](https://app.theneo.io/leaddyno/leaddyno-rest-api/campaigns.md): The Campaigns section allows users to manage and track their marketing campaigns efficiently. With this functionality, users can create, monitor, and analyze t • [Retrieve Campaign Leads](https://app.theneo.io/leaddyno/leaddyno-rest-api/campaigns/get-campaigns-id-leads.md): This section allows users to retrieve the leads associated with a specific campaign. • [Retrieve Campaign by ID](https://app.theneo.io/leaddyno/leaddyno-rest-api/campaigns/get-campaigns-id.md): Retrieve detailed information about a specific campaign using its unique ID. • [Retrieve total campaign count](https://app.theneo.io/leaddyno/leaddyno-rest-api/campaigns/get-campaigns-count.md): Retrieve the total number of campaigns associated with an account. • [List all campaigns](https://app.theneo.io/leaddyno/leaddyno-rest-api/campaigns/get-campaigns.md): This endpoint allows users to retrieve a paginated list of campaigns. • [Custom Fields](https://app.theneo.io/leaddyno/leaddyno-rest-api/custom_fields.md): This section allows users to define and manage custom fields within the LeadDyno. By utilizing this section, users can customize their data structures and collect specific information tailored to their business needs. This section empowers users to enhance the flexibility and functionality of their LeadDyno integration. • [Create Custom Fields for Affiliates](https://app.theneo.io/leaddyno/leaddyno-rest-api/custom_fields/post-custom-fields.md): This section allows users to create custom fields for affiliates using the LeadDyno REST API. By leveraging this functionality, users can define and manage custom fields, determine if they are required, and associate them with specific affiliate groups, providing greater flexibility and organization within the LeadDyno platform. • [Delete custom fields](https://app.theneo.io/leaddyno/leaddyno-rest-api/custom_fields/delete-custom-fields.md): This endpoint allows users to delete a specific custom field associated with an affiliate group in LeadDyno. • [Retrieve custom fields](https://app.theneo.io/leaddyno/leaddyno-rest-api/custom_fields/get-custom-fields.md): This section allows users to retrieve custom fields. • [Sub IDs](https://app.theneo.io/leaddyno/leaddyno-rest-api/sub-id.md): The Sub IDs section allows users to retrieve detailed information about the affiliate links, Sub IDS. • [Create a Sub ID](https://app.theneo.io/leaddyno/leaddyno-rest-api/sub-id/post-affiliates-id-create-subid.md): This section allows users to create a unique Sub ID for an affiliate, enabling them to track and analyze performance metrics associated with specific URLs and channels. By utilizing this functionality, users can efficiently manage and optimize their affiliate marketing strategies within the LeadDyno REST API. • [Retrieve a Sub ID for a specific affiliate](https://app.theneo.io/leaddyno/leaddyno-rest-api/sub-id/get-affiliates-id-subids-sub-id.md): Retrieve detailed information about a specific Sub ID associated with an affiliate. • [List Sub IDs for an Affiliate](https://app.theneo.io/leaddyno/leaddyno-rest-api/sub-id/get-affiliates-id-subids.md): Retrieve a paginated list of Sub IDs associated with a specific affiliate. • [Archive Affiliate Sub ID](https://app.theneo.io/leaddyno/leaddyno-rest-api/sub-id/delete-affiliates-id-subids-sub-id.md): This endpoint allows users to archive a specific Sub ID associated with an affiliate. • [Highlighted Links](https://app.theneo.io/leaddyno/leaddyno-rest-api/highlighted-links.md): This section allows users to retrieve detailed information about the affiliate highlighted links. • [List Highlighted Links for an Affiliate](https://app.theneo.io/leaddyno/leaddyno-rest-api/highlighted-links/list-sub-ids-for-an-affiliate-copy.md): Retrieve a paginated list of Highlighted Links associated with a specific affiliate.