> ## Documentation Index
> Fetch the complete documentation index at: https://api.smartlead.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Place Order

> Place an order to purchase domains and provision mailboxes through a Smart Senders vendor

<Note>
  **Smart Senders API**: Mailbox marketplace feature. Contact [support@smartlead.ai](mailto:support@smartlead.ai) for access.
</Note>

## Query Parameters

<ParamField query="api_key" type="string" required>
  API key used to authenticate and authorise the request.
</ParamField>

## Body Parameters

<ParamField body="vendor_id" type="integer" required>
  Unique identifier of the vendor with whom the order will be placed.
</ParamField>

<ParamField body="forwarding_domain" type="string" required>
  Domain to which purchased domains will be configured to forward (e.g., `example.com` or customer's tracking domain).
</ParamField>

<ParamField body="user_details" type="object" required>
  Customer billing/contact details required by the vendor for domain purchase and provisioning. Fields include:

  * `email` (string) — Contact email
  * `firstName` (string) — First name
  * `lastName` (string) — Last name
  * `company` (string) — Company name
  * `country` (string) — Country
  * `city` (string) — City
  * `addressLineOne` (string) — Primary address
  * `addressLineTwo` (string) — Secondary address (optional)
  * `postalCode` (string) — Postal/ZIP code
  * `state` (string) — State/province
  * `phoneCc` (string) — Phone country code (e.g., `+91`)
  * `phone` (string) — Phone number
  * `languagePreference` (string) — Language preference (e.g., `en`)
</ParamField>

<ParamField body="domains" type="array" required>
  Array of domain objects. Each object contains:

  * `domain_name` (string) — The domain to purchase
  * `mailbox_details` (array) — Array of mailbox objects, each containing:
    * `mailbox` (string, required) — Full email address for the mailbox
    * `first_name` (string, required) — First name for the mailbox
    * `last_name` (string, required) — Last name for the mailbox
    * `profile_pic` (string) — Profile picture filename
    * `parent_account_id` (number) — ID of the parent email account to link to (optional)
</ParamField>

## Headers

<ParamField header="Content-Type" type="string">
  Must be `application/json`
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://smart-senders.smartlead.ai/api/v1/smart-senders/place-order?api_key=YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "vendor_id": 2,
      "forwarding_domain": "example.com",
      "user_details": {
        "email": "manjit@example.com",
        "firstName": "Manjit",
        "lastName": "Singh",
        "company": "Smartlead",
        "country": "India",
        "city": "Bangalore",
        "addressLineOne": "123 MG Road",
        "addressLineTwo": "",
        "postalCode": "560001",
        "state": "Karnataka",
        "phoneCc": "+91",
        "phone": "9876543210",
        "languagePreference": "en"
      },
      "domains": [
        {
          "domain_name": "example.com",
          "mailbox_details": [
            {
              "mailbox": "manjit.singh@example.com",
              "first_name": "Manjit",
              "last_name": "Singh",
              "profile_pic": "profile1.jpg",
              "parent_account_id": 123
            },
            {
              "mailbox": "singh@example.com",
              "first_name": "Manjit",
              "last_name": "Singh",
              "profile_pic": "profile2.jpg"
            }
          ]
        },
        {
          "domain_name": "testdomain.com",
          "mailbox_details": [
            {
              "mailbox": "john.doe@testdomain.com",
              "first_name": "John",
              "last_name": "Doe",
              "profile_pic": "profile3.jpg"
            }
          ]
        }
      ]
    }'
  ```

  ```python Python theme={null}
  import requests

  API_KEY = "YOUR_API_KEY"

  payload = {
      "vendor_id": 2,
      "forwarding_domain": "example.com",
      "user_details": {
          "email": "manjit@example.com",
          "firstName": "Manjit",
          "lastName": "Singh",
          "company": "Smartlead",
          "country": "India",
          "city": "Bangalore",
          "addressLineOne": "123 MG Road",
          "addressLineTwo": "",
          "postalCode": "560001",
          "state": "Karnataka",
          "phoneCc": "+91",
          "phone": "9876543210",
          "languagePreference": "en"
      },
      "domains": [
          {
              "domain_name": "example.com",
              "mailbox_details": [
                  {
                      "mailbox": "manjit.singh@example.com",
                      "first_name": "Manjit",
                      "last_name": "Singh",
                      "profile_pic": "profile1.jpg",
                      "parent_account_id": 123
                  },
                  {
                      "mailbox": "singh@example.com",
                      "first_name": "Manjit",
                      "last_name": "Singh",
                      "profile_pic": "profile2.jpg"
                  }
              ]
          },
          {
              "domain_name": "testdomain.com",
              "mailbox_details": [
                  {
                      "mailbox": "john.doe@testdomain.com",
                      "first_name": "John",
                      "last_name": "Doe",
                      "profile_pic": "profile3.jpg"
                  }
              ]
          }
      ]
  }

  response = requests.post(
      "https://smart-senders.smartlead.ai/api/v1/smart-senders/place-order",
      params={"api_key": API_KEY},
      json=payload
  )

  result = response.json()
  print(result)
  ```

  ```javascript JavaScript theme={null}
  const API_KEY = 'YOUR_API_KEY';

  const payload = {
    vendor_id: 2,
    forwarding_domain: 'example.com',
    user_details: {
      email: 'manjit@example.com',
      firstName: 'Manjit',
      lastName: 'Singh',
      company: 'Smartlead',
      country: 'India',
      city: 'Bangalore',
      addressLineOne: '123 MG Road',
      addressLineTwo: '',
      postalCode: '560001',
      state: 'Karnataka',
      phoneCc: '+91',
      phone: '9876543210',
      languagePreference: 'en'
    },
    domains: [
      {
        domain_name: 'example.com',
        mailbox_details: [
          {
            mailbox: 'manjit.singh@example.com',
            first_name: 'Manjit',
            last_name: 'Singh',
            profile_pic: 'profile1.jpg',
            parent_account_id: 123
          },
          {
            mailbox: 'singh@example.com',
            first_name: 'Manjit',
            last_name: 'Singh',
            profile_pic: 'profile2.jpg'
          }
        ]
      },
      {
        domain_name: 'testdomain.com',
        mailbox_details: [
          {
            mailbox: 'john.doe@testdomain.com',
            first_name: 'John',
            last_name: 'Doe',
            profile_pic: 'profile3.jpg'
          }
        ]
      }
    ]
  };

  const response = await fetch(
    `https://smart-senders.smartlead.ai/api/v1/smart-senders/place-order?api_key=${API_KEY}`,
    {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify(payload)
    }
  );

  const result = await response.json();
  console.log(result);
  ```
</RequestExample>

## Response Codes

<ResponseField name="200" type="Success">
  Order placed successfully. Returns order confirmation details.
</ResponseField>

<ResponseField name="400" type="Bad Request">
  Invalid request parameters or malformed request body
</ResponseField>

<ResponseField name="401" type="Unauthorized">
  Invalid or missing API key. Check your authentication.
</ResponseField>

<ResponseField name="500" type="Internal Server Error">
  Server error occurred. Please try again or contact support if the issue persists.
</ResponseField>

<ResponseExample>
  ```json 200 - Success theme={null}
  {
    "ok": true,
    "data": []
  }
  ```

  ```json 401 - Unauthorized theme={null}
  {
    "message": "Invalid API Key"
  }
  ```
</ResponseExample>
