Accounts

Accounts

Retrieve and manage account records.

FieldData TypePOSTPATCH
AccountStringXX
IsActiveBooleanXX
DescriptionStringXX
CreatedByString
DateCreatedDateTime
EditedByString
DateEditedDateTime

Key: Account

Required property: Account

Endpoints

GET

URL: https://{site}.mvpplant.com/ODataApi/v1/Accounts

Description: Retrieve account records.

POST

URL: https://{site}.mvpplant.com/ODataApi/v1/Accounts

Description: Create an account record.

Body: Send the property values marked in the POST column.

PATCH

URL: https://{site}.mvpplant.com/ODataApi/v1/Accounts('Account')

Description: Update an existing account record.

Body: Send only the property values you want to update from the PATCH column.

Example Requests

GET all accounts

curl -X GET "https://{site}.mvpplant.com/ODataApi/v1/Accounts" \
  -H "API_KEY: your_api_key"

POST create an account

curl -X POST "https://{site}.mvpplant.com/ODataApi/v1/Accounts" \
  -H "Content-Type: application/json" \
  -H "API_KEY: your_api_key" \
  -d '{
    "Account": "1000",
    "Description": "Main Expense Account",
    "IsActive": true
  }'

PATCH update an account

curl -X PATCH "https://{site}.mvpplant.com/ODataApi/v1/Accounts" \
  -H "Content-Type: application/json" \
  -H "API_KEY: your_api_key" \
  -d '{
    "Account": "1000",
    "Description": "Updated Account Description",
    "IsActive": true
  }'

Example Responses

GET success response

{
  "value": [
    {
      "Account": "1000",
      "Description": "Main Expense Account",
      "IsActive": true,
      "CreatedBy": "admin",
      "DateCreated": "2024-01-15T10:30:00Z",
      "EditedBy": "admin",
      "DateEdited": "2024-01-15T10:30:00Z"
    }
  ]
}

POST or PATCH success response

{
  "success": true
}

OData Query Examples

  • Select specific fields:
    https://{site}.mvpplant.com/ODataApi/v1/Accounts?$select=Account,Description

  • Filter active accounts:
    https://{site}.mvpplant.com/ODataApi/v1/Accounts?$filter=IsActive eq true

  • Sort by account:
    https://{site}.mvpplant.com/ODataApi/v1/Accounts?$orderby=Account

  • Return the first 10 records:
    https://{site}.mvpplant.com/ODataApi/v1/Accounts?$top=10

Notes

  • CreatedBy, DateCreated, EditedBy, and DateEdited are system-generated fields.
  • For PATCH requests, send only the fields you want to update.
  • Include the key field Account when updating an existing record.

Common Errors

  • 400 Bad Request — Check that the request body includes valid field names and data types.
  • 401 Unauthorized — Check that your API_KEY header is present and valid.
  • 404 Not Found — Check that the requested account exists.