(accounting->profitAndLoss)
- get - Get Profit and Loss
Get Profit and Loss
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\AccountingProfitAndLossOneRequest(
serviceId: 'salesforce',
filter: new Components\ProfitAndLossFilter(
customerId: '123abc',
startDate: '2021-01-01',
endDate: '2021-12-31',
),
passThrough: [
'search' => 'San Francisco',
],
fields: 'id,updated_at',
);
$response = $sdk->accounting->profitAndLoss->get(
request: $request
);
if ($response->getProfitAndLossResponse !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\AccountingProfitAndLossOneRequest | ✔️ | The request object to use for the request. |
?Operations\AccountingProfitAndLossOneResponse
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 | */* |