Customers

Customers are at the core of any financial service. This page provides details on how to manage customer records programmatically using various endpoints. We'll look at how to query, create, update, and delete customer records.

The customer model

The customer model contains all the information related to a customer, including their personal details, contact information, and account status.

Properties

  • Name
    id
    Type
    string
    Description

    Unique identifier for the customer record.

  • Name
    first_name
    Type
    string
    Description

    First name of the customer.

  • Name
    last_name
    Type
    string
    Description

    Last name of the customer.

  • Name
    email
    Type
    string
    Description

    Email address of the customer.

  • Name
    phone_number
    Type
    string
    Description

    Phone number of the customer.

  • Name
    address
    Type
    object
    Description

    Address of the customer.

  • Name
    status
    Type
    string
    Description

    Status of the customer account (e.g., active, inactive).

  • Name
    created_at
    Type
    timestamp
    Description

    Timestamp of when the customer record was created.

  • Name
    updated_at
    Type
    timestamp
    Description

    Timestamp of when the customer record was last updated.


GET/v1/customers

List all customers

This endpoint allows you to retrieve a paginated list of all your customer records. By default, a maximum of ten records are shown per page.

Optional attributes

  • Name
    limit
    Type
    integer
    Description

    Limit the number of customer records returned.

  • Name
    status
    Type
    string
    Description

    Only show records with the specified status.

Request

GET
/v1/customers
curl -G https://api.finx.ai/v1/customers \
  -H "Authorization: Bearer {token}" \
  -d limit=10

Response

{
  "has_more": false,
  "data": [
    {
      "id": "xgQQXg3hrtjh7AvZ",
      "first_name": "John",
      "last_name": "Doe",
      "email": "john.doe@example.com",
      "phone_number": "+1234567890",
      "address": {
        "street": "123 Main St",
        "city": "Anytown",
        "state": "CA",
        "zip_code": "12345"
      },
      "status": "active",
      "created_at": 705103200,
      "updated_at": 705103200
    },
    {
      "id": "hSIhXBhNe8X1d8Et"
      // ...
    }
  ]
}

POST/v1/customers

Create a customer

This endpoint allows you to add a new customer record. You need to provide the customer's personal details, contact information, and account status to create a customer record.

Required attributes

  • Name
    first_name
    Type
    string
    Description

    First name of the customer.

  • Name
    last_name
    Type
    string
    Description

    Last name of the customer.

  • Name
    email
    Type
    string
    Description

    Email address of the customer.

  • Name
    phone_number
    Type
    string
    Description

    Phone number of the customer.

  • Name
    address
    Type
    object
    Description

    Address of the customer.

  • Name
    status
    Type
    string
    Description

    Status of the customer account (e.g., active, inactive).

Request

POST
/v1/customers'
curl https://api.finx.ai/v1/customers \
  -H "Authorization: Bearer {token}" \
  -d 'first_name'="John" \
  -d 'last_name'="Doe" \
  -d 'email'="john.doe@example.com" \
  -d 'phone_number'="+1234567890" \
  -d 'address'='{"street": "123 Main St", "city": "Anytown", "state": "CA", "zip_code": "12345"}' \
  -d 'status'="active"

Response

{
  "id": "xgQQXg3hrtjh7AvZ",
  "first_name": "John",
  "last_name": "Doe",
  "email": "john.doe@example.com",
  "phone_number": "+1234567890",
  "address": {
    "street": "123 Main St",
    "city": "Anytown",
    "state": "CA",
    "zip_code": "12345"
  },
  "status": "active",
  "created_at": 705103200,
  "updated_at": 705103200
}

GET/v1/customers/:id

Retrieve a customer

This endpoint allows you to retrieve a customer record by providing the record id. Refer to the list at the top of this page to see which properties are included with customer objects.

Request

GET
/v1/customers/xgQQXg3hrtjh7AvZ
curl https://api.finx.ai/v1/customers/xgQQXg3hrtjh7AvZ \
  -H "Authorization: Bearer {token}"

Response

{
  "id": "xgQQXg3hrtjh7AvZ",
  "first_name": "John",
  "last_name": "Doe",
  "

email": "john.doe@example.com",
  "phone_number": "+1234567890",
  "address": {
    "street": "123 Main St",
    "city": "Anytown",
    "state": "CA",
    "zip_code": "12345"
  },
  "status": "active",
  "created_at": 705103200,
  "updated_at": 705103200
}

PUT/v1/customers/:id

Update a customer

This endpoint allows you to perform an update on a customer record. Examples of updates are changing the contact information, updating the address, or modifying the account status.

Optional attributes

  • Name
    first_name
    Type
    string
    Description

    Updated first name of the customer.

  • Name
    last_name
    Type
    string
    Description

    Updated last name of the customer.

  • Name
    email
    Type
    string
    Description

    Updated email address of the customer.

  • Name
    phone_number
    Type
    string
    Description

    Updated phone number of the customer.

  • Name
    address
    Type
    object
    Description

    Updated address of the customer.

  • Name
    status
    Type
    string
    Description

    Updated status of the customer account.

Request

PUT
/v1/customers/xgQQXg3hrtjh7AvZ
curl -X PUT https://api.finx.ai/v1/customers/xgQQXg3hrtjh7AvZ \
  -H "Authorization: Bearer {token}" \
  -d 'status'="inactive"

Response

{
  "id": "xgQQXg3hrtjh7AvZ",
  "first_name": "John",
  "last_name": "Doe",
  "email": "john.doe@example.com",
  "phone_number": "+1234567890",
  "address": {
    "street": "123 Main St",
    "city": "Anytown",
    "state": "CA",
    "zip_code": "12345"
  },
  "status": "inactive",
  "created_at": 705103200,
  "updated_at": 705103200
}

DELETE/v1/customers/:id

Delete a customer

This endpoint allows you to delete your customer records in Fin X. Note: This will permanently delete the record and all its data — ensure this is the desired action before proceeding.

Request

DELETE
/v1/customers/xgQQXg3hrtjh7AvZ
curl -X DELETE https://api.finx.ai/v1/customers/xgQQXg3hrtjh7AvZ \
  -H "Authorization: Bearer {token}"

Was this page helpful?