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

# Buyers

# Overview

The Buyer object represents a customer that pays money to your organization.

***

# Methods

<Tabs>
  <Tab title="Create">
    <Card icon="square-plus" iconType="solid" color="#86B74B">
      **`POST`  /buyer**<br />
      Create a new buyer under your enterprise.
    </Card>

    ## Body Parameters

    <ParamField body="first_name" type="string">
      Legal first name from your records.
    </ParamField>

    <ParamField body="last_name" type="string">
      Legal last name from your records.
    </ParamField>

    <ParamField body="external_id" type="string">
      Optional user identifier from your system. If set, Manifest will enforce uniqueness, e.g. attempts to create a second buyer for the same user will fail.

      This should be a stable value like a User ID, not something that might change like an email address or phone number. This value should not contain any sensitive information.
    </ParamField>

    <ParamField body="email" type="string">
      Email address from your records.
    </ParamField>

    <ParamField body="payment_instrument_id" type="string">
      ID of the payment instrument to associate with the buyer, if you have one. Primary usage is migrating existing customers to Manifest.
    </ParamField>

    <ParamField body="user_data" type="object">
      User defined data that can be attached to the object. See the [User Data](/reference/user-data)
      page for details.
    </ParamField>

    ## Example

    <CodeGroup>
      ```json Request theme={null}
      // POST /buyer
      {
          "first_name": "Paul",
          "last_name": "McCartney",
          "email": "paul@thebeatles.com",
      }
      ```

      ```json Response theme={null}
      {
          "id": "buy_XXXXX",
          "first_name": "Paul",
          "last_name": "McCartney",
          "email": "paul@thebeatles.com",
          "user_data": {},
          "created_at": "2024-01-26T21:18:16.704Z",
          "updated_at": "2024-01-26T21:18:16.704Z"
      }
      ```
    </CodeGroup>
  </Tab>

  <Tab title="Get">
    <Card icon="square-arrow-right" iconType="solid" color="#425BE0">
      **`GET`  /buyer/:id**<br />
      Retrieve a buyer by its ID.
    </Card>

    ## Path Parameters

    <ParamField path="id" type="string" required="true">
      The ID of the buyer to retrieve.
    </ParamField>

    ## Example

    <CodeGroup>
      ```json Response theme={null}
      {
          "id": "buy_XXXXX",
          "external_id": "AB789",
          "first_name": "Paul",
          "last_name": "McCartney",
          "email": "paul@thebeatles.com",
          "user_data": {},
          "created_at": "2024-01-26T21:18:16.704Z",
          "updated_at": "2024-01-26T21:18:16.704Z"
      }
      ```
    </CodeGroup>
  </Tab>

  <Tab title="Get by External ID">
    <Card icon="square-arrow-right" iconType="solid" color="#425BE0">
      **`GET`  /buyer/external/:external\_id**<br />
      Get details of one of your enterprise's buyers by your own user identifier. (Must set `external_id` during buyer creation to use this method.)
    </Card>

    ## Path Parameters

    <ParamField path="external_id" type="string" required="true">
      User identifier from your system.
    </ParamField>

    ## Example

    <CodeGroup>
      ```json Response theme={null}
      {
          "id": "buy_XXXXX",
          "external_id": "AB789",
          "first_name": "Paul",
          "last_name": "McCartney",
          "email": "paul@thebeatles.com",
          "user_data": {},
          "created_at": "2024-01-26T21:18:16.704Z",
          "updated_at": "2024-01-26T21:18:16.704Z"
      }
      ```
    </CodeGroup>
  </Tab>

  <Tab title="Update">
    <Card icon="square-pen" iconType="solid" color="#F1E067">
      **`PUT`  /account-connection/:id**<br />
      Update data associated with one of your enterprise's connections.
    </Card>

    ## Path Parameters

    <ParamField path="id" type="string" required="true">
      The ID of the buyer to update.
    </ParamField>

    ## Body Parameters

    <ParamField body="first_name" type="string">
      Legal first name from your records.
    </ParamField>

    <ParamField body="last_name" type="string">
      Legal last name from your records.
    </ParamField>

    <ParamField body="email" type="string">
      Email address from your records.
    </ParamField>

    <ParamField body="user_data" type="object">
      User defined data that can be attached to the object. See the [User Data](/reference/user-data)
      page for details.
    </ParamField>

    ## Example

    <CodeGroup>
      ```json Request theme={null}
      // PUT /account-connection/acon_XXXXX
      {
          "first_name": "Linda",
          "email": "linda@gmail.com"
      }
      ```

      ```json Response theme={null}
      {
          "id": "buy_XXXXX",
          "external_id": "AB789",
          "first_name": "Linda",
          "last_name": "McCartney",
          "email": "linda@gmail.com",
          "user_data": {},
          "created_at": "2024-01-26T21:18:16.704Z",
          "updated_at": "2024-01-26T21:18:16.704Z"
      }
      ```
    </CodeGroup>
  </Tab>

  <Tab title="List">
    <Card icon="square-list" iconType="solid" color="#BDE1CD">
      **`GET`  /buyer**<br />
      List all buyers associated with your enterprise.
    </Card>

    ## Query Parameters

    <ParamField query="page" type="integer">
      The page number to return. Default is 1.
    </ParamField>

    <ParamField query="page_size" type="integer">
      The number of items to return per page. Default is 10.
    </ParamField>

    ## Example

    <CodeGroup>
      ```json Response theme={null}
      {
          "data": [
                {
                    "id": "buy_XXXXX",
                    "first_name": "Paul",
                    "last_name": "McCartney",
                    "email": "paul@thebeatles.com",
                    "user_data": {},
                    "created_at": "2024-01-26T21:18:16.704Z",
                    "updated_at": "2024-01-26T21:18:16.704Z"
                },
                {
                    "id": "buy_YYYYY",
                    "first_name": "John",
                    "last_name": "Lennon",
                    "email": "john@thebeatles.com",
                    "user_data": {},
                    "created_at": "2024-01-26T21:18:16.704Z",
                    "updated_at": "2024-01-26T21:18:16.704Z"
                },
                {
                    "id": "buy_ZZZZZ",
                    "first_name": "George",
                    "last_name": "Harrison",
                    "email": "george@thebeatles.com",
                    "user_data": {},
                    "created_at": "2024-01-26T21:18:16.704Z",
                    "updated_at": "2024-01-26T21:18:16.704Z"
                },
          ],
          "pagination": {
              "page": 1,
              "page_size": 10,
              "total": 3
          }
      }
      ```
    </CodeGroup>
  </Tab>
</Tabs>

***

# Properties

<ParamField path="id" type="string">
  Identifier for this buyer.
</ParamField>

<ParamField body="first_name" type="string">
  Legal first name from your records.
</ParamField>

<ParamField body="last_name" type="string">
  Legal last name from your records.
</ParamField>

<ParamField body="external_id" type="string">
  Optional user identifier from your system. If set, Manifest will enforce uniqueness, e.g. attempts to create a second buyer for the same user will fail.

  This should be a stable value like a User ID, not something that might change like an email address or phone number. This value should not contain any sensitive information.
</ParamField>

<ParamField body="email" type="string">
  Email address from your records.
</ParamField>

<ParamField body="user_data" type="object">
  User defined data that can be attached to the object. See the [User Data](/reference/user-data) page for details.
</ParamField>

<ParamField body="payment_method_embed_url" type="string (read-only)">
  Embeddable form that allows your buyers to securely manage their payment method. You should not store this URL, as it may change over time. See [Payment Methods](/platform/payment-methods) for details.
</ParamField>

<ResponseField name="card" type="object">
  The buyer's stored payment card details. If null, the buyer has no stored card.

  <Expandable title="Object">
    <ResponseField name="last_four" type="string">
      Last 4 digits of the card
    </ResponseField>

    <ResponseField name="brand" type="string">
      Card brand key (e.g. `VISA`, `MASTERCARD`, `AMERICAN_EXPRESS`, `DISCOVER`)
    </ResponseField>

    <ResponseField name="expiration_month" type="integer">
      Card expiration month  (1-12)
    </ResponseField>

    <ResponseField name="expiration_year" type="integer">
      Card expiration year
    </ResponseField>
  </Expandable>
</ResponseField>
