Customers API Guide: Fetch All Customer, Create, Update, Delete Customers


This section explains how to manage customer data using the EverAccounting API. API calls allow you to perform operations such as retrieving customer details, creating new customers, updating existing records, and deleting customers. All API requests require Authorization via a JWT token.

Base URL

yoursite.com/wp-json/eac/v1/

Get Customer List

Retrieve a list of all customers.

Request

Method: GET

URL: yoursite.com/wp-json/eac/v1/customers/

Headers:

Authorization: Bearer <JWT Token>

Response

{
      "id": 16,
      "name": "Myra Goff",
      "company": "Marquez Wilson Trading",
      "email": "[email protected]",
      "phone": "+1 (735) 973-5995",
      "website": "https://www.zirol.tv",
      "address": null,
      "city": "Voluptates et optio",
      "state": "Adipisci hic quaerat",
      "postcode": "Inventore dolore fug",
      "country": "HN",
      "tax_number": "321",
      "currency": "USD",
      "user_id": null,
      "uuid": null,
      "created_via": "manual",
      "date_updated": false,
      "date_created": "2025-01-09T04:14:10"
  },
  {
      "id": 15,
      "name": "Gisela Doyle",
      "company": "Wynn and Rollins Trading",
      "email": "[email protected]",
      "phone": "+1 (841) 691-4052",
      "website": "https://www.fekunekanomuta.biz",
      "address": null,
      "city": "Ab velit est id dol",
      "state": "Rerum adipisicing co",
      "postcode": "Aut eum labore exerc",
      "country": "CK",
      "tax_number": "580",
      "currency": "EUR",
      "user_id": null,
      "uuid": null,
      "created_via": "manual",
      "date_updated": false,
      "date_created": "2025-01-09T04:14:06"
  }

Get Single Customer by ID

Retrieve details for a specific customer.

Request

Method: GET

URL: yoursite.com/wp-json/eac/v1/customers/:id

Path Parameters

id: The Customer ID (required)

Headers:

Authorization: Bearer <JWT Token>

Response

{
 
    "id": 3,
 
    "name": "John Doe",
 
    "company": "Arj Company LTD",
 
    "email": "[email protected]",
 
    "phone": "",
 
    "website": "",
 
    "address": null,
 
    "city": "Florida",
 
    "state": "Florida",
 
    "postcode": "10001",
 
    "country": "US",
 
    "tax_number": "",
 
    "currency": "USD",
 
    "user_id": null,
 
    "uuid": null,
 
    "created_via": "manual",
 
    "date_updated": false,
 
    "date_created": "2025-01-09T04:10:52"
 
}

Create New Customer

Add a new customer record to the database.

Request

Method: POST

URL: yoursite.com/wp-json/eac/v1/customers/

Headers:

Authorization: Bearer <JWT Token>

Request Body Parameters:

Key Value Description
nameCustomer’s Full NameRequired
companyCompany NameOptional
emailCustomer Email AddressOptional
phoneCustomer Phone NumberOptional
websiteWebsite URLOptional
addressCustomer AddressOptional
cityCityOptional
stateStateOptional
postcodePost CodeOptional
countryCountryOptional
tax_numberTAX-NumberOptional
currencyCurrent CodeRequired

Example Response

{
    "id": 17,
 
    "name": "New Customer",
 
    "company": "Company Name",
 
    "email": "[email protected]",
 
    "phone": "+1 234 567 890",
 
    "website": "https://www.customerwebsite.com",
 
    "address": "123 Street",
 
    "city": "CityName",
 
    "state": "StateName",
 
    "postcode": "12345",
 
    "country": "US",
 
    "tax_number": "123456789",
 
    "currency": "USD",
 
    "user_id": null,
 
    "uuid": null,
 
    "created_via": "manual",
 
    "date_updated": false,
 
    "date_created": "2025-02-11T05:00:00"
}

Update Existing Customer

Modify the information of an existing customer.

Request

Method: POST

URL: yoursite.com/wp-json/eac/v1/customers/

Path Parameters:

id: The Customer ID (required)

Headers:

Authorization: Bearer <JWT Token>

Request Body Parameters:

(Provide any fields you wish to update. All optional fields are allowed for modification.)

Key Value 
nameCustomer’s Full Name
companyCompany Name
emailCustomer Email Address
phoneCustomer Phone Number
websiteWebsite URL
addressCustomer Address
cityCity
stateState
postcodePost Code
countryCountry
tax_numberTAX-Number
currencyCurrent Code

Example Response

{
 
    "id": 3,
 
    "name": "Updated Customer Name",
 
    "company": "Updated Company",
 
    "email": "[email protected]",
 
    "phone": "+1 234 567 890",
 
    "website": "https://www.updatedwebsite.com",
 
    "address": "456 Street",
 
    "city": "Updated City",
 
    "state": "Updated State",
 
    "postcode": "67890",
 
    "country": "US",
 
    "tax_number": "987654321",
 
    "currency": "USD",
 
    "user_id": null,
 
    "uuid": null,
 
    "created_via": "manual",
 
    "date_updated": "2025-02-11T06:00:00",
 
    "date_created": "2025-01-09T04:10:52"
 
}

Delete Customer

Delete a customer from the system.

Request

Method: DELETE

URL: yoursite.com/wp-json/eac/v1/customers/:id

Path Parameters:

id: The Customer ID (required)

Headers:

Authorization: Bearer <JWT Token>

Example Response

{
    "deleted": true,
    "previous": {
        "id": 2,
        "name": "Mr. Maxine Lueilwitz Jr.",
        "company": "Apple INC",
        "email": "[email protected]",
        "phone": "232-593-8909",
        "website": "http://reinger.com/quo-molestias-voluptatem-nisi-eos-dolores-quae",
        "address": null,
        "city": "New York",
        "state": "New York",
        "postcode": "49172-2298",
        "country": "US",
        "tax_number": "8.83576E+11",
        "currency": "USD",
        "uuid": null,
        "date_updated": false,
        "date_created": "2025-01-09T04:08:07"
    }
}

Error Handling

The API returns detailed error messages for failed requests. Common errors include:

  • 400 Bad Request: Missing or invalid parameters.
  • 401 Unauthorized: Invalid or missing JWT token.
  • 404 Not Found: Resource not found.
  • 500 Internal Server Error: An error occurred on the server.

Security & Authentication

All API endpoints require authentication via JWT tokens. To obtain a token, log in to your EverAccounting account and use the JWT Token in your requests.