# Account and Contact Mapping

## Account Creation (createAccountContact function)

### Personal Account (if createPersonAccount = true)

| Limio Source                       | Salesforce Field  | Notes                                                     |
| ---------------------------------- | ----------------- | --------------------------------------------------------- |
| customerDetails.firstName          | FirstName         |                                                           |
| customerDetails.lastName           | LastName          |                                                           |
| customerDetails.email              | PersonEmail       |                                                           |
| customerDetails.phone              | Phone             |                                                           |
| partnerSalesforceAccountId         | ParentId          | If partner org exists                                     |
| accountOptions.recordTypeName      | RecordType.Name   | If configured                                             |
| billingDetails.address1 + address2 | BillingStreet     | Combined, comma-separated if includeBillingDetails = true |
| billingDetails.city                | BillingCity       | If includeBillingDetails = true                           |
| billingDetails.state               | BillingState      | If includeBillingDetails = true                           |
| billingDetails.country             | BillingCountry    | If includeBillingDetails = true                           |
| billingDetails.postalCode          | BillingPostalCode | If includeBillingDetails = true                           |
| Auto-generated from Account        | PersonContactId   | Retrieved after account creation                          |

### Business Account (if createPersonAccount = false)

| Limio Source                                        | Salesforce Field  | Notes                                                                 |
| --------------------------------------------------- | ----------------- | --------------------------------------------------------------------- |
| customerDetails.companyName or firstName + lastName | Name              | Company name preferred if available, fallback to firstName + lastName |
| partnerSalesforceAccountId                          | ParentId          | If partner org exists                                                 |
| accountOptions.recordTypeName                       | RecordType.Name   | If configured                                                         |
| billingDetails.address1 + address2                  | BillingStreet     | Combined, comma-separated if includeBillingDetails = true             |
| billingDetails.city                                 | BillingCity       | If includeBillingDetails = true                                       |
| billingDetails.state                                | BillingState      | If includeBillingDetails = true                                       |
| billingDetails.country                              | BillingCountry    | If includeBillingDetails = true                                       |
| billingDetails.postalCode                           | BillingPostalCode | If includeBillingDetails = true                                       |

{% hint style="info" %}
**Address format:** Limio sends `billingDetails.state` and `billingDetails.country` as the values collected by the checkout form. If your Salesforce org uses **State & Country/Territory Picklists**, ensure the picklist values match what Limio sends (e.g. ISO codes like `US`, `GB`). Mismatches will cause the account creation to fail silently on the address fields.
{% endhint %}

{% hint style="warning" %}
**Enabling address mapping:** Billing address fields are only mapped when `includeBillingDetails` is set to `true` in the Salesforce plugin configuration. If your accounts are being created without addresses, verify this flag is enabled. Contact <support@limio.com> to check your configuration.
{% endhint %}

## Contact Creation (for Business Accounts)

| Limio Source              | Salesforce Field | Notes                |
| ------------------------- | ---------------- | -------------------- |
| accountId                 | AccountId        | Generated account ID |
| customerDetails.firstName | FirstName        |                      |
| customerDetails.lastName  | LastName         |                      |
| customerDetails.email     | Email            |                      |
| customerDetails.phone     | Phone            |                      |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.limio.com/integrations/populating-salesforce-data/limio-updates-salesforce/account-contact-mapping.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
