Easy-Acumatica Docs

Leads Service

The `LeadsService` provides a straightforward way to create new Lead records through the contract-based API. While the Acumatica endpoint for creating a lead is the same as for a general contact, this service provides a clear, dedicated interface for this specific task.

Importing Helpers

To create a new lead, you must import the `LeadBuilder` to construct the request payload.

python

from easy_acumatica.models.lead_builder import LeadBuilder

Service Method

create_lead(api_version, builder, options=None)

Use this method to create a new lead record. You must provide a `LeadBuilder` object containing the new lead's details. The endpoint often only requires basic contact information like first name, last name, and email.

python

# Build the lead payload using the fluent builder
lead_payload = (
    LeadBuilder()
    .first_name("Brent")
    .last_name("Edds")
    .email("brent.edds.test@example.com")
)

# Use the service to create the lead
new_lead = client.leads.create_lead(
    "24.200.001",
    builder=lead_payload
)

# The response will contain the full lead/contact record
print(f"Successfully created lead with NoteID: {new_lead['NoteID']['value']}")
Easy-Acumatica v0.3.9 — Created and Developed by Matthew Hirstius (Nioron07).
Significant Contributions made by Chris Xu
Want to see the NPM version? See it here