- list - List Invoice Items
- create - Create Invoice Item
- get - Get Invoice Item
- update - Update Invoice Item
- delete - Delete Invoice Item
List Invoice Items
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()
->setConsumerId('test-consumer')
->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$request = new Operations\AccountingInvoiceItemsAllRequest(
serviceId: 'salesforce',
filter: new Components\InvoiceItemsFilter(
name: 'Widgets Large',
type: Components\InvoiceItemType::Service,
),
sort: new Components\InvoiceItemsSort(
by: Components\InvoiceItemsSortBy::UpdatedAt,
direction: Components\SortDirection::Desc,
),
passThrough: [
'search' => 'San Francisco',
],
fields: 'id,updated_at',
);
$responses = $sdk->accounting->invoiceItems->list(
request: $request
);
foreach ($responses as $response) {
if ($response->httpMeta->response->getStatusCode() === 200) {
// handle response
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
$request |
Operations\AccountingInvoiceItemsAllRequest | ✔️ | The request object to use for the request. |
?Operations\AccountingInvoiceItemsAllResponse
| 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 | */* |
Create Invoice Item
declare(strict_types=1);
require 'vendor/autoload.php';
use Apideck\Unify;
use Apideck\Unify\Models\Components;
use Apideck\Unify\Models\Operations;
use Brick\DateTime\LocalDate;
$sdk = Unify\Apideck::builder()
->setConsumerId('test-consumer')
->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$request = new Operations\AccountingInvoiceItemsAddRequest(
serviceId: 'salesforce',
invoiceItem: new Components\InvoiceItemInput(
name: 'Model Y',
description: 'Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.',
code: '120-C',
sold: true,
purchased: true,
tracked: true,
taxable: true,
inventoryDate: LocalDate::parse('2020-10-30'),
type: Components\InvoiceItemTypeType::Inventory,
salesDetails: new Components\InvoiceItemSalesDetails(
unitPrice: 27500.5,
unitOfMeasure: 'pc.',
taxInclusive: true,
taxRate: new Components\LinkedTaxRateInput(
id: '123456',
rate: 10,
),
),
purchaseDetails: new Components\InvoiceItemPurchaseDetails(
unitPrice: 27500.5,
unitOfMeasure: 'pc.',
taxInclusive: true,
taxRate: new Components\LinkedTaxRateInput(
id: '123456',
rate: 10,
),
),
quantity: 1,
unitPrice: 27500.5,
assetAccount: new Components\LinkedLedgerAccount(
id: '123456',
nominalCode: 'N091',
code: '453',
),
incomeAccount: new Components\LinkedLedgerAccount(
id: '123456',
nominalCode: 'N091',
code: '453',
),
expenseAccount: new Components\LinkedLedgerAccount(
id: '123456',
nominalCode: 'N091',
code: '453',
),
trackingCategories: null,
active: true,
departmentId: '12345',
locationId: '12345',
subsidiaryId: '12345',
taxScheduleId: '123456',
rowVersion: '1-12345',
passThrough: [
new Components\PassThroughBody(
serviceId: '<id>',
extendPaths: [
new Components\ExtendPaths(
path: '$.nested.property',
value: [
'TaxClassificationRef' => [
'value' => 'EUC-99990201-V1-00020000',
],
],
),
new Components\ExtendPaths(
path: '$.nested.property',
value: [
'TaxClassificationRef' => [
'value' => 'EUC-99990201-V1-00020000',
],
],
),
],
),
],
),
);
$response = $sdk->accounting->invoiceItems->create(
request: $request
);
if ($response->createInvoiceItemResponse !== null) {
// handle response
}| Parameter | Type | Required | Description |
|---|---|---|---|
$request |
Operations\AccountingInvoiceItemsAddRequest | ✔️ | The request object to use for the request. |
?Operations\AccountingInvoiceItemsAddResponse
| 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 Invoice Item
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()
->setConsumerId('test-consumer')
->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$request = new Operations\AccountingInvoiceItemsOneRequest(
id: '<id>',
serviceId: 'salesforce',
fields: 'id,updated_at',
filter: new Components\InvoiceItemFilter(
type: Components\InvoiceItemFilterInvoiceItemType::Service,
),
);
$response = $sdk->accounting->invoiceItems->get(
request: $request
);
if ($response->getInvoiceItemResponse !== null) {
// handle response
}| Parameter | Type | Required | Description |
|---|---|---|---|
$request |
Operations\AccountingInvoiceItemsOneRequest | ✔️ | The request object to use for the request. |
?Operations\AccountingInvoiceItemsOneResponse
| 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 Invoice Item
declare(strict_types=1);
require 'vendor/autoload.php';
use Apideck\Unify;
use Apideck\Unify\Models\Components;
use Apideck\Unify\Models\Operations;
use Brick\DateTime\LocalDate;
$sdk = Unify\Apideck::builder()
->setConsumerId('test-consumer')
->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$request = new Operations\AccountingInvoiceItemsUpdateRequest(
id: '<id>',
serviceId: 'salesforce',
invoiceItem: new Components\InvoiceItemInput(
name: 'Model Y',
description: 'Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.',
code: '120-C',
sold: true,
purchased: true,
tracked: true,
taxable: true,
inventoryDate: LocalDate::parse('2020-10-30'),
type: Components\InvoiceItemTypeType::Inventory,
salesDetails: new Components\InvoiceItemSalesDetails(
unitPrice: 27500.5,
unitOfMeasure: 'pc.',
taxInclusive: true,
taxRate: new Components\LinkedTaxRateInput(
id: '123456',
rate: 10,
),
),
purchaseDetails: new Components\InvoiceItemPurchaseDetails(
unitPrice: 27500.5,
unitOfMeasure: 'pc.',
taxInclusive: true,
taxRate: new Components\LinkedTaxRateInput(
id: '123456',
rate: 10,
),
),
quantity: 1,
unitPrice: 27500.5,
assetAccount: new Components\LinkedLedgerAccount(
id: '123456',
nominalCode: 'N091',
code: '453',
),
incomeAccount: null,
expenseAccount: new Components\LinkedLedgerAccount(
id: '123456',
nominalCode: 'N091',
code: '453',
),
trackingCategories: [
new Components\LinkedTrackingCategory(
id: '123456',
name: 'New York',
),
new Components\LinkedTrackingCategory(
id: '123456',
name: 'New York',
),
],
active: true,
departmentId: '12345',
locationId: '12345',
subsidiaryId: '12345',
taxScheduleId: '123456',
rowVersion: '1-12345',
passThrough: [
new Components\PassThroughBody(
serviceId: '<id>',
extendPaths: [
new Components\ExtendPaths(
path: '$.nested.property',
value: [
'TaxClassificationRef' => [
'value' => 'EUC-99990201-V1-00020000',
],
],
),
],
),
new Components\PassThroughBody(
serviceId: '<id>',
extendPaths: [
new Components\ExtendPaths(
path: '$.nested.property',
value: [
'TaxClassificationRef' => [
'value' => 'EUC-99990201-V1-00020000',
],
],
),
],
),
],
),
);
$response = $sdk->accounting->invoiceItems->update(
request: $request
);
if ($response->updateInvoiceItemsResponse !== null) {
// handle response
}| Parameter | Type | Required | Description |
|---|---|---|---|
$request |
Operations\AccountingInvoiceItemsUpdateRequest | ✔️ | The request object to use for the request. |
?Operations\AccountingInvoiceItemsUpdateResponse
| 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 Invoice Item
declare(strict_types=1);
require 'vendor/autoload.php';
use Apideck\Unify;
use Apideck\Unify\Models\Operations;
$sdk = Unify\Apideck::builder()
->setConsumerId('test-consumer')
->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$request = new Operations\AccountingInvoiceItemsDeleteRequest(
id: '<id>',
serviceId: 'salesforce',
);
$response = $sdk->accounting->invoiceItems->delete(
request: $request
);
if ($response->deleteTaxRateResponse !== null) {
// handle response
}| Parameter | Type | Required | Description |
|---|---|---|---|
$request |
Operations\AccountingInvoiceItemsDeleteRequest | ✔️ | The request object to use for the request. |
?Operations\AccountingInvoiceItemsDeleteResponse
| 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 | */* |