Contract expense templates

An expense template defines the schedule to recognize an expense amount for a contract or contract line over the contract term. You can create any number of expense templates and reuse them across contracts.

List Contract expense templates

get/objects/contracts/expense-template

Returns up to 100 object references from the collection with a key, ID, and link for each contract expense template. This operation is mostly for use in testing; use query to find objects that meet certain criteria and to specify properties that are returned.

SecurityOAuth2
Responses
200

OK

400

Bad Request

Request samples
/**
 * Requires libcurl
 */

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <YOUR_TOKEN_HERE>"
  ],
  CURLOPT_PORT => "",
  CURLOPT_URL => "https://api.intacct.com/ia/api/v1/objects/contracts/expense-template",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "GET",
]);

$response = curl_exec($curl);
$error = curl_error($curl);

curl_close($curl);

if ($error) {
  echo "cURL Error #:" . $error;
} else {
  echo $response;
}
Response samples
application/json
{
  • "ia::result": [
    • {
      • "key": "2",
      • "id": "EXPSTRAIGHTLINE_AUTO",
      • "href": "/objects/contracts/expense-template/2"
      }
    ],
  • "ia::meta": {
    • "totalCount": 1,
    • "start": 1,
    • "pageSize": 100,
    • "next": null,
    • "previous": null
    }
}

Create a contract expense template

post/objects/contracts/expense-template

Creates a new contract expense template.

SecurityOAuth2
Request
Request Body schema: application/json
required

Contract expense template to create

id
required
string

Contract Expense Template ID

Example: "EXPSTRAIGHTLINE_MAN"
description
string

Description

Example: "Expense straight line manual"
amortizationSchedulePeriod
string
Default: "monthly"

Amortization Schedule Period

Enum: "annually" "monthly" "quarterly" "semiAnnually"
Example: "annually"
amortizationMethod
string
Default: "straightLine"

Amortization method

Enum: "dailyRate" "predefinedPercentages" "straightLine"
Example: "straightLine"
defaultPostingType
string
Default: "manual"

Default Posting type

Enum: "automatic" "manual"
Example: "manual"
Array of objects

Contract expense template entries

Array
periodOffset
string

Number of months offset

Example: "2"
percentToRecognize
string <decimal-precision-8>

Percentage to recognize

Example: "10.12312000"
object
status
string
Default: "active"

Object status. Active objects are fully functional. Inactive objects are essentially hidden and cannot be used or referenced.

Enum: "active" "inactive"
Example: "active"
status
string
Default: "active"

Object status. Active objects are fully functional. Inactive objects are essentially hidden and cannot be used or referenced.

Enum: "active" "inactive"
Example: "active"
Responses
201

Created

400

Bad Request

Request samples
/**
 * Requires libcurl
 */

$curl = curl_init();

$payload = array(
  "id" => "EXPSTRAIGHTLINE_MAN1",
  "description" => "Cont Expenses straighline Amortization  Monthly Manual",
  "defaultPostingType" => "manual",
  "amortizationSchedulePeriod" => "monthly",
  "postingDay" => 2,
  "amortizationMethod" => "straightLine"
);

curl_setopt_array($curl, [
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <YOUR_TOKEN_HERE>",
    "Content-Type: application/json"
  ],
  CURLOPT_POSTFIELDS => json_encode($payload),
  CURLOPT_PORT => "",
  CURLOPT_URL => "https://api.intacct.com/ia/api/v1/objects/contracts/expense-template",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "POST",
]);

$response = curl_exec($curl);
$error = curl_error($curl);

curl_close($curl);

if ($error) {
  echo "cURL Error #:" . $error;
} else {
  echo $response;
}
Response samples
application/json
{
  • "ia::result": {
    • "key": "26",
    • "id": "EXPSTRAIGHTLINE_MAN1",
    • "href": "/objects/contracts/expense-template/26"
    },
  • "ia::meta": {
    • "totalCount": 1
    }
}

Get a contract expense template

get/objects/contracts/expense-template/{key}

Returns detailed information for a specified contract expense template.

SecurityOAuth2
Request
path Parameters
key
required
string

System-assigned key for the contract expense template.

Example: 87
Responses
200

OK

400

Bad Request

Request samples
/**
 * Requires libcurl
 */

const key = "YOUR_key_PARAMETER";
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <YOUR_TOKEN_HERE>"
  ],
  CURLOPT_PORT => "",
  CURLOPT_URL => "https://api.intacct.com/ia/api/v1/objects/contracts/expense-template/" . key,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "GET",
]);

$response = curl_exec($curl);
$error = curl_error($curl);

curl_close($curl);

if ($error) {
  echo "cURL Error #:" . $error;
} else {
  echo $response;
}
Response samples
application/json
{
  • "ia::result": {
    • "key": "1",
    • "id": "EXPSTRAIGHTLINE_MAN",
    • "description": "Cont Expenses straighline Amortization Monthly Manual",
    • "defaultPostingType": "manual",
    • "amortizationSchedulePeriod": "monthly",
    • "postingDay": 1,
    • "amortizationMethod": "straightLine",
    • "status": "active",
    • "audit": {
      • "modifiedDateTime": "2016-05-13T18:22:57Z",
      • "createdDateTime": "2016-05-13T18:22:57Z",
      • "createdBy": "1",
      • "modifiedBy": "1"
      },
    • "lines": [ ],
    • "href": "/objects/contracts/expense-template/1"
    },
  • "ia::meta": {
    • "totalCount": 1,
    • "totalSuccess": 1,
    • "totalError": 0
    }
}

Update a contract expense template

patch/objects/contracts/expense-template/{key}

Updates an existing contract expense template by setting field values. Any fields not provided remain unchanged.

SecurityOAuth2
Request
path Parameters
key
required
string

System-assigned key for the contract expense template.

Example: 87
Request Body schema: application/json
description
string

Description

Example: "Expense straight line manual"
amortizationSchedulePeriod
string
Default: "monthly"

Amortization Schedule Period

Enum: "annually" "monthly" "quarterly" "semiAnnually"
Example: "annually"
amortizationMethod
string
Default: "straightLine"

Amortization method

Enum: "dailyRate" "predefinedPercentages" "straightLine"
Example: "straightLine"
defaultPostingType
string
Default: "manual"

Default Posting type

Enum: "automatic" "manual"
Example: "manual"
Array of objects

Contract expense template entries

Array
periodOffset
string

Number of months offset

Example: "2"
percentToRecognize
string <decimal-precision-8>

Percentage to recognize

Example: "10.12312000"
object
status
string
Default: "active"

Object status. Active objects are fully functional. Inactive objects are essentially hidden and cannot be used or referenced.

Enum: "active" "inactive"
Example: "active"
status
string
Default: "active"

Object status. Active objects are fully functional. Inactive objects are essentially hidden and cannot be used or referenced.

Enum: "active" "inactive"
Example: "active"
Responses
200

OK

400

Bad Request

Request samples
/**
 * Requires libcurl
 */

const key = "YOUR_key_PARAMETER";
$curl = curl_init();

$payload = array(
  "description" => "Cont Expenses straighline Amortization  Monthly Manual",
  "defaultPostingType" => "manual",
  "amortizationSchedulePeriod" => "monthly",
  "postingDay" => 3,
  "amortizationMethod" => "straightLine"
);

curl_setopt_array($curl, [
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <YOUR_TOKEN_HERE>",
    "Content-Type: application/json"
  ],
  CURLOPT_POSTFIELDS => json_encode($payload),
  CURLOPT_PORT => "",
  CURLOPT_URL => "https://api.intacct.com/ia/api/v1/objects/contracts/expense-template/" . key,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "PATCH",
]);

$response = curl_exec($curl);
$error = curl_error($curl);

curl_close($curl);

if ($error) {
  echo "cURL Error #:" . $error;
} else {
  echo $response;
}
Response samples
application/json
{
  • "ia::result": {
    • "key": "27",
    • "id": "EXPSTRAIGHTLINE_1",
    • "href": "/objects/contracts/expense-template/27"
    },
  • "ia::meta": {
    • "totalCount": 1,
    • "totalSuccess": 1,
    • "totalError": 0
    }
}

Delete a contract expense template

delete/objects/contracts/expense-template/{key}

Deletes a contract expense template.

SecurityOAuth2
Request
path Parameters
key
required
string

System-assigned key for the contract expense template.

Example: 87
Responses
204

No Content

400

Bad Request

Request samples
/**
 * Requires libcurl
 */

const key = "YOUR_key_PARAMETER";
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <YOUR_TOKEN_HERE>"
  ],
  CURLOPT_PORT => "",
  CURLOPT_URL => "https://api.intacct.com/ia/api/v1/objects/contracts/expense-template/" . key,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "DELETE",
]);

$response = curl_exec($curl);
$error = curl_error($curl);

curl_close($curl);

if ($error) {
  echo "cURL Error #:" . $error;
} else {
  echo $response;
}
Response samples
application/json
{
  • "ia::result": {
    • "ia::error": {
      • "code": "invalidRequest",
      • "message": "A POST request requires a payload",
      • "errorId": "REST-1028",
      • "additionalInfo": {
        },
      • "supportId": "Kxi78%7EZuyXBDEGVHD2UmO1phYXDQAAAAo"
      }
    },
  • "ia::meta": {
    • "totalCount": 1,
    • "totalSuccess": 0,
    • "totalError": 1
    }
}

Query expense templates

post/services/core/query

Use the query service to find expense templates that meet certain criteria and to specify the properties that are returned.

SecurityOAuth2
Responses
200

OK

400

Bad Request

Request samples
/**
 * Requires libcurl
 */

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <YOUR_TOKEN_HERE>"
  ],
  CURLOPT_PORT => "",
  CURLOPT_URL => "https://api.intacct.com/ia/api/v1/services/core/query",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "POST",
]);

$response = curl_exec($curl);
$error = curl_error($curl);

curl_close($curl);

if ($error) {
  echo "cURL Error #:" . $error;
} else {
  echo $response;
}
Response samples
application/json
{
  • "ia::result": {
    • "ia::error": {
      • "code": "invalidRequest",
      • "message": "A POST request requires a payload",
      • "errorId": "REST-1028",
      • "additionalInfo": {
        },
      • "supportId": "Kxi78%7EZuyXBDEGVHD2UmO1phYXDQAAAAo"
      }
    },
  • "ia::meta": {
    • "totalCount": 1,
    • "totalSuccess": 0,
    • "totalError": 1
    }
}

Feedback