Customers

About the Customer API

The EverTransit Customer API allows you to create a new customer, list customers from a given email, and retrieve the details of a particular customer by its ID. To make your requests, you can use the endpoints and their methods listed below.

Endpoints

The Customer object

{
   "id": "5f886c22fe5dd800318f8092",
   "firstName": "John",
   "lastName": "Doe",
   "email": "john@example.com",
   "phoneNumber": "+19545556666",
   "createdTime": "2022-08-18T01:10:16.000Z",
}

Attributes

NameTypeDescription

firstName

string

The first name of the customer.

lastName

string

The last name of the customer.

email

string

The email of the customer.

id

string

A unique identifier for the customer.

phoneNumber

string

The phone number of the customer.

createdTime

string

The date and time the customer was created in ISO format.

hits

array

Information about the ride that matches the search criteria. For example, the ID, passengers, status, destination, service level, rider, driver, etc.

totalHits

number

The number of matching criteria from the search result.

Create a customer

Create a customer.

Create a customer.

POSThttps://endpoints.evertransit.com/v2beta/customers
Body

The data to create the customer.

email*string (email)

The email of the customer.

Example: "jhon@mail.com"
firstName*string

The first name of the customer.

Example: "John"
lastName*string

The last name of the customer.

Example: "Doe"
phoneNumber*string

The phone number of the customer.

Example: "+123456789"
Response

The customer was created successfully.

Body
idstring

A unique identifier for the customer.

Example: "5f886c22fe5dd800318f809j"
emailstring (email)

The email of the customer.

Example: "john@mail.com"
firstNamestring

The first name of the customer.

Example: "John"
lastNamestring

The last name of the customer.

Example: "Doe"
phoneNumberstring

The phone number of the customer.

Example: "+123456789"
createdTimestring (date-time)

The date and time the customer was created in ISO format.

Example: "2022-08-16T22:06:24.024Z"
Request
const response = await fetch('https://endpoints.evertransit.com/v2beta/customers', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "email": "jhon@mail.com",
      "firstName": "John",
      "lastName": "Doe",
      "phoneNumber": "+123456789"
    }),
});
const data = await response.json();
Response
{
  "id": "5f886c22fe5dd800318f809j",
  "email": "john@mail.com",
  "firstName": "John",
  "lastName": "Doe",
  "phoneNumber": "+123456789",
  "createdTime": "2022-08-16T22:06:24.024Z"
}

API playground for creating a customer

List customers

List customers.

Retrieves a list of customers that matches the criteria.

GEThttps://endpoints.evertransit.com/v2beta/customers
Query parameters
Response

Results that match the criteria.

Body
hitsarray of Customer (object)

An array of objects with the information about the customer that matches the criteria.

totalHitsinteger

The number of matching criteria from the result.

Example: 1
Request
const response = await fetch('https://endpoints.evertransit.com/v2beta/customers', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
{
  "hits": [
    {
      "id": "5f886c22fe5dd800318f809j",
      "email": "john@mail.com",
      "firstName": "John",
      "lastName": "Doe",
      "phoneNumber": "+123456789",
      "createdTime": "2022-08-16T22:06:24.024Z"
    }
  ],
  "totalHits": 1
}

API playground for listing customers

Retrieve a customer

Retrieve a customer.

Retrieve a customer by its ID.

GEThttps://endpoints.evertransit.com/v2beta/customers/{customerId}
Path parameters
customerId*string

A unique identifier for the customer.

Example: "507f191e810c19729de860jk"
Response

The customer was retrieved successfully.

Body
idstring

A unique identifier for the customer.

Example: "5f886c22fe5dd800318f809j"
emailstring (email)

The email of the customer.

Example: "john@mail.com"
firstNamestring

The first name of the customer.

Example: "John"
lastNamestring

The last name of the customer.

Example: "Doe"
phoneNumberstring

The phone number of the customer.

Example: "+123456789"
createdTimestring (date-time)

The date and time the customer was created in ISO format.

Example: "2022-08-16T22:06:24.024Z"
Request
const response = await fetch('https://endpoints.evertransit.com/v2beta/customers/{customerId}', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
{
  "id": "5f886c22fe5dd800318f809j",
  "email": "john@mail.com",
  "firstName": "John",
  "lastName": "Doe",
  "phoneNumber": "+123456789",
  "createdTime": "2022-08-16T22:06:24.024Z"
}

API playground for retrieving a customer

Last updated