Clients

Clients are the individuals or organizations that your company does business with. The clients API allows you to manage your client records.

List Clients

Retrieves a paginated list of clients for your company. Supports sorting and searching.

Required attributes

The authentication token must be provided in the header.

Optional attributes

  • Name
    page
    Type
    integer
    Description

    Page number for pagination.

  • Name
    limit
    Type
    integer
    Description

    Number of clients per page.

  • Name
    sort
    Type
    string
    Description

    Field to sort by (e.g., name, createdAt).

  • Name
    order
    Type
    string
    Description

    Sort order (asc or desc).

  • Name
    q
    Type
    string
    Description

    Search term to filter clients by name or email.

Request

curl -X GET "https://your-summit-instance.com/api/clients?page=1&limit=5&sort=name&order=desc" \
     -H "Authorization: Bearer <YOUR_API_TOKEN>"

Response

{
  "data": [
    {
      "id": 1,
      "companyId": 1,
      "name": "Client Alpha",
      "email": "[email protected]",
      "phone": "555-0101",
      "address": "123 Alpha St, Alphaville",
      "paymentTerms": 30,
      "createdAt": "2023-10-01T10:00:00.000Z",
      "updatedAt": "2023-10-01T10:00:00.000Z",
      "softDelete": false
    }
  ],
  "meta": {
    "total": 1,
    "page": 1,
    "limit": 5,
    "pageCount": 1
  }
}

Create Client

Creates a new client for your company.

Required attributes

  • Name
    name
    Type
    string
    Description

    Name of the client.

Optional attributes

  • Name
    email
    Type
    string
    Description

    Email address of the client. Must be unique within the company if provided.

  • Name
    phone
    Type
    string
    Description

    Phone number of the client.

  • Name
    address
    Type
    string
    Description

    Address of the client.

  • Name
    paymentTerms
    Type
    integer
    Description

    Payment terms in days (e.g., 30 for Net 30).

Error Responses

  • 409 Conflict: If a client with the same email already exists for the company.

Request

curl -X POST "https://your-summit-instance.com/api/clients" \
     -H "Authorization: Bearer <YOUR_API_TOKEN>" \
     -H "Content-Type: application/json" \
     -d '{
       "name": "New Client Beta",
       "email": "[email protected]",
       "phone": "555-0102",
       "address": "456 Beta Rd, Betatown",
       "paymentTerms": 15
     }'

Response

{
  "id": 2,
  "companyId": 1,
  "name": "New Client Beta",
  "email": "[email protected]",
  "phone": "555-0102",
  "address": "456 Beta Rd, Betatown",
  "paymentTerms": 15,
  "createdAt": "2023-10-27T10:00:00.000Z",
  "updatedAt": "2023-10-27T10:00:00.000Z",
  "softDelete": false
}

Get Client Details

Retrieves the details of a specific client.

Required attributes

  • Name
    clientId
    Type
    integer
    Description

    ID of the client to retrieve.

Request

curl -X GET "https://your-summit-instance.com/api/clients/2" \
     -H "Authorization: Bearer <YOUR_API_TOKEN>"

Response

{
  "id": 2,
  "companyId": 1,
  "name": "New Client Beta",
  "email": "[email protected]",
  "phone": "555-0102",
  "address": "456 Beta Rd, Betatown",
  "paymentTerms": 15,
  "createdAt": "2023-10-27T10:00:00.000Z",
  "updatedAt": "2023-10-27T10:00:00.000Z",
  "softDelete": false
}

Update Client

Updates the details of an existing client.

Required attributes

  • Name
    clientId
    Type
    integer
    Description

    ID of the client to update.

Optional attributes (Request Body)

The request body is application/json. Fields are the same as for Create Client, and all are optional for an update. For example, you can update just the name and paymentTerms:

Request

curl -X PUT "https://your-summit-instance.com/api/clients/2" \
     -H "Authorization: Bearer <YOUR_API_TOKEN>" \
     -H "Content-Type: application/json" \
     -d '{
       "name": "Updated Client Beta",
       "paymentTerms": 45
     }'

Response

{
  "id": 2,
  "companyId": 1,
  "name": "Updated Client Beta",
  "email": "[email protected]",
  "phone": "555-0102",
  "address": "456 Beta Rd, Betatown",
  "paymentTerms": 45,
  "createdAt": "2023-10-27T10:00:00.000Z",
  "updatedAt": "2023-10-27T11:00:00.000Z",
  "softDelete": false
}

Delete Client

Soft deletes a client. The client record is not permanently removed but marked as deleted.

Required attributes

  • Name
    clientId
    Type
    integer
    Description

    ID of the client to delete.

Request

curl -X DELETE "https://your-summit-instance.com/api/clients/2" \
     -H "Authorization: Bearer <YOUR_API_TOKEN>"

Response

{
  "id": 2,
  "companyId": 1,
  "name": "Updated Client Beta",
  "email": "[email protected]",
  "phone": "555-0102",
  "address": "456 Beta Rd, Betatown",
  "paymentTerms": 45,
  "createdAt": "2023-10-27T10:00:00.000Z",
  "updatedAt": "2023-10-27T12:00:00.000Z",
  "softDelete": true
}

Was this page helpful?