(accounting->departments)
- create - Create Department
- list - List Departments
- delete - Delete Department
- get - Get Department
- update - Update Department
Create Department
declare(strict_types=1);
require 'vendor/autoload.php';
use Apideck\Unify;
use Apideck\Unify\Models\Components;
use Apideck\Unify\Models\Operations;
$sdk = Unify\Apideck::builder()
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->setConsumerId('test-consumer')
->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
->build();
$request = new Operations\AccountingDepartmentsAddRequest(
accountingDepartment: new Components\AccountingDepartmentInput(
status: Components\DepartmentStatus::Active,
subsidiaries: [
new Components\SubsidiaryReferenceInput(
name: 'SpaceX',
),
],
passThrough: [
new Components\PassThroughBody(
serviceId: '<id>',
extendPaths: [
new Components\ExtendPaths(
path: '$.nested.property',
value: [
'TaxClassificationRef' => [
'value' => 'EUC-99990201-V1-00020000',
],
],
),
],
),
],
parentId: '12345',
name: 'Sales',
rowVersion: '1-12345',
),
serviceId: 'salesforce',
);
$response = $sdk->accounting->departments->create(
request: $request
);
if ($response->createAccountingDepartmentResponse !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\AccountingDepartmentsAddRequest | ✔️ | The request object to use for the request. |
?Operations\AccountingDepartmentsAddResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\BadRequestResponse | 400 | application/json |
Errors\UnauthorizedResponse | 401 | application/json |
Errors\PaymentRequiredResponse | 402 | application/json |
Errors\NotFoundResponse | 404 | application/json |
Errors\UnprocessableResponse | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |
List Departments
declare(strict_types=1);
require 'vendor/autoload.php';
use Apideck\Unify;
use Apideck\Unify\Models\Components;
use Apideck\Unify\Models\Operations;
$sdk = Unify\Apideck::builder()
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->setConsumerId('test-consumer')
->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
->build();
$request = new Operations\AccountingDepartmentsAllRequest(
serviceId: 'salesforce',
filter: new Components\AccountingDepartmentsFilter(
subsidiary: '1',
),
fields: 'id,updated_at',
);
$responses = $sdk->accounting->departments->list(
request: $request
);
foreach ($responses as $response) {
if ($response->httpMeta->response->getStatusCode() === 200) {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\AccountingDepartmentsAllRequest | ✔️ | The request object to use for the request. |
?Operations\AccountingDepartmentsAllResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\BadRequestResponse | 400 | application/json |
Errors\UnauthorizedResponse | 401 | application/json |
Errors\PaymentRequiredResponse | 402 | application/json |
Errors\NotFoundResponse | 404 | application/json |
Errors\UnprocessableResponse | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |
Delete Department
declare(strict_types=1);
require 'vendor/autoload.php';
use Apideck\Unify;
use Apideck\Unify\Models\Operations;
$sdk = Unify\Apideck::builder()
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->setConsumerId('test-consumer')
->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
->build();
$request = new Operations\AccountingDepartmentsDeleteRequest(
id: '<id>',
serviceId: 'salesforce',
);
$response = $sdk->accounting->departments->delete(
request: $request
);
if ($response->deleteAccountingDepartmentResponse !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\AccountingDepartmentsDeleteRequest | ✔️ | The request object to use for the request. |
?Operations\AccountingDepartmentsDeleteResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\BadRequestResponse | 400 | application/json |
Errors\UnauthorizedResponse | 401 | application/json |
Errors\PaymentRequiredResponse | 402 | application/json |
Errors\NotFoundResponse | 404 | application/json |
Errors\UnprocessableResponse | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |
Get Department
declare(strict_types=1);
require 'vendor/autoload.php';
use Apideck\Unify;
use Apideck\Unify\Models\Operations;
$sdk = Unify\Apideck::builder()
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->setConsumerId('test-consumer')
->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
->build();
$request = new Operations\AccountingDepartmentsOneRequest(
id: '<id>',
serviceId: 'salesforce',
fields: 'id,updated_at',
);
$response = $sdk->accounting->departments->get(
request: $request
);
if ($response->getAccountingDepartmentResponse !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\AccountingDepartmentsOneRequest | ✔️ | The request object to use for the request. |
?Operations\AccountingDepartmentsOneResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\BadRequestResponse | 400 | application/json |
Errors\UnauthorizedResponse | 401 | application/json |
Errors\PaymentRequiredResponse | 402 | application/json |
Errors\NotFoundResponse | 404 | application/json |
Errors\UnprocessableResponse | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |
Update Department
declare(strict_types=1);
require 'vendor/autoload.php';
use Apideck\Unify;
use Apideck\Unify\Models\Components;
use Apideck\Unify\Models\Operations;
$sdk = Unify\Apideck::builder()
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->setConsumerId('test-consumer')
->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
->build();
$request = new Operations\AccountingDepartmentsUpdateRequest(
id: '<id>',
accountingDepartment: new Components\AccountingDepartmentInput(
status: Components\DepartmentStatus::Active,
subsidiaries: [
new Components\SubsidiaryReferenceInput(
name: 'SpaceX',
),
],
passThrough: [
new Components\PassThroughBody(
serviceId: '<id>',
extendPaths: [
new Components\ExtendPaths(
path: '$.nested.property',
value: [
'TaxClassificationRef' => [
'value' => 'EUC-99990201-V1-00020000',
],
],
),
],
),
],
parentId: '12345',
name: 'Sales',
rowVersion: '1-12345',
),
serviceId: 'salesforce',
);
$response = $sdk->accounting->departments->update(
request: $request
);
if ($response->updateAccountingDepartmentResponse !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\AccountingDepartmentsUpdateRequest | ✔️ | The request object to use for the request. |
?Operations\AccountingDepartmentsUpdateResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\BadRequestResponse | 400 | application/json |
Errors\UnauthorizedResponse | 401 | application/json |
Errors\PaymentRequiredResponse | 402 | application/json |
Errors\NotFoundResponse | 404 | application/json |
Errors\UnprocessableResponse | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |