(accounting->taxRates)
- create - Create Tax Rate
- list - List Tax Rates
- delete - Delete Tax Rate
- get - Get Tax Rate
- update - Update Tax Rate
Create Tax Rate
declare(strict_types=1);
require 'vendor/autoload.php';
use Apideck\Unify;
use Apideck\Unify\Models\Components;
use Apideck\Unify\Models\Operations;
$security = '<YOUR_BEARER_TOKEN_HERE>';
$sdk = Unify\Apideck::builder()
->setConsumerId('test-consumer')
->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
->setSecurity($security)->build();
$request = new Operations\AccountingTaxRatesAddRequest(
taxRate: new Components\TaxRateInput(
name: 'GST on Purchases',
passThrough: [
new Components\PassThroughBody(
serviceId: '<id>',
extendPaths: [
new Components\ExtendPaths(
path: '$.nested.property',
value: [
'TaxClassificationRef' => [
'value' => 'EUC-99990201-V1-00020000',
],
],
),
],
),
],
customFields: [
new Components\CustomField(
id: '2389328923893298',
name: 'employee_level',
description: 'Employee Level',
value: true,
),
],
id: '1234',
code: 'ABN',
description: 'Reduced rate GST Purchases',
effectiveTaxRate: 10,
totalTaxRate: 10,
taxPayableAccountId: '123456',
taxRemittedAccountId: '123456',
components: [
new Components\Components(
name: 'GST',
id: '10',
rate: 10,
compound: true,
),
],
type: 'NONE',
reportTaxType: 'NONE',
originalTaxRateId: '12345',
status: Components\TaxRateStatus::Active,
rowVersion: '1-12345',
),
serviceId: 'salesforce',
);
$response = $sdk->accounting->taxRates->create(
request: $request
);
if ($response->createTaxRateResponse !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\AccountingTaxRatesAddRequest | ✔️ | The request object to use for the request. |
?Operations\AccountingTaxRatesAddResponse
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 Tax Rates. Note: Not all connectors return the actual rate/percentage value. In this case, only the tax code or reference is returned. Connectors Affected: Quickbooks
declare(strict_types=1);
require 'vendor/autoload.php';
use Apideck\Unify;
use Apideck\Unify\Models\Components;
use Apideck\Unify\Models\Operations;
$security = '<YOUR_BEARER_TOKEN_HERE>';
$sdk = Unify\Apideck::builder()
->setConsumerId('test-consumer')
->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
->setSecurity($security)->build();
$request = new Operations\AccountingTaxRatesAllRequest(
serviceId: 'salesforce',
filter: new Components\TaxRatesFilter(
assets: true,
equity: true,
expenses: true,
liabilities: true,
revenue: true,
),
passThrough: [
'search' => 'San Francisco',
],
fields: 'id,updated_at',
);
$responses = $sdk->accounting->taxRates->list(
request: $request
);
foreach ($responses as $response) {
if ($response->httpMeta->response->getStatusCode() === 200) {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\AccountingTaxRatesAllRequest | ✔️ | The request object to use for the request. |
?Operations\AccountingTaxRatesAllResponse
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 Tax Rate
declare(strict_types=1);
require 'vendor/autoload.php';
use Apideck\Unify;
use Apideck\Unify\Models\Operations;
$security = '<YOUR_BEARER_TOKEN_HERE>';
$sdk = Unify\Apideck::builder()
->setConsumerId('test-consumer')
->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
->setSecurity($security)->build();
$request = new Operations\AccountingTaxRatesDeleteRequest(
id: '<id>',
serviceId: 'salesforce',
);
$response = $sdk->accounting->taxRates->delete(
request: $request
);
if ($response->deleteTaxRateResponse !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\AccountingTaxRatesDeleteRequest | ✔️ | The request object to use for the request. |
?Operations\AccountingTaxRatesDeleteResponse
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 Tax Rate. Note: Not all connectors return the actual rate/percentage value. In this case, only the tax code or reference is returned. Support will soon be added to return the actual rate/percentage by doing additional calls in the background to provide the full view of a given tax rate. Connectors Affected: Quickbooks
declare(strict_types=1);
require 'vendor/autoload.php';
use Apideck\Unify;
use Apideck\Unify\Models\Operations;
$security = '<YOUR_BEARER_TOKEN_HERE>';
$sdk = Unify\Apideck::builder()
->setConsumerId('test-consumer')
->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
->setSecurity($security)->build();
$request = new Operations\AccountingTaxRatesOneRequest(
id: '<id>',
serviceId: 'salesforce',
fields: 'id,updated_at',
);
$response = $sdk->accounting->taxRates->get(
request: $request
);
if ($response->getTaxRateResponse !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\AccountingTaxRatesOneRequest | ✔️ | The request object to use for the request. |
?Operations\AccountingTaxRatesOneResponse
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 Tax Rate
declare(strict_types=1);
require 'vendor/autoload.php';
use Apideck\Unify;
use Apideck\Unify\Models\Components;
use Apideck\Unify\Models\Operations;
$security = '<YOUR_BEARER_TOKEN_HERE>';
$sdk = Unify\Apideck::builder()
->setConsumerId('test-consumer')
->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
->setSecurity($security)->build();
$request = new Operations\AccountingTaxRatesUpdateRequest(
id: '<id>',
taxRate: new Components\TaxRateInput(
name: 'GST on Purchases',
passThrough: [
new Components\PassThroughBody(
serviceId: '<id>',
extendPaths: [
new Components\ExtendPaths(
path: '$.nested.property',
value: [
'TaxClassificationRef' => [
'value' => 'EUC-99990201-V1-00020000',
],
],
),
],
),
],
customFields: [
new Components\CustomField(
id: '2389328923893298',
name: 'employee_level',
description: 'Employee Level',
value: [
new Components\Six(),
],
),
],
id: '1234',
code: 'ABN',
description: 'Reduced rate GST Purchases',
effectiveTaxRate: 10,
totalTaxRate: 10,
taxPayableAccountId: '123456',
taxRemittedAccountId: '123456',
components: [
new Components\Components(
name: 'GST',
id: '10',
rate: 10,
compound: true,
),
],
type: 'NONE',
reportTaxType: 'NONE',
originalTaxRateId: '12345',
status: Components\TaxRateStatus::Active,
rowVersion: '1-12345',
),
serviceId: 'salesforce',
);
$response = $sdk->accounting->taxRates->update(
request: $request
);
if ($response->updateTaxRateResponse !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\AccountingTaxRatesUpdateRequest | ✔️ | The request object to use for the request. |
?Operations\AccountingTaxRatesUpdateResponse
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 | */* |