Skip to content

Latest commit

 

History

History
753 lines (584 loc) · 49.7 KB

File metadata and controls

753 lines (584 loc) · 49.7 KB

Accounting

Overview

Available Operations

listCompanies

List Companies

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;
use StackOne\client\Utils;

$sdk = client\StackOne::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$request = new Operations\AccountingListCompaniesRequest(
    xAccountId: '<id>',
    fields: 'id,remote_id,name,base_currency,fiscal_year_start_month,fiscal_year_start_day,unified_custom_fields',
    filter: new Operations\AccountingListCompaniesQueryParamFilter(
        updatedAfter: Utils\Utils::parseDateTime('2020-01-01T00:00:00.000Z'),
    ),
    prefer: 'heartbeat',
);

$responses = $sdk->accounting->listCompanies(
    request: $request
);


foreach ($responses as $response) {
    if ($response->statusCode === 200) {
        // handle response
    }
}

Parameters

Parameter Type Required Description
$request Operations\AccountingListCompaniesRequest ✔️ The request object to use for the request.

Response

?Operations\AccountingListCompaniesResponse

Errors

Error Type Status Code Content Type
Errors\BadRequestResponse 400 application/json
Errors\UnauthorizedResponse 401 application/json
Errors\ForbiddenResponse 403 application/json
Errors\NotFoundResponse 404 application/json
Errors\RequestTimedOutResponse 408 application/json
Errors\ConflictResponse 409 application/json
Errors\PreconditionFailedResponse 412 application/json
Errors\UnprocessableEntityResponse 422 application/json
Errors\TooManyRequestsResponse 429 application/json
Errors\InternalServerErrorResponse 500 application/json
Errors\NotImplementedResponse 501 application/json
Errors\BadGatewayResponse 502 application/json
Errors\SDKException 4XX, 5XX */*

getCompany

Get Company

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;

$sdk = client\StackOne::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$request = new Operations\AccountingGetCompanyRequest(
    xAccountId: '<id>',
    id: '<id>',
    fields: 'id,remote_id,name,base_currency,fiscal_year_start_month,fiscal_year_start_day,unified_custom_fields',
    prefer: 'heartbeat',
);

$response = $sdk->accounting->getCompany(
    request: $request
);

if ($response->accountingCompanyResult !== null) {
    // handle response
}

Parameters

Parameter Type Required Description
$request Operations\AccountingGetCompanyRequest ✔️ The request object to use for the request.

Response

?Operations\AccountingGetCompanyResponse

Errors

Error Type Status Code Content Type
Errors\BadRequestResponse 400 application/json
Errors\UnauthorizedResponse 401 application/json
Errors\ForbiddenResponse 403 application/json
Errors\NotFoundResponse 404 application/json
Errors\RequestTimedOutResponse 408 application/json
Errors\ConflictResponse 409 application/json
Errors\PreconditionFailedResponse 412 application/json
Errors\UnprocessableEntityResponse 422 application/json
Errors\TooManyRequestsResponse 429 application/json
Errors\InternalServerErrorResponse 500 application/json
Errors\NotImplementedResponse 501 application/json
Errors\BadGatewayResponse 502 application/json
Errors\SDKException 4XX, 5XX */*

listCompanyAccounts

List Accounts

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;

$sdk = client\StackOne::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$request = new Operations\AccountingListCompanyAccountsRequest(
    xAccountId: '<id>',
    id: '<id>',
    fields: 'id,remote_id,company_id,remote_company_id,code,name,type,active,unified_custom_fields',
    filter: null,
    prefer: 'heartbeat',
);

$responses = $sdk->accounting->listCompanyAccounts(
    request: $request
);


foreach ($responses as $response) {
    if ($response->statusCode === 200) {
        // handle response
    }
}

Parameters

Parameter Type Required Description
$request Operations\AccountingListCompanyAccountsRequest ✔️ The request object to use for the request.

Response

?Operations\AccountingListCompanyAccountsResponse

Errors

Error Type Status Code Content Type
Errors\BadRequestResponse 400 application/json
Errors\UnauthorizedResponse 401 application/json
Errors\ForbiddenResponse 403 application/json
Errors\NotFoundResponse 404 application/json
Errors\RequestTimedOutResponse 408 application/json
Errors\ConflictResponse 409 application/json
Errors\PreconditionFailedResponse 412 application/json
Errors\UnprocessableEntityResponse 422 application/json
Errors\TooManyRequestsResponse 429 application/json
Errors\InternalServerErrorResponse 500 application/json
Errors\NotImplementedResponse 501 application/json
Errors\BadGatewayResponse 502 application/json
Errors\SDKException 4XX, 5XX */*

getCompanyAccount

Get Account

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;

$sdk = client\StackOne::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$request = new Operations\AccountingGetCompanyAccountRequest(
    xAccountId: '<id>',
    id: '<id>',
    subResourceId: '<id>',
    fields: 'id,remote_id,company_id,remote_company_id,code,name,type,active,unified_custom_fields',
    prefer: 'heartbeat',
);

$response = $sdk->accounting->getCompanyAccount(
    request: $request
);

if ($response->accountingAccountResult !== null) {
    // handle response
}

Parameters

Parameter Type Required Description
$request Operations\AccountingGetCompanyAccountRequest ✔️ The request object to use for the request.

Response

?Operations\AccountingGetCompanyAccountResponse

Errors

Error Type Status Code Content Type
Errors\BadRequestResponse 400 application/json
Errors\UnauthorizedResponse 401 application/json
Errors\ForbiddenResponse 403 application/json
Errors\NotFoundResponse 404 application/json
Errors\RequestTimedOutResponse 408 application/json
Errors\ConflictResponse 409 application/json
Errors\PreconditionFailedResponse 412 application/json
Errors\UnprocessableEntityResponse 422 application/json
Errors\TooManyRequestsResponse 429 application/json
Errors\InternalServerErrorResponse 500 application/json
Errors\NotImplementedResponse 501 application/json
Errors\BadGatewayResponse 502 application/json
Errors\SDKException 4XX, 5XX */*

listCompanyTaxRates

List Tax Rates

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;
use StackOne\client\Utils;

$sdk = client\StackOne::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$request = new Operations\AccountingListCompanyTaxRatesRequest(
    xAccountId: '<id>',
    id: '<id>',
    fields: 'id,remote_id,company_id,remote_company_id,name,code,percentage,active,unified_custom_fields',
    filter: new Operations\AccountingListCompanyTaxRatesQueryParamFilter(
        updatedAfter: Utils\Utils::parseDateTime('2020-01-01T00:00:00.000Z'),
    ),
    prefer: 'heartbeat',
);

$responses = $sdk->accounting->listCompanyTaxRates(
    request: $request
);


foreach ($responses as $response) {
    if ($response->statusCode === 200) {
        // handle response
    }
}

Parameters

Parameter Type Required Description
$request Operations\AccountingListCompanyTaxRatesRequest ✔️ The request object to use for the request.

Response

?Operations\AccountingListCompanyTaxRatesResponse

Errors

Error Type Status Code Content Type
Errors\BadRequestResponse 400 application/json
Errors\UnauthorizedResponse 401 application/json
Errors\ForbiddenResponse 403 application/json
Errors\NotFoundResponse 404 application/json
Errors\RequestTimedOutResponse 408 application/json
Errors\ConflictResponse 409 application/json
Errors\PreconditionFailedResponse 412 application/json
Errors\UnprocessableEntityResponse 422 application/json
Errors\TooManyRequestsResponse 429 application/json
Errors\InternalServerErrorResponse 500 application/json
Errors\NotImplementedResponse 501 application/json
Errors\BadGatewayResponse 502 application/json
Errors\SDKException 4XX, 5XX */*

getCompanyTaxRate

Get Tax Rate

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;

$sdk = client\StackOne::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$request = new Operations\AccountingGetCompanyTaxRateRequest(
    xAccountId: '<id>',
    id: '<id>',
    subResourceId: '<id>',
    fields: 'id,remote_id,company_id,remote_company_id,name,code,percentage,active,unified_custom_fields',
    prefer: 'heartbeat',
);

$response = $sdk->accounting->getCompanyTaxRate(
    request: $request
);

if ($response->accountingTaxRateResult !== null) {
    // handle response
}

Parameters

Parameter Type Required Description
$request Operations\AccountingGetCompanyTaxRateRequest ✔️ The request object to use for the request.

Response

?Operations\AccountingGetCompanyTaxRateResponse

Errors

Error Type Status Code Content Type
Errors\BadRequestResponse 400 application/json
Errors\UnauthorizedResponse 401 application/json
Errors\ForbiddenResponse 403 application/json
Errors\NotFoundResponse 404 application/json
Errors\RequestTimedOutResponse 408 application/json
Errors\ConflictResponse 409 application/json
Errors\PreconditionFailedResponse 412 application/json
Errors\UnprocessableEntityResponse 422 application/json
Errors\TooManyRequestsResponse 429 application/json
Errors\InternalServerErrorResponse 500 application/json
Errors\NotImplementedResponse 501 application/json
Errors\BadGatewayResponse 502 application/json
Errors\SDKException 4XX, 5XX */*

batchCreateCompanyJournals

Batch Create Journals

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;

$sdk = client\StackOne::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$accountingJournalBatchCreateRequestDto = new Components\AccountingJournalBatchCreateRequestDto(
    items: [],
);

$response = $sdk->accounting->batchCreateCompanyJournals(
    xAccountId: '<id>',
    id: '<id>',
    accountingJournalBatchCreateRequestDto: $accountingJournalBatchCreateRequestDto,
    prefer: 'heartbeat'

);

if ($response->batchResultApiModel !== null) {
    // handle response
}

Parameters

Parameter Type Required Description Example
xAccountId string ✔️ The account identifier
id string ✔️ N/A
accountingJournalBatchCreateRequestDto Components\AccountingJournalBatchCreateRequestDto ✔️ N/A
prefer ?string Set to "heartbeat" to enable keep-alive newline heartbeats during long-running requests. Response includes Preference-Applied: heartbeat header when honored. (RFC 7240) heartbeat

Response

?Operations\AccountingBatchCreateCompanyJournalsResponse

Errors

Error Type Status Code Content Type
Errors\BadRequestResponse 400 application/json
Errors\UnauthorizedResponse 401 application/json
Errors\ForbiddenResponse 403 application/json
Errors\NotFoundResponse 404 application/json
Errors\RequestTimedOutResponse 408 application/json
Errors\ConflictResponse 409 application/json
Errors\PreconditionFailedResponse 412 application/json
Errors\UnprocessableEntityResponse 422 application/json
Errors\TooManyRequestsResponse 429 application/json
Errors\InternalServerErrorResponse 500 application/json
Errors\NotImplementedResponse 501 application/json
Errors\BadGatewayResponse 502 application/json
Errors\SDKException 4XX, 5XX */*

listCompanyJournals

List Journals

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;

$sdk = client\StackOne::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$request = new Operations\AccountingListCompanyJournalsRequest(
    xAccountId: '<id>',
    id: '<id>',
    fields: 'id,remote_id,company_id,remote_company_id,reference,memo,transaction_date,status,lines,created_at,updated_at,posted_at,unified_custom_fields',
    filter: null,
    prefer: 'heartbeat',
);

$responses = $sdk->accounting->listCompanyJournals(
    request: $request
);


foreach ($responses as $response) {
    if ($response->statusCode === 200) {
        // handle response
    }
}

Parameters

Parameter Type Required Description
$request Operations\AccountingListCompanyJournalsRequest ✔️ The request object to use for the request.

Response

?Operations\AccountingListCompanyJournalsResponse

Errors

Error Type Status Code Content Type
Errors\BadRequestResponse 400 application/json
Errors\UnauthorizedResponse 401 application/json
Errors\ForbiddenResponse 403 application/json
Errors\NotFoundResponse 404 application/json
Errors\RequestTimedOutResponse 408 application/json
Errors\ConflictResponse 409 application/json
Errors\PreconditionFailedResponse 412 application/json
Errors\UnprocessableEntityResponse 422 application/json
Errors\TooManyRequestsResponse 429 application/json
Errors\InternalServerErrorResponse 500 application/json
Errors\NotImplementedResponse 501 application/json
Errors\BadGatewayResponse 502 application/json
Errors\SDKException 4XX, 5XX */*

createCompanyJournal

Create Journal

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Utils;

$sdk = client\StackOne::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$accountingJournalCreateRequestDto = new Components\AccountingJournalCreateRequestDto(
    reference: 'JRN-2024-001',
    memo: 'Monthly closing entries',
    currencyCode: new Components\AccountingJournalCreateRequestDtoCurrencyCode(
        value: Components\AccountingJournalCreateRequestDtoValue::Usd,
        sourceValue: 'USD',
    ),
    exchangeRate: 1,
    transactionDate: Utils\Utils::parseDateTime('2024-03-20T10:00:00Z'),
    lines: [
        new Components\CreateJournalLine(
            accountId: 'acc_123456789',
            description: 'Payment for office supplies',
            amount: 10010,
            taxRateId: 'tax_123456789',
            taxAmount: 10010,
        ),
    ],
);

$response = $sdk->accounting->createCompanyJournal(
    xAccountId: '<id>',
    id: '<id>',
    accountingJournalCreateRequestDto: $accountingJournalCreateRequestDto,
    prefer: 'heartbeat'

);

if ($response->createResult !== null) {
    // handle response
}

Parameters

Parameter Type Required Description Example
xAccountId string ✔️ The account identifier
id string ✔️ N/A
accountingJournalCreateRequestDto Components\AccountingJournalCreateRequestDto ✔️ N/A
prefer ?string Set to "heartbeat" to enable keep-alive newline heartbeats during long-running requests. Response includes Preference-Applied: heartbeat header when honored. (RFC 7240) heartbeat

Response

?Operations\AccountingCreateCompanyJournalResponse

Errors

Error Type Status Code Content Type
Errors\BadRequestResponse 400 application/json
Errors\UnauthorizedResponse 401 application/json
Errors\ForbiddenResponse 403 application/json
Errors\NotFoundResponse 404 application/json
Errors\RequestTimedOutResponse 408 application/json
Errors\ConflictResponse 409 application/json
Errors\PreconditionFailedResponse 412 application/json
Errors\UnprocessableEntityResponse 422 application/json
Errors\TooManyRequestsResponse 429 application/json
Errors\InternalServerErrorResponse 500 application/json
Errors\NotImplementedResponse 501 application/json
Errors\BadGatewayResponse 502 application/json
Errors\SDKException 4XX, 5XX */*

getCompanyJournal

Get Journal

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;

$sdk = client\StackOne::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$request = new Operations\AccountingGetCompanyJournalRequest(
    xAccountId: '<id>',
    id: '<id>',
    subResourceId: '<id>',
    fields: 'id,remote_id,company_id,remote_company_id,reference,memo,transaction_date,status,lines,created_at,updated_at,posted_at,unified_custom_fields',
    prefer: 'heartbeat',
);

$response = $sdk->accounting->getCompanyJournal(
    request: $request
);

if ($response->accountingJournalResult !== null) {
    // handle response
}

Parameters

Parameter Type Required Description
$request Operations\AccountingGetCompanyJournalRequest ✔️ The request object to use for the request.

Response

?Operations\AccountingGetCompanyJournalResponse

Errors

Error Type Status Code Content Type
Errors\BadRequestResponse 400 application/json
Errors\UnauthorizedResponse 401 application/json
Errors\ForbiddenResponse 403 application/json
Errors\NotFoundResponse 404 application/json
Errors\RequestTimedOutResponse 408 application/json
Errors\ConflictResponse 409 application/json
Errors\PreconditionFailedResponse 412 application/json
Errors\UnprocessableEntityResponse 422 application/json
Errors\TooManyRequestsResponse 429 application/json
Errors\InternalServerErrorResponse 500 application/json
Errors\NotImplementedResponse 501 application/json
Errors\BadGatewayResponse 502 application/json
Errors\SDKException 4XX, 5XX */*